anything-config.el: anything-c-source-call-source: Add action: "Copy variable name"
[anything-config.git] / doc / anything.tex
blobbdb2f25fdf55e6b84868c961a9cbc09e548ff58c
1 %%% anything.tex - Anything documentation.
3 %%% Copyright (C) 2010 ~ 2011, Thierry Volpiatto, all rights reserved.
5 %% This file is NOT part of GNU Emacs
6 %%
7 %% License
8 %
9 % This program is free software; you can redistribute it and/or modify
10 % it under the terms of the GNU General Public License as published by
11 % the Free Software Foundation; either version 3, or (at your option)
12 % any later version.
14 % This program is distributed in the hope that it will be useful,
15 % but WITHOUT ANY WARRANTY; without even the implied warranty of
16 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 % GNU General Public License for more details.
19 % You should have received a copy of the GNU General Public License
20 % along with this program; see the file COPYING. If not, write to
21 % the Free Software Foundation, Inc., 51 Franklin Street, Fifth
22 % Floor, Boston, MA 02110-1301, USA.
24 % This file is intended to be processed by plain TeX (TeX82).
26 \documentclass[a4paper,11pt]{article}
27 \usepackage[french]{babel}
28 \usepackage[utf8]{inputenc}
29 \usepackage{textcomp}
30 \usepackage{graphicx}
31 \usepackage{array}
32 \usepackage[pdftex=true,
33 hyperindex=true,
34 colorlinks=true]{hyperref}
35 \usepackage{url}
36 \usepackage{natbib}
37 \usepackage{setspace}
39 \newsavebox{\boiteencadre}
40 \newenvironment{encadre}{%
41 % clause begin
42 \begin{lrbox}{\boiteencadre}% début mise en boîte
43 \begin{minipage}{.8\textwidth}}{%
44 % clause end
45 \end{minipage}
46 \end{lrbox}% fin mise en boîte
47 % production de la boîte encadrée
48 \begin{center}
49 \fbox{\usebox{\boiteencadre}}
50 \end{center}}
52 \begin{document}
53 \begin{titlepage}
54 \title{Anything User Manual}
55 \date{Last update: \today}
56 \author{ThierryVolpiatto}
57 \maketitle
58 \tableofcontents
59 \end{titlepage}
61 \section{Install}
62 \label{sec:install}
64 First get the files from git repo:
66 Anything git repo is at:\\
67 \url{http://repo.or.cz/w/anything-config.git}\\
68 You will find there tarballs of differents versions.\\
70 To get it with git:
71 \begin{verbatim}
72 git clone git://repo.or.cz/anything-config.git
73 \end{verbatim}
74 NOTE: Files are published on Emacswiki, but be aware that it is \underline{unsafe} to get files from Emacswiki,\\
75 thus, anything is not maintained anymore on Emacswiki, so files found there should be deprecated.\\
77 Once you have the anything directory, `cd' to it and run `make'.\\
78 Add it now to your `load-path':
79 \begin{verbatim}
80 (add-to-list 'load-path "/path/to/anything/directory")
81 \end{verbatim}
84 Manual installation:\\
86 You need 3 files:
87 \begin{itemize}
88 \item 1) anything.el
89 \end{itemize}
90 Contain the anything engine.
92 \begin{itemize}
93 \item 2) anything-config.el
94 \end{itemize}
95 Contain all the sources and preconfigured functions ready to use.
97 \begin{itemize}
98 \item 3) anything-match-plugin.el
99 \end{itemize}
100 Allow matching multi pattern search when entering a space in prompt.
102 Once downloaded these files, put them in your `load-path' and byte-compile them.
103 If you don't know what is your load-path do C-h v load-path.
105 \section{Config}
106 \label{sec:config}
107 Edit your ~/.emacs.el file and add:
109 \begin{verbatim}
110 (require 'anything-config)
111 \end{verbatim}
114 NOTE:
115 It is not recommended to use the variable `anything-sources', please use instead the preconfigured anything command
116 you will find in anything-config.el or build your own.
118 Be aware also that making your own anything commands with a lot of sources involved can be very costly and slowdown
119 anything a lot.
121 \section{General anything commands}
122 \label{sec:gener-anyth-comm}
123 Anything allow you to have few binding to remember unlike all others Emacs applications.\\
124 Thus, all bindings are auto documented.
126 Anything show you by default in mode-line the most useful bindings, you will see in headers of anything buffer some more specific
127 commands.
129 So when anything start what you have to remember:
131 \begin{itemize}
132 \item Access to action menu with
133 \begin{verbatim}
135 \end{verbatim}
136 \end{itemize}
137 \begin{itemize}
138 \item Use persistent actions with
139 \begin{verbatim}
141 \end{verbatim}
142 \end{itemize}
143 \begin{itemize}
144 \item Mark candidate with
145 \begin{verbatim}
146 M-<SPACE>
147 \end{verbatim}
148 \end{itemize}
150 So three bindings to remember and they are anyway documented in mode-line.
151 For more, hitting
152 \begin{verbatim}
153 C-h m
154 \end{verbatim}
155 while in anything session will show you all other bindings.\\
156 NOTE: Some anything commands have a special keymap, you can access infos on these keymap with `C-c ?',
157 it should be documented in mode-line.
159 \section{Overview of preconfigured anything commands}
160 \label{sec:overv-comm-avail}
161 For starting with anything, a set of commands have been set for you in anything menu.
162 The bindings of all these commands are prefixed with `f5-a'.
164 To discover more anything commands run from menu anything all commands (anything-execute-anything-command).
165 Or run anything-M-x (f5-a M-x) and type anything.
167 When you like a command, e.g f5 a M-x you should bind it to something more convenient like M-x to replace the Emacs
168 original keybinding.
170 \section{Anything Find Files}
171 \label{sec:anything-find-files}
172 `anything-find-files' provide you a way to navigate in your system file easily.
173 All the actions you can do on files from here are described in this section.
175 It is binded in menu, and in `anything-command-map' to f5-a C-x C-f. \\
176 We will assume you have binded `anything-find-files' to C-x C-f.
177 To do that put in your .emacs.el:
178 \begin{verbatim}
179 (global-set-key (kbd "C-x C-f") 'anything-find-files)
180 \end{verbatim}
181 It is well integrated with tramp, you can enter any tramp filename and it will complete.
182 (e.g /su::, /sudo::, /ssh:host:, ... etc)
184 Called with a prefix arg, (C-u) anything-find-files will show you also history of last visited directories.
186 \subsection{Navigation}
187 \label{sec:navigation}
188 Anything-find-files is not by default on ~/ but on default-directory or
189 thing-at-point as it use ffap.If you are on a url, a mail adress
190 etc.. it will do the right thing.
192 So anything-find-files work like find-file (C-x C-f), but if you use it
193 with anything-match-plugin.el, you have to add a space and then the next
194 part of pattern you want to match:
196 Example:
198 \begin{verbatim}
199 Find Files or url: ~/
200 That show all ~/ directory.
202 Find Files or url: ~/des
203 will show all what begin with "des"
205 Find Files or url: ~/ esk
206 (Notice the space after ~/) will show all what contain esk.
208 Find Files or url: ~/ el$
209 Will show all what finish with el
211 \end{verbatim}
212 You can move in the anything buffer with C-n C-p or arrow keys, when you
213 are on a file, you can hit C-z to show only this file-name in the
214 anything buffer.
215 On a directory, C-z will switch to this directory to continue searching
216 in it.
217 On a symlink C-z will expand to the true name of symlink.(moving your
218 mouse cursor over a symlink will show the true name of it).
220 So it is quite easy to navigate in your files with anything-find-files.
222 Forget to mention C-. that go to root of current dir or to precedent
223 level of dir.
224 So for example you can hit C-z and then come back immediatly where you
225 were with C-. instead of erasing minibuffer input with DEL.
226 On non graphic display, it is bound to C-l.\\
227 If `anything-ff-lynx-style-map' is non--nil, you will be able to use `left' instead of C-l and `right' instead of C-z.
229 If you like it, you can safely bind it to C-x C-f to replace the standard
230 find-file:
232 \begin{verbatim}
233 (global-set-key (kbd "C-x C-f") 'anything-find-files)
234 \end{verbatim}
236 NOTE:
237 Starting anything-find-files with C-u will show you a little history of the last visited directories.
240 \subsection{Jump with nth commands}
241 \label{sec:jump-with-nth}
242 Take advantage of the second, third and 4th actions in anything.
243 Instead of opening action menu with TAB, just hit:
245 C-e for 2th action\\
246 C-j for 3th action\\
248 You can bind 4th action to some key like this:
249 \begin{verbatim}
250 (define-key anything-map (kbd "<C-tab>") 'anything-select-4th-action)
251 \end{verbatim}
252 \newpage
253 \subsection{Anything find files action shortcuts}
254 \label{sec:anything-find-files-1}
255 Instead of having to open action pannel with TAB,
256 you have some convenients shortcuts to quickly run actions.
257 Use C-c ? from an anything-find-files session to have a description.\\
259 \begin{tabular}{| l | l |}
260 \hline
261 Command & Key \\
262 \hline
263 anything-ff-run-grep & M-g s (C-u recurse)\\
264 \hline
265 anything-ff-run-rename-file & M-R (C-u Follow)\\
266 \hline
267 anything-ff-run-copy-file & M-C (C-u Follow)\\
268 \hline
269 anything-ff-run-byte-compile-file & M-B (C-u Load)\\
270 \hline
271 anything-ff-run-load-file & M-L \\
272 \hline
273 anything-ff-run-symlink-file & M-S (C-u Follow)\\
274 \hline
275 anything-ff-run-delete-file & M-D \\
276 \hline
277 anything-ff-run-switch-to-eshell & M-e \\
278 \hline
279 anything-ff-run-complete-fn-at-point & M-tab \\
280 \hline
281 anything-ff-run-switch-other-window & C-o \\
282 \hline
283 anything-ff-run-open-file-externally & C-c C-x (C-u choose)\\
284 \hline
285 anything-ff-help & C-c ? \\
286 \hline
287 anything-ff-rotate-left-persistent & M-l \\
288 \hline
289 anything-ff-rotate-right-persistent & M-r \\
290 \hline
291 anything-find-files-down-one-level & C-. or C-l \\
292 \hline
293 anything-ff-properties-persistent & M-i \\
294 \hline
295 \end{tabular}
296 \subsection{Turn in image viewer}
297 \label{sec:turn-image-viewer}
298 You can turn anything-find-files in a nice image-viewer.
300 Navigate to your image directory, then type C-u C-z on first image.
301 Now turn on `follow-mode' with C-c C-f.
302 You can now navigate in your image directory with arrow up and down or C-n C-p.
303 Don't forget also to use C-t to split you windows vertically if needed.
305 You will find also two actions to rotate image in action menu.
306 To use these actions whitout quitting, use M-l (rotate left) and M-r (rotate right).
307 Of course M-l and M-r have no effect if candidate is not an image file.\\
309 Don't forget to use `C-t' to split windows vertically, and then
310 \begin{verbatim}
311 `C-}' and `C-{'
312 \end{verbatim}
313 to narrow/enlarge anything window.\\
315 NOTE:
316 It use image-dired in background, so if image-dired don't work for some reason, this will
317 not work too.
318 Be sure to have Imagemagick package installed.\\
320 \includegraphics[width=15cm]{image-viewer1}
321 \newpage
323 \subsection{Serial rename}
324 \label{sec:serial-rename}
325 You can rename files with a new prefix name and by incremental number.
326 The marked files will be renamed with a new prefix name and starting
327 at the start-number you have choosen.\\
328 Note that the marked files are in the order of the selection you did, this allow to reorder
329 files.\\
330 If you mark files in other directories than the current one, these files will be moved or symlinked to current one.\\
332 TIP: If you have more than 100 files to serial rename, start at 100 instead of one to have your directory
333 sorted correctly.\\
335 You have to ways to serial rename:\\
336 \begin{itemize}
337 \item By renaming: All the file of others directories are moved in directory where renaming happen.\\
338 \end{itemize}
339 \begin{itemize}
340 \item By symlinking: All the files that are not files of the directory where you want to rename will be symlinked,
341 others will be renamed.\\
342 \end{itemize}
343 \begin{itemize}
344 \item By copying: All the file of others directories are copied in directory where renaming happen.\\
345 \end{itemize}
347 Example of Use:\\
348 I want to create a directory with many symlinked images coming from various directories.\\
349 1) C-x C-f (launch anything-find-files)\\
350 2) Navigate to the place of your choice and write new directory name ending with ``/'' and press RET.\\
351 3) Navigate and browse images, when you want an image mark it, you can mark all in a directory with M-a.\\
352 4) When you have marked all files, choose ``serial rename by symlinking'' in action menu.\\
353 5) Choose new name and start number.\\
354 6) Navigate to initial directory (where files will be renamed/symlinked) and RET.\\
355 7) Say yes to confirm, that's done.\\
356 8) Start viewing your pictures.\\
358 \subsection{Grep}
359 \label{sec:grep}
360 We describe here anything-do-grep, an incremental grep.
361 It is really convenient as you can start a search just after finding the place or file(s) you want to search in.
362 By the nature of incremental stuff, it is faster than original Emacs grep for searching.
364 As you type the display change (like in all other anything commands).
365 This grep is also recursive unlike the emacs implementation that use find/xargs.
367 It support wildcard and (re)use the variables `grep-find-ignored-files'
368 and `grep-find-ignored-directories'.
370 It have full tramp integration.
371 (you can grep file on a remote host or in su/sudo methods).
373 \begin{itemize}
374 \item NOTE:
375 You will find a file named anything-grep.el in extensions.
376 It is DEPRECATED and NOT needed to use with what is described here.
377 It is another implementation of grep but not incremental.
378 \end{itemize}
381 \begin{itemize}
382 \item NOTE:
383 When using it recursively, `grep-find-ignored-files' is not used unless you don't specify
384 the only extensions of files where you want to search (you will have a prompt).
385 You can now specify more than one extension to search.\\
386 e.g *.el *.py *.tex \\
387 will search only in files with these extensions.
388 \end{itemize}
390 \begin{itemize}
391 \item NOTE: Windows users need grep version
392 \begin{math}
393 \geq2.5.4
394 \end{math}
395 of Gnuwin32 on windoze.
396 This version should accept the --exclude-dir option.
397 \end{itemize}
399 \newpage
400 Grep in action on current file: \\
402 \includegraphics[width=15cm]{grep-screenshot2}
404 \subsection{Anything do grep}
405 \label{sec:anything-do-grep}
406 Start with M-x anything-do-grep bound to f5 a M-g s
407 A prefix arg will launch recursive grep.
409 \subsection{Grep from anything-find-files}
410 \label{sec:grep-from-anything}
411 From anything-find-files (f5 a C-x C-f) Open the action menu with tab and choose grep.
412 A prefix arg will launch recursive grep.\\
414 \begin{itemize}
415 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
416 \end{itemize}
418 \subsection{Grep One file}
419 \label{sec:grep-one-file}
420 Just launch grep, it will search in file at point.
421 if file is a directory, it will search in ALL files of this directory like:
423 \begin{verbatim}
424 grep -nH -e pattern *
425 \end{verbatim}
428 \subsection{Grep Marked files}
429 \label{sec:grep-marked-files}
430 Just mark some files with
431 \begin{verbatim}
432 C-<SPACE>
433 \end{verbatim}
434 and launch grep.
435 \subsubsection{Grep marked files from differents directories}
436 \label{sec:grep-marked-files-1}
437 This is a very nice feature of anything grep implementation that allow to search in specific files located not
438 only in current directory but anywhere in your file system.
440 To use navigate in your file system and mark files with
441 \begin{verbatim}
442 C-<SPACE>
443 \end{verbatim}
444 When you have marked all files, just launch grep in action menu.
446 NOTE: Using prefix-arg (C-u) will start a recursive search with the extensions of the marked files
447 except if those are one of ``grep-find-ignored-files''.
449 \subsection{Grep Directory recursively}
450 \label{sec:grep-direct-recurs}
451 From anything-find-files, reach the root of the directory where you want to search in,
452 then hit TAB to open the action menu and choose grep with a prefix arg (i.e C-u RET).
454 if you want to use grep directly from anything-do-grep, do:
456 \begin{verbatim}
457 C-u f5 a M-g s
458 \end{verbatim}
460 You will be prompted for selecting in which category of files to search:
461 Use the wilcard syntax like *.el for example (search in only ``.el'' files).
463 \begin{itemize}
464 \item NOTE: Be sure to be at the root of directory, of course grepping recursively with cursor
465 on a filename candidate will find nothing.
467 \end{itemize}
468 \subsection{Grep Using Wildcard}
469 \label{sec:grep-using-wildcard}
470 You can use wildcard:
471 From the root of your directory, if you want for example to search files with .el extension:
472 add *.el to prompt.
474 \subsection{Grep thing at point}
475 \label{sec:grep-thing-at}
476 Before lauching anything, put your cursor on the start of symbol or sexp you will want to grep.
477 Then launch anything-do-grep or anything-find-files, and when in the grep prompt hit C-w as many time as needed.
479 \subsection{Grep persistent action}
480 \label{sec:grep-pers-acti}
481 As always, C-z will bring you in the buffer corresponding to the file you are grepping. \\
482 Well nothing new, but using C-u C-z will record this place in the mark-ring.
483 So if you want to come back later to these places no need to grep again, you will find all these
484 places in the mark-ring.\\
485 Accessing the mark-ring in Emacs is really inconvenient, fortunately, you will find in anything-config
486 ``anything-all-mark-ring'' which is a mark-ring browser (f5-a C-c SPACE).
487 \newpage
488 ``anything-all-mark-ring'' is in anything menu also, in the tool section.\\
490 \begin{itemize}
491 \item TIP: Bind ``anything-all-mark-ring'' to C-c SPACE.
492 \begin{verbatim}
493 (global-set-key (kbd "C-c <SPC>") 'anything-all-mark-rings)
494 \end{verbatim}
495 \end{itemize}
497 \begin{itemize}
498 \item NOTE: ``anything-all-mark-ring'' handle global-mark-ring also.
499 \end{itemize}
501 \subsection{Save grep session}
502 \label{sec:save-grep-session}
503 If you want to save the results of your grep session, doing ``C-x C-s'' will save your grep results
504 in a grep-mode buffer.
506 \subsection{Open Files Externally}
507 \label{sec:open-files-extern}
508 You will find in action menu from anything-find-files an action to open file with external program.
509 If you have no entry in .mailcap or /etc/mailcap, you will enter an anything session to choose a program
510 to use with this kind of file.
511 It will offer to you to save setting to always open this kind of files with this program.
512 Once configured, you can however open the files of same extension with some other program by forcing anything
513 to choose program with C-u.\\
515 NOTE: You can now open files externally with ``C-c C-x'' from anything-find-files.
517 \subsection{Eshell command on files}
518 \label{sec:eshell-command-files}
519 You can run eshell-command on files or marked files, the command you use have to accept
520 one file as argument.
521 The completion is make on your eshell aliases.
522 This allow you creating personal actions for ``anything-find-files''.
524 \subsection{Why Eshell}
525 \label{sec:why-eshell}
526 \begin{itemize}
527 \item Because eshell allow you to create aliases.
528 \end{itemize}
529 \begin{itemize}
530 \item Because eshell accept shell commands but also elisp functions.
531 \end{itemize}
532 All these command should end with \$1.
533 You will have completion against all these aliases once eshell is loaded.
534 (start it once before using anything-find-files).
536 \subsection{Setup Aliases}
537 \label{sec:setup-aliases}
538 Go in eshell, an enter at prompt:
539 \begin{verbatim}
540 alias my_alias command \$1
541 \end{verbatim}
542 NOTE: don't forget to escape the \$.
544 See the documentation of Eshell for more info.
546 \subsection{Problem starting Eshell}
547 \label{sec:probl-start-eshell}
548 Eshell code is available (autoloaded) only when you have started once eshell.
549 That's annoying like many autoloaded stuff in Emacs.\\
551 Here how to start Eshell at emacs startup:\\
553 Add this to your .emacs:
554 \begin{verbatim}
555 (add-hook 'emacs-startup-hook #'(lambda ()
556 (let ((default-directory (getenv "HOME")))
557 (command-execute 'eshell)
558 (bury-buffer))))
560 \end{verbatim}
562 \subsection{Dired Commands}
563 \label{sec:dired-commands}
564 To enable some of the usual commands of dired, put in .emacs.el
565 \begin{verbatim}
566 (anything-dired-bindings 1)
567 \end{verbatim}
568 Or run interactively:
569 \begin{verbatim}
570 M-x anything-dired-bindings
571 \end{verbatim}
572 This will replace in dired C, R, S, and H commands.
573 That is copy, rename, symlink, hardlink.
574 When creating a symlink, you will find relsymlink in actions menu.(TAB).\\
575 NOTE: This is deprecated for Emacs24 users, use instead 'ac-mode'.
577 \subsection{Copy Files}
578 \label{sec:copy-files}
579 It is a powerfull feature of anything-find-files as you can mark files in very different places in your
580 file system and copy them in one place.
582 Dired is not able to do that, you can mark files only in current dired display and copy them somewhere.
584 So, easy to use, just mark some files, and hit copy files in the action menu.
585 That will open a new anything-find-files where you can choose destination.
586 \subsection{Rename Files}
587 \label{sec:rename-files}
588 Just mark some files, and hit rename files in the action menu.
589 That will open a new anything-find-files where you can choose destination.
590 \subsection{Symlink Files}
591 \label{sec:symlink-files}
592 Just mark some files, and hit symlink or relsymlink files in the action menu.
593 That will open a new anything-find-files where you can choose destination.
594 \subsection{Hardlink}
595 \label{sec:hardlink}
596 Just mark some files, and hit hardlink files in the action menu.
597 That will open a new anything-find-files where you can choose destination.
599 \subsection{Follow file after action}
600 \label{sec:follow-file-after}
601 A prefix arg on any of the action above, copy, rename, symlink, hardlink, will
602 allow you to follow the file.
603 For example, when you want to copy an elisp file somewhere and you want to compile it in this place,
604 hitting C-u RET will bring you in this place with the file already marked, you have just to go in action menu to
605 compile it.
607 \subsection{In Buffer File Completion}
608 \label{sec:buff-file-compl}
609 In any buffer and even in minibuffer if you have enable recursive-minibuffer
610 \begin{verbatim}
611 (setq enable-recursive-minibuffers t)
612 \end{verbatim}
613 You can have completion with C-x C-f and then hit tab to choose action Complete at point \\
614 once you have found the filename you want.
615 \subsection{Create File}
616 \label{sec:create-file}
617 Navigate to the directory where you want to create your new file, then \\
618 continue typing the name of your file and type enter. \\
619 NOTE: If your filename ends with a / you will be prompt to create a new directory.
621 \subsection{Create Directory}
622 \label{sec:create-directory}
623 Navigate to the directory where you want to create your new directory, \\
624 then continue typing the name of new directory - Parents accepted - \\
625 and end it with / type enter, you will be prompt to create your new directory (possibly with parents).
627 \subsection{Ediff files}
628 \label{sec:ediff-files}
629 Well, that is easy to use,
630 move cursor to a file, hit ediff in action menu, you will jump in
631 another anything-find-files to choose second file.
632 \subsection{Ediff merge files}
633 \label{sec:ediff-merge-files}
634 move cursor to a file, hit ediff merge in action menu, you will jump in
635 another anything-find-files to choose second file.
637 \subsection{Browse archive with avfs}
638 \label{sec:browse-archive-with}
640 If you have installed avfs (See: http://sourceforge.net/projects/avf) you can browse archives
641 in your directory .avfs once it is mounted with ``mountavfs''.
643 Just move on the archive filename and press C-z (persistent action) and you will see
644 in anything buffer the subdirectories of archive, just navigate inside as usual.
646 \subsection{Display with icons}
647 \label{sec:display-with-icons}
649 You can have a more fancy display showing icons for files and directories.
650 Just add in .emacs:
651 \begin{verbatim}
652 (setq anything-c-find-files-show-icons t)
653 \end{verbatim}
654 NOTE: This will slowdown anything-find-files unless you have a fast computer.
656 \section{Anything write buffer}
657 \label{sec:anyth-write-buff}
658 That is a replacement of standard write-buffer Emacs command with anything completion.
659 \section{Anything insert file}
660 \label{sec:anything-insert-file}
661 That is a replacement of standard insert-file Emacs command with anything completion.
663 \section{Anything M-x}
664 \label{sec:anything-m-x}
665 It is binded to f5 a M-x, you should bind it to M-x.
667 Features:\\
668 \begin{itemize}
669 \item You can use prefix arguments before or during M-x session
670 \end{itemize}
671 \begin{itemize}
672 \item C-z is a toggle documentation for this command
673 \end{itemize}
674 \begin{itemize}
675 \item The key binding of command are shown.
676 \end{itemize}
678 \section{Anything regexp}
679 \label{sec:anything-regexp}
680 This is a replacement of regexp-builder.
681 The groups are shown in a convenient way.
683 \subsection{Query replace regexp}
684 \label{sec:query-replace-regexp}
685 Write your regexp in anything-regexp, when it match what you want,
686 you can run query-replace from action menu.
687 NOTE:
688 Before running anything-regexp, you can select a region to work in, that will narrow this region
689 automatically.
690 \subsection{Save regexp as sexp}
691 \label{sec:save-regexp-as}
692 When you use this, it will save your regexp for further use in lisp code,
693 with backslash duplicated.
695 \subsection{Save regexp as string}
696 \label{sec:save-regexp-as-1}
697 Save the regexp as you wrote it.
699 \section{Anything locate}
700 \label{sec:anything-locate}
701 First be sure you have a locate program installed on your system.
702 Most GNU/Linux distro come with locate included, you update or create the data base with
703 ``updatedb'' command.
705 \subsection{Search files}
706 \label{sec:search-files}
708 To use, just launch
709 \begin{verbatim}
710 M-x anything-locate (f5 a l)
711 \end{verbatim}
713 Then enter filename at prompt.
714 It will search this pattern entered also in directory and subdirectory names, to limit your search to basename,
715 add ``-b'' after pattern.
716 The search is performed on all files known in database, they maybe not exists anymore, so to limit to
717 really existing files add after pattern ``-e''.
718 To limit you search to specific number of results, use ``-n'' after your pattern with the number of results
719 you want.
721 Example:
722 \begin{verbatim}
723 Pattern: emacs -b -e -n 12
724 \end{verbatim}
726 \subsection{Launch grep}
727 \label{sec:launch-grep}
729 When search is done, you can search in a specific file or directory with grep that you will find in action menu (TAB).\\
731 \begin{itemize}
732 \item NOTE:You can now launch grep with (C-u) M-g s without switching to the action pannel.
733 \end{itemize}
735 \subsection{Use a local locate DB}
736 \label{sec:use-local-locate}
738 You can specify a specific database with prefix argument ARG (C-u).
739 Many databases can be used: navigate and mark them.
740 See also `anything-locate-with-db'.
742 To create a user specific db, use:
743 \begin{verbatim}
744 updatedb -l 0 -o dbpath -U directory
745 \end{verbatim}
747 Where ``dbpath'' is a filename matched by
748 ``anything-locate-db-file-regexp''
750 \subsection{Windows specificity}
751 \label{sec:windows-specificity}
753 On Windows you should use Everything program that mimic locate, is very fast and don't need to
754 update database manually.
755 To use with anything-locate, you will need his command line named ``es''.
756 Be sure to modify the PATH environment variable, to include path to the directory that contain ``es''.
757 The arguments are the same than the ones in ``locate''.
759 \section{Anything Etags}
760 \label{sec:anything-etags}
762 \subsection{Create the tag file}
763 \label{sec:create-tag-file}
766 To use etags in Emacs you have first to create a TAGS file for your project with the etags shell command.
767 If your directory contains subdirectories use someting like:(e.g .el files)
768 \begin{verbatim}
769 find . -iregex .*\.el$ | xargs etags
770 \end{verbatim}
771 Otherwise
772 \begin{verbatim}
773 etags *.el
774 \end{verbatim}
775 is enough
777 For more infos see the man page of etags.
779 \subsection{Start anything etags}
780 \label{sec:start-anything-etags}
783 Now just using f5 a e will show you all entries.
784 If the project is big it take some time to load tag file but when it is done, next search will be very fast.
785 If you modify the TAGS file, use
786 \begin{verbatim}
787 C-u C-u f5 a e
788 \end{verbatim}
789 to refresh the tag cache.
791 To search the definition at point use just
792 \begin{verbatim}
793 C-u f5 a e
794 \end{verbatim}
796 \section{Firefox bookmarks}
797 \label{sec:firefox-bookmarks}
799 You will have to set firefox to import bookmarks in his html file book-marks.html.
800 \begin{verbatim}
801 (only for firefox versions >=3)
802 \end{verbatim}
803 To achieve that, open ``about:config'' in firefox and double click on this line to enable value to true :
804 \begin{verbatim}
805 user_pref("browser.bookmarks.autoExportHTML", false);
806 \end{verbatim}
807 You should have now :
808 \begin{verbatim}
809 user_pref("browser.bookmarks.autoExportHTML", true);
810 \end{verbatim}
811 Now you can use
812 \begin{verbatim}
813 M-x anything-firefox-bookmarks
814 \end{verbatim}
815 To see your firefox bookmarks from Emacs.
816 When you are in firefox things are a little more complicated. You will
817 need wmctrl program and a script named ffbookmarks :
818 \begin{verbatim}
819 #!/bin/bash
821 wmctrl -xa emacs
822 emacsclient -e "(progn (anything-firefox-bookmarks) nil)" > /dev/null
823 wmctrl -xa firefox
824 exit 0
825 \end{verbatim}
826 Put this script somewhere in PATH and make it executable :
827 \begin{verbatim}
828 chmod +x ffbookmarks
829 \end{verbatim}
831 Firefox is not aware about this new protocol, you will have to instruct
832 it. See Firefox documentation or use firefox-protocol.el package you can get
833 here: \\
834 \url{http://mercurial.intuxication.org/hg/emacs-bookmark-extension/} \\
835 Install new protocol: \\
836 \begin{verbatim}
837 M-x firefox-protocol-installer-install
838 \end{verbatim}
839 to install new protocol ffbookmarks
840 Then install a bookmarklet in firefox : Right click on the bookmark
841 toolbar in firefox and add a new bookmark called ffbookmarks. Add this
842 instead of url: \\
843 \begin{verbatim}
844 javascript:location.href='ffbookmarks://localhost'
845 \end{verbatim}
847 Now when you click on ffbookmarks it will bring you in Emacs and allow
848 you to browse your bookmarks with anything.
850 NOTE : emacs server need to be started in the running Emacs, see Emacs
851 documentation.
853 \section{Anything for buffers}
854 \label{sec:anything-buffers}
856 \begin{verbatim}
857 M-x anything-buffers-list
858 \end{verbatim}
860 \subsection{Borring buffers}
861 \label{sec:borring-buffers}
863 Will show you your buffers list without borring buffers defined by regexp in
864 ``anything-c-boring-buffer-regexp''.
865 Just use customize to set that for your need.\\
867 \subsection{Search buffers by major-mode}
868 \label{sec:search-buffers-major}
871 Once in this anything session, you can narrow your buffer list by ``major mode'', regexp as usual or the both:\\
873 Example:\\
875 I want to show all my buffer that are in emacs-lisp mode:\\
877 Pattern: lisp \\
879 will show all emacs-lisp and lisp related buffers.\\
881 Now i want to limit these buffers to the one that match ``any''\\
883 Pattern: lisp any \\
885 I want to match buffers that match ``any'' but not limited to lisp buffers:\\
887 Pattern: any \\
889 \subsection{Different colors for buffers}
890 \label{sec:diff-colors-buff}
892 \begin{itemize}
893 \item If a buffer is modified, it will showup in orange.
894 \end{itemize}
895 \begin{itemize}
896 \item If a buffer have been modified by some external program (e.g sed) in the back of emacs, it will showup in red.
897 \end{itemize}
898 \begin{itemize}
899 \item Non--buffer file, Directory and files have differents face.
900 \end{itemize}
902 \subsection{Special commands}
903 \label{sec:special-commands}
904 Not complete.\\
906 C-c ? will show you all commands available.
909 \section{Other tools}
910 \label{sec:other-tools}
912 In addition of what is described above, you will find a bunch of powerfull tools that come with anything-config.el.
913 Just browse the anything commands availables with anything-M-x.
915 Not complete.
917 \section{Anything completion mode}
918 \label{sec:anyth-compl-mode}
919 `anything-completion-mode' aka `ac-mode' will enable anything completion in all
920 Emacs commands using `completing-read' or `read-file-name'.\\
921 To use it:
922 \begin{verbatim}
923 M-x ac-mode
924 \end{verbatim}
925 Turn it on in .emacs with:
926 \begin{verbatim}
927 (ac-mode 1)
928 \end{verbatim}
929 Customize with:\\
930 `anything-completing-read-handlers-alist'
932 See C-h v `anything-completing-read-handlers-alist' for more infos.
934 Not complete.
936 \section{Anything Eshell completion}
937 \label{sec:anyth-eshell-compl}
939 \subsection{Enable anything pcomplete}
940 \label{sec:enable-anyth-pcompl}
943 Of course pcomplete is already enabled in Eshell, but what we want here
944 is to enable it with anything support. \\
945 To enable it's easy, just add to ``.emacs.el'':
947 \begin{encadre}
948 \begin{verbatim}
949 (add-hook 'eshell-mode-hook
950 #'(lambda ()
951 (define-key eshell-mode-map
952 [remap pcomplete]
953 'anything-esh-pcomplete)))
955 \end{verbatim}
956 \end{encadre}
958 Now when hitting ``TAB'', you should have anything pcompletion.\\
961 \subsubsection{Write your own pcomplete functions}
962 \label{sec:write-your-own}
964 You can enhance Emacs pcomplete by writing your own pcomplete functions.\\
966 Here an example with ``find'' command:
968 \begin{verbatim}
970 (defun pcomplete/find ()
971 (let ((prec (pcomplete-arg 'last -1)))
972 (cond ((and (pcomplete-match "^-" 'last)
973 (string= "find" prec))
974 (pcomplete-opt "HLPDO"))
975 ((pcomplete-match "^-" 'last)
976 (while (pcomplete-here
977 '("-amin" "-anewer" "-atime" "-cmin" "-cnewer" "-context"
978 "-ctime" "-daystart" "-delete" "-depth" "-empty" "-exec"
979 "-execdir" "-executable" "-false" "-fls" "-follow" "-fprint"
980 "-fprint0" "-fprintf" "-fstype" "-gid" "-group"
981 "-help" "-ignore_readdir_race" "-ilname" "-iname"
982 "-inum" "-ipath" "-iregex" "-iwholename"
983 "-links" "-lname" "-ls" "-maxdepth"
984 "-mindepth" "-mmin" "-mount" "-mtime"
985 "-name" "-newer" "-nogroup" "-noignore_readdir_race"
986 "-noleaf" "-nouser" "-nowarn" "-ok"
987 "-okdir" "-path" "-perm" "-print"
988 "-print0" "-printf" "-prune" "-quit"
989 "-readable" "-regex" "-regextype" "-samefile"
990 "-size" "-true" "-type" "-uid"
991 "-used" "-user" "-version" "-warn"
992 "-wholename" "-writable" "-xdev" "-xtype"))))
993 ((string= "-type" prec)
994 (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s" "D"))))
995 ((string= "-xtype" prec)
996 (while (pcomplete-here (list "b" "c" "d" "p" "f" "l" "s"))))
997 ((or (string= prec "-exec")
998 (string= prec "-execdir"))
999 (while (pcomplete-here* (funcall pcomplete-command-completion-function)
1000 (pcomplete-arg 'last) t))))
1001 (while (pcomplete-here (pcomplete-entries) nil 'identity))))
1003 \end{verbatim}
1004 \newpage
1005 \subsection{Enable anything Eshell history}
1006 \label{sec:enable-anyth-eshell}
1008 Add this to ``.emacs.el''
1009 \begin{encadre}
1010 \begin{verbatim}
1011 (add-hook 'eshell-mode-hook
1012 #'(lambda ()
1013 (define-key eshell-mode-map
1014 (kbd "M-p")
1015 'anything-eshell-history)))
1016 \end{verbatim}
1017 \end{encadre}
1019 \section{Usefuls extensions}
1020 \label{sec:usefuls-extensions}
1021 Not complete.
1023 \section{Usefuls links}
1024 \label{sec:usefuls-links}
1026 You can have infos about anything on Emacswiki (Mostly deprecated).\\
1027 \url{http://www.emacswiki.org/emacs/Anything}\\
1029 You can ask on the anything mailing-list by subscribing at:\\
1030 \url{https://groups.google.com/group/emacs-anything?hl=en}
1032 Or at gmane: gmane.emacs.anything
1034 \end{document}
1036 %%% Local Variables:
1037 %%% mode: latex
1038 %%% TeX-master: t
1039 %%% End: