-
Notifications
You must be signed in to change notification settings - Fork 0
/
anything-config.el
12650 lines (11366 loc) · 513 KB
/
anything-config.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;; anything-config.el --- Applications libary for `anything.el'
;; Filename: anything-config.el
;; Description: Applications libary for `anything.el'
;; Author: Tassilo Horn <[email protected]>
;; Maintainer: Tassilo Horn <[email protected]>
;; rubikitch <[email protected]>
;; Thierry Volpiatto <[email protected]>
;; Copyright (C) 2007 ~ 2011, Tassilo Horn, all rights reserved.
;; Copyright (C) 2009, Andy Stewart, all rights reserved.
;; Copyright (C) 2009 ~ 2012, rubikitch, all rights reserved.
;; Copyright (C) 2009 ~ 2012, Thierry Volpiatto, all rights reserved.
;; Created: 2009-02-16 21:38:23
;; X-URL: <http://repo.or.cz/w/anything-config.git>
;; MailingList: <https://groups.google.com/group/emacs-anything?hl=en>
;; Keywords: anything, anything-config
;; Compatibility: GNU Emacs 22 ~ 24
;; Dependencies: `anything.el', `anything-match-plugin.el'.
;;; This file is NOT part of GNU Emacs
;;; License
;;
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 3, or (at your option)
;; any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program; see the file COPYING. If not, write to
;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth
;; Floor, Boston, MA 02110-1301, USA.
;;; Commentary:
;;
;; Predefined configurations for `anything.el'
;;
;; For quick start, try `anything-for-files' to open files.
;;
;; To configure anything you should define anything command
;; with your favorite sources, like below:
;;
;; (defun my-anything ()
;; (interactive)
;; (anything-other-buffer
;; '(anything-c-source-buffers
;; anything-c-source-file-name-history
;; anything-c-source-info-pages
;; anything-c-source-info-elisp
;; anything-c-source-man-pages
;; anything-c-source-locate
;; anything-c-source-emacs-commands)
;; " *my-anything*"))
;;
;; Then type M-x my-anything to use sources.
;;
;; Defining own command is better than setup `anything-sources'
;; directly, because you can define multiple anything commands with
;; different sources. Each anything command should have own anything
;; buffer, because M-x anything-resume revives anything command.
;; NOTE: What you find on Emacswiki is mostly deprecated and not maintained,
;; don't complain if you use such code or configuration and something
;; doesn't work.
;;; Autodoc documentation:
;; ---------------------
;; * Commands defined here are:
;; [EVAL] (autodoc-document-lisp-buffer :type 'command :prefix "anything-" :docstring t)
;; `anything-configuration'
;; Customize `anything'.
;; `anything-c-buffer-help'
;; Help command for anything buffers.
;; `anything-ff-help'
;; Help command for `anything-find-files'.
;; `anything-read-file-name-help'
;; Not documented.
;; `anything-generic-file-help'
;; Not documented.
;; `anything-grep-help'
;; Not documented.
;; `anything-pdfgrep-help'
;; Not documented.
;; `anything-etags-help'
;; The help function for etags.
;; `anything-c-ucs-help'
;; Help command for `anything-ucs'.
;; `anything-c-bookmark-help'
;; Help command for bookmarks.
;; `anything-show-this-source-only'
;; Show all candidates of this source.
;; `anything-test-sources'
;; List all anything sources for test.
;; `anything-select-source'
;; [OBSOLETE] Select source.
;; `anything-insert-buffer-name'
;; Insert buffer name.
;; `anything-quit-and-find-file'
;; Drop into `anything-find-files' from `anything'.
;; `anything-mark-all'
;; Mark all visible unmarked candidates in current source.
;; `anything-unmark-all'
;; Unmark all candidates in all sources of current anything session.
;; `anything-toggle-all-marks'
;; Toggle all marks.
;; `anything-buffer-diff-persistent'
;; Toggle diff buffer without quitting anything.
;; `anything-buffer-revert-persistent'
;; Revert buffer without quitting anything.
;; `anything-buffer-save-persistent'
;; Save buffer without quitting anything.
;; `anything-buffer-run-kill-buffers'
;; Run kill buffer action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-grep'
;; Run Grep action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-zgrep'
;; Run Grep action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-query-replace-regexp'
;; Run Query replace regexp action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-query-replace'
;; Run Query replace action from `anything-c-source-buffers-list'.
;; `anything-buffer-switch-other-window'
;; Run switch to other window action from `anything-c-source-buffers-list'.
;; `anything-buffer-switch-other-frame'
;; Run switch to other frame action from `anything-c-source-buffers-list'.
;; `anything-buffer-switch-to-elscreen'
;; Run switch to elscreen action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-ediff'
;; Run ediff action from `anything-c-source-buffers-list'.
;; `anything-buffer-run-ediff-merge'
;; Run ediff action from `anything-c-source-buffers-list'.
;; `anything-ff-run-toggle-auto-update'
;; Not documented.
;; `anything-ff-run-switch-to-history'
;; Run Switch to history action from `anything-c-source-find-files'.
;; `anything-ff-run-grep'
;; Run Grep action from `anything-c-source-find-files'.
;; `anything-ff-run-pdfgrep'
;; Run Pdfgrep action from `anything-c-source-find-files'.
;; `anything-ff-run-zgrep'
;; Run Grep action from `anything-c-source-find-files'.
;; `anything-ff-run-copy-file'
;; Run Copy file action from `anything-c-source-find-files'.
;; `anything-ff-run-rename-file'
;; Run Rename file action from `anything-c-source-find-files'.
;; `anything-ff-run-byte-compile-file'
;; Run Byte compile file action from `anything-c-source-find-files'.
;; `anything-ff-run-load-file'
;; Run Load file action from `anything-c-source-find-files'.
;; `anything-ff-run-eshell-command-on-file'
;; Run eshell command on file action from `anything-c-source-find-files'.
;; `anything-ff-run-ediff-file'
;; Run Ediff file action from `anything-c-source-find-files'.
;; `anything-ff-run-ediff-merge-file'
;; Run Ediff merge file action from `anything-c-source-find-files'.
;; `anything-ff-run-symlink-file'
;; Run Symlink file action from `anything-c-source-find-files'.
;; `anything-ff-run-hardlink-file'
;; Run Hardlink file action from `anything-c-source-find-files'.
;; `anything-ff-run-delete-file'
;; Run Delete file action from `anything-c-source-find-files'.
;; `anything-ff-run-complete-fn-at-point'
;; Run complete file name action from `anything-c-source-find-files'.
;; `anything-ff-run-switch-to-eshell'
;; Run switch to eshell action from `anything-c-source-find-files'.
;; `anything-ff-run-switch-other-window'
;; Run switch to other window action from `anything-c-source-find-files'.
;; `anything-ff-run-switch-other-frame'
;; Run switch to other frame action from `anything-c-source-find-files'.
;; `anything-ff-run-open-file-externally'
;; Run open file externally command action from `anything-c-source-find-files'.
;; `anything-ff-run-locate'
;; Run locate action from `anything-c-source-find-files'.
;; `anything-ff-run-gnus-attach-files'
;; Run gnus attach files command action from `anything-c-source-find-files'.
;; `anything-ff-run-etags'
;; Run Etags command action from `anything-c-source-find-files'.
;; `anything-ff-run-print-file'
;; Run Print file action from `anything-c-source-find-files'.
;; `anything-ff-run-toggle-basename'
;; Not documented.
;; `anything-find-files-down-one-level'
;; Go down one level like unix command `cd ..'.
;; `anything-ff-properties-persistent'
;; Show properties without quitting anything.
;; `anything-ff-persistent-delete'
;; Delete current candidate without quitting.
;; `anything-ff-run-kill-buffer-persistent'
;; Execute `anything-ff-kill-buffer-fname' whitout quitting.
;; `anything-ff-rotate-left-persistent'
;; Rotate image left without quitting anything.
;; `anything-ff-rotate-right-persistent'
;; Rotate image right without quitting anything.
;; `anything-c-goto-precedent-file'
;; Go to precedent file in anything grep/etags buffers.
;; `anything-c-goto-next-file'
;; Go to precedent file in anything grep/etags buffers.
;; `anything-c-grep-run-persistent-action'
;; Run grep persistent action from `anything-do-grep-1'.
;; `anything-c-grep-run-default-action'
;; Run grep default action from `anything-do-grep-1'.
;; `anything-c-grep-run-other-window-action'
;; Run grep goto other window action from `anything-do-grep-1'.
;; `anything-c-grep-run-save-buffer'
;; Run grep save results action from `anything-do-grep-1'.
;; `anything-yank-text-at-point'
;; Yank text at point in minibuffer.
;; `anything-c-bookmark-run-jump-other-window'
;; Jump to bookmark from keyboard.
;; `anything-c-bookmark-run-delete'
;; Delete bookmark from keyboard.
;; `anything-c-bmkext-run-edit'
;; Run `bmkext-edit-bookmark' from keyboard.
;; `anything-yaoddmuse-cache-pages'
;; Fetch the list of files on emacswiki and create cache file.
;; `anything-eval-new-line-and-indent'
;; Not documented.
;; `anything-call-source-from-anything'
;; Call anything source within `anything' session.
;; `anything-create-from-anything'
;; Run `anything-create' from `anything' as a fallback.
;; `anything-c-ucs-persistent-insert'
;; Not documented.
;; `anything-c-ucs-persistent-forward'
;; Not documented.
;; `anything-c-ucs-persistent-backward'
;; Not documented.
;; `anything-c-ucs-persistent-delete'
;; Not documented.
;; `anything-lisp-completion-at-point'
;; Anything lisp symbol completion at point.
;; `anything-c-complete-file-name-at-point'
;; Complete file name at point.
;; `anything-lisp-completion-at-point-or-indent'
;; First call indent and second call complete lisp symbol.
;; `anything-lisp-completion-or-file-name-at-point'
;; Complete lisp symbol or filename at point.
;; `anything-w32-shell-execute-open-file'
;; Not documented.
;; `anything-c-set-variable'
;; Set value to VAR interactively.
;; `anything-c-adaptive-save-history'
;; Save history information to file given by `anything-c-adaptive-history-file'.
;; `anything-c-reset-adaptative-history'
;; Delete all `anything-c-adaptive-history' and his file.
;; `anything-mini'
;; Preconfigured `anything' lightweight version (buffer -> recentf).
;; `anything-for-files'
;; Preconfigured `anything' for opening files.
;; `anything-recentf'
;; Preconfigured `anything' for `recentf'.
;; `anything-info-at-point'
;; Preconfigured `anything' for searching info at point.
;; `anything-show-kill-ring'
;; Preconfigured `anything' for `kill-ring'.
;; `anything-minibuffer-history'
;; Preconfigured `anything' for `minibuffer-history'.
;; `anything-gentoo'
;; Preconfigured `anything' for gentoo linux.
;; `anything-imenu'
;; Preconfigured `anything' for `imenu'.
;; `anything-google-suggest'
;; Preconfigured `anything' for google search with google suggest.
;; `anything-yahoo-suggest'
;; Preconfigured `anything' for Yahoo searching with Yahoo suggest.
;; `anything-for-buffers'
;; Preconfigured `anything' for buffers.
;; `anything-buffers-list'
;; Preconfigured `anything' to list buffers.
;; `anything-bbdb'
;; Preconfigured `anything' for BBDB.
;; `anything-locate'
;; Preconfigured `anything' for Locate.
;; `anything-w3m-bookmarks'
;; Preconfigured `anything' for w3m bookmark.
;; `anything-firefox-bookmarks'
;; Preconfigured `anything' for firefox bookmark.
;; `anything-colors'
;; Preconfigured `anything' for color.
;; `anything-bookmarks'
;; Preconfigured `anything' for bookmarks.
;; `anything-c-pp-bookmarks'
;; Preconfigured `anything' for bookmarks (pretty-printed).
;; `anything-c-insert-latex-math'
;; Preconfigured anything for latex math symbols completion.
;; `anything-register'
;; Preconfigured `anything' for Emacs registers.
;; `anything-man-woman'
;; Preconfigured `anything' for Man and Woman pages.
;; `anything-org-keywords'
;; Preconfigured `anything' for org keywords.
;; `anything-emms'
;; Preconfigured `anything' for emms sources.
;; `anything-eev-anchors'
;; Preconfigured `anything' for eev anchors.
;; `anything-bm-list'
;; Preconfigured `anything' for visible bookmarks.
;; `anything-timers'
;; Preconfigured `anything' for timers.
;; `anything-list-emacs-process'
;; Preconfigured `anything' for emacs process.
;; `anything-occur'
;; Preconfigured Anything for Occur source.
;; `anything-browse-code'
;; Preconfigured anything to browse code.
;; `anything-org-headlines'
;; Preconfigured anything to show org headlines.
;; `anything-regexp'
;; Preconfigured anything to build regexps.
;; `anything-c-copy-files-async'
;; Preconfigured anything to copy file list FLIST to DEST asynchronously.
;; `anything-find-files'
;; Preconfigured `anything' for anything implementation of `find-file'.
;; `anything-write-file'
;; Preconfigured `anything' providing completion for `write-file'.
;; `anything-insert-file'
;; Preconfigured `anything' providing completion for `insert-file'.
;; `anything-dired-rename-file'
;; Preconfigured `anything' to rename files from dired.
;; `anything-dired-copy-file'
;; Preconfigured `anything' to copy files from dired.
;; `anything-dired-symlink-file'
;; Preconfigured `anything' to symlink files from dired.
;; `anything-dired-hardlink-file'
;; Preconfigured `anything' to hardlink files from dired.
;; `anything-do-grep'
;; Preconfigured anything for grep.
;; `anything-do-pdfgrep'
;; Preconfigured anything for pdfgrep.
;; `anything-c-etags-select'
;; Preconfigured anything for etags.
;; `anything-filelist'
;; Preconfigured `anything' to open files instantly.
;; `anything-filelist+'
;; Preconfigured `anything' to open files/buffers/bookmarks instantly.
;; `anything-M-x'
;; Preconfigured `anything' for Emacs commands.
;; `anything-manage-advice'
;; Preconfigured `anything' to disable/enable function advices.
;; `anything-bookmark-ext'
;; Preconfigured `anything' for bookmark-extensions sources.
;; `anything-simple-call-tree'
;; Preconfigured `anything' for simple-call-tree. List function relationships.
;; `anything-mark-ring'
;; Preconfigured `anything' for `anything-c-source-mark-ring'.
;; `anything-global-mark-ring'
;; Preconfigured `anything' for `anything-c-source-global-mark-ring'.
;; `anything-all-mark-rings'
;; Preconfigured `anything' for `anything-c-source-global-mark-ring' and `anything-c-source-mark-ring'.
;; `anything-yaoddmuse-emacswiki-edit-or-view'
;; Preconfigured `anything' to edit or view EmacsWiki page.
;; `anything-yaoddmuse-emacswiki-post-library'
;; Preconfigured `anything' to post library to EmacsWiki.
;; `anything-eval-expression'
;; Preconfigured anything for `anything-c-source-evaluation-result'.
;; `anything-eval-expression-with-eldoc'
;; Preconfigured anything for `anything-c-source-evaluation-result' with `eldoc' support.
;; `anything-calcul-expression'
;; Preconfigured anything for `anything-c-source-calculation-result'.
;; `anything-surfraw'
;; Preconfigured `anything' to search PATTERN with search ENGINE.
;; `anything-call-source'
;; Preconfigured `anything' to call anything source.
;; `anything-execute-anything-command'
;; Preconfigured `anything' to execute preconfigured `anything'.
;; `anything-create'
;; Preconfigured `anything' to do many create actions from STRING.
;; `anything-top'
;; Preconfigured `anything' for top command.
;; `anything-select-xfont'
;; Preconfigured `anything' to select Xfont.
;; `anything-world-time'
;; Preconfigured `anything' to show world time.
;; `anything-apt'
;; Preconfigured `anything' : frontend of APT package manager.
;; `anything-esh-pcomplete'
;; Preconfigured anything to provide anything completion in eshell.
;; `anything-eshell-history'
;; Preconfigured anything for eshell history.
;; `anything-c-run-external-command'
;; Preconfigured `anything' to run External PROGRAM asyncronously from Emacs.
;; `anything-ratpoison-commands'
;; Preconfigured `anything' to execute ratpoison commands.
;; `anything-ucs'
;; Preconfigured anything for `ucs-names' math symbols.
;; `anything-c-apropos'
;; Preconfigured anything to describe commands, functions, variables and faces.
;; `anything-xrandr-set'
;; Not documented.
;; * User variables defined here:
;; [EVAL] (autodoc-document-lisp-buffer :type 'user-variable :prefix "anything-" :var-value t)
;; `anything-c-adaptive-history-file'
;; Default Value: "~/.emacs.d/anything-c-adaptive-history"
;; `anything-c-adaptive-history-length'
;; Default Value: 50
;; `anything-c-google-suggest-url'
;; Default Value: "http://google.com/complete/search?output=toolbar&q="
;; `anything-c-google-suggest-search-url'
;; Default Value: "http://www.google.com/search?ie=utf-8&oe=utf-8&q="
;; `anything-google-suggest-use-curl-p'
;; Default Value: nil
;; `anything-c-yahoo-suggest-url'
;; Default Value: "http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=G [...]
;; `anything-c-yahoo-suggest-search-url'
;; Default Value: "http://search.yahoo.com/search?&ei=UTF-8&fr&h=c&p="
;; `anything-c-boring-buffer-regexp'
;; Default Value: "\\ (\\` \\)\\|\\*anything\\|\\*ac-mode\\| \\*Echo Area\\| \\*Minibuf"
;; `anything-c-boring-file-regexp'
;; Default Value: "/\\ (?:\\(?:\\.\\(?:git\\|hg\\|svn\\)\\|CVS\\|_darcs\\)\\)\\(?:/\\|$\\)\\| [...]
;; `anything-kill-ring-threshold'
;; Default Value: 10
;; `anything-c-kill-ring-max-lines-number'
;; Default Value: nil
;; `anything-su-or-sudo'
;; Default Value: "su"
;; `anything-for-files-prefered-list'
;; Default Value: (anything-c-source-ffap-line anything-c-source-ffap-guesser anything-c-sou [...]
;; `anything-create--actions-private'
;; Default Value: nil
;; `anything-allow-skipping-current-buffer'
;; Default Value: nil
;; `anything-c-enable-eval-defun-hack'
;; Default Value: t
;; `anything-tramp-verbose'
;; Default Value: 0
;; `anything-raise-command'
;; Default Value: nil
;; `anything-command-map-prefix-key'
;; Default Value: "<f5> a"
;; `anything-c-browse-code-regexp-lisp'
;; Default Value: "^ * (def\\(un\\|subst\\|macro\\|face\\|alias\\|advice\\|struct\\|type\\|th [...]
;; `anything-c-browse-code-regexp-python'
;; Default Value: "\\<def\\>\\|\\<class\\>"
;; `anything-c-browse-code-regexp-alist'
;; Default Value: ((lisp-interaction-mode . "^ *(def\\(un\\|subst\\|macro\\|face\\|alias\\|a [...]
;; `anything-c-external-programs-associations'
;; Default Value: nil
;; `anything-ff-auto-update-initial-value'
;; Default Value: t
;; `anything-c-copy-async-prefered-emacs'
;; Default Value: "emacs"
;; `anything-ff-lynx-style-map'
;; Default Value: t
;; `anything-ff-history-max-length'
;; Default Value: 100
;; `anything-ff-smart-completion'
;; Default Value: t
;; `anything-ff-default-kbsize'
;; Default Value: 1024.0
;; `anything-ff-tramp-not-fancy'
;; Default Value: t
;; `anything-ff-exif-data-program'
;; Default Value: "exiftran"
;; `anything-ff-exif-data-program-args'
;; Default Value: "-d"
;; `anything-c-grep-use-ioccur-style-keys'
;; Default Value: t
;; `anything-c-pdfgrep-default-read-command'
;; Default Value: "xpdf '%f' %p"
;; `anything-c-etags-tag-file-name'
;; Default Value: "TAGS"
;; `anything-c-etags-tag-file-search-limit'
;; Default Value: 10
;; `anything-c-etags-use-regexp-search'
;; Default Value: nil
;; `anything-c-etags-search-regexp'
;; Default Value: "^.+: .+ \\<%s"
;; `anything-c-filelist-file-name'
;; Default Value: nil
;; `anything-c-eldoc-in-minibuffer-show-fn'
;; Default Value: anything-c-show-info-in-mode-line
;; `anything-c-turn-on-show-completion'
;; Default Value: t
;; `anything-c-show-completion-use-special-display'
;; Default Value: t
;; `anything-c-show-completion-min-window-height'
;; Default Value: 7
;; `anything-lisp-completion-or-indent-delay'
;; Default Value: 0.6
;; `anything-c-default-external-file-browser'
;; Default Value: "nautilus"
;; `anything-c-use-adaptative-sorting'
;; Default Value: nil
;; `anything-ff-newfile-prompt-p'
;; Default Value: t
;; `anything-ff-avfs-directory'
;; Default Value: nil
;; `anything-ff-file-compressed-list'
;; Default Value: ("gz" "bz2" "zip" "7z")
;; `anything-locate-db-file-regexp'
;; Default Value: "m?locate.db$"
;; `anything-c-locate-command'
;; Default Value: nil
;; `anything-c-show-info-in-mode-line-delay'
;; Default Value: 12
;; `anything-c-copy-files-async-log-file'
;; Default Value: "/tmp/dired.log"
;; `anything-ff-printer-list'
;; Default Value: nil
;; `anything-ff-transformer-show-only-basename'
;; Default Value: nil
;; `anything-ff-quick-delete-dont-prompt-for-deletion'
;; Default Value: nil
;; `anything-ff-signal-error-on-dot-files'
;; Default Value: t
;; `anything-completing-read-handlers-alist'
;; Default Value: ((describe-function . anything-completing-read-symbols) (describe-variabl [...]
;; * Anything sources defined here:
;; [EVAL] (autodoc-document-lisp-buffer :type 'anything-source :prefix "anything-" :any-sname t)
;; `anything-c-source-regexp' (Regexp Builder)
;; `anything-c-source-buffers' (Buffers)
;; `anything-c-source-buffer-not-found' (Create buffer)
;; `anything-c-source-buffers-list' (Buffers)
;; `anything-c-source-file-name-history' (File Name History)
;; `anything-c-source-files-in-current-dir' (Files from Current Directory)
;; `anything-c-source-files-in-current-dir+' (Files from Current Directory)
;; `anything-c-source-find-files' (Find Files)
;; `anything-c-source-write-file' (Write File)
;; `anything-c-source-insert-file' (Insert File)
;; `anything-c-source-copy-files' (Copy Files)
;; `anything-c-source-symlink-files' (Symlink Files)
;; `anything-c-source-hardlink-files' (Hardlink Files)
;; `anything-c-source-file-cache' (File Cache)
;; `anything-c-source-locate' (Locate)
;; `anything-c-source-recentf' (Recentf)
;; `anything-c-source-ffap-guesser' (File at point)
;; `anything-c-source-ffap-line' (File/Lineno at point)
;; `anything-c-source-files-in-all-dired' (Files in all dired buffer.)
;; `anything-c-source-filelist' (FileList)
;; `anything-c-source-info-pages' (Info Pages)
;; `anything-c-source-man-pages' (Manual Pages)
;; `anything-c-source-complex-command-history' (Complex Command History)
;; `anything-c-source-extended-command-history' (Emacs Commands History)
;; `anything-c-source-emacs-commands' (Emacs Commands)
;; `anything-c-source-emacs-functions' (Emacs Functions)
;; `anything-c-source-emacs-functions-with-abbrevs' (Emacs Functions)
;; `anything-c-source-advice' (Function Advice)
;; `anything-c-source-emacs-variables' (Emacs Variables)
;; `anything-c-source-lacarte' (Lacarte)
;; `anything-c-source-bookmarks' (Bookmarks)
;; `anything-c-source-bookmark-set' (Set Bookmark)
;; `anything-c-source-bm' (Visible Bookmarks)
;; `anything-c-source-bookmarks-ssh' (Bookmarks-ssh)
;; `anything-c-source-bookmarks-su' (Bookmarks-root)
;; `anything-c-source-bookmarks-local' (Bookmarks-Local)
;; `anything-c-source-bmkext-addressbook' (Bookmark Addressbook)
;; `anything-c-source-bookmark-w3m' (Bookmark W3m)
;; `anything-c-source-bookmark-images' (Bookmark Images)
;; `anything-c-source-bookmark-man' (Bookmark Woman&Man)
;; `anything-c-source-bookmark-gnus' (Bookmark Gnus)
;; `anything-c-source-bookmark-info' (Bookmark Info)
;; `anything-c-source-bookmark-files&dirs' (Bookmark Files&Directories)
;; `anything-c-source-bookmark-su-files&dirs' (Bookmark Root-Files&Directories)
;; `anything-c-source-bookmark-ssh-files&dirs' (Bookmark Ssh-Files&Directories)
;; `anything-c-source-firefox-bookmarks' (Firefox Bookmarks)
;; `anything-c-source-w3m-bookmarks' (W3m Bookmarks)
;; `anything-c-source-elisp-library-scan' (Elisp libraries (Scan))
;; `anything-c-source-imenu' (Imenu)
;; `anything-c-source-ctags' (Exuberant ctags)
;; `anything-c-source-etags-select' (Etags)
;; `anything-c-source-semantic' (Semantic Tags)
;; `anything-c-source-simple-call-tree-functions-callers' (Function is called by)
;; `anything-c-source-simple-call-tree-callers-functions' (Function calls)
;; `anything-c-source-commands-and-options-in-file' (Commands/Options in file)
;; `anything-c-source-customize-face' (Customize Face)
;; `anything-c-source-colors' (Colors)
;; `anything-c-source-tracker-search' (Tracker Search)
;; `anything-c-source-mac-spotlight' (mdfind)
;; `anything-c-source-picklist' (Picklist)
;; `anything-c-source-kill-ring' (Kill Ring)
;; `anything-c-source-mark-ring' (mark-ring)
;; `anything-c-source-global-mark-ring' (global-mark-ring)
;; `anything-c-source-register' (Registers)
;; `anything-c-source-latex-math' (Latex Math Menu)
;; `anything-c-source-fixme' (TODO/FIXME/DRY comments)
;; `anything-c-source-rd-headline' (RD HeadLine)
;; `anything-c-source-oddmuse-headline' (Oddmuse HeadLine)
;; `anything-c-source-emacs-source-defun' (Emacs Source DEFUN)
;; `anything-c-source-emacs-lisp-expectations' (Emacs Lisp Expectations)
;; `anything-c-source-emacs-lisp-toplevels' (Emacs Lisp Toplevel / Level 4 Comment / Linkd Star)
;; `anything-c-source-yaoddmuse-emacswiki-edit-or-view' (Yaoddmuse Edit or View (EmacsWiki))
;; `anything-c-source-yaoddmuse-emacswiki-post-library' (Yaoddmuse Post library (EmacsWiki))
;; `anything-c-source-eev-anchor' (Anchors)
;; `anything-c-source-org-headline' (Org HeadLine)
;; `anything-c-source-org-keywords' (Org Keywords)
;; `anything-c-source-bbdb' (BBDB)
;; `anything-c-source-evaluation-result' (Evaluation Result)
;; `anything-c-source-calculation-result' (Calculation Result)
;; `anything-c-source-google-suggest' (Google Suggest)
;; `anything-c-source-yahoo-suggest' (Yahoo Suggest)
;; `anything-c-source-emms-streams' (Emms Streams)
;; `anything-c-source-emms-dired' (Music Directory)
;; `anything-c-source-emms-files' (Emms files)
;; `anything-c-source-jabber-contacts' (Jabber Contacts)
;; `anything-c-source-call-source' (Call anything source)
;; `anything-c-source-anything-commands' (Preconfigured Anything)
;; `anything-c-source-occur' (Occur)
;; `anything-c-source-browse-code' (Browse code)
;; `anything-c-source-create' (Create)
;; `anything-c-source-minibuffer-history' (Minibuffer History)
;; `anything-c-source-elscreen' (Elscreen)
;; `anything-c-source-top' (Top (Press C-c C-u to refresh))
;; `anything-c-source-absolute-time-timers' (Absolute Time Timers)
;; `anything-c-source-idle-time-timers' (Idle Time Timers)
;; `anything-c-source-xrandr-change-resolution' (Change Resolution)
;; `anything-c-source-xfonts' (X Fonts)
;; `anything-c-source-ucs' (Ucs names)
;; `anything-c-source-emacs-process' (Emacs Process)
;; `anything-c-source-time-world' (Time World List)
;; `anything-c-source-apt' (APT)
;; `anything-c-source-gentoo' (Portage sources)
;; `anything-c-source-use-flags' (Use Flags)
;; `anything-c-source-ratpoison-commands' (Ratpoison Commands)
;; `anything-c-source-esh' (Eshell completions)
;; `anything-c-source-eshell-history' (Eshell history)
;; *** END auto-documentation
;;; For Maintainers:
;;
;; Install developer-tools/autodoc.el and
;; Evaluate (autodoc-update-all) before commit or run it interactively.
;; This function generates anything-c-source-* / functions / options list.
;;
;; [EVAL IT] (autodoc-update-all)
;;
;; Please write details documentation about function, then others will
;; read code more easier. -- Andy Stewart
;;
;;; Change log:
;;
;; Change log of this file is found at
;; http://repo.or.cz/w/anything-config.git/history/master:/anything-config.el
;;
;; Change log of this project is found at
;; http://repo.or.cz/w/anything-config.git?a=shortlog
;;; Contributors:
;;
;; Tamas Patrovics
;; Tassilo Horn <[email protected]>
;; Vagn Johansen <[email protected]>
;; Mathias Dahl <[email protected]>
;; Bill Clementson <[email protected]>
;; Stefan Kamphausen (see http://www.skamphausen.de for more informations)
;; Drew Adams <[email protected]>
;; Jason McBrayer <[email protected]>
;; Andy Stewart <[email protected]>
;; Thierry Volpiatto <[email protected]>
;; rubikitch <[email protected]>
;; Scott Vokes <[email protected]>
;; Kenichirou Oyama <[email protected]>
;;; TODO
;;
;; - Fix documentation, now many functions haven't documentations.
;;
;;; Code:
;;; Require
;;
;;
(require 'anything)
(require 'thingatpt)
(require 'ffap)
(require 'cl)
(eval-when-compile (require 'dired))
(require 'dired-aux)
(require 'dired-x)
(require 'tramp)
(require 'grep)
(require 'url)
(require 'xml)
(eval-when-compile (require 'org)) ; Shut up byte compiler about org-directory.
(eval-when-compile (require 'semantic nil t))
(require 'anything-match-plugin)
;;; Declare external functions
;;
;;
(declare-function gnus-dired-attach "ext:gnus-dired.el" (files-to-attach))
(declare-function image-dired-display-image "image-dired.el" (file &optional original-size))
(declare-function image-dired-update-property "image-dired.el" (prop value))
(declare-function woman-file-name-all-completions "woman.el" (topic))
(declare-function Man-getpage-in-background "man.el" (topic))
(declare-function simple-call-tree-analyze "ext:simple-call-tree.el" (&optional test))
(declare-function yaoddmuse-update-pagename "ext:yaoddmuse.el" (&optional unforced))
(declare-function yaoddmuse-get-library-list "ext:yaoddmuse.el" (&optional dirs string))
(declare-function org-get-current-options "ext:org-exp.el")
(declare-function emms-streams "ext:emms-streams")
(declare-function emms-stream-delete-bookmark "ext:emms-streams")
(declare-function emms-stream-add-bookmark "ext:emms-streams" (name url fd type))
(declare-function emms-stream-save-bookmarks-file "ext:emms-streams")
(declare-function emms-stream-quit "ext:emms-streams")
(declare-function with-current-emms-playlist "ext:emms" (&rest body))
(declare-function emms-playlist-tracks-in-region "ext:emms" (beg end))
(declare-function emms-playlist-first "ext:emms")
(declare-function emms-playlist-mode-play-smart "ext:emms-playlist-mode")
(declare-function term-line-mode "term")
(declare-function term-char-mode "term")
(declare-function term-send-input "term")
(declare-function term-send-eof "term")
(declare-function Info-index-nodes "info" (&optional file))
(declare-function Info-goto-node "info" (&optional fork))
(declare-function Info-find-node "info.el" (filename nodename &optional no-going-back))
(declare-function elscreen-find-screen-by-buffer "ext:elscreen.el" (buffer &optional create))
(declare-function elscreen-find-file "ext:elscreen.el" (filename))
(declare-function elscreen-goto "ext:elscreen.el" (screen))
(declare-function semantic-format-tag-summarize "ext:format.el" (tag &optional parent color) t)
(declare-function semantic-tag-components "ext:tag.el" (tag) t)
(declare-function semantic-go-to-tag "ext:tag-file.el" (tag) t)
(declare-function semantic-tag-type "ext:tag-file.el" (tag) t)
(declare-function semantic-tag-class "ext:tag-file.el" (tag) t)
(declare-function bbdb "ext:bbdb-com")
(declare-function bbdb-current-record "ext:bbdb-com")
(declare-function bbdb-redisplay-one-record "ext:bbdb-com")
(declare-function bbdb-record-net "ext:bbdb-com" (string) t)
(declare-function bbdb-current-record "ext:bbdb-com")
(declare-function bbdb-dwim-net-address "ext:bbdb-com")
(declare-function bbdb-records "ext:bbdb-com"
(&optional dont-check-disk already-in-db-buffer))
(declare-function eshell-read-aliases-list "em-alias")
(declare-function eshell-send-input "esh-mode" (&optional use-region queue-p no-newline))
(declare-function eshell-bol "esh-mode")
(declare-function eldoc-current-symbol "eldoc")
(declare-function eldoc-get-fnsym-args-string "eldoc" (sym &optional index))
(declare-function eldoc-get-var-docstring "eldoc" (sym))
(declare-function eldoc-fnsym-in-current-sexp "eldoc")
(declare-function find-library-name "find-func.el" (library))
(declare-function adoc-construct "ext:auto-document.el" (buf))
(declare-function adoc-first-line "ext:auto-document.el" (str))
(declare-function adoc-prin1-to-string "ext:auto-document.el" (object))
(declare-function secure-hash "ext:fns.c" (algorithm object &optional start end binary))
(declare-function w32-shell-execute "ext:w32fns.c" (operation document &optional parameters show-flag))
(declare-function undo-tree-restore-state-from-register "ext:undo-tree.el" (register))
;;; compatibility
;;
;;
(unless (fboundp 'window-system)
(defun window-system (&optional arg)
window-system))
(unless (fboundp 'make-composed-keymap)
(defun make-composed-keymap (maps &optional parent)
"Construct a new keymap composed of MAPS and inheriting from PARENT.
When looking up a key in the returned map, the key is looked in each
keymap of MAPS in turn until a binding is found.
If no binding is found in MAPS, the lookup continues in PARENT, if non-nil.
As always with keymap inheritance, a nil binding in MAPS overrides
any corresponding binding in PARENT, but it does not override corresponding
bindings in other keymaps of MAPS.
MAPS can be a list of keymaps or a single keymap.
PARENT if non-nil should be a keymap."
`(keymap
,@(if (keymapp maps) (list maps) maps)
,@parent)))
(unless (fboundp 'apply-partially)
(defun apply-partially (fun &rest args)
"Return a function that is a partial application of FUN to ARGS.
ARGS is a list of the first N arguments to pass to FUN.
The result is a new function which does the same as FUN, except that
the first N arguments are fixed at the values with which this function
was called."
(lexical-let ((fun fun) (args1 args))
(lambda (&rest args2) (apply fun (append args1 args2))))))
;;; Customize
;;
;;
(defgroup anything-config nil
"Predefined configurations for `anything.el'."
:group 'anything)
(defcustom anything-c-adaptive-history-file
"~/.emacs.d/anything-c-adaptive-history"
"Path of file where history information is stored."
:type 'string
:group 'anything-config)
(defcustom anything-c-adaptive-history-length 50
"Maximum number of candidates stored for a source."
:type 'number
:group 'anything-config)
(defcustom anything-c-google-suggest-url
"http://google.com/complete/search?output=toolbar&q="
"URL used for looking up Google suggestions."
:type 'string
:group 'anything-config)
(defcustom anything-c-google-suggest-search-url
"http://www.google.com/search?ie=utf-8&oe=utf-8&q="
"URL used for Google searching."
:type 'string
:group 'anything-config)
(defcustom anything-google-suggest-use-curl-p nil
"When non--nil use CURL to get info from `anything-c-google-suggest-url'.
Otherwise `url-retrieve-synchronously' is used."
:type 'boolean
:group 'anything-config)
(defcustom anything-c-yahoo-suggest-url
"http://search.yahooapis.com/WebSearchService/V1/relatedSuggestion?appid=Generic&query="
"Url used for looking up Yahoo suggestions."
:type 'string
:group 'anything-config)
(defcustom anything-c-yahoo-suggest-search-url
"http://search.yahoo.com/search?&ei=UTF-8&fr&h=c&p="
"Url used for Yahoo searching."
:type 'string
:group 'anything-config)
(defcustom anything-c-boring-buffer-regexp
(rx (or
(group bos " ")
;; anything-buffers
"*anything" "*ac-mode"
;; echo area
" *Echo Area" " *Minibuf"))
"The regexp that match boring buffers.
Buffer candidates matching this regular expression will be
filtered from the list of candidates if the
`anything-c-skip-boring-buffers' candidate transformer is used, or
they will be displayed with face `file-name-shadow' if
`anything-c-shadow-boring-buffers' is used."
:type 'string
:group 'anything-config)
;; (string-match anything-c-boring-buffer-regexp "buf")
;; (string-match anything-c-boring-buffer-regexp " hidden")
;; (string-match anything-c-boring-buffer-regexp " *Minibuf-1*")
(defcustom anything-c-boring-file-regexp
(rx (or
;; Boring directories
(and "/" (or ".svn" "CVS" "_darcs" ".git" ".hg") (or "/" eol))
;; Boring files
(and line-start ".#")
(and (or ".class" ".la" ".o" "~") eol)))
"The regexp that match boring files.
File candidates matching this regular expression will be
filtered from the list of candidates if the
`anything-c-skip-boring-files' candidate transformer is used, or
they will be displayed with face `file-name-shadow' if
`anything-c-shadow-boring-files' is used."
:type 'string
:group 'anything-config)
(defcustom anything-kill-ring-threshold 10
"Minimum length to be listed by `anything-c-source-kill-ring'."
:type 'integer
:group 'anything-config)
(defcustom anything-c-kill-ring-max-lines-number nil
"Max number of lines displayed per candidate in kill-ring browser.
If nil or zero, don't truncate candidate, show all."
:type 'integer
:group 'anything-config)
(defcustom anything-su-or-sudo "su"
"What command to use for root access."
:type 'string
:group 'anything-config)
(defcustom anything-for-files-prefered-list
'(anything-c-source-ffap-line
anything-c-source-ffap-guesser
anything-c-source-buffers-list
anything-c-source-recentf
anything-c-source-bookmarks
anything-c-source-file-cache
anything-c-source-files-in-current-dir+
anything-c-source-locate)
"Your prefered sources to find files."
:type 'list
:group 'anything-config)
(defcustom anything-create--actions-private nil
"User defined actions for `anything-create' / `anything-c-source-create'.
It is a list of (DISPLAY . FUNCTION) pairs like `action'
attribute of `anything-sources'.
It is prepended to predefined pairs."
:type 'list
:group 'anything-config)
(defcustom anything-allow-skipping-current-buffer nil
"Show current buffer or not in anything buffer"
:type 'boolean
:group 'anything-config)
(defcustom anything-c-enable-eval-defun-hack t
"If non-nil, execute `anything' using the source at point when C-M-x is pressed.
This hack is invoked when pressing C-M-x in the form \
(defvar anything-c-source-XXX ...) or (setq anything-c-source-XXX ...)."
:type 'boolean
:group 'anything-config)
(defcustom anything-tramp-verbose 0
"Just like `tramp-verbose' but specific to anything.
When set to 0 don't show tramp messages in anything.
If you want to have the default tramp messages set it to 3."
:type 'integer
:group 'anything-config)
(defcustom anything-raise-command nil
"A shell command to jump to a window running specific program.
Need external program wmctrl.
This will be use with `format', so use something like \"wmctrl -xa %s\"."
:type 'string
:group 'anything-config)
(defun anything-set-anything-command-map-prefix-key (var key)
"The customize set function for `anything-command-map-prefix-key'."
(when (boundp var)
(define-key global-map (read-kbd-macro (symbol-value var)) nil))
(set var key)
(define-key global-map
(read-kbd-macro (symbol-value var)) 'anything-command-map))
(defcustom anything-command-map-prefix-key "C-x c"
"The prefix key for all `anything-command-map' commands."
:type 'string
:set 'anything-set-anything-command-map-prefix-key
:group 'anything-config)
(defcustom anything-c-browse-code-regexp-lisp
"^ *\(def\\(un\\|subst\\|macro\\|face\\|alias\\|advice\\|struct\\|\
type\\|theme\\|var\\|group\\|custom\\|const\\|method\\|class\\)"
"Regexp used to parse lisp buffer when browsing code."
:type 'string
:group 'anything-config)
(defcustom anything-c-browse-code-regexp-python
"\\<def\\>\\|\\<class\\>"
"Regexp used to parse python buffer when browsing code."
:type 'string
:group 'anything-config)
(defcustom anything-c-browse-code-regexp-alist
`((lisp-interaction-mode . ,anything-c-browse-code-regexp-lisp)
(emacs-lisp-mode . ,anything-c-browse-code-regexp-lisp)
(lisp-mode . ,anything-c-browse-code-regexp-lisp)
(python-mode . ,anything-c-browse-code-regexp-python))
"Alist to store regexps for browsing code corresponding \
to a specific `major-mode'."
:type 'list
:group 'anything-config)
(defcustom anything-c-external-programs-associations nil
"Alist to store externals programs associated with file extension.
This variable overhide setting in .mailcap file.
e.g : '\(\(\"jpg\" . \"gqview\"\) (\"pdf\" . \"xpdf\"\)\) "
:type 'list
:group 'anything-config)
(defcustom anything-ff-auto-update-initial-value t
"Auto update when only one candidate directory is matched.
This is the default value when starting `anything-find-files'."
:group 'anything-config
:type 'boolean)
(defcustom anything-c-copy-async-prefered-emacs "emacs"
"Path to the emacs you want to use for copying async.
Emacs versions < 24 fail to copy directory due to a bug not fixed
in `copy-directory'."
:group 'anything-config
:type 'string)
(defcustom anything-ff-lynx-style-map t