diff options
Diffstat (limited to 'doc')
51 files changed, 3336 insertions, 2426 deletions
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi index 23d7e28f4e3..695ffa8d1cd 100644 --- a/doc/emacs/abbrevs.texi +++ b/doc/emacs/abbrevs.texi | |||
| @@ -407,7 +407,7 @@ you are expanding. | |||
| 407 | in this search; if it is @code{nil}, the word and the expansion must | 407 | in this search; if it is @code{nil}, the word and the expansion must |
| 408 | match in case. If the value is @code{case-fold-search} (the default), | 408 | match in case. If the value is @code{case-fold-search} (the default), |
| 409 | then the variable @code{case-fold-search} controls whether to ignore | 409 | then the variable @code{case-fold-search} controls whether to ignore |
| 410 | case while searching for expansions (@pxref{Search Case}). | 410 | case while searching for expansions (@pxref{Lax Search}). |
| 411 | 411 | ||
| 412 | @vindex dabbrev-case-replace | 412 | @vindex dabbrev-case-replace |
| 413 | Normally, dynamic abbrev expansion preserves the case pattern | 413 | Normally, dynamic abbrev expansion preserves the case pattern |
| @@ -421,7 +421,7 @@ the dynamic abbrev's case pattern is preserved in most cases; if it is | |||
| 421 | @code{nil}, the expansion is always copied verbatim. If the value is | 421 | @code{nil}, the expansion is always copied verbatim. If the value is |
| 422 | @code{case-replace} (the default), then the variable | 422 | @code{case-replace} (the default), then the variable |
| 423 | @code{case-replace} controls whether to copy the expansion verbatim | 423 | @code{case-replace} controls whether to copy the expansion verbatim |
| 424 | (@pxref{Replacement and Case}). | 424 | (@pxref{Replacement and Lax Matches}). |
| 425 | 425 | ||
| 426 | However, if the expansion contains a complex mixed case pattern, and | 426 | However, if the expansion contains a complex mixed case pattern, and |
| 427 | the dynamic abbrev matches this pattern as far as it goes, then the | 427 | the dynamic abbrev matches this pattern as far as it goes, then the |
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi index 1c88e97a659..4d53456d0f0 100644 --- a/doc/emacs/ack.texi +++ b/doc/emacs/ack.texi | |||
| @@ -64,6 +64,10 @@ point vertically fixed by scrolling the window when moving up and down | |||
| 64 | in the buffer. | 64 | in the buffer. |
| 65 | 65 | ||
| 66 | @item | 66 | @item |
| 67 | Aurélien Aptel added dynamic module support to Emacs. Philipp | ||
| 68 | Stephani and others also worked on the dynamic module code. | ||
| 69 | |||
| 70 | @item | ||
| 67 | Joe Arceneaux wrote the original text property implementation, and | 71 | Joe Arceneaux wrote the original text property implementation, and |
| 68 | implemented support for X11. | 72 | implemented support for X11. |
| 69 | 73 | ||
diff --git a/doc/emacs/buffers.texi b/doc/emacs/buffers.texi index 5a4d1abfc39..ae64fefbb70 100644 --- a/doc/emacs/buffers.texi +++ b/doc/emacs/buffers.texi | |||
| @@ -703,5 +703,6 @@ C-b}. To customize this buffer list, use the @code{bs} Custom group | |||
| 703 | MSB global minor mode (``MSB'' stands for ``mouse select buffer'') | 703 | MSB global minor mode (``MSB'' stands for ``mouse select buffer'') |
| 704 | provides a different and customizable mouse buffer menu which you may | 704 | provides a different and customizable mouse buffer menu which you may |
| 705 | prefer. It replaces the bindings of @code{mouse-buffer-menu}, | 705 | prefer. It replaces the bindings of @code{mouse-buffer-menu}, |
| 706 | normally on @kbd{C-Down-Mouse-1}, and the menu bar buffer menu. You | 706 | normally on @kbd{C-Down-Mouse-1} and @kbd{C-@key{F10}}, and the menu |
| 707 | can customize the menu in the @code{msb} Custom group. | 707 | bar buffer menu. You can customize the menu in the @code{msb} Custom |
| 708 | group. | ||
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index 8441c889bbf..fc405e3a147 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi | |||
| @@ -403,6 +403,8 @@ customizations in your initialization file. This is because saving | |||
| 403 | customizations from such a session would wipe out all the other | 403 | customizations from such a session would wipe out all the other |
| 404 | customizations you might have on your initialization file. | 404 | customizations you might have on your initialization file. |
| 405 | 405 | ||
| 406 | @cindex unsaved customizations, reminder to save | ||
| 407 | @findex custom-prompt-customize-unsaved-options | ||
| 406 | Please note that any customizations you have not chosen to save for | 408 | Please note that any customizations you have not chosen to save for |
| 407 | future sessions will be lost when you terminate Emacs. If you'd like | 409 | future sessions will be lost when you terminate Emacs. If you'd like |
| 408 | to be prompted about unsaved customizations at termination time, add | 410 | to be prompted about unsaved customizations at termination time, add |
| @@ -1131,6 +1133,12 @@ won't confuse other programs that the file is intended for. The | |||
| 1131 | example above is for the C programming language, where comments start | 1133 | example above is for the C programming language, where comments start |
| 1132 | with @samp{/*} and end with @samp{*/}. | 1134 | with @samp{/*} and end with @samp{*/}. |
| 1133 | 1135 | ||
| 1136 | If some unrelated text might look to Emacs as a local variables list, | ||
| 1137 | you can countermand that by inserting a form-feed character (a page | ||
| 1138 | delimiter, @pxref{Pages}) after that text. Emacs only looks for | ||
| 1139 | file-local variables in the last page of a file, after the last page | ||
| 1140 | delimiter. | ||
| 1141 | |||
| 1134 | @findex add-file-local-variable | 1142 | @findex add-file-local-variable |
| 1135 | @findex delete-file-local-variable | 1143 | @findex delete-file-local-variable |
| 1136 | @findex copy-dir-locals-to-file-locals | 1144 | @findex copy-dir-locals-to-file-locals |
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 27bb77d5cac..0030467cdce 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -188,6 +188,7 @@ Advanced Features | |||
| 188 | * Sending Mail:: Sending mail in Emacs. | 188 | * Sending Mail:: Sending mail in Emacs. |
| 189 | * Rmail:: Reading mail in Emacs. | 189 | * Rmail:: Reading mail in Emacs. |
| 190 | * Gnus:: A flexible mail and news reader. | 190 | * Gnus:: A flexible mail and news reader. |
| 191 | * Host Security:: Security issues on a single computer. | ||
| 191 | * Network Security:: Managing the network security. | 192 | * Network Security:: Managing the network security. |
| 192 | * Document View:: Viewing PDF, PS and DVI files. | 193 | * Document View:: Viewing PDF, PS and DVI files. |
| 193 | * EWW:: A web browser in Emacs. | 194 | * EWW:: A web browser in Emacs. |
| @@ -392,18 +393,20 @@ Searching and Replacement | |||
| 392 | * Regexps:: Syntax of regular expressions. | 393 | * Regexps:: Syntax of regular expressions. |
| 393 | * Regexp Backslash:: Regular expression constructs starting with `\'. | 394 | * Regexp Backslash:: Regular expression constructs starting with `\'. |
| 394 | * Regexp Example:: A complex regular expression explained. | 395 | * Regexp Example:: A complex regular expression explained. |
| 395 | * Search Case:: To ignore case while searching, or not. | 396 | * Lax Search:: Search ignores some distinctions between |
| 397 | similar characters, like letter-case. | ||
| 396 | * Replace:: Search, and replace some or all matches. | 398 | * Replace:: Search, and replace some or all matches. |
| 397 | * Other Repeating Search:: Operating on all matches for some regexp. | 399 | * Other Repeating Search:: Operating on all matches for some regexp. |
| 400 | * Search Customizations:: Various search customizations. | ||
| 398 | 401 | ||
| 399 | Incremental Search | 402 | Incremental Search |
| 400 | 403 | ||
| 401 | * Basic Isearch:: Basic incremental search commands. | 404 | * Basic Isearch:: Basic incremental search commands. |
| 402 | * Repeat Isearch:: Searching for the same string again. | 405 | * Repeat Isearch:: Searching for the same string again. |
| 403 | * Error in Isearch:: When your string is not found. | ||
| 404 | * Special Isearch:: Special input in incremental search. | ||
| 405 | * Isearch Yank:: Commands that grab text into the search string | 406 | * Isearch Yank:: Commands that grab text into the search string |
| 406 | or else edit the search string. | 407 | or else edit the search string. |
| 408 | * Error in Isearch:: When your string is not found. | ||
| 409 | * Special Isearch:: Special input in incremental search. | ||
| 407 | * Not Exiting Isearch:: Prefix argument and scrolling commands. | 410 | * Not Exiting Isearch:: Prefix argument and scrolling commands. |
| 408 | * Isearch Minibuffer:: Incremental search of the minibuffer history. | 411 | * Isearch Minibuffer:: Incremental search of the minibuffer history. |
| 409 | 412 | ||
| @@ -411,7 +414,8 @@ Replacement Commands | |||
| 411 | 414 | ||
| 412 | * Unconditional Replace:: Replacing all matches for a string. | 415 | * Unconditional Replace:: Replacing all matches for a string. |
| 413 | * Regexp Replace:: Replacing all matches for a regexp. | 416 | * Regexp Replace:: Replacing all matches for a regexp. |
| 414 | * Replacement and Case:: How replacements preserve case of letters. | 417 | * Replacement and Lax Matches:: |
| 418 | Lax searching for text to replace. | ||
| 415 | * Query Replace:: How to use querying. | 419 | * Query Replace:: How to use querying. |
| 416 | 420 | ||
| 417 | Commands for Fixing Typos | 421 | Commands for Fixing Typos |
| @@ -534,6 +538,7 @@ Frames and Graphical Displays | |||
| 534 | * Multiple Displays:: How one Emacs instance can talk to several displays. | 538 | * Multiple Displays:: How one Emacs instance can talk to several displays. |
| 535 | * Frame Parameters:: Changing the colors and other modes of frames. | 539 | * Frame Parameters:: Changing the colors and other modes of frames. |
| 536 | * Scroll Bars:: How to enable and disable scroll bars; how to use them. | 540 | * Scroll Bars:: How to enable and disable scroll bars; how to use them. |
| 541 | * Window Dividers:: Window separators that can be dragged with the mouse. | ||
| 537 | * Drag and Drop:: Using drag and drop to open files and insert text. | 542 | * Drag and Drop:: Using drag and drop to open files and insert text. |
| 538 | * Menu Bars:: Enabling and disabling the menu bar. | 543 | * Menu Bars:: Enabling and disabling the menu bar. |
| 539 | * Tool Bars:: Enabling and disabling the tool bar. | 544 | * Tool Bars:: Enabling and disabling the tool bar. |
| @@ -589,6 +594,7 @@ Commands for Human Languages | |||
| 589 | * Sentences:: Moving over and killing sentences. | 594 | * Sentences:: Moving over and killing sentences. |
| 590 | * Paragraphs:: Moving over paragraphs. | 595 | * Paragraphs:: Moving over paragraphs. |
| 591 | * Pages:: Moving over pages. | 596 | * Pages:: Moving over pages. |
| 597 | * Quotation Marks:: Inserting quotation marks. | ||
| 592 | * Filling:: Filling or justifying text. | 598 | * Filling:: Filling or justifying text. |
| 593 | * Case:: Changing the case of text. | 599 | * Case:: Changing the case of text. |
| 594 | * Text Mode:: The major modes for editing text files. | 600 | * Text Mode:: The major modes for editing text files. |
| @@ -1164,6 +1170,11 @@ Reporting Bugs | |||
| 1164 | * Checklist:: Steps to follow for a good bug report. | 1170 | * Checklist:: Steps to follow for a good bug report. |
| 1165 | * Sending Patches:: How to send a patch for GNU Emacs. | 1171 | * Sending Patches:: How to send a patch for GNU Emacs. |
| 1166 | 1172 | ||
| 1173 | Contributing to Emacs Development | ||
| 1174 | |||
| 1175 | * Coding Standards:: Gnu Emacs coding standards. | ||
| 1176 | * Copyright Assignment:: Assigning copyright to the FSF. | ||
| 1177 | |||
| 1167 | Command Line Arguments for Emacs Invocation | 1178 | Command Line Arguments for Emacs Invocation |
| 1168 | 1179 | ||
| 1169 | * Action Arguments:: Arguments to visit files, load libraries, | 1180 | * Action Arguments:: Arguments to visit files, load libraries, |
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi index 5752d02fe85..4f7596e058c 100644 --- a/doc/emacs/files.texi +++ b/doc/emacs/files.texi | |||
| @@ -1295,11 +1295,12 @@ would make to the file if you save the buffer. | |||
| 1295 | 1295 | ||
| 1296 | @findex compare-windows | 1296 | @findex compare-windows |
| 1297 | The command @kbd{M-x compare-windows} compares the text in the | 1297 | The command @kbd{M-x compare-windows} compares the text in the |
| 1298 | current window with that in the next window. (For more information | 1298 | current window with that in the window that was the selected window |
| 1299 | about windows in Emacs, @ref{Windows}.) Comparison starts at point in | 1299 | before you selected the current one. (For more information about |
| 1300 | each window, after pushing each initial point value on the mark ring | 1300 | windows in Emacs, @ref{Windows}.) Comparison starts at point in each |
| 1301 | in its respective buffer. Then it moves point forward in each window, | 1301 | window, after pushing each initial point value on the mark ring in its |
| 1302 | one character at a time, until it reaches characters that don't match. | 1302 | respective buffer. Then it moves point forward in each window, one |
| 1303 | character at a time, until it reaches characters that don't match. | ||
| 1303 | Then the command exits. | 1304 | Then the command exits. |
| 1304 | 1305 | ||
| 1305 | If point in the two windows is followed by non-matching text when | 1306 | If point in the two windows is followed by non-matching text when |
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi index 95b721fa739..acfdfe25cb2 100644 --- a/doc/emacs/frames.texi +++ b/doc/emacs/frames.texi | |||
| @@ -1265,10 +1265,11 @@ Some text terminals support mouse clicks in the terminal window. | |||
| 1265 | In a terminal emulator which is compatible with @command{xterm}, you | 1265 | In a terminal emulator which is compatible with @command{xterm}, you |
| 1266 | can use @kbd{M-x xterm-mouse-mode} to give Emacs control over simple | 1266 | can use @kbd{M-x xterm-mouse-mode} to give Emacs control over simple |
| 1267 | uses of the mouse---basically, only non-modified single clicks are | 1267 | uses of the mouse---basically, only non-modified single clicks are |
| 1268 | supported. The normal @command{xterm} mouse functionality for such | 1268 | supported. Newer versions of @command{xterm} also support |
| 1269 | clicks is still available by holding down the @kbd{SHIFT} key when you | 1269 | mouse-tracking. The normal @command{xterm} mouse functionality for |
| 1270 | press the mouse button. Xterm Mouse mode is a global minor mode | 1270 | such clicks is still available by holding down the @kbd{SHIFT} key |
| 1271 | (@pxref{Minor Modes}). Repeating the command turns the mode off | 1271 | when you press the mouse button. Xterm Mouse mode is a global minor |
| 1272 | mode (@pxref{Minor Modes}). Repeating the command turns the mode off | ||
| 1272 | again. | 1273 | again. |
| 1273 | 1274 | ||
| 1274 | @findex gpm-mouse-mode | 1275 | @findex gpm-mouse-mode |
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi index e66cd79e740..cc81101d67a 100644 --- a/doc/emacs/glossary.texi +++ b/doc/emacs/glossary.texi | |||
| @@ -175,11 +175,22 @@ corresponding Control character. @xref{User Input,C-M-}. | |||
| 175 | Case conversion means changing text from upper case to lower case or | 175 | Case conversion means changing text from upper case to lower case or |
| 176 | vice versa. @xref{Case}. | 176 | vice versa. @xref{Case}. |
| 177 | 177 | ||
| 178 | @item Case Folding | ||
| 179 | Case folding means ignoring the differences between case variants of | ||
| 180 | the same letter: upper-case, lower-case, and title-case. Emacs | ||
| 181 | performs case folding by default in text search. @xref{Lax Search}. | ||
| 182 | |||
| 178 | @item Character | 183 | @item Character |
| 179 | Characters form the contents of an Emacs buffer. Also, key sequences | 184 | Characters form the contents of an Emacs buffer. Also, key sequences |
| 180 | (q.v.@:) are usually made up of characters (though they may include | 185 | (q.v.@:) are usually made up of characters (though they may include |
| 181 | other input events as well). @xref{User Input}. | 186 | other input events as well). @xref{User Input}. |
| 182 | 187 | ||
| 188 | @item Character Folding | ||
| 189 | Character folding means ignoring differences between similarly looking | ||
| 190 | characters, such as between @code{a}, and @code{@:a} and @code{@'a}. | ||
| 191 | Emacs performs character folding by default in text search. @xref{Lax | ||
| 192 | Search}. | ||
| 193 | |||
| 183 | @item Character Set | 194 | @item Character Set |
| 184 | Emacs supports a number of character sets, each of which represents a | 195 | Emacs supports a number of character sets, each of which represents a |
| 185 | particular alphabet or script. @xref{International}. | 196 | particular alphabet or script. @xref{International}. |
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi index a9c63b91785..25e783f6ed7 100644 --- a/doc/emacs/help.texi +++ b/doc/emacs/help.texi | |||
| @@ -126,6 +126,10 @@ Display documentation of the current major mode and minor modes | |||
| 126 | (@code{describe-mode}). | 126 | (@code{describe-mode}). |
| 127 | @item C-h n | 127 | @item C-h n |
| 128 | Display news of recent Emacs changes (@code{view-emacs-news}). | 128 | Display news of recent Emacs changes (@code{view-emacs-news}). |
| 129 | @item C-h o @var{symbol} | ||
| 130 | Display documentation of the Lisp symbol named @var{symbol} | ||
| 131 | (@code{describe-symbol}). This will show the documentation of all | ||
| 132 | kinds of symbols: functions, variables, and faces. | ||
| 129 | @item C-h p | 133 | @item C-h p |
| 130 | Find packages by topic keyword (@code{finder-by-keyword}). This lists | 134 | Find packages by topic keyword (@code{finder-by-keyword}). This lists |
| 131 | packages using a package menu buffer. @xref{Packages}. | 135 | packages using a package menu buffer. @xref{Packages}. |
| @@ -272,6 +276,14 @@ source files installed (@pxref{Hyperlinking}). | |||
| 272 | (@code{Info-goto-emacs-command-node}). This knows about various | 276 | (@code{Info-goto-emacs-command-node}). This knows about various |
| 273 | manuals, not just the Emacs manual, and finds the right one. | 277 | manuals, not just the Emacs manual, and finds the right one. |
| 274 | 278 | ||
| 279 | @kindex C-h o | ||
| 280 | @findex describe-symbol | ||
| 281 | @kbd{C-h o} (@code{describe-symbol}) is like @kbd{C-h f} and | ||
| 282 | @kbd{C-h v}, but it describes any symbol, be it a function, a | ||
| 283 | variable, or a face. If the symbol has more than one definition, like | ||
| 284 | it has both definition as a function and as a variable, this command | ||
| 285 | will show the documentation of all of them, one after the other. | ||
| 286 | |||
| 275 | @node Apropos | 287 | @node Apropos |
| 276 | @section Apropos | 288 | @section Apropos |
| 277 | @cindex apropos | 289 | @cindex apropos |
| @@ -524,8 +536,9 @@ command works depend on the major mode. | |||
| 524 | @findex view-lossage | 536 | @findex view-lossage |
| 525 | If something surprising happens, and you are not sure what you typed, | 537 | If something surprising happens, and you are not sure what you typed, |
| 526 | use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays your last | 538 | use @kbd{C-h l} (@code{view-lossage}). @kbd{C-h l} displays your last |
| 527 | 300 input keystrokes. If you see commands that you don't know, you can | 539 | 300 input keystrokes and the commands they invoked. If you see |
| 528 | use @kbd{C-h c} to find out what they do. | 540 | commands that you are not familiar with, you can use @kbd{C-h k} or |
| 541 | @kbd{C-h f} to find out what they do. | ||
| 529 | 542 | ||
| 530 | @kindex C-h e | 543 | @kindex C-h e |
| 531 | @findex view-echo-area-messages | 544 | @findex view-echo-area-messages |
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi index d453647b0c5..9761ac7d11c 100644 --- a/doc/emacs/killing.texi +++ b/doc/emacs/killing.texi | |||
| @@ -504,9 +504,9 @@ does not alter the clipboard. However, if you change | |||
| 504 | @code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the | 504 | @code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the |
| 505 | new yank to the clipboard. | 505 | new yank to the clipboard. |
| 506 | 506 | ||
| 507 | @vindex x-select-enable-clipboard | 507 | @vindex select-enable-clipboard |
| 508 | To prevent kill and yank commands from accessing the clipboard, | 508 | To prevent kill and yank commands from accessing the clipboard, |
| 509 | change the variable @code{x-select-enable-clipboard} to @code{nil}. | 509 | change the variable @code{select-enable-clipboard} to @code{nil}. |
| 510 | 510 | ||
| 511 | @cindex clipboard manager | 511 | @cindex clipboard manager |
| 512 | @vindex x-select-enable-clipboard-manager | 512 | @vindex x-select-enable-clipboard-manager |
| @@ -519,14 +519,14 @@ when exiting Emacs; if you wish to prevent Emacs from transferring | |||
| 519 | data to the clipboard manager, change the variable | 519 | data to the clipboard manager, change the variable |
| 520 | @code{x-select-enable-clipboard-manager} to @code{nil}. | 520 | @code{x-select-enable-clipboard-manager} to @code{nil}. |
| 521 | 521 | ||
| 522 | @vindex x-select-enable-primary | 522 | @vindex select-enable-primary |
| 523 | @findex clipboard-kill-region | 523 | @findex clipboard-kill-region |
| 524 | @findex clipboard-kill-ring-save | 524 | @findex clipboard-kill-ring-save |
| 525 | @findex clipboard-yank | 525 | @findex clipboard-yank |
| 526 | Prior to Emacs 24, the kill and yank commands used the primary | 526 | Prior to Emacs 24, the kill and yank commands used the primary |
| 527 | selection (@pxref{Primary Selection}), not the clipboard. If you | 527 | selection (@pxref{Primary Selection}), not the clipboard. If you |
| 528 | prefer this behavior, change @code{x-select-enable-clipboard} to | 528 | prefer this behavior, change @code{select-enable-clipboard} to |
| 529 | @code{nil}, @code{x-select-enable-primary} to @code{t}, and | 529 | @code{nil}, @code{select-enable-primary} to @code{t}, and |
| 530 | @code{mouse-drag-copy-region} to @code{t}. In this case, you can use | 530 | @code{mouse-drag-copy-region} to @code{t}. In this case, you can use |
| 531 | the following commands to act explicitly on the clipboard: | 531 | the following commands to act explicitly on the clipboard: |
| 532 | @code{clipboard-kill-region} kills the region and saves it to the | 532 | @code{clipboard-kill-region} kills the region and saves it to the |
| @@ -853,6 +853,19 @@ so in a rectangular fashion, and killing and yanking operate on the | |||
| 853 | rectangle. @xref{Killing}. The mode persists only as long as the | 853 | rectangle. @xref{Killing}. The mode persists only as long as the |
| 854 | region is active. | 854 | region is active. |
| 855 | 855 | ||
| 856 | Unlike the standard region, the region-rectangle can have its corners | ||
| 857 | extended past the end of buffer, or inside stretches of white space | ||
| 858 | that point normally cannot enter, like the TAB. | ||
| 859 | |||
| 860 | @findex rectangle-exchange-point-and-mark | ||
| 861 | @findex exchange-point-and-mark@r{, in rectangle-mark-mode} | ||
| 862 | @kindex C-x C-x@r{, in rectangle-mark-mode} | ||
| 863 | When the region is in rectangle-mark-mode, @kbd{C-x C-x} runs the | ||
| 864 | command @code{rectangle-exchange-point-and-mark}, which cycles between | ||
| 865 | the four corners of the region-rectangle. This comes in handy if you | ||
| 866 | want to modify the dimensions of the region-rectangle before invoking | ||
| 867 | an operation on the marked text. | ||
| 868 | |||
| 856 | @node CUA Bindings | 869 | @node CUA Bindings |
| 857 | @section CUA Bindings | 870 | @section CUA Bindings |
| 858 | @findex cua-mode | 871 | @findex cua-mode |
diff --git a/doc/emacs/m-x.texi b/doc/emacs/m-x.texi index c9ae559f984..795d6fe373b 100644 --- a/doc/emacs/m-x.texi +++ b/doc/emacs/m-x.texi | |||
| @@ -43,6 +43,13 @@ Note that @code{forward-char} is the same command that you invoke with | |||
| 43 | the key @kbd{C-f}. The existence of a key binding does not stop you | 43 | the key @kbd{C-f}. The existence of a key binding does not stop you |
| 44 | from running the command by name. | 44 | from running the command by name. |
| 45 | 45 | ||
| 46 | @cindex obsolete command | ||
| 47 | When @kbd{M-x} completes on commands, it ignores the commands that | ||
| 48 | are declared @dfn{obsolete}; for these, you will have to type their | ||
| 49 | full name. Obsolete commands are those for which newer, better | ||
| 50 | alternatives exist, and which are slated for removal in some future | ||
| 51 | Emacs release. | ||
| 52 | |||
| 46 | To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead | 53 | To cancel the @kbd{M-x} and not run a command, type @kbd{C-g} instead |
| 47 | of entering the command name. This takes you back to command level. | 54 | of entering the command name. This takes you back to command level. |
| 48 | 55 | ||
| @@ -57,7 +64,16 @@ mentions this in the echo area after running the command. For | |||
| 57 | example, if you type @kbd{M-x forward-word}, the message says that you | 64 | example, if you type @kbd{M-x forward-word}, the message says that you |
| 58 | can run the same command by typing @kbd{M-f}. You can turn off these | 65 | can run the same command by typing @kbd{M-f}. You can turn off these |
| 59 | messages by setting the variable @code{suggest-key-bindings} to | 66 | messages by setting the variable @code{suggest-key-bindings} to |
| 60 | @code{nil}. | 67 | @code{nil}. The value of @code{suggest-key-bindings} can also be a |
| 68 | number, in which case Emacs will show the binding for that many | ||
| 69 | seconds before removing it from display. The default behavior is to | ||
| 70 | display the binding for 2 seconds. | ||
| 71 | |||
| 72 | Commands that don't have key bindings, can still be invoked after | ||
| 73 | typing less than their full name at the @samp{M-x} prompt. Emacs | ||
| 74 | mentions such shorthands in the echo area if they are significantly | ||
| 75 | shorter than the full command name. The setting of | ||
| 76 | @code{suggest-key-bindings} affects these hints as well. | ||
| 61 | 77 | ||
| 62 | In this manual, when we speak of running a command by name, we often | 78 | In this manual, when we speak of running a command by name, we often |
| 63 | omit the @key{RET} that terminates the name. Thus we might say | 79 | omit the @key{RET} that terminates the name. Thus we might say |
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi index a571ea7ed67..801d147845b 100644 --- a/doc/emacs/maintaining.texi +++ b/doc/emacs/maintaining.texi | |||
| @@ -47,6 +47,17 @@ variable @code{vc-handled-backends} to @code{nil} | |||
| 47 | (@pxref{Customizing VC}). | 47 | (@pxref{Customizing VC}). |
| 48 | @end ifnottex | 48 | @end ifnottex |
| 49 | 49 | ||
| 50 | @findex vc-refresh-state | ||
| 51 | @findex vc-state-refresh | ||
| 52 | To update the VC state information for the file visited in the | ||
| 53 | current buffer, use the command @code{vc-refresh-state}. This command | ||
| 54 | is useful when you perform version control commands outside Emacs | ||
| 55 | (e.g., from the shell prompt), or if you put the buffer's file under a | ||
| 56 | different version control system, or remove it from version control | ||
| 57 | entirely. A companion command @code{vc-state-refresh} does the same, | ||
| 58 | but does not consider switching the version control system or removal | ||
| 59 | from VC. | ||
| 60 | |||
| 50 | @menu | 61 | @menu |
| 51 | * Introduction to VC:: How version control works in general. | 62 | * Introduction to VC:: How version control works in general. |
| 52 | * VC Mode Line:: How the mode line shows version control status. | 63 | * VC Mode Line:: How the mode line shows version control status. |
| @@ -821,15 +832,19 @@ corresponding to @var{revision}, saves it to | |||
| 821 | window. | 832 | window. |
| 822 | 833 | ||
| 823 | @findex vc-annotate | 834 | @findex vc-annotate |
| 835 | @vindex vc-annotate-background-mode | ||
| 824 | @kindex C-x v g | 836 | @kindex C-x v g |
| 825 | Many version control systems allow you to view files @dfn{annotated} | 837 | Many version control systems allow you to view files @dfn{annotated} |
| 826 | with per-line revision information, by typing @kbd{C-x v g} | 838 | with per-line revision information, by typing @kbd{C-x v g} |
| 827 | (@code{vc-annotate}). This creates a new ``annotate'' buffer | 839 | (@code{vc-annotate}). This creates a new ``annotate'' buffer |
| 828 | displaying the file's text, with each line colored to show | 840 | displaying the file's text, with each line colored to show how old it |
| 829 | how old it is. Red text is new, blue is old, and intermediate colors | 841 | is. Red text is new, blue is old, and intermediate colors indicate |
| 830 | indicate intermediate ages. By default, the color is scaled over the | 842 | intermediate ages. By default, the color is scaled over the full |
| 831 | full range of ages, such that the oldest changes are blue, and the | 843 | range of ages, such that the oldest changes are blue, and the newest |
| 832 | newest changes are red. | 844 | changes are red. If the variable @code{vc-annotate-background-mode} |
| 845 | is non-@code{nil}, the colors expressing the age of each line are | ||
| 846 | applied to the background color, leaving the foreground at its default | ||
| 847 | color. | ||
| 833 | 848 | ||
| 834 | When you give a prefix argument to this command, Emacs reads two | 849 | When you give a prefix argument to this command, Emacs reads two |
| 835 | arguments using the minibuffer: the revision to display and annotate | 850 | arguments using the minibuffer: the revision to display and annotate |
| @@ -1009,6 +1024,22 @@ increase the number of revisions shown in an existing | |||
| 1009 | entries} or @samp{Show unlimited entries} buttons at the end of the | 1024 | entries} or @samp{Show unlimited entries} buttons at the end of the |
| 1010 | buffer. However, RCS, SCCS, and CVS do not support this feature. | 1025 | buffer. However, RCS, SCCS, and CVS do not support this feature. |
| 1011 | 1026 | ||
| 1027 | @findex vc-region-history | ||
| 1028 | A useful variant of examining changes is provided by the command | ||
| 1029 | @kbd{vc-region-history}, which shows a @file{*VC-history*} buffer with | ||
| 1030 | the history of changes to the region of the current file between point | ||
| 1031 | and the mark (@pxref{Mark}). The history of changes includes the | ||
| 1032 | commit log messages and also the changes themselves in the Diff | ||
| 1033 | format. | ||
| 1034 | |||
| 1035 | Invoke this command after marking the region of the current file in | ||
| 1036 | whose changes you are interested. In the @file{*VC-history*} buffer | ||
| 1037 | it pops up, you can use all of the commands available in the | ||
| 1038 | @file{*vc-change-log*} buffer described above, and also the commands | ||
| 1039 | defined by Diff mode (@pxref{Diff Mode}). | ||
| 1040 | |||
| 1041 | This command is currently available only with Git. | ||
| 1042 | |||
| 1012 | @node VC Undo | 1043 | @node VC Undo |
| 1013 | @subsection Undoing Version Control Actions | 1044 | @subsection Undoing Version Control Actions |
| 1014 | 1045 | ||
| @@ -1353,19 +1384,43 @@ commit will be committed to that specific branch. | |||
| 1353 | @subsubsection Pulling/Pushing Changes into/from a Branch | 1384 | @subsubsection Pulling/Pushing Changes into/from a Branch |
| 1354 | 1385 | ||
| 1355 | @table @kbd | 1386 | @table @kbd |
| 1387 | @item C-x v P | ||
| 1388 | On a decentralized version control system, update another location | ||
| 1389 | with changes from the current branch (a.k.a. ``push'' changes). This | ||
| 1390 | concept does not exist for centralized version control systems | ||
| 1391 | |||
| 1356 | @item C-x v + | 1392 | @item C-x v + |
| 1357 | On a decentralized version control system, update the current branch | 1393 | On a decentralized version control system, update the current branch |
| 1358 | by ``pulling in'' changes from another location. | 1394 | by ``pulling in'' changes from another location. |
| 1359 | 1395 | ||
| 1360 | On a centralized version control system, update the current VC | 1396 | On a centralized version control system, update the current VC |
| 1361 | fileset. | 1397 | fileset. |
| 1362 | |||
| 1363 | @item C-x v P | ||
| 1364 | On a decentralized version control system, ``push'' changes from the | ||
| 1365 | current branch to another location. This concept does not exist | ||
| 1366 | for centralized version control systems. | ||
| 1367 | @end table | 1398 | @end table |
| 1368 | 1399 | ||
| 1400 | @kindex C-x v P | ||
| 1401 | @findex vc-push | ||
| 1402 | On a decentralized version control system, the command @kbd{C-x v P} | ||
| 1403 | (@code{vc-push}) updates another location with changes from the | ||
| 1404 | current branch. With a prefix argument, it prompts for the exact | ||
| 1405 | version control command to run, which lets you specify where to push | ||
| 1406 | changes; the default is @command{bzr push} with Bazaar, @command{git | ||
| 1407 | push} with Git, and @command{hg push} with Mercurial. The default | ||
| 1408 | commands always push to a default location determined by the version | ||
| 1409 | control system from your branch configuration. | ||
| 1410 | |||
| 1411 | Prior to pushing, you can use @kbd{C-x v O} (@code{vc-log-outgoing}) | ||
| 1412 | to view a log buffer of the changes to be sent. @xref{VC Change Log}. | ||
| 1413 | |||
| 1414 | @cindex bound branch (Bazaar VCS) | ||
| 1415 | This command is currently supported only by Bazaar, Git, and Mercurial. | ||
| 1416 | The concept of ``pushing'' does not exist for centralized version | ||
| 1417 | control systems, where this operation is a part of committing a | ||
| 1418 | changeset, so invoking this command on a centralized VCS signals an | ||
| 1419 | error. This command also signals an error when attempted in a Bazaar | ||
| 1420 | @dfn{bound branch}, where committing a changeset automatically pushes | ||
| 1421 | the changes to the remote repository to which the local branch is | ||
| 1422 | bound. | ||
| 1423 | |||
| 1369 | @kindex C-x v + | 1424 | @kindex C-x v + |
| 1370 | @findex vc-pull | 1425 | @findex vc-pull |
| 1371 | On a decentralized version control system, the command @kbd{C-x v +} | 1426 | On a decentralized version control system, the command @kbd{C-x v +} |
| @@ -1377,12 +1432,12 @@ Otherwise, it pulls from a default location determined by the version | |||
| 1377 | control system. | 1432 | control system. |
| 1378 | 1433 | ||
| 1379 | Amongst decentralized version control systems, @kbd{C-x v +} is | 1434 | Amongst decentralized version control systems, @kbd{C-x v +} is |
| 1380 | currently supported only by Bazaar, Git, and Mercurial. On Bazaar, it | 1435 | currently supported only by Bazaar, Git, and Mercurial. With Bazaar, |
| 1381 | calls @command{bzr pull} for ordinary branches (to pull from a master | 1436 | it calls @command{bzr pull} for ordinary branches (to pull from a |
| 1382 | branch into a mirroring branch), and @command{bzr update} for a bound | 1437 | master branch into a mirroring branch), and @command{bzr update} for a |
| 1383 | branch (to pull from a central repository). On Git, it calls | 1438 | bound branch (to pull from a central repository). With Git, it calls |
| 1384 | @command{git pull} to fetch changes from a remote repository and merge | 1439 | @command{git pull} to fetch changes from a remote repository and merge |
| 1385 | it into the current branch. On Mercurial, it calls @command{hg pull | 1440 | it into the current branch. With Mercurial, it calls @command{hg pull |
| 1386 | -u} to fetch changesets from the default remote repository and update | 1441 | -u} to fetch changesets from the default remote repository and update |
| 1387 | the working directory. | 1442 | the working directory. |
| 1388 | 1443 | ||
| @@ -1393,21 +1448,6 @@ Log}. | |||
| 1393 | On a centralized version control system like CVS, @kbd{C-x v +} | 1448 | On a centralized version control system like CVS, @kbd{C-x v +} |
| 1394 | updates the current VC fileset from the repository. | 1449 | updates the current VC fileset from the repository. |
| 1395 | 1450 | ||
| 1396 | @kindex C-x v P | ||
| 1397 | @findex vc-push | ||
| 1398 | On a decentralized version control system, the command @kbd{C-x v P} | ||
| 1399 | (@code{vc-push}) sends changes from your current branch to another location. | ||
| 1400 | With a prefix argument, the command prompts for the exact | ||
| 1401 | version control command to use, which lets you specify where to push | ||
| 1402 | changes. Otherwise, it pushes to a default location determined | ||
| 1403 | by the version control system. | ||
| 1404 | |||
| 1405 | Prior to pushing, you can use @kbd{C-x v O} (@code{vc-log-outgoing}) | ||
| 1406 | to view a log buffer of the changes to be sent. @xref{VC Change Log}. | ||
| 1407 | |||
| 1408 | This command is currently supported only by Bazaar, Git, and Mercurial. | ||
| 1409 | It signals an error for centralized version control systems. | ||
| 1410 | |||
| 1411 | @node Merging | 1451 | @node Merging |
| 1412 | @subsubsection Merging Branches | 1452 | @subsubsection Merging Branches |
| 1413 | @cindex merging changes | 1453 | @cindex merging changes |
| @@ -2285,7 +2325,7 @@ input. @xref{Query Replace}, for more information on query replace. | |||
| 2285 | You can control the case-sensitivity of tags search commands by | 2325 | You can control the case-sensitivity of tags search commands by |
| 2286 | customizing the value of the variable @code{tags-case-fold-search}. The | 2326 | customizing the value of the variable @code{tags-case-fold-search}. The |
| 2287 | default is to use the same setting as the value of | 2327 | default is to use the same setting as the value of |
| 2288 | @code{case-fold-search} (@pxref{Search Case}). | 2328 | @code{case-fold-search} (@pxref{Lax Search}). |
| 2289 | 2329 | ||
| 2290 | It is possible to get through all the files in the tags table with a | 2330 | It is possible to get through all the files in the tags table with a |
| 2291 | single invocation of @kbd{M-x tags-query-replace}. But often it is | 2331 | single invocation of @kbd{M-x tags-query-replace}. But often it is |
diff --git a/doc/emacs/mini.texi b/doc/emacs/mini.texi index 2493fdadf37..869e06424ad 100644 --- a/doc/emacs/mini.texi +++ b/doc/emacs/mini.texi | |||
| @@ -588,13 +588,17 @@ argument into the minibuffer: | |||
| 588 | 588 | ||
| 589 | @table @kbd | 589 | @table @kbd |
| 590 | @item M-p | 590 | @item M-p |
| 591 | @itemx @key{UP} | ||
| 592 | Move to the previous item in the minibuffer history, an earlier | 591 | Move to the previous item in the minibuffer history, an earlier |
| 593 | argument (@code{previous-history-element}). | 592 | argument (@code{previous-history-element}). |
| 594 | @item M-n | 593 | @item M-n |
| 595 | @itemx @key{DOWN} | ||
| 596 | Move to the next item in the minibuffer history | 594 | Move to the next item in the minibuffer history |
| 597 | (@code{next-history-element}). | 595 | (@code{next-history-element}). |
| 596 | @item @key{UP} | ||
| 597 | @itemx @key{DOWN} | ||
| 598 | Like @kbd{M-p} and @kbd{M-n}, but move to the previous or next line of | ||
| 599 | a multi-line item before going to the previous history item | ||
| 600 | (@code{previous-line-or-history-element} and | ||
| 601 | @code{next-line-or-history-element}) . | ||
| 598 | @item M-r @var{regexp} @key{RET} | 602 | @item M-r @var{regexp} @key{RET} |
| 599 | Move to an earlier item in the minibuffer history that | 603 | Move to an earlier item in the minibuffer history that |
| 600 | matches @var{regexp} (@code{previous-matching-history-element}). | 604 | matches @var{regexp} (@code{previous-matching-history-element}). |
| @@ -609,13 +613,13 @@ Move to a later item in the minibuffer history that matches | |||
| 609 | @kindex DOWN @r{(minibuffer history)} | 613 | @kindex DOWN @r{(minibuffer history)} |
| 610 | @findex next-history-element | 614 | @findex next-history-element |
| 611 | @findex previous-history-element | 615 | @findex previous-history-element |
| 612 | While in the minibuffer, @kbd{M-p} or @key{UP} | 616 | While in the minibuffer, @kbd{M-p} (@code{previous-history-element}) |
| 613 | (@code{previous-history-element}) moves through the minibuffer history | 617 | moves through the minibuffer history list, one item at a time. Each |
| 614 | list, one item at a time. Each @kbd{M-p} fetches an earlier item from | 618 | @kbd{M-p} fetches an earlier item from the history list into the |
| 615 | the history list into the minibuffer, replacing its existing contents. | 619 | minibuffer, replacing its existing contents. Typing @kbd{M-n} |
| 616 | Typing @kbd{M-n} or @key{DOWN} (@code{next-history-element}) moves | 620 | (@code{next-history-element}) moves through the minibuffer history |
| 617 | through the minibuffer history list in the opposite direction, | 621 | list in the opposite direction, fetching later entries into the |
| 618 | fetching later entries into the minibuffer. | 622 | minibuffer. |
| 619 | 623 | ||
| 620 | If you type @kbd{M-n} in the minibuffer when there are no later | 624 | If you type @kbd{M-n} in the minibuffer when there are no later |
| 621 | entries in the minibuffer history (e.g., if you haven't previously | 625 | entries in the minibuffer history (e.g., if you haven't previously |
| @@ -623,6 +627,14 @@ typed @kbd{M-p}), Emacs tries fetching from a list of default | |||
| 623 | arguments: values that you are likely to enter. You can think of this | 627 | arguments: values that you are likely to enter. You can think of this |
| 624 | as moving through the ``future history''. | 628 | as moving through the ``future history''. |
| 625 | 629 | ||
| 630 | @findex previous-line-or-history-element | ||
| 631 | @findex next-line-or-history-element | ||
| 632 | The arrow keys @kbd{@key{UP}} and @kbd{@key{DOWN}} work like | ||
| 633 | @kbd{M-p} and @kbd{M-n}, but if the current history item is longer | ||
| 634 | than a single line, they allow you to move to the previous or next | ||
| 635 | line of the current history item before going to the previous or next | ||
| 636 | history item. | ||
| 637 | |||
| 626 | If you edit the text inserted by the @kbd{M-p} or @kbd{M-n} | 638 | If you edit the text inserted by the @kbd{M-p} or @kbd{M-n} |
| 627 | minibuffer history commands, this does not change its entry in the | 639 | minibuffer history commands, this does not change its entry in the |
| 628 | history list. However, the edited argument does go at the end of the | 640 | history list. However, the edited argument does go at the end of the |
| @@ -642,8 +654,8 @@ expressions. A numeric prefix argument @var{n} means to fetch the | |||
| 642 | @var{n}th matching entry. These commands are unusual, in that they | 654 | @var{n}th matching entry. These commands are unusual, in that they |
| 643 | use the minibuffer to read the regular expression argument, even | 655 | use the minibuffer to read the regular expression argument, even |
| 644 | though they are invoked from the minibuffer. An upper-case letter in | 656 | though they are invoked from the minibuffer. An upper-case letter in |
| 645 | the regular expression makes the search case-sensitive (@pxref{Search | 657 | the regular expression makes the search case-sensitive (@pxref{Lax |
| 646 | Case}). | 658 | Search}). |
| 647 | 659 | ||
| 648 | You can also search through the history using an incremental search. | 660 | You can also search through the history using an incremental search. |
| 649 | @xref{Isearch Minibuffer}. | 661 | @xref{Isearch Minibuffer}. |
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi index 7fad8268d06..41dce521c0a 100644 --- a/doc/emacs/misc.texi +++ b/doc/emacs/misc.texi | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | @chapter Miscellaneous Commands | 6 | @chapter Miscellaneous Commands |
| 7 | 7 | ||
| 8 | This chapter contains several brief topics that do not fit anywhere | 8 | This chapter contains several brief topics that do not fit anywhere |
| 9 | else: reading Usenet news, viewing PDFs and other such documents, web | 9 | else: reading Usenet news, host and network security, |
| 10 | viewing PDFs and other such documents, web | ||
| 10 | browsing, running shell commands and shell subprocesses, using a | 11 | browsing, running shell commands and shell subprocesses, using a |
| 11 | single shared Emacs for utilities that expect to run an editor as a | 12 | single shared Emacs for utilities that expect to run an editor as a |
| 12 | subprocess, printing, sorting text, editing binary files, saving an | 13 | subprocess, printing, sorting text, editing binary files, saving an |
| @@ -249,6 +250,25 @@ Search forward for articles containing a match for @var{regexp}. | |||
| 249 | Exit the summary buffer and return to the group buffer. | 250 | Exit the summary buffer and return to the group buffer. |
| 250 | @end table | 251 | @end table |
| 251 | 252 | ||
| 253 | @node Host Security | ||
| 254 | @section Host Security | ||
| 255 | @cindex security | ||
| 256 | |||
| 257 | Emacs runs inside an operating system such as GNU/Linux, and relies on | ||
| 258 | the operating system to check security constraints such as accesses to | ||
| 259 | files. The default settings for Emacs are designed for typical use; | ||
| 260 | they may require some tailoring in environments where security is more | ||
| 261 | of a concern, or less of a concern, than usual. For example, | ||
| 262 | file-local variables can be risky, and you can set the variable | ||
| 263 | @code{enable-local-variables} to @code{:safe} or (even more | ||
| 264 | conservatively) to @code{nil}; conversely, if your files can all be | ||
| 265 | trusted and the default checking for these variables is irritating, | ||
| 266 | you can set @code{enable-local-variables} to @code{:all}. @xref{Safe | ||
| 267 | File Variables}. | ||
| 268 | |||
| 269 | @xref{Security Considerations,,, elisp, The Emacs Lisp Reference | ||
| 270 | Manual}, for more information about security considerations when using | ||
| 271 | Emacs as part of a larger application. | ||
| 252 | 272 | ||
| 253 | @node Network Security | 273 | @node Network Security |
| 254 | @section Network Security | 274 | @section Network Security |
| @@ -741,6 +761,10 @@ advancing point, and any terminal input for the subshell comes from | |||
| 741 | text in the buffer. To give input to the subshell, go to the end of | 761 | text in the buffer. To give input to the subshell, go to the end of |
| 742 | the buffer and type the input, terminated by @key{RET}. | 762 | the buffer and type the input, terminated by @key{RET}. |
| 743 | 763 | ||
| 764 | By default, when the subshell is invoked interactively, the | ||
| 765 | @file{*shell*} buffer is displayed in a new window. This behavior can | ||
| 766 | be customized via @code{display-buffer-alist} (@pxref{Window Choice}). | ||
| 767 | |||
| 744 | While the subshell is waiting or running a command, you can switch | 768 | While the subshell is waiting or running a command, you can switch |
| 745 | windows or buffers and perform other editing in Emacs. Emacs inserts | 769 | windows or buffers and perform other editing in Emacs. Emacs inserts |
| 746 | the output from the subshell into the Shell buffer whenever it has | 770 | the output from the subshell into the Shell buffer whenever it has |
diff --git a/doc/emacs/package.texi b/doc/emacs/package.texi index 1a6a735d3ae..5f80b0afe3f 100644 --- a/doc/emacs/package.texi +++ b/doc/emacs/package.texi | |||
| @@ -59,7 +59,12 @@ The package's version number (e.g., @samp{11.86}). | |||
| 59 | The package's status---normally one of @samp{available} (can be | 59 | The package's status---normally one of @samp{available} (can be |
| 60 | downloaded from the package archive), @samp{installed}, | 60 | downloaded from the package archive), @samp{installed}, |
| 61 | @c @samp{unsigned} (installed, but not signed; @pxref{Package Signing}), | 61 | @c @samp{unsigned} (installed, but not signed; @pxref{Package Signing}), |
| 62 | or @samp{built-in} (included in Emacs by default). | 62 | or @samp{built-in} (included in Emacs by default). The status |
| 63 | @samp{external} means the package is not built-in and not from the | ||
| 64 | directory specified by @code{package-user-dir} (@pxref{Package | ||
| 65 | Files}). External packages are treated much like built-in: they | ||
| 66 | cannot be deleted through the package menu, and are not considered for | ||
| 67 | upgrading. | ||
| 63 | 68 | ||
| 64 | The status can also be @samp{new}. This is equivalent to | 69 | The status can also be @samp{new}. This is equivalent to |
| 65 | @samp{available}, except that it means the package became newly | 70 | @samp{available}, except that it means the package became newly |
| @@ -106,7 +111,13 @@ line; typing @kbd{x} (see below) will delete the package. | |||
| 106 | @xref{Package Files}, for information about what package deletion | 111 | @xref{Package Files}, for information about what package deletion |
| 107 | entails. | 112 | entails. |
| 108 | 113 | ||
| 114 | @item ~ | ||
| 115 | Mark all obsolete packages for deletion | ||
| 116 | (@code{package-menu-mark-obsolete-for-deletion}). This marks for | ||
| 117 | deletion all the packages whose status is @samp{obsolete}. | ||
| 118 | |||
| 109 | @item u | 119 | @item u |
| 120 | @itemx @key{DEL} | ||
| 110 | Remove any installation or deletion mark previously added to the | 121 | Remove any installation or deletion mark previously added to the |
| 111 | current line by an @kbd{i} or @kbd{d} command. | 122 | current line by an @kbd{i} or @kbd{d} command. |
| 112 | 123 | ||
| @@ -117,6 +128,7 @@ on the new available versions, and a deletion mark on the old | |||
| 117 | installed versions. | 128 | installed versions. |
| 118 | 129 | ||
| 119 | @item x | 130 | @item x |
| 131 | @vindex package-menu-async | ||
| 120 | Download and install all packages marked with @kbd{i}, and their | 132 | Download and install all packages marked with @kbd{i}, and their |
| 121 | dependencies; also, delete all packages marked with @kbd{d} | 133 | dependencies; also, delete all packages marked with @kbd{d} |
| 122 | (@code{package-menu-execute}). This also removes the marks. | 134 | (@code{package-menu-execute}). This also removes the marks. |
| @@ -131,6 +143,14 @@ Filter the package list (@code{package-menu-filter}). This prompts | |||
| 131 | for a keyword (e.g., @samp{games}), then shows only the packages | 143 | for a keyword (e.g., @samp{games}), then shows only the packages |
| 132 | that relate to that keyword. To restore the full package list, | 144 | that relate to that keyword. To restore the full package list, |
| 133 | type @kbd{q}. | 145 | type @kbd{q}. |
| 146 | |||
| 147 | @item H | ||
| 148 | Permanently hide packages that match a regexp | ||
| 149 | (@code{package-menu-hide-package}). | ||
| 150 | |||
| 151 | @item ( | ||
| 152 | Toggle visibility of old versions of packages and also of versions | ||
| 153 | from lower-priority archives (@code{package-menu-toggle-hiding}). | ||
| 134 | @end table | 154 | @end table |
| 135 | 155 | ||
| 136 | @noindent | 156 | @noindent |
| @@ -205,6 +225,17 @@ offer different versions of the same package, you may find the option | |||
| 205 | pairs to this list, to ensure that the specified package is only ever | 225 | pairs to this list, to ensure that the specified package is only ever |
| 206 | downloaded from the specified archive. | 226 | downloaded from the specified archive. |
| 207 | 227 | ||
| 228 | @vindex package-archive-priorities | ||
| 229 | @vindex package-menu-hide-low-priority | ||
| 230 | Another option that is useful when you have several package archives | ||
| 231 | enabled is @code{package-archive-priorities}. It specifies the | ||
| 232 | priority of each archive (higher numbers specify higher priority | ||
| 233 | archives). By default, archives have the priority of zero, unless | ||
| 234 | specified otherwise by this option's value. Packages from | ||
| 235 | lower-priority archives will not be shown in the menu, if the same | ||
| 236 | package is available from a higher-priority archive. (This is | ||
| 237 | controlled by the value of @code{package-menu-hide-low-priority}.) | ||
| 238 | |||
| 208 | Once a package is downloaded and installed, it is @dfn{loaded} into | 239 | Once a package is downloaded and installed, it is @dfn{loaded} into |
| 209 | the current Emacs session. Loading a package is not quite the same as | 240 | the current Emacs session. Loading a package is not quite the same as |
| 210 | loading a Lisp library (@pxref{Lisp Libraries}); its effect varies | 241 | loading a Lisp library (@pxref{Lisp Libraries}); its effect varies |
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi index 1f2c8b1e1c2..8423b70203c 100644 --- a/doc/emacs/programs.texi +++ b/doc/emacs/programs.texi | |||
| @@ -833,9 +833,36 @@ displayed. The default is 102400. | |||
| 833 | @findex show-paren-mode | 833 | @findex show-paren-mode |
| 834 | Show Paren mode, a global minor mode, provides a more powerful kind | 834 | Show Paren mode, a global minor mode, provides a more powerful kind |
| 835 | of automatic matching. Whenever point is before an opening delimiter | 835 | of automatic matching. Whenever point is before an opening delimiter |
| 836 | or after a closing delimiter, both that delimiter and its opposite | 836 | or after a closing delimiter, the delimiter, its matching delimiter, |
| 837 | delimiter are highlighted. To toggle Show Paren mode, type @kbd{M-x | 837 | and optionally the text between them are highlighted. To toggle Show |
| 838 | show-paren-mode}. | 838 | Paren mode, type @kbd{M-x show-paren-mode}. To customize it, type |
| 839 | @kbd{M-x customize-group @key{RET} paren-showing}. The customizable | ||
| 840 | options which control the operation of this mode include: | ||
| 841 | |||
| 842 | @itemize @bullet | ||
| 843 | @item | ||
| 844 | @code{show-paren-highlight-open-paren} controls whether to highlight | ||
| 845 | an open paren when point stands just before it, and hence its position | ||
| 846 | is marked by the cursor anyway. The default is non-@code{nil} (yes). | ||
| 847 | |||
| 848 | @item | ||
| 849 | @code{show-paren-style} controls whether just the two parens, or also | ||
| 850 | the space between them get highlighted. The valid options here are | ||
| 851 | @code{parenthesis} (show the matching paren), @code{expression} | ||
| 852 | (highlight the entire expression enclosed by the parens), and | ||
| 853 | @code{mixed} (highlight the matching paren if it is visible, the | ||
| 854 | expression otherwise). | ||
| 855 | |||
| 856 | @item | ||
| 857 | @code{show-paren-when-point-inside-paren}, when non-@code{nil}, causes | ||
| 858 | highlighting also when point is on the inside of a parenthesis. | ||
| 859 | |||
| 860 | @item | ||
| 861 | @code{show-paren-when-point-in-periphery}, when non-@code{nil}, causes | ||
| 862 | highlighting also when point is in whitespace at the beginning or end | ||
| 863 | of a line, and there is a paren at, respectively, the first or last, | ||
| 864 | or the last, non-whitespace position on the line. | ||
| 865 | @end itemize | ||
| 839 | 866 | ||
| 840 | @cindex Electric Pair mode | 867 | @cindex Electric Pair mode |
| 841 | @cindex inserting matching parentheses | 868 | @cindex inserting matching parentheses |
| @@ -917,6 +944,8 @@ will indent the comment to the appropriate position. | |||
| 917 | @item @kbd{M-;} | 944 | @item @kbd{M-;} |
| 918 | Insert or realign comment on current line; if the region is active, | 945 | Insert or realign comment on current line; if the region is active, |
| 919 | comment or uncomment the region instead (@code{comment-dwim}). | 946 | comment or uncomment the region instead (@code{comment-dwim}). |
| 947 | @item @kbd{C-x C-;} | ||
| 948 | Comment or uncomment the current line (@code{comment-line}). | ||
| 920 | @item @kbd{C-u M-;} | 949 | @item @kbd{C-u M-;} |
| 921 | Kill comment on current line (@code{comment-kill}). | 950 | Kill comment on current line (@code{comment-kill}). |
| 922 | @item @kbd{C-x ;} | 951 | @item @kbd{C-x ;} |
| @@ -971,6 +1000,18 @@ are not moved. Even when an existing comment is properly aligned, | |||
| 971 | @kbd{M-;} is still useful for moving directly to the start of the | 1000 | @kbd{M-;} is still useful for moving directly to the start of the |
| 972 | comment text. | 1001 | comment text. |
| 973 | 1002 | ||
| 1003 | @findex comment-line | ||
| 1004 | @kindex C-x C-; | ||
| 1005 | @kbd{C-x C-;} (@code{comment-line}) comments or uncomments complete | ||
| 1006 | lines. When a region is active (@pxref{Mark}), @kbd{C-x C-;} either | ||
| 1007 | comments or uncomments the lines in the region. If the region is not | ||
| 1008 | active, this command comments or uncomments the line point is on. | ||
| 1009 | With a positive prefix argument @var{n}, it operates on @var{n} lines | ||
| 1010 | starting with the current one; with a negative @var{n}, it affects | ||
| 1011 | @var{n} preceding lines. After invoking this command with a negative | ||
| 1012 | argument, successive invocations with a positive argument will operate | ||
| 1013 | on preceding lines as if the argument were negated. | ||
| 1014 | |||
| 974 | @findex comment-kill | 1015 | @findex comment-kill |
| 975 | @kindex C-u M-; | 1016 | @kindex C-u M-; |
| 976 | @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any | 1017 | @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any |
| @@ -1220,13 +1261,16 @@ variables that you want to use. @xref{Name Help}. | |||
| 1220 | 1261 | ||
| 1221 | @cindex Eldoc mode | 1262 | @cindex Eldoc mode |
| 1222 | @findex eldoc-mode | 1263 | @findex eldoc-mode |
| 1264 | @findex global-eldoc-mode | ||
| 1223 | Eldoc is a buffer-local minor mode that helps with looking up Lisp | 1265 | Eldoc is a buffer-local minor mode that helps with looking up Lisp |
| 1224 | documentation. When it is enabled, the echo area displays some useful | 1266 | documentation. When it is enabled, the echo area displays some useful |
| 1225 | information whenever there is a Lisp function or variable at point; | 1267 | information whenever there is a Lisp function or variable at point; |
| 1226 | for a function, it shows the argument list, and for a variable it | 1268 | for a function, it shows the argument list, and for a variable it |
| 1227 | shows the first line of the variable's documentation string. To | 1269 | shows the first line of the variable's documentation string. To |
| 1228 | toggle Eldoc mode, type @kbd{M-x eldoc-mode}. Eldoc mode can be used | 1270 | toggle Eldoc mode, type @kbd{M-x eldoc-mode}. There's also a Global |
| 1229 | with the Emacs Lisp and Lisp Interaction major modes. | 1271 | Eldoc mode, which is turned on by default, and affects buffers, such |
| 1272 | as @samp{*scratch*}, whose major mode is Emacs Lisp or Lisp | ||
| 1273 | Interaction (@w{@kbd{M-x global-eldoc-mode}} to turn it off globally). | ||
| 1230 | 1274 | ||
| 1231 | @node Hideshow | 1275 | @node Hideshow |
| 1232 | @section Hideshow minor mode | 1276 | @section Hideshow minor mode |
| @@ -1484,14 +1528,21 @@ with the Foldout package (@pxref{Foldout}). | |||
| 1484 | 1528 | ||
| 1485 | @findex prettify-symbols-mode | 1529 | @findex prettify-symbols-mode |
| 1486 | Prettify Symbols mode is a buffer-local minor mode that replaces | 1530 | Prettify Symbols mode is a buffer-local minor mode that replaces |
| 1487 | certain strings with more attractive versions for display | 1531 | certain strings with more attractive versions for display purposes. |
| 1488 | purposes. For example, in Emacs Lisp mode, it replaces the string | 1532 | For example, in Emacs Lisp mode, it replaces the string @samp{lambda} |
| 1489 | @samp{lambda} with the Greek lambda character @samp{λ}. You may wish | 1533 | with the Greek lambda character @samp{λ}. You may wish to use this in |
| 1490 | to use this | 1534 | non-programming modes as well. You can customize the mode by adding |
| 1491 | in non-programming modes as well. You can customize the mode by | 1535 | more entries to @code{prettify-symbols-alist}. More elaborate |
| 1492 | adding more entries to @code{prettify-symbols-alist}. There is also a | 1536 | customization is available via customizing |
| 1493 | global version, @code{global-prettify-symbols-mode}, which enables the | 1537 | @code{prettify-symbols-compose-predicate} if its default value |
| 1494 | mode in all buffers that support it. | 1538 | @code{prettify-symbols-default-compose-p} is not appropriate. There |
| 1539 | is also a global version, @code{global-prettify-symbols-mode}, which | ||
| 1540 | enables the mode in all buffers that support it. | ||
| 1541 | |||
| 1542 | The symbol at point can be shown in its original form. This is | ||
| 1543 | controlled by the variable @code{prettify-symbols-unprettify-at-point}: | ||
| 1544 | if non-@code{nil}, the original form of symbol at point will be | ||
| 1545 | restored for as long as point is at it. | ||
| 1495 | 1546 | ||
| 1496 | 1547 | ||
| 1497 | @node C Modes | 1548 | @node C Modes |
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi index d8841caa311..13c03f78a52 100644 --- a/doc/emacs/regs.texi +++ b/doc/emacs/regs.texi | |||
| @@ -293,9 +293,11 @@ various files. | |||
| 293 | Set the bookmark for the visited file, at point. | 293 | Set the bookmark for the visited file, at point. |
| 294 | 294 | ||
| 295 | @item C-x r m @var{bookmark} @key{RET} | 295 | @item C-x r m @var{bookmark} @key{RET} |
| 296 | @findex bookmark-set | ||
| 297 | Set the bookmark named @var{bookmark} at point (@code{bookmark-set}). | 296 | Set the bookmark named @var{bookmark} at point (@code{bookmark-set}). |
| 298 | 297 | ||
| 298 | @item C-x r M @var{bookmark} @key{RET} | ||
| 299 | Like @kbd{C-x r m}, but don't overwrite an existing bookmark. | ||
| 300 | |||
| 299 | @item C-x r b @var{bookmark} @key{RET} | 301 | @item C-x r b @var{bookmark} @key{RET} |
| 300 | @findex bookmark-jump | 302 | @findex bookmark-jump |
| 301 | Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}). | 303 | Jump to the bookmark named @var{bookmark} (@code{bookmark-jump}). |
| @@ -320,6 +322,12 @@ name. If you name each bookmark after the file it points to, then you | |||
| 320 | can conveniently revisit any of those files with @kbd{C-x r b}, and move | 322 | can conveniently revisit any of those files with @kbd{C-x r b}, and move |
| 321 | to the position of the bookmark at the same time. | 323 | to the position of the bookmark at the same time. |
| 322 | 324 | ||
| 325 | @kindex C-x r M | ||
| 326 | @findex bookmark-set-no-overwrite | ||
| 327 | The command @kbd{C-x r M} (@code{bookmark-set-no-overwrite}) works | ||
| 328 | like @kbd{C-x r m}, but it signals an error if the specified bookmark | ||
| 329 | already exists, instead of overwriting it. | ||
| 330 | |||
| 323 | @kindex C-x r l | 331 | @kindex C-x r l |
| 324 | To display a list of all your bookmarks in a separate buffer, type | 332 | To display a list of all your bookmarks in a separate buffer, type |
| 325 | @kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer, | 333 | @kbd{C-x r l} (@code{list-bookmarks}). If you switch to that buffer, |
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi index 6e2a60b6378..b37f42cc56f 100644 --- a/doc/emacs/rmail.texi +++ b/doc/emacs/rmail.texi | |||
| @@ -282,9 +282,9 @@ current message and select another. @kbd{d} | |||
| 282 | messages already deleted, while @kbd{C-d} (@code{rmail-delete-backward}) | 282 | messages already deleted, while @kbd{C-d} (@code{rmail-delete-backward}) |
| 283 | moves to the previous nondeleted message. If there is no nondeleted | 283 | moves to the previous nondeleted message. If there is no nondeleted |
| 284 | message to move to in the specified direction, the message that was just | 284 | message to move to in the specified direction, the message that was just |
| 285 | deleted remains current. @kbd{d} with a prefix argument is equivalent | 285 | deleted remains current. A numeric prefix argument serves as a repeat |
| 286 | to @kbd{C-d}. Note that the Rmail summary versions of these commands | 286 | count, to allow deletion of several messages in a single command. A |
| 287 | behave slightly differently (@pxref{Rmail Summary Edit}). | 287 | negative argument reverses the meaning of @kbd{d} and @kbd{C-d}. |
| 288 | 288 | ||
| 289 | @c mention other hooks, e.g., show message hook? | 289 | @c mention other hooks, e.g., show message hook? |
| 290 | @vindex rmail-delete-message-hook | 290 | @vindex rmail-delete-message-hook |
| @@ -305,7 +305,8 @@ type @kbd{x} (@code{rmail-expunge}). Until you do this, you can still | |||
| 305 | effect of a @kbd{d} command in most cases. It undeletes the current | 305 | effect of a @kbd{d} command in most cases. It undeletes the current |
| 306 | message if the current message is deleted. Otherwise it moves backward | 306 | message if the current message is deleted. Otherwise it moves backward |
| 307 | to previous messages until a deleted message is found, and undeletes | 307 | to previous messages until a deleted message is found, and undeletes |
| 308 | that message. | 308 | that message. A numeric prefix argument serves as a repeat count, to |
| 309 | allow deletion of several messages in a single command. | ||
| 309 | 310 | ||
| 310 | You can usually undo a @kbd{d} with a @kbd{u} because the @kbd{u} | 311 | You can usually undo a @kbd{d} with a @kbd{u} because the @kbd{u} |
| 311 | moves back to and undeletes the message that the @kbd{d} deleted. But | 312 | moves back to and undeletes the message that the @kbd{d} deleted. But |
| @@ -974,13 +975,11 @@ different lines. It doesn't matter what Emacs command you use to move | |||
| 974 | point; whichever line point is on at the end of the command, that | 975 | point; whichever line point is on at the end of the command, that |
| 975 | message is selected in the Rmail buffer. | 976 | message is selected in the Rmail buffer. |
| 976 | 977 | ||
| 977 | Almost all Rmail commands work in the summary buffer as well as in the | 978 | Almost all Rmail commands work in the summary buffer as well as in |
| 978 | Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the current | 979 | the Rmail buffer. Thus, @kbd{d} in the summary buffer deletes the |
| 979 | message, @kbd{u} undeletes, and @kbd{x} expunges. (However, in the | 980 | current message, @kbd{u} undeletes, and @kbd{x} expunges. (However, |
| 980 | summary buffer, a numeric argument to @kbd{d}, @kbd{C-d} and @kbd{u} | 981 | in the summary buffer, if there are no more undeleted messages in the |
| 981 | serves as a repeat count. A negative argument reverses the meaning of | 982 | relevant direction, the delete commands go to the first or last |
| 982 | @kbd{d} and @kbd{C-d}. Also, if there are no more undeleted messages in | ||
| 983 | the relevant direction, the delete commands go to the first or last | ||
| 984 | message, rather than staying on the current message.) @kbd{o} and | 983 | message, rather than staying on the current message.) @kbd{o} and |
| 985 | @kbd{C-o} output the current message to a FILE; @kbd{r} starts a reply | 984 | @kbd{C-o} output the current message to a FILE; @kbd{r} starts a reply |
| 986 | to it; etc. You can scroll the current message while remaining in the | 985 | to it; etc. You can scroll the current message while remaining in the |
| @@ -1224,6 +1223,15 @@ tagline (except for buttons for other actions, if there are any). Type | |||
| 1224 | the undecoded @acronym{MIME} data. With a prefix argument, this | 1223 | the undecoded @acronym{MIME} data. With a prefix argument, this |
| 1225 | command toggles the display of only an entity at point. | 1224 | command toggles the display of only an entity at point. |
| 1226 | 1225 | ||
| 1226 | @vindex rmail-mime-prefer-html | ||
| 1227 | If the message has an @acronym{HTML} @acronym{MIME} part, Rmail | ||
| 1228 | displays it in preference to the plain-text part, if Emacs can render | ||
| 1229 | @acronym{HTML}@footnote{ | ||
| 1230 | This capability requires that Emacs be built with @file{libxml2} | ||
| 1231 | support or that you have the Lynx browser installed.}. To prevent | ||
| 1232 | that, and have the plain-text part displayed instead, customize the | ||
| 1233 | variable @code{rmail-mime-prefer-html} to a @code{nil} value. | ||
| 1234 | |||
| 1227 | To prevent Rmail from handling MIME decoded messages, change the | 1235 | To prevent Rmail from handling MIME decoded messages, change the |
| 1228 | variable @code{rmail-enable-mime} to @code{nil}. When this is the | 1236 | variable @code{rmail-enable-mime} to @code{nil}. When this is the |
| 1229 | case, the @kbd{v} (@code{rmail-mime}) command instead creates a | 1237 | case, the @kbd{v} (@code{rmail-mime}) command instead creates a |
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi index ae275d1ca67..1cc7753f113 100644 --- a/doc/emacs/search.texi +++ b/doc/emacs/search.texi | |||
| @@ -26,9 +26,11 @@ thing, but search for patterns instead of fixed strings. | |||
| 26 | * Regexps:: Syntax of regular expressions. | 26 | * Regexps:: Syntax of regular expressions. |
| 27 | * Regexp Backslash:: Regular expression constructs starting with `\'. | 27 | * Regexp Backslash:: Regular expression constructs starting with `\'. |
| 28 | * Regexp Example:: A complex regular expression explained. | 28 | * Regexp Example:: A complex regular expression explained. |
| 29 | * Search Case:: To ignore case while searching, or not. | 29 | * Lax Search:: Search ignores some distinctions among |
| 30 | similar characters, like letter-case. | ||
| 30 | * Replace:: Search, and replace some or all matches. | 31 | * Replace:: Search, and replace some or all matches. |
| 31 | * Other Repeating Search:: Operating on all matches for some regexp. | 32 | * Other Repeating Search:: Operating on all matches for some regexp. |
| 33 | * Search Customizations:: Various search customizations. | ||
| 32 | @end menu | 34 | @end menu |
| 33 | 35 | ||
| 34 | @node Incremental Search | 36 | @node Incremental Search |
| @@ -54,10 +56,10 @@ Incremental search backward (@code{isearch-backward}). | |||
| 54 | @menu | 56 | @menu |
| 55 | * Basic Isearch:: Basic incremental search commands. | 57 | * Basic Isearch:: Basic incremental search commands. |
| 56 | * Repeat Isearch:: Searching for the same string again. | 58 | * Repeat Isearch:: Searching for the same string again. |
| 57 | * Error in Isearch:: When your string is not found. | ||
| 58 | * Special Isearch:: Special input in incremental search. | ||
| 59 | * Isearch Yank:: Commands that grab text into the search string | 59 | * Isearch Yank:: Commands that grab text into the search string |
| 60 | or else edit the search string. | 60 | or else edit the search string. |
| 61 | * Error in Isearch:: When your string is not found. | ||
| 62 | * Special Isearch:: Special input in incremental search. | ||
| 61 | * Not Exiting Isearch:: Prefix argument and scrolling commands. | 63 | * Not Exiting Isearch:: Prefix argument and scrolling commands. |
| 62 | * Isearch Minibuffer:: Incremental search of the minibuffer history. | 64 | * Isearch Minibuffer:: Incremental search of the minibuffer history. |
| 63 | @end menu | 65 | @end menu |
| @@ -89,31 +91,46 @@ cursor moves to just after the first @samp{FOO}. | |||
| 89 | @cindex isearch face | 91 | @cindex isearch face |
| 90 | At each step, Emacs highlights the @dfn{current match}---the buffer | 92 | At each step, Emacs highlights the @dfn{current match}---the buffer |
| 91 | text that matches the search string---using the @code{isearch} face | 93 | text that matches the search string---using the @code{isearch} face |
| 92 | (@pxref{Faces}). The current search string is also displayed in the | 94 | (@pxref{Faces}). @xref{Search Customizations}, for various options |
| 93 | echo area. | 95 | that customize this highlighting. The current search string is also |
| 96 | displayed in the echo area. | ||
| 94 | 97 | ||
| 95 | If you make a mistake typing the search string, type @key{DEL}. | 98 | If you make a mistake typing the search string, type @key{DEL}. |
| 96 | Each @key{DEL} cancels the last character of the search string. | 99 | Each @key{DEL} cancels the last character of the search string. |
| 100 | @xref{Error in Isearch}, for more about dealing with unsuccessful | ||
| 101 | search. | ||
| 97 | 102 | ||
| 103 | @cindex exit incremental search | ||
| 104 | @cindex incremental search, exiting | ||
| 98 | When you are satisfied with the place you have reached, type | 105 | When you are satisfied with the place you have reached, type |
| 99 | @key{RET}. This stops searching, leaving the cursor where the search | 106 | @key{RET}. This stops searching, leaving the cursor where the search |
| 100 | brought it. Also, any command not specially meaningful in searches | 107 | brought it. Also, any command not specially meaningful in searches |
| 101 | stops the searching and is then executed. Thus, typing @kbd{C-a} | 108 | stops the searching and is then executed. Thus, typing @kbd{C-a} |
| 102 | exits the search and then moves to the beginning of the line. | 109 | exits the search and then moves to the beginning of the line; typing |
| 103 | @key{RET} is necessary only if the next command you want to type is a | 110 | one of the arrow keys exits the search and performs the respective |
| 104 | printing character, @key{DEL}, @key{RET}, or another character that is | 111 | movement command; etc. @key{RET} is necessary only if the next |
| 105 | special within searches (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, | 112 | command you want to type is a printing character, @key{DEL}, |
| 106 | @kbd{C-y}, @kbd{M-y}, @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some others | 113 | @key{RET}, or another character that is special within searches |
| 107 | described below). | 114 | (@kbd{C-q}, @kbd{C-w}, @kbd{C-r}, @kbd{C-s}, @kbd{C-y}, @kbd{M-y}, |
| 115 | @kbd{M-r}, @kbd{M-c}, @kbd{M-e}, and some others described below). | ||
| 116 | You can fine-tune the commands that exit the search; see @ref{Not | ||
| 117 | Exiting Isearch}. | ||
| 108 | 118 | ||
| 109 | As a special exception, entering @key{RET} when the search string is | 119 | As a special exception, entering @key{RET} when the search string is |
| 110 | empty launches nonincremental search (@pxref{Nonincremental Search}). | 120 | empty launches nonincremental search (@pxref{Nonincremental Search}). |
| 121 | (This can be customized; see @ref{Search Customizations}.) | ||
| 122 | |||
| 123 | To abandon the search and return to the place where you started, | ||
| 124 | type @kbd{@key{ESC} @key{ESC} @key{ESC}} (@code{isearch-cancel}) or | ||
| 125 | @kbd{C-g C-g} (@code{isearch-abort}). | ||
| 111 | 126 | ||
| 112 | When you exit the incremental search, it adds the original value of | 127 | When you exit the incremental search, it adds the original value of |
| 113 | point to the mark ring, without activating the mark; you can thus use | 128 | point to the mark ring, without activating the mark; you can thus use |
| 114 | @kbd{C-u C-@key{SPC}} to return to where you were before beginning the | 129 | @kbd{C-u C-@key{SPC}} or @kbd{C-x C-x} to return to where you were |
| 115 | search. @xref{Mark Ring}. It only does this if the mark was not | 130 | before beginning the search. @xref{Mark Ring}. (Emacs only does this |
| 116 | already active. | 131 | if the mark was not already active; if the mark was active when you |
| 132 | started the search, both @kbd{C-u C-@key{SPC}} and @kbd{C-x C-x} will | ||
| 133 | go to the mark.) | ||
| 117 | 134 | ||
| 118 | @kindex C-r | 135 | @kindex C-r |
| 119 | @findex isearch-backward | 136 | @findex isearch-backward |
| @@ -134,7 +151,6 @@ characters with @key{DEL}. Similarly, each @kbd{C-r} in a backward | |||
| 134 | incremental search repeats the backward search. | 151 | incremental search repeats the backward search. |
| 135 | 152 | ||
| 136 | @cindex lazy search highlighting | 153 | @cindex lazy search highlighting |
| 137 | @vindex isearch-lazy-highlight | ||
| 138 | If you pause for a little while during incremental search, Emacs | 154 | If you pause for a little while during incremental search, Emacs |
| 139 | highlights all the other possible matches for the search string that | 155 | highlights all the other possible matches for the search string that |
| 140 | are present on the screen. This helps you anticipate where you can | 156 | are present on the screen. This helps you anticipate where you can |
| @@ -142,21 +158,26 @@ get to by typing @kbd{C-s} or @kbd{C-r} to repeat the search. The | |||
| 142 | other matches are highlighted differently from the current match, | 158 | other matches are highlighted differently from the current match, |
| 143 | using the customizable face @code{lazy-highlight} (@pxref{Faces}). If | 159 | using the customizable face @code{lazy-highlight} (@pxref{Faces}). If |
| 144 | you don't like this feature, you can disable it by setting | 160 | you don't like this feature, you can disable it by setting |
| 145 | @code{isearch-lazy-highlight} to @code{nil}. | 161 | @code{isearch-lazy-highlight} to @code{nil}. For other customizations |
| 162 | related to highlighting matches, see @ref{Search Customizations}. | ||
| 146 | 163 | ||
| 147 | After exiting a search, you can search for the same string again by | 164 | After exiting a search, you can search for the same string again by |
| 148 | typing just @kbd{C-s C-s}. The first @kbd{C-s} is the key that | 165 | typing just @kbd{C-s C-s}. The first @kbd{C-s} is the key that |
| 149 | invokes incremental search, and the second @kbd{C-s} means to search | 166 | invokes incremental search, and the second @kbd{C-s} means to search |
| 150 | again. Similarly, @kbd{C-r C-r} searches backward for the last | 167 | again for the last search string. Similarly, @kbd{C-r C-r} searches |
| 151 | search string. In determining the last search string, it doesn't | 168 | backward for the last search string. In determining the last search |
| 152 | matter whether the string was searched for with @kbd{C-s} or | 169 | string, it doesn't matter whether that string was searched for with |
| 153 | @kbd{C-r}. | 170 | @kbd{C-s} or @kbd{C-r}. |
| 154 | 171 | ||
| 155 | If you are searching forward but you realize you were looking for | 172 | If you are searching forward but you realize you were looking for |
| 156 | something before the starting point, type @kbd{C-r} to switch to a | 173 | something before the starting point, type @kbd{C-r} to switch to a |
| 157 | backward search, leaving the search string unchanged. Similarly, | 174 | backward search, leaving the search string unchanged. Similarly, |
| 158 | @kbd{C-s} in a backward search switches to a forward search. | 175 | @kbd{C-s} in a backward search switches to a forward search. |
| 159 | 176 | ||
| 177 | @cindex search, wrapping around | ||
| 178 | @cindex search, overwrapped | ||
| 179 | @cindex wrapped search | ||
| 180 | @cindex overwrapped search | ||
| 160 | If a search is failing and you ask to repeat it by typing another | 181 | If a search is failing and you ask to repeat it by typing another |
| 161 | @kbd{C-s}, it starts again from the beginning of the buffer. | 182 | @kbd{C-s}, it starts again from the beginning of the buffer. |
| 162 | Repeating a failing reverse search with @kbd{C-r} starts again from | 183 | Repeating a failing reverse search with @kbd{C-r} starts again from |
| @@ -169,19 +190,86 @@ you have already seen. | |||
| 169 | @cindex search ring | 190 | @cindex search ring |
| 170 | @kindex M-n @r{(Incremental search)} | 191 | @kindex M-n @r{(Incremental search)} |
| 171 | @kindex M-p @r{(Incremental search)} | 192 | @kindex M-p @r{(Incremental search)} |
| 193 | @vindex search-ring-max | ||
| 172 | To reuse earlier search strings, use the @dfn{search ring}. The | 194 | To reuse earlier search strings, use the @dfn{search ring}. The |
| 173 | commands @kbd{M-p} and @kbd{M-n} move through the ring to pick a | 195 | commands @kbd{M-p} and @kbd{M-n} move through the ring to pick a |
| 174 | search string to reuse. These commands leave the selected search ring | 196 | search string to reuse. These commands leave the selected search ring |
| 175 | element in the minibuffer, where you can edit it. | 197 | element in the minibuffer, where you can edit it. Type |
| 176 | 198 | @kbd{C-s}/@kbd{C-r} or @key{RET} to accept the string and start | |
| 199 | searching for it. The number of most recently used search strings | ||
| 200 | saved in the search ring is specified by the variable | ||
| 201 | @code{search-ring-max}, 16 by default. | ||
| 202 | |||
| 203 | @cindex incremental search, edit search string | ||
| 204 | @cindex interactively edit search string | ||
| 177 | @kindex M-e @r{(Incremental search)} | 205 | @kindex M-e @r{(Incremental search)} |
| 206 | @kindex Mouse-1 @r{in the minibuffer (Incremental Search)} | ||
| 178 | To edit the current search string in the minibuffer without | 207 | To edit the current search string in the minibuffer without |
| 179 | replacing it with items from the search ring, type @kbd{M-e}. Type @key{RET}, | 208 | replacing it with items from the search ring, type @kbd{M-e} or click |
| 180 | @kbd{C-s} or @kbd{C-r} to finish editing the string and search for it. | 209 | @kbd{Mouse-1} in the minibuffer. Type @key{RET}, @kbd{C-s} or |
| 210 | @kbd{C-r} to finish editing the string and search for it. Type | ||
| 211 | @kbd{C-f} or @kbd{@key{RIGHT}} to add to the search string characters | ||
| 212 | following point from the buffer from which you started the search. | ||
| 213 | |||
| 214 | @node Isearch Yank | ||
| 215 | @subsection Isearch Yanking | ||
| 216 | |||
| 217 | In many cases, you will want to use text at or near point as your | ||
| 218 | search string. The commands described in this subsection let you do | ||
| 219 | that conveniently. | ||
| 220 | |||
| 221 | @kindex C-w @r{(Incremental search)} | ||
| 222 | @findex isearch-yank-word-or-char | ||
| 223 | @kbd{C-w} (@code{isearch-yank-word-or-char}) appends the next | ||
| 224 | character or word at point to the search string. This is an easy way | ||
| 225 | to search for another occurrence of the text at point. (The decision | ||
| 226 | of whether to copy a character or a word is heuristic.) | ||
| 227 | |||
| 228 | @kindex M-s C-e @r{(Incremental search)} | ||
| 229 | @findex isearch-yank-line | ||
| 230 | Similarly, @kbd{M-s C-e} (@code{isearch-yank-line}) appends the rest | ||
| 231 | of the current line to the search string. If point is already at the | ||
| 232 | end of a line, it appends the next line. With a prefix argument | ||
| 233 | @var{n}, it appends the next @var{n} lines. | ||
| 234 | |||
| 235 | @kindex C-y @r{(Incremental search)} | ||
| 236 | @kindex M-y @r{(Incremental search)} | ||
| 237 | @kindex Mouse-2 @r{in the minibuffer (Incremental search)} | ||
| 238 | @findex isearch-yank-kill | ||
| 239 | @findex isearch-yank-pop | ||
| 240 | @findex isearch-yank-x-selection | ||
| 241 | Within incremental search, @kbd{C-y} (@code{isearch-yank-kill}) | ||
| 242 | appends the current kill to the search string. @kbd{M-y} | ||
| 243 | (@code{isearch-yank-pop}), if called after @kbd{C-y}, replaces that | ||
| 244 | appended text with an earlier kill, similar to the usual @kbd{M-y} | ||
| 245 | (@code{yank-pop}) command (@pxref{Yanking}). Clicking @kbd{Mouse-2} | ||
| 246 | in the echo area appends the current X selection (@pxref{Primary | ||
| 247 | Selection}) to the search string (@code{isearch-yank-x-selection}). | ||
| 248 | |||
| 249 | @kindex C-M-w @r{(Incremental search)} | ||
| 250 | @kindex C-M-y @r{(Incremental search)} | ||
| 251 | @findex isearch-del-char | ||
| 252 | @findex isearch-yank-char | ||
| 253 | @kbd{C-M-w} (@code{isearch-del-char}) deletes the last character | ||
| 254 | from the search string, and @kbd{C-M-y} (@code{isearch-yank-char}) | ||
| 255 | appends the character after point to the search string. An | ||
| 256 | alternative method to add the character after point is to enter the | ||
| 257 | minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f} | ||
| 258 | or @kbd{@key{RIGHT}} at the end of the search string in the | ||
| 259 | minibuffer. Each @kbd{C-f} or @kbd{@key{RIGHT}} you type adds another | ||
| 260 | character following point to the search string. | ||
| 261 | |||
| 262 | Normally, when the search is case-insensitive, text yanked into the | ||
| 263 | search string is converted to lower case, so that the search remains | ||
| 264 | case-insensitive (@pxref{Lax Search, case folding}). However, if the | ||
| 265 | value of the variable @code{search-upper-case} (@pxref{Lax Search, | ||
| 266 | search-upper-case}) is other than @code{not-yanks}, that disables this | ||
| 267 | down-casing. | ||
| 181 | 268 | ||
| 182 | @node Error in Isearch | 269 | @node Error in Isearch |
| 183 | @subsection Errors in Incremental Search | 270 | @subsection Errors in Incremental Search |
| 184 | 271 | ||
| 272 | @cindex isearch-fail face | ||
| 185 | If your string is not found at all, the echo area says @samp{Failing | 273 | If your string is not found at all, the echo area says @samp{Failing |
| 186 | I-Search}, and the cursor moves past the place where Emacs found as | 274 | I-Search}, and the cursor moves past the place where Emacs found as |
| 187 | much of your string as it could. Thus, if you search for @samp{FOOT}, | 275 | much of your string as it could. Thus, if you search for @samp{FOOT}, |
| @@ -192,12 +280,13 @@ string that failed to match is highlighted using the face | |||
| 192 | 280 | ||
| 193 | At this point, there are several things you can do. If your string | 281 | At this point, there are several things you can do. If your string |
| 194 | was mistyped, you can use @key{DEL} to erase some of it and correct | 282 | was mistyped, you can use @key{DEL} to erase some of it and correct |
| 195 | it. If you like the place you have found, you can type @key{RET} to | 283 | it, or you can type @kbd{M-e} and edit it. If you like the place you |
| 196 | remain there. Or you can type @kbd{C-g}, which removes from the | 284 | have found, you can type @key{RET} to remain there. Or you can type |
| 197 | search string the characters that could not be found (the @samp{T} in | 285 | @kbd{C-g}, which removes from the search string the characters that |
| 198 | @samp{FOOT}), leaving those that were found (the @samp{FOO} in | 286 | could not be found (the @samp{T} in @samp{FOOT}), leaving those that |
| 199 | @samp{FOOT}). A second @kbd{C-g} at that point cancels the search | 287 | were found (the @samp{FOO} in @samp{FOOT}). A second @kbd{C-g} at |
| 200 | entirely, returning point to where it was when the search started. | 288 | that point cancels the search entirely, returning point to where it |
| 289 | was when the search started. | ||
| 201 | 290 | ||
| 202 | @cindex quitting (in search) | 291 | @cindex quitting (in search) |
| 203 | @kindex C-g @r{(Incremental search)} | 292 | @kindex C-g @r{(Incremental search)} |
| @@ -216,34 +305,21 @@ search. | |||
| 216 | @node Special Isearch | 305 | @node Special Isearch |
| 217 | @subsection Special Input for Incremental Search | 306 | @subsection Special Input for Incremental Search |
| 218 | 307 | ||
| 219 | Some of the characters you type during incremental search have | 308 | In addition to characters described in the previous subsections, |
| 220 | special effects. | 309 | some of the other characters you type during incremental search have |
| 310 | special effects. They are described here. | ||
| 221 | 311 | ||
| 222 | @cindex lax space matching | 312 | To toggle lax space matching (@pxref{Lax Search, lax space |
| 223 | @kindex M-s SPC @r{(Incremental search)} | 313 | matching}), type @kbd{M-s @key{SPC}}. |
| 224 | @kindex SPC @r{(Incremental search)} | 314 | |
| 225 | @findex isearch-toggle-lax-whitespace | 315 | To toggle case sensitivity of the search, type @kbd{M-c} or |
| 226 | @vindex search-whitespace-regexp | 316 | @kbd{M-s c}. @xref{Lax Search, case folding}. If the search string |
| 227 | By default, incremental search performs @dfn{lax space matching}: | 317 | includes upper-case letters, the search is case-sensitive by default. |
| 228 | each space, or sequence of spaces, matches any sequence of one or more | 318 | |
| 229 | spaces in the text. Hence, @samp{foo bar} matches @samp{foo bar}, | 319 | To toggle whether or not the search will consider similar and |
| 230 | @samp{foo@w{ }bar}, @samp{foo@w{ }bar}, and so on (but not | 320 | equivalent characters as a match, type @kbd{M-s '}. @xref{Lax Search, |
| 231 | @samp{foobar}). More precisely, Emacs matches each sequence of space | 321 | character folding}. If the search string includes accented |
| 232 | characters in the search string to a regular expression specified by | 322 | characters, that disables character folding during that search. |
| 233 | the variable @code{search-whitespace-regexp}. For example, to make | ||
| 234 | spaces match sequences of newlines as well as spaces, set it to | ||
| 235 | @samp{"[[:space:]\n]+"}. | ||
| 236 | |||
| 237 | To toggle lax space matching, type @kbd{M-s @key{SPC}} | ||
| 238 | (@code{isearch-toggle-lax-whitespace}). To disable this feature | ||
| 239 | entirely, change @code{search-whitespace-regexp} to @code{nil}; then | ||
| 240 | each space in the search string matches exactly one space. | ||
| 241 | |||
| 242 | If the search string you entered contains only lower-case letters, | ||
| 243 | the search is case-insensitive; as long as an upper-case letter exists | ||
| 244 | in the search string, the search becomes case-sensitive. If you | ||
| 245 | delete the upper-case character from the search string, it ceases to | ||
| 246 | have this effect. @xref{Search Case}. | ||
| 247 | 323 | ||
| 248 | @cindex invisible text, searching for | 324 | @cindex invisible text, searching for |
| 249 | @kindex M-s i @r{(Incremental search)} | 325 | @kindex M-s i @r{(Incremental search)} |
| @@ -251,7 +327,17 @@ have this effect. @xref{Search Case}. | |||
| 251 | To toggle whether or not invisible text is searched, type | 327 | To toggle whether or not invisible text is searched, type |
| 252 | @kbd{M-s i} (@code{isearch-toggle-invisible}). @xref{Outline Search}. | 328 | @kbd{M-s i} (@code{isearch-toggle-invisible}). @xref{Outline Search}. |
| 253 | 329 | ||
| 254 | To search for a newline character, type @kbd{C-j}. | 330 | @kindex M-r @r{(Incremental Search)} |
| 331 | @kindex M-s r @r{(Incremental Search)} | ||
| 332 | @findex isearch-toggle-regexp | ||
| 333 | To toggle between non-regexp and regexp incremental search, type | ||
| 334 | @kbd{M-r} or @kbd{M-s r} (@code{isearch-toggle-regexp}). | ||
| 335 | @xref{Regexp Search}. | ||
| 336 | |||
| 337 | To toggle symbol mode, type @kbd{M-s _}. @xref{Symbol Search}. | ||
| 338 | |||
| 339 | To search for a newline character, type @kbd{C-j} as part of the | ||
| 340 | search string. | ||
| 255 | 341 | ||
| 256 | To search for non-@acronym{ASCII} characters, use one of the | 342 | To search for non-@acronym{ASCII} characters, use one of the |
| 257 | following methods: | 343 | following methods: |
| @@ -265,17 +351,21 @@ example, @kbd{C-q C-s} during incremental search adds the | |||
| 265 | @samp{control-S} character to the search string. | 351 | @samp{control-S} character to the search string. |
| 266 | 352 | ||
| 267 | @item | 353 | @item |
| 268 | Type @kbd{C-x 8 @key{RET}}, followed by a Unicode name or code-point. | 354 | Type @kbd{C-x 8 @key{RET}}, followed by a Unicode name or code-point |
| 269 | This adds the specified character into the search string, similar to | 355 | in hex. This adds the specified character into the search string, |
| 270 | the usual @code{insert-char} command (@pxref{Inserting Text}). | 356 | similar to the usual @code{insert-char} command (@pxref{Inserting |
| 357 | Text}). | ||
| 271 | 358 | ||
| 272 | @item | 359 | @item |
| 360 | @kindex C-^ @r{(Incremental Search)} | ||
| 361 | @findex isearch-toggle-input-method | ||
| 362 | @findex isearch-toggle-specified-input-method | ||
| 273 | Use an input method (@pxref{Input Methods}). If an input method is | 363 | Use an input method (@pxref{Input Methods}). If an input method is |
| 274 | enabled in the current buffer when you start the search, you can use | 364 | enabled in the current buffer when you start the search, the same |
| 275 | it in the search string also. While typing the search string, you can | 365 | method will be active in the minibuffer when you type the search |
| 276 | toggle the input method with @kbd{C-\} | 366 | string. While typing the search string, you can toggle the input |
| 277 | (@code{isearch-toggle-input-method}). You can also turn on a | 367 | method with @kbd{C-\} (@code{isearch-toggle-input-method}). You can |
| 278 | non-default input method with @kbd{C-^} | 368 | also turn on a non-default input method with @kbd{C-^} |
| 279 | (@code{isearch-toggle-specified-input-method}), which prompts for the | 369 | (@code{isearch-toggle-specified-input-method}), which prompts for the |
| 280 | name of the input method. When an input method is active during | 370 | name of the input method. When an input method is active during |
| 281 | incremental search, the search prompt includes the input method | 371 | incremental search, the search prompt includes the input method |
| @@ -286,13 +376,17 @@ I-search [@var{im}]: | |||
| 286 | @end example | 376 | @end example |
| 287 | 377 | ||
| 288 | @noindent | 378 | @noindent |
| 289 | @findex isearch-toggle-input-method | ||
| 290 | @findex isearch-toggle-specified-input-method | ||
| 291 | where @var{im} is the mnemonic of the active input method. Any input | 379 | where @var{im} is the mnemonic of the active input method. Any input |
| 292 | method you enable during incremental search remains enabled in the | 380 | method you enable during incremental search remains enabled in the |
| 293 | current buffer afterwards. | 381 | current buffer afterwards. |
| 294 | @end itemize | 382 | @end itemize |
| 295 | 383 | ||
| 384 | @kindex M-s o @r{(Incremental Search)} | ||
| 385 | @findex isearch-occur | ||
| 386 | Typing @kbd{M-s o} in incremental search invokes | ||
| 387 | @code{isearch-occur}, which runs @code{occur} with the current search | ||
| 388 | string. @xref{Other Repeating Search, occur}. | ||
| 389 | |||
| 296 | @kindex M-% @r{(Incremental search)} | 390 | @kindex M-% @r{(Incremental search)} |
| 297 | Typing @kbd{M-%} in incremental search invokes @code{query-replace} | 391 | Typing @kbd{M-%} in incremental search invokes @code{query-replace} |
| 298 | or @code{query-replace-regexp} (depending on search mode) with the | 392 | or @code{query-replace-regexp} (depending on search mode) with the |
| @@ -302,83 +396,72 @@ prefix argument means to replace backward. @xref{Query Replace}. | |||
| 302 | @kindex M-TAB @r{(Incremental search)} | 396 | @kindex M-TAB @r{(Incremental search)} |
| 303 | Typing @kbd{M-@key{TAB}} in incremental search invokes | 397 | Typing @kbd{M-@key{TAB}} in incremental search invokes |
| 304 | @code{isearch-complete}, which attempts to complete the search string | 398 | @code{isearch-complete}, which attempts to complete the search string |
| 305 | using the search ring as a list of completion alternatives. | 399 | using the search ring (the previous search strings you used) as a list |
| 306 | @xref{Completion}. In many operating systems, the @kbd{M-@key{TAB}} | 400 | of completion alternatives. @xref{Completion}. In many operating |
| 307 | key sequence is captured by the window manager; you then need to | 401 | systems, the @kbd{M-@key{TAB}} key sequence is captured by the window |
| 308 | rebind @code{isearch-complete} to another key sequence if you want to | 402 | manager; you then need to rebind @code{isearch-complete} to another |
| 309 | use it (@pxref{Rebinding}). | 403 | key sequence if you want to use it (@pxref{Rebinding}). |
| 310 | 404 | ||
| 405 | @kindex M-s h r @r{(Incremental Search)} | ||
| 406 | @findex isearch-highlight-regexp | ||
| 407 | You can exit the search while leaving the matches for the last | ||
| 408 | search string highlighted on display. To this end, type @kbd{M-s h r} | ||
| 409 | (@code{isearch-highlight-regexp}), which will run | ||
| 410 | @code{highlight-regexp} (@pxref{Highlight Interactively}) passing | ||
| 411 | it the regexp derived from the last search string and prompting you | ||
| 412 | for the face to use for highlighting. To remove the highlighting, | ||
| 413 | type @kbd{M-s h u} (@code{unhighlight-regexp}). | ||
| 414 | |||
| 415 | @cindex incremental search, help on special keys | ||
| 416 | @kindex C-h C-h @r{(Incremental Search)} | ||
| 417 | @findex isearch-help-map | ||
| 311 | @vindex isearch-mode-map | 418 | @vindex isearch-mode-map |
| 312 | When incremental search is active, you can type @kbd{C-h C-h} to | 419 | When incremental search is active, you can type @kbd{C-h C-h} |
| 313 | access interactive help options, including a list of special key | 420 | (@code{isearch-help-map}) to access interactive help options, |
| 314 | bindings. These key bindings are part of the keymap | 421 | including a list of special key bindings. These key bindings are part |
| 315 | @code{isearch-mode-map} (@pxref{Keymaps}). | 422 | of the keymap @code{isearch-mode-map} (@pxref{Keymaps}). |
| 316 | |||
| 317 | @node Isearch Yank | ||
| 318 | @subsection Isearch Yanking | ||
| 319 | |||
| 320 | @kindex C-y @r{(Incremental search)} | ||
| 321 | @kindex M-y @r{(Incremental search)} | ||
| 322 | @findex isearch-yank-kill | ||
| 323 | @findex isearch-yank-pop | ||
| 324 | Within incremental search, @kbd{C-y} (@code{isearch-yank-kill}) | ||
| 325 | appends the current kill to the search string. @kbd{M-y} | ||
| 326 | (@code{isearch-yank-pop}), if called after @kbd{C-y}, replaces that | ||
| 327 | appended text with an earlier kill, similar to the usual @kbd{M-y} | ||
| 328 | (@code{yank-pop}) command (@pxref{Yanking}). @kbd{Mouse-2} appends | ||
| 329 | the current X selection (@pxref{Primary Selection}). | ||
| 330 | |||
| 331 | @kindex C-w @r{(Incremental search)} | ||
| 332 | @findex isearch-yank-word-or-char | ||
| 333 | @kbd{C-w} (@code{isearch-yank-word-or-char}) appends the next | ||
| 334 | character or word at point to the search string. This is an easy way | ||
| 335 | to search for another occurrence of the text at point. (The decision | ||
| 336 | of whether to copy a character or a word is heuristic.) | ||
| 337 | |||
| 338 | @kindex M-s C-e @r{(Incremental search)} | ||
| 339 | @findex isearch-yank-line | ||
| 340 | Similarly, @kbd{M-s C-e} (@code{isearch-yank-line}) appends the rest | ||
| 341 | of the current line to the search string. If point is already at the | ||
| 342 | end of a line, it appends the next line. With a prefix argument | ||
| 343 | @var{n}, it appends the next @var{n} lines. | ||
| 344 | |||
| 345 | If the search is currently case-insensitive, both @kbd{C-w} and | ||
| 346 | @kbd{M-s C-e} convert the text they copy to lower case, so that the | ||
| 347 | search remains case-insensitive. | ||
| 348 | |||
| 349 | @kindex C-M-w @r{(Incremental search)} | ||
| 350 | @kindex C-M-y @r{(Incremental search)} | ||
| 351 | @findex isearch-del-char | ||
| 352 | @findex isearch-yank-char | ||
| 353 | @kbd{C-M-w} (@code{isearch-del-char}) deletes the last character | ||
| 354 | from the search string, and @kbd{C-M-y} (@code{isearch-yank-char}) | ||
| 355 | appends the character after point to the search string. An | ||
| 356 | alternative method to add the character after point is to enter the | ||
| 357 | minibuffer with @kbd{M-e} (@pxref{Repeat Isearch}) and type @kbd{C-f} | ||
| 358 | at the end of the search string in the minibuffer. | ||
| 359 | 423 | ||
| 360 | @node Not Exiting Isearch | 424 | @node Not Exiting Isearch |
| 361 | @subsection Not Exiting Incremental Search | 425 | @subsection Not Exiting Incremental Search |
| 362 | 426 | ||
| 363 | This subsection describes two categories of commands which you can | 427 | This subsection describes how to control whether typing a command not |
| 364 | type without exiting the current incremental search, even though they | 428 | specifically meaningful is searches exits the search before executing |
| 365 | are not themselves part of incremental search. | 429 | the command. It also describes two categories of commands which you |
| 430 | can type without exiting the current incremental search, even though | ||
| 431 | they are not themselves part of incremental search. | ||
| 432 | |||
| 433 | @vindex search-exit-option | ||
| 434 | Normally, typing a command that is not bound by the incremental | ||
| 435 | search exits the search before executing the command. Thus, the | ||
| 436 | command operates on the buffer from which you invoked the search. | ||
| 437 | However, if you customize the variable @code{search-exit-option} to | ||
| 438 | @code{nil}, the characters which you type that are not interpreted by | ||
| 439 | the incremental search are simply appended to the search string. This | ||
| 440 | is so you could include in the search string control characters, such | ||
| 441 | as @kbd{C-a}, that would normally exit the search and invoke the | ||
| 442 | command bound to them on the buffer. | ||
| 366 | 443 | ||
| 367 | @table @asis | 444 | @table @asis |
| 368 | @item Prefix Arguments | 445 | @item Prefix Arguments |
| 446 | @cindex prefix argument commands, during incremental search | ||
| 369 | @vindex isearch-allow-prefix | 447 | @vindex isearch-allow-prefix |
| 370 | In incremental search, when you enter a prefix argument | 448 | In incremental search, when you type a command that specifies a |
| 371 | (@pxref{Arguments}), by default it will apply either to the next | 449 | prefix argument (@pxref{Arguments}), by default it will apply either |
| 372 | action in the search or to the command that exits the search. | 450 | to the next action in the search or to the command that exits the |
| 451 | search. In other words, entering a prefix argument will not by itself | ||
| 452 | terminate the search. | ||
| 373 | 453 | ||
| 374 | In previous versions of Emacs, entering a prefix argument always | 454 | In previous versions of Emacs, entering a prefix argument always |
| 375 | terminated the search. You can revert to this behavior by setting the | 455 | terminated the search. You can revert to this behavior by setting the |
| 376 | variable @code{isearch-allow-prefix} to @code{nil}. | 456 | variable @code{isearch-allow-prefix} to @code{nil}. |
| 377 | 457 | ||
| 378 | When @code{isearch-allow-scroll} is non-@code{nil} (see below), | 458 | When @code{isearch-allow-scroll} is non-@code{nil} (see below), |
| 379 | prefix arguments always have the default behavior described above. | 459 | prefix arguments always have the default behavior described above, |
| 460 | i.e., they don't terminate the search, even if | ||
| 461 | @code{isearch-allow-prefix} is @code{nil}. | ||
| 380 | 462 | ||
| 381 | @item Scrolling Commands | 463 | @item Scrolling Commands |
| 464 | @cindex scrolling commands, during incremental search | ||
| 382 | @vindex isearch-allow-scroll | 465 | @vindex isearch-allow-scroll |
| 383 | Normally, scrolling commands exit incremental search. If you change | 466 | Normally, scrolling commands exit incremental search. If you change |
| 384 | the variable @code{isearch-allow-scroll} to a non-@code{nil} value, | 467 | the variable @code{isearch-allow-scroll} to a non-@code{nil} value, |
| @@ -390,12 +473,14 @@ prefix arguments to these commands in the usual way. This feature | |||
| 390 | won't let you scroll the current match out of visibility, however. | 473 | won't let you scroll the current match out of visibility, however. |
| 391 | 474 | ||
| 392 | The @code{isearch-allow-scroll} feature also affects some other | 475 | The @code{isearch-allow-scroll} feature also affects some other |
| 393 | commands, such as @kbd{C-x 2} (@code{split-window-below}) and @kbd{C-x | 476 | commands, such as @kbd{C-x 2} (@code{split-window-below}) and |
| 394 | ^} (@code{enlarge-window}), which don't exactly scroll but do affect | 477 | @kbd{C-x ^} (@code{enlarge-window}), which don't exactly scroll but do |
| 395 | where the text appears on the screen. It applies to any command whose | 478 | affect where the text appears on the screen. It applies to any |
| 396 | name has a non-@code{nil} @code{isearch-scroll} property. So you can | 479 | command whose name has a non-@code{nil} @code{isearch-scroll} |
| 397 | control which commands are affected by changing these properties. | 480 | property. So you can control which commands are affected by changing |
| 398 | 481 | these properties. | |
| 482 | |||
| 483 | @cindex prevent commands from exiting incremental search | ||
| 399 | For example, to make @kbd{C-h l} usable within an incremental search | 484 | For example, to make @kbd{C-h l} usable within an incremental search |
| 400 | in all future Emacs sessions, use @kbd{C-h c} to find what command it | 485 | in all future Emacs sessions, use @kbd{C-h c} to find what command it |
| 401 | runs (@pxref{Key Help}), which is @code{view-lossage}. Then you can | 486 | runs (@pxref{Key Help}), which is @code{view-lossage}. Then you can |
| @@ -409,7 +494,8 @@ put the following line in your init file (@pxref{Init File}): | |||
| 409 | This feature can be applied to any command that doesn't permanently | 494 | This feature can be applied to any command that doesn't permanently |
| 410 | change point, the buffer contents, the match data, the current buffer, | 495 | change point, the buffer contents, the match data, the current buffer, |
| 411 | or the selected window and frame. The command must not itself attempt | 496 | or the selected window and frame. The command must not itself attempt |
| 412 | an incremental search. | 497 | an incremental search. This feature is disabled if |
| 498 | @code{isearch-allow-scroll} is @code{nil} (which it is by default). | ||
| 413 | @end table | 499 | @end table |
| 414 | 500 | ||
| 415 | @node Isearch Minibuffer | 501 | @node Isearch Minibuffer |
| @@ -455,14 +541,22 @@ This enters the minibuffer to read the search string; terminate the | |||
| 455 | string with @key{RET}, and then the search takes place. If the string | 541 | string with @key{RET}, and then the search takes place. If the string |
| 456 | is not found, the search command signals an error. | 542 | is not found, the search command signals an error. |
| 457 | 543 | ||
| 458 | @findex search-forward | ||
| 459 | @findex search-backward | ||
| 460 | When you type @kbd{C-s @key{RET}}, the @kbd{C-s} invokes incremental | 544 | When you type @kbd{C-s @key{RET}}, the @kbd{C-s} invokes incremental |
| 461 | search as usual. That command is specially programmed to invoke the | 545 | search as usual. That command is specially programmed to invoke the |
| 462 | command for nonincremental search, @code{search-forward}, if the | 546 | command for nonincremental search, if the string you specify is empty. |
| 463 | string you specify is empty. (Such an empty argument would otherwise | 547 | (Such an empty argument would otherwise be useless.) @kbd{C-r |
| 464 | be useless.) @kbd{C-r @key{RET}} does likewise, invoking the command | 548 | @key{RET}} does likewise, invoking the nonincremental |
| 465 | @code{search-backward}. | 549 | backward-searching command. |
| 550 | |||
| 551 | Nonincremental search can also be invoked form the menu bar's | ||
| 552 | @samp{Edit->Search} menu. | ||
| 553 | |||
| 554 | @findex search-forward | ||
| 555 | @findex search-backward | ||
| 556 | You can also use two simpler commands, @kbd{M-x search-forward} and | ||
| 557 | @kbd{M-x search-backward}. These commands look for the literal | ||
| 558 | strings you specify, and don't support any of the lax-search features | ||
| 559 | (@pxref{Lax Search}) except case folding. | ||
| 466 | 560 | ||
| 467 | @node Word Search | 561 | @node Word Search |
| 468 | @section Word Search | 562 | @section Word Search |
| @@ -475,11 +569,13 @@ search matches any sequence of those two words separated by one or | |||
| 475 | more spaces, newlines, or other punctuation characters. This is | 569 | more spaces, newlines, or other punctuation characters. This is |
| 476 | particularly useful for searching text documents, because you don't | 570 | particularly useful for searching text documents, because you don't |
| 477 | have to worry whether the words you are looking for are separated by | 571 | have to worry whether the words you are looking for are separated by |
| 478 | newlines or spaces. | 572 | newlines or spaces. Note that major modes for programming languages |
| 573 | or other specialized modes can modify the definition of a word to suit | ||
| 574 | their syntactic needs. | ||
| 479 | 575 | ||
| 480 | @table @kbd | 576 | @table @kbd |
| 481 | @item M-s w | 577 | @item M-s w |
| 482 | If incremental search is active, toggle word search mode | 578 | If incremental search is active, toggle word search mode |
| 483 | (@code{isearch-toggle-word}); otherwise, begin an incremental forward | 579 | (@code{isearch-toggle-word}); otherwise, begin an incremental forward |
| 484 | word search (@code{isearch-forward-word}). | 580 | word search (@code{isearch-forward-word}). |
| 485 | @item M-s w @key{RET} @var{words} @key{RET} | 581 | @item M-s w @key{RET} @var{words} @key{RET} |
| @@ -514,6 +610,18 @@ so that the matching can proceed incrementally as you type. This | |||
| 514 | additional laxity does not apply to the lazy highlight | 610 | additional laxity does not apply to the lazy highlight |
| 515 | (@pxref{Incremental Search}), which always matches whole words. | 611 | (@pxref{Incremental Search}), which always matches whole words. |
| 516 | 612 | ||
| 613 | The word search commands don't perform character folding, and | ||
| 614 | toggling lax whitespace matching (@pxref{Lax Search, lax space | ||
| 615 | matching}) has no effect on them. | ||
| 616 | |||
| 617 | @kindex M-s M-w | ||
| 618 | @findex eww-search-word | ||
| 619 | @vindex eww-search-prefix | ||
| 620 | Search the Web for the text in region. This command performs an | ||
| 621 | Internet search for the words in region using the search engine whose | ||
| 622 | @acronym{URL} is specified by the variable @code{eww-search-prefix}. | ||
| 623 | @xref{Basics, EWW, , eww, The Emacs Web Wowser Manual}. | ||
| 624 | |||
| 517 | @node Symbol Search | 625 | @node Symbol Search |
| 518 | @section Symbol Search | 626 | @section Symbol Search |
| 519 | @cindex symbol search | 627 | @cindex symbol search |
| @@ -529,6 +637,7 @@ searching source code. | |||
| 529 | 637 | ||
| 530 | @table @kbd | 638 | @table @kbd |
| 531 | @item M-s _ | 639 | @item M-s _ |
| 640 | @findex isearch-toggle-symbol | ||
| 532 | If incremental search is active, toggle symbol search mode | 641 | If incremental search is active, toggle symbol search mode |
| 533 | (@code{isearch-toggle-symbol}); otherwise, begin an incremental | 642 | (@code{isearch-toggle-symbol}); otherwise, begin an incremental |
| 534 | forward symbol search (@code{isearch-forward-symbol}). | 643 | forward symbol search (@code{isearch-forward-symbol}). |
| @@ -561,6 +670,10 @@ search. In nonincremental symbol searches, the beginning and end of | |||
| 561 | the search string are required to match the beginning and end of a | 670 | the search string are required to match the beginning and end of a |
| 562 | symbol, respectively. | 671 | symbol, respectively. |
| 563 | 672 | ||
| 673 | The symbol search commands don't perform character folding, and | ||
| 674 | toggling lax whitespace matching (@pxref{Lax Search, lax space | ||
| 675 | matching}) has no effect on them. | ||
| 676 | |||
| 564 | @node Regexp Search | 677 | @node Regexp Search |
| 565 | @section Regular Expression Search | 678 | @section Regular Expression Search |
| 566 | @cindex regexp search | 679 | @cindex regexp search |
| @@ -595,22 +708,31 @@ for. To search backward for a regexp, use @kbd{C-M-r} | |||
| 595 | (@code{isearch-backward-regexp}), @kbd{C-r} with a prefix argument, | 708 | (@code{isearch-backward-regexp}), @kbd{C-r} with a prefix argument, |
| 596 | or @kbd{M-r} within a backward incremental search. | 709 | or @kbd{M-r} within a backward incremental search. |
| 597 | 710 | ||
| 711 | @vindex regexp-search-ring-max | ||
| 598 | All of the special key sequences in an ordinary incremental search | 712 | All of the special key sequences in an ordinary incremental search |
| 599 | do similar things in an incremental regexp search. For instance, | 713 | (@pxref{Special Isearch}) do similar things in an incremental regexp |
| 600 | typing @kbd{C-s} immediately after starting the search retrieves the | 714 | search. For instance, typing @kbd{C-s} immediately after starting the |
| 601 | last incremental search regexp used and searches forward for it. | 715 | search retrieves the last incremental search regexp used and searches |
| 602 | Incremental regexp and non-regexp searches have independent defaults. | 716 | forward for it. Incremental regexp and non-regexp searches have |
| 603 | They also have separate search rings, which you can access with | 717 | independent defaults. They also have separate search rings, which you |
| 604 | @kbd{M-p} and @kbd{M-n}. | 718 | can access with @kbd{M-p} and @kbd{M-n}. The maximum number of search |
| 719 | regexps saved in the search ring is determined by the value of | ||
| 720 | @code{regexp-search-ring-max}, 16 by default. | ||
| 605 | 721 | ||
| 606 | Unlike ordinary incremental search, incremental regexp search | 722 | Unlike ordinary incremental search, incremental regexp search |
| 607 | do not use lax space matching by default. To toggle this feature | 723 | does not use lax space matching by default. To toggle this feature |
| 608 | use @kbd{M-s @key{SPC}} (@code{isearch-toggle-lax-whitespace}). | 724 | use @kbd{M-s @key{SPC}} (@code{isearch-toggle-lax-whitespace}). |
| 609 | Then any @key{SPC} typed in incremental regexp search will match | 725 | Then any @key{SPC} typed in incremental regexp search will match |
| 610 | any sequence of one or more whitespace characters. The variable | 726 | any sequence of one or more whitespace characters. The variable |
| 611 | @code{search-whitespace-regexp} specifies the regexp for the lax | 727 | @code{search-whitespace-regexp} specifies the regexp for the lax |
| 612 | space matching. @xref{Special Isearch}. | 728 | space matching. @xref{Special Isearch}. |
| 613 | 729 | ||
| 730 | Also unlike ordinary incremental search, incremental regexp search | ||
| 731 | cannot use character folding (@pxref{Lax Search}). (If you toggle | ||
| 732 | character folding during incremental regexp search with @kbd{M-s '}, | ||
| 733 | the search becomes a non-regexp search and the search pattern you | ||
| 734 | typed is interpreted as a literal string.) | ||
| 735 | |||
| 614 | In some cases, adding characters to the regexp in an incremental | 736 | In some cases, adding characters to the regexp in an incremental |
| 615 | regexp search can make the cursor move back and start again. For | 737 | regexp search can make the cursor move back and start again. For |
| 616 | example, if you have searched for @samp{foo} and you add @samp{\|bar}, | 738 | example, if you have searched for @samp{foo} and you add @samp{\|bar}, |
| @@ -629,7 +751,10 @@ starting position. These search methods are not mirror images. | |||
| 629 | Nonincremental search for a regexp is done with the commands | 751 | Nonincremental search for a regexp is done with the commands |
| 630 | @code{re-search-forward} and @code{re-search-backward}. You can | 752 | @code{re-search-forward} and @code{re-search-backward}. You can |
| 631 | invoke these with @kbd{M-x}, or by way of incremental regexp search | 753 | invoke these with @kbd{M-x}, or by way of incremental regexp search |
| 632 | with @kbd{C-M-s @key{RET}} and @kbd{C-M-r @key{RET}}. | 754 | with @kbd{C-M-s @key{RET}} and @kbd{C-M-r @key{RET}}. When you invoke |
| 755 | these commands with @kbd{M-x}, they search for the exact regexp you | ||
| 756 | specify, and thus don't support any lax-search features (@pxref{Lax | ||
| 757 | Search}) except case folding. | ||
| 633 | 758 | ||
| 634 | If you use the incremental regexp search commands with a prefix | 759 | If you use the incremental regexp search commands with a prefix |
| 635 | argument, they perform ordinary string search, like | 760 | argument, they perform ordinary string search, like |
| @@ -1030,21 +1155,67 @@ This contains two parts in succession: a character set matching | |||
| 1030 | period, @samp{?}, or @samp{!}, and a character set matching | 1155 | period, @samp{?}, or @samp{!}, and a character set matching |
| 1031 | close-brackets, quotes, or parentheses, repeated zero or more times. | 1156 | close-brackets, quotes, or parentheses, repeated zero or more times. |
| 1032 | 1157 | ||
| 1033 | @node Search Case | 1158 | @node Lax Search |
| 1034 | @section Searching and Case | 1159 | @section Lax Matching During Searching |
| 1035 | 1160 | ||
| 1036 | Searches in Emacs normally ignore the case of the text they are | 1161 | @cindex lax search |
| 1037 | searching through, if you specify the text in lower case. Thus, if | 1162 | @cindex character equivalence in search |
| 1038 | you specify searching for @samp{foo}, then @samp{Foo} and @samp{foo} | 1163 | Normally, you'd want search commands to disregard certain minor |
| 1039 | also match. Regexps, and in particular character sets, behave | 1164 | differences between the search string you type and the text being |
| 1040 | likewise: @samp{[ab]} matches @samp{a} or @samp{A} or @samp{b} or | 1165 | searched. For example, sequences of whitespace characters of |
| 1041 | @samp{B}. | 1166 | different length are usually perceived as equivalent; letter-case |
| 1167 | differences usually don't matter; etc. This is known as | ||
| 1168 | @dfn{character equivalence}. | ||
| 1042 | 1169 | ||
| 1043 | An upper-case letter anywhere in the incremental search string makes | 1170 | This section describes the Emacs lax search features, and how to |
| 1044 | the search case-sensitive. Thus, searching for @samp{Foo} does not find | 1171 | tailor them to your needs. |
| 1045 | @samp{foo} or @samp{FOO}. This applies to regular expression search as | 1172 | |
| 1046 | well as to string search. The effect ceases if you delete the | 1173 | @cindex lax space matching in search |
| 1047 | upper-case letter from the search string. | 1174 | @kindex M-s SPC @r{(Incremental search)} |
| 1175 | @kindex SPC @r{(Incremental search)} | ||
| 1176 | @findex isearch-toggle-lax-whitespace | ||
| 1177 | @vindex search-whitespace-regexp | ||
| 1178 | By default, search commands perform @dfn{lax space matching}: | ||
| 1179 | each space, or sequence of spaces, matches any sequence of one or more | ||
| 1180 | whitespace characters in the text. (Incremental regexp search has a | ||
| 1181 | separate default; see @ref{Regexp Search}.) Hence, @samp{foo bar} | ||
| 1182 | matches @samp{foo bar}, @samp{foo@w{ }bar}, @samp{foo@w{ }bar}, and | ||
| 1183 | so on (but not @samp{foobar}). More precisely, Emacs matches each | ||
| 1184 | sequence of space characters in the search string to a regular | ||
| 1185 | expression specified by the variable @code{search-whitespace-regexp}. | ||
| 1186 | For example, to make spaces match sequences of newlines as well as | ||
| 1187 | spaces, set it to @samp{"[[:space:]\n]+"}. The default value of this | ||
| 1188 | variable depends on the buffer's major mode; most major modes classify | ||
| 1189 | spaces, tabs, and formfeed characters as whitespace. | ||
| 1190 | |||
| 1191 | If you want whitespace characters to match exactly, you can turn lax | ||
| 1192 | space matching off by typing @kbd{M-s @key{SPC}} | ||
| 1193 | (@code{isearch-toggle-lax-whitespace}) within an incremental search. | ||
| 1194 | Another @kbd{M-s @key{SPC}} turns lax space matching back on. To | ||
| 1195 | disable lax whitespace matching for all searches, change | ||
| 1196 | @code{search-whitespace-regexp} to @code{nil}; then each space in the | ||
| 1197 | search string matches exactly one space. | ||
| 1198 | |||
| 1199 | @cindex case folding in search | ||
| 1200 | @cindex case-sensitivity and search | ||
| 1201 | Searches in Emacs by default ignore the case of the text they are | ||
| 1202 | searching through, if you specify the search string in lower case. | ||
| 1203 | Thus, if you specify searching for @samp{foo}, then @samp{Foo} and | ||
| 1204 | @samp{foo} also match. Regexps, and in particular character sets, | ||
| 1205 | behave likewise: @samp{[ab]} matches @samp{a} or @samp{A} or @samp{b} | ||
| 1206 | or @samp{B}. This feature is known as @dfn{case folding}, and it is | ||
| 1207 | supported in both incremental and non-incremental search modes. | ||
| 1208 | |||
| 1209 | @vindex search-upper-case | ||
| 1210 | An upper-case letter anywhere in the search string makes the search | ||
| 1211 | case-sensitive. Thus, searching for @samp{Foo} does not find | ||
| 1212 | @samp{foo} or @samp{FOO}. This applies to regular expression search | ||
| 1213 | as well as to literal string search. The effect ceases if you delete | ||
| 1214 | the upper-case letter from the search string. The variable | ||
| 1215 | @code{search-upper-case} controls this: if it is non-@code{nil} (the | ||
| 1216 | default), an upper-case character in the search string make the search | ||
| 1217 | case-sensitive; setting it to @code{nil} disables this effect of | ||
| 1218 | upper-case characters. | ||
| 1048 | 1219 | ||
| 1049 | @vindex case-fold-search | 1220 | @vindex case-fold-search |
| 1050 | If you set the variable @code{case-fold-search} to @code{nil}, then | 1221 | If you set the variable @code{case-fold-search} to @code{nil}, then |
| @@ -1055,12 +1226,14 @@ This variable applies to nonincremental searches also, including those | |||
| 1055 | performed by the replace commands (@pxref{Replace}) and the minibuffer | 1226 | performed by the replace commands (@pxref{Replace}) and the minibuffer |
| 1056 | history matching commands (@pxref{Minibuffer History}). | 1227 | history matching commands (@pxref{Minibuffer History}). |
| 1057 | 1228 | ||
| 1058 | @c isearch-toggle-case-fold | 1229 | @kindex M-c @r{(Incremental search)} |
| 1059 | Typing @kbd{M-c} within an incremental search toggles the case | 1230 | @kindex M-s c @r{(Incremental search)} |
| 1060 | sensitivity of that search. The effect does not extend beyond the | 1231 | @findex isearch-toggle-case-fold |
| 1061 | current incremental search to the next one, but it does override the | 1232 | Typing @kbd{M-c} or @kbd{M-s c} (@code{isearch-toggle-case-fold}) |
| 1062 | effect of adding or removing an upper-case letter in the current | 1233 | within an incremental search toggles the case sensitivity of that |
| 1063 | search. | 1234 | search. The effect does not extend beyond the current incremental |
| 1235 | search, but it does override the effect of adding or removing an | ||
| 1236 | upper-case letter in the current search. | ||
| 1064 | 1237 | ||
| 1065 | Several related variables control case-sensitivity of searching and | 1238 | Several related variables control case-sensitivity of searching and |
| 1066 | matching for specific commands or activities. For instance, | 1239 | matching for specific commands or activities. For instance, |
| @@ -1068,6 +1241,45 @@ matching for specific commands or activities. For instance, | |||
| 1068 | @code{find-tag}. To find these variables, do @kbd{M-x | 1241 | @code{find-tag}. To find these variables, do @kbd{M-x |
| 1069 | apropos-variable @key{RET} case-fold-search @key{RET}}. | 1242 | apropos-variable @key{RET} case-fold-search @key{RET}}. |
| 1070 | 1243 | ||
| 1244 | @cindex character folding in search | ||
| 1245 | @cindex equivalent character sequences | ||
| 1246 | Case folding disregards case distinctions among characters, making | ||
| 1247 | upper-case characters match lower-case variants, and vice versa. A | ||
| 1248 | generalization of case folding is @dfn{character folding}, which | ||
| 1249 | disregards wider classes of distinctions among similar characters. | ||
| 1250 | For instance, under character folding the letter @code{a} matches all | ||
| 1251 | of its accented cousins like @code{@"a} and @code{@'a}, i.e., the | ||
| 1252 | match disregards the diacritics that distinguish these | ||
| 1253 | variants. In addition, @code{a} matches other characters that | ||
| 1254 | resemble it, or have it as part of their graphical representation, | ||
| 1255 | such as @sc{u+249c parenthesized latin small letter a} and @sc{u+2100 | ||
| 1256 | account of} (which looks like a small @code{a} over @code{c}). | ||
| 1257 | Similarly, the @acronym{ASCII} double-quote character @code{"} matches | ||
| 1258 | all the other variants of double quotes defined by the Unicode | ||
| 1259 | standard. Finally, character folding can make a sequence of one or | ||
| 1260 | more characters match another sequence of a different length: for | ||
| 1261 | example, the sequence of two characters @code{ff} matches @sc{u+fb00 | ||
| 1262 | latin small ligature ff}. Character sequences that are not identical, | ||
| 1263 | but match under character folding are known as @dfn{equivalent | ||
| 1264 | character sequences}. | ||
| 1265 | |||
| 1266 | @kindex M-s ' @r{(Incremental Search)} | ||
| 1267 | @findex isearch-toggle-character-fold | ||
| 1268 | Generally, search commands in Emacs by default perform character | ||
| 1269 | folding, thus matching equivalent character sequences. You can | ||
| 1270 | disable this behavior by customizing the variable | ||
| 1271 | @code{search-default-regexp-mode} to @code{nil}. @xref{Search | ||
| 1272 | Customizations}. Within an incremental search, typing @kbd{M-s '} | ||
| 1273 | (@code{isearch-toggle-character-fold}) toggles character folding, but | ||
| 1274 | only for that search. (Replace commands have a different default, | ||
| 1275 | controlled by a separate option; see @ref{Replacement and Lax | ||
| 1276 | Matches}.) | ||
| 1277 | |||
| 1278 | Like with case folding, typing an explicit variant of a character, | ||
| 1279 | such as @code{@"a}, as part of the search string disables character | ||
| 1280 | folding for that search. If you delete such a character from the | ||
| 1281 | search string, this effect ceases. | ||
| 1282 | |||
| 1071 | @node Replace | 1283 | @node Replace |
| 1072 | @section Replacement Commands | 1284 | @section Replacement Commands |
| 1073 | @cindex replacement | 1285 | @cindex replacement |
| @@ -1078,7 +1290,8 @@ apropos-variable @key{RET} case-fold-search @key{RET}}. | |||
| 1078 | Emacs provides several commands for performing search-and-replace | 1290 | Emacs provides several commands for performing search-and-replace |
| 1079 | operations. In addition to the simple @kbd{M-x replace-string} | 1291 | operations. In addition to the simple @kbd{M-x replace-string} |
| 1080 | command, there is @kbd{M-%} (@code{query-replace}), which presents | 1292 | command, there is @kbd{M-%} (@code{query-replace}), which presents |
| 1081 | each occurrence of the pattern and asks you whether to replace it. | 1293 | each occurrence of the search pattern and asks you whether to replace |
| 1294 | it. | ||
| 1082 | 1295 | ||
| 1083 | The replace commands normally operate on the text from point to the | 1296 | The replace commands normally operate on the text from point to the |
| 1084 | end of the buffer. When the region is active, they operate on it | 1297 | end of the buffer. When the region is active, they operate on it |
| @@ -1087,17 +1300,11 @@ instead (@pxref{Mark}). The basic replace commands replace one | |||
| 1087 | is possible to perform several replacements in parallel, using the | 1300 | is possible to perform several replacements in parallel, using the |
| 1088 | command @code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}). | 1301 | command @code{expand-region-abbrevs} (@pxref{Expanding Abbrevs}). |
| 1089 | 1302 | ||
| 1090 | @vindex replace-lax-whitespace | ||
| 1091 | Unlike incremental search, the replacement commands do not use lax | ||
| 1092 | space matching (@pxref{Special Isearch}) by default. To enable lax | ||
| 1093 | space matching for replacement, change the variable | ||
| 1094 | @code{replace-lax-whitespace} to @code{t}. (This only affects how | ||
| 1095 | Emacs finds the text to replace, not the replacement text.) | ||
| 1096 | |||
| 1097 | @menu | 1303 | @menu |
| 1098 | * Unconditional Replace:: Replacing all matches for a string. | 1304 | * Unconditional Replace:: Replacing all matches for a string. |
| 1099 | * Regexp Replace:: Replacing all matches for a regexp. | 1305 | * Regexp Replace:: Replacing all matches for a regexp. |
| 1100 | * Replacement and Case:: How replacements preserve case of letters. | 1306 | * Replacement and Lax Matches:: |
| 1307 | Lax searching for text to replace. | ||
| 1101 | * Query Replace:: How to use querying. | 1308 | * Query Replace:: How to use querying. |
| 1102 | @end menu | 1309 | @end menu |
| 1103 | 1310 | ||
| @@ -1128,8 +1335,8 @@ activating the mark; use @kbd{C-u C-@key{SPC}} to move back there. | |||
| 1128 | A prefix argument restricts replacement to matches that are | 1335 | A prefix argument restricts replacement to matches that are |
| 1129 | surrounded by word boundaries. | 1336 | surrounded by word boundaries. |
| 1130 | 1337 | ||
| 1131 | @xref{Replacement and Case}, for details about case-sensitivity in | 1338 | @xref{Replacement and Lax Matches}, for details about |
| 1132 | replace commands. | 1339 | case-sensitivity in replace commands. |
| 1133 | 1340 | ||
| 1134 | @node Regexp Replace | 1341 | @node Regexp Replace |
| 1135 | @subsection Regexp Replacement | 1342 | @subsection Regexp Replacement |
| @@ -1137,7 +1344,7 @@ replace commands. | |||
| 1137 | 1344 | ||
| 1138 | The @kbd{M-x replace-string} command replaces exact matches for a | 1345 | The @kbd{M-x replace-string} command replaces exact matches for a |
| 1139 | single string. The similar command @kbd{M-x replace-regexp} replaces | 1346 | single string. The similar command @kbd{M-x replace-regexp} replaces |
| 1140 | any match for a specified pattern. | 1347 | any match for a specified regular expression pattern (@pxref{Regexps}). |
| 1141 | 1348 | ||
| 1142 | @table @kbd | 1349 | @table @kbd |
| 1143 | @item M-x replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} | 1350 | @item M-x replace-regexp @key{RET} @var{regexp} @key{RET} @var{newstring} @key{RET} |
| @@ -1218,9 +1425,28 @@ M-x replace-regexp @key{RET} ^.\@{0,72\@}$ @key{RET} | |||
| 1218 | \,(format "%-72sABC%05d" \& \#) @key{RET} | 1425 | \,(format "%-72sABC%05d" \& \#) @key{RET} |
| 1219 | @end example | 1426 | @end example |
| 1220 | 1427 | ||
| 1221 | @node Replacement and Case | 1428 | @node Replacement and Lax Matches |
| 1222 | @subsection Replace Commands and Case | 1429 | @subsection Replace Commands and Lax Matches |
| 1430 | |||
| 1431 | This subsection describes the behavior of replace commands with | ||
| 1432 | respect to lax matches (@pxref{Lax Search}) and how to customize it. | ||
| 1433 | In general, replace commands mostly default to stricter matching than | ||
| 1434 | their search counterparts. | ||
| 1223 | 1435 | ||
| 1436 | @cindex lax space matching in replace commands | ||
| 1437 | @vindex replace-lax-whitespace | ||
| 1438 | Unlike incremental search, the replacement commands do not use lax | ||
| 1439 | space matching (@pxref{Lax Search, lax space matching}) by default. | ||
| 1440 | To enable lax space matching for replacement, change the variable | ||
| 1441 | @code{replace-lax-whitespace} to non-@code{nil}. (This only affects | ||
| 1442 | how Emacs finds the text to replace, not the replacement text.) | ||
| 1443 | |||
| 1444 | @vindex replace-regexp-lax-whitespace | ||
| 1445 | A companion variable @code{replace-regexp-lax-whitespace} controls | ||
| 1446 | whether @code{query-replace-regexp} uses lax whitespace matching when | ||
| 1447 | searching for patterns. | ||
| 1448 | |||
| 1449 | @cindex case folding in replace commands | ||
| 1224 | If the first argument of a replace command is all lower case, the | 1450 | If the first argument of a replace command is all lower case, the |
| 1225 | command ignores case while searching for occurrences to | 1451 | command ignores case while searching for occurrences to |
| 1226 | replace---provided @code{case-fold-search} is non-@code{nil}. If | 1452 | replace---provided @code{case-fold-search} is non-@code{nil}. If |
| @@ -1250,6 +1476,15 @@ exactly as given, with no case conversion. Likewise, if either | |||
| 1250 | @code{case-replace} or @code{case-fold-search} is set to @code{nil}, | 1476 | @code{case-replace} or @code{case-fold-search} is set to @code{nil}, |
| 1251 | replacement is done without case conversion. | 1477 | replacement is done without case conversion. |
| 1252 | 1478 | ||
| 1479 | @cindex character folding in replace commands | ||
| 1480 | The replacement commands by default do not use character folding | ||
| 1481 | (@pxref{Lax Search, character folding}) when looking for the text to | ||
| 1482 | replace. To enable character folding for matching in | ||
| 1483 | @code{query-replace} and @code{replace-string}, set the variable | ||
| 1484 | @code{replace-character-fold} to a non-@code{nil} value. (This | ||
| 1485 | setting does not affect the replacement text, only how Emacs finds the | ||
| 1486 | text to replace. It also doesn't affect @code{replace-regexp}.) | ||
| 1487 | |||
| 1253 | @node Query Replace | 1488 | @node Query Replace |
| 1254 | @subsection Query Replace | 1489 | @subsection Query Replace |
| 1255 | @cindex query replace | 1490 | @cindex query replace |
| @@ -1270,9 +1505,9 @@ occurrence and asks you whether to replace it. Aside from querying, | |||
| 1270 | @code{query-replace} works just like @code{replace-string} | 1505 | @code{query-replace} works just like @code{replace-string} |
| 1271 | (@pxref{Unconditional Replace}). In particular, it preserves case | 1506 | (@pxref{Unconditional Replace}). In particular, it preserves case |
| 1272 | provided @code{case-replace} is non-@code{nil}, as it normally is | 1507 | provided @code{case-replace} is non-@code{nil}, as it normally is |
| 1273 | (@pxref{Replacement and Case}). A numeric argument means to consider | 1508 | (@pxref{Replacement and Lax Matches}). A numeric argument means to |
| 1274 | only occurrences that are bounded by word-delimiter characters. A | 1509 | consider only occurrences that are bounded by word-delimiter |
| 1275 | negative prefix argument replaces backward. | 1510 | characters. A negative prefix argument replaces backward. |
| 1276 | 1511 | ||
| 1277 | @kindex C-M-% | 1512 | @kindex C-M-% |
| 1278 | @findex query-replace-regexp | 1513 | @findex query-replace-regexp |
| @@ -1280,18 +1515,38 @@ negative prefix argument replaces backward. | |||
| 1280 | It works like @code{replace-regexp} except that it queries | 1515 | It works like @code{replace-regexp} except that it queries |
| 1281 | like @code{query-replace}. | 1516 | like @code{query-replace}. |
| 1282 | 1517 | ||
| 1518 | @vindex query-replace-from-to-separator | ||
| 1519 | You can reuse earlier replacements with these commands. When | ||
| 1520 | @code{query-replace} or @code{query-replace-regexp} prompts for the | ||
| 1521 | search string, use @kbd{M-p} and @kbd{M-n} to show previous | ||
| 1522 | replacements in the form @samp{@var{from} -> @var{to}}, where | ||
| 1523 | @var{from} is the search pattern, @var{to} is its replacement, and the | ||
| 1524 | separator between them is determined by the value of the variable | ||
| 1525 | @code{query-replace-from-to-separator}. Type @key{RET} to select the | ||
| 1526 | desired replacement. | ||
| 1527 | |||
| 1283 | @cindex faces for highlighting query replace | 1528 | @cindex faces for highlighting query replace |
| 1284 | @cindex query-replace face | 1529 | @cindex query-replace face |
| 1285 | @cindex lazy-highlight face | 1530 | @cindex lazy-highlight face, in replace |
| 1531 | @vindex query-replace-highlight | ||
| 1532 | @vindex query-replace-lazy-highlight | ||
| 1533 | @vindex query-replace-show-replacement | ||
| 1286 | These commands highlight the current match using the face | 1534 | These commands highlight the current match using the face |
| 1287 | @code{query-replace}. They highlight other matches using | 1535 | @code{query-replace}. You can disable this highlight by setting the |
| 1288 | @code{lazy-highlight} just like incremental search (@pxref{Incremental | 1536 | variable @code{query-replace-highlight} to @code{nil}. They highlight |
| 1289 | Search}). By default, @code{query-replace-regexp} will show the | 1537 | other matches using @code{lazy-highlight} just like incremental search |
| 1290 | substituted replacement string for the current match in the | 1538 | (@pxref{Incremental Search}); this can be disabled by setting |
| 1291 | minibuffer. If you want to keep special sequences @samp{\&} and | 1539 | @code{query-replace-lazy-highlight} to @code{nil}. By default, |
| 1292 | @samp{\@var{n}} unexpanded, customize | 1540 | @code{query-replace-regexp} will show the substituted replacement |
| 1541 | string for the current match in the minibuffer. If you want to keep | ||
| 1542 | special sequences @samp{\&} and @samp{\@var{n}} unexpanded, customize | ||
| 1293 | @code{query-replace-show-replacement} variable. | 1543 | @code{query-replace-show-replacement} variable. |
| 1294 | 1544 | ||
| 1545 | @vindex query-replace-skip-read-only | ||
| 1546 | The variable @code{query-replace-skip-read-only}, if set | ||
| 1547 | non-@code{nil}, will cause replacement commands to ignore matches in | ||
| 1548 | read-only text. The default is not to ignore them. | ||
| 1549 | |||
| 1295 | The characters you can type when you are shown a match for the string | 1550 | The characters you can type when you are shown a match for the string |
| 1296 | or regexp are: | 1551 | or regexp are: |
| 1297 | 1552 | ||
| @@ -1311,9 +1566,13 @@ or regexp are: | |||
| 1311 | @c WideCommands | 1566 | @c WideCommands |
| 1312 | @table @kbd | 1567 | @table @kbd |
| 1313 | @item @key{SPC} | 1568 | @item @key{SPC} |
| 1569 | @itemx y | ||
| 1314 | to replace the occurrence with @var{newstring}. | 1570 | to replace the occurrence with @var{newstring}. |
| 1315 | 1571 | ||
| 1316 | @item @key{DEL} | 1572 | @item @key{DEL} |
| 1573 | @itemx @key{Delete} | ||
| 1574 | @itemx @key{BACKSPACE} | ||
| 1575 | @itemx n | ||
| 1317 | to skip to the next occurrence without replacing this one. | 1576 | to skip to the next occurrence without replacing this one. |
| 1318 | 1577 | ||
| 1319 | @item , @r{(Comma)} | 1578 | @item , @r{(Comma)} |
| @@ -1329,6 +1588,7 @@ must use @kbd{C-x @key{ESC} @key{ESC} @key{RET}} to restart | |||
| 1329 | (@pxref{Repetition}). | 1588 | (@pxref{Repetition}). |
| 1330 | 1589 | ||
| 1331 | @item @key{RET} | 1590 | @item @key{RET} |
| 1591 | @itemx q | ||
| 1332 | to exit without doing any more replacements. | 1592 | to exit without doing any more replacements. |
| 1333 | 1593 | ||
| 1334 | @item .@: @r{(Period)} | 1594 | @item .@: @r{(Period)} |
| @@ -1338,19 +1598,6 @@ occurrences. | |||
| 1338 | @item ! | 1598 | @item ! |
| 1339 | to replace all remaining occurrences without asking again. | 1599 | to replace all remaining occurrences without asking again. |
| 1340 | 1600 | ||
| 1341 | @item Y @r{(Upper-case)} | ||
| 1342 | to replace all remaining occurrences in all remaining buffers in | ||
| 1343 | multi-buffer replacements (like the Dired @key{Q} command that performs | ||
| 1344 | query replace on selected files). It answers this question and all | ||
| 1345 | subsequent questions in the series with ``yes'', without further | ||
| 1346 | user interaction. | ||
| 1347 | |||
| 1348 | @item N @r{(Upper-case)} | ||
| 1349 | to skip to the next buffer in multi-buffer replacements without | ||
| 1350 | replacing remaining occurrences in the current buffer. It answers | ||
| 1351 | this question ``no'', gives up on the questions for the current buffer, | ||
| 1352 | and continues to the next buffer in the sequence. | ||
| 1353 | |||
| 1354 | @item ^ | 1601 | @item ^ |
| 1355 | to go back to the position of the previous occurrence (or what used to | 1602 | to go back to the position of the previous occurrence (or what used to |
| 1356 | be an occurrence), in case you changed it by mistake or want to | 1603 | be an occurrence), in case you changed it by mistake or want to |
| @@ -1378,19 +1625,30 @@ replacement string for any further occurrences. | |||
| 1378 | to redisplay the screen. Then you must type another character to | 1625 | to redisplay the screen. Then you must type another character to |
| 1379 | specify what to do with this occurrence. | 1626 | specify what to do with this occurrence. |
| 1380 | 1627 | ||
| 1628 | @item Y @r{(Upper-case)} | ||
| 1629 | to replace all remaining occurrences in all remaining buffers in | ||
| 1630 | multi-buffer replacements (like the Dired @key{Q} command that performs | ||
| 1631 | query replace on selected files). It answers this question and all | ||
| 1632 | subsequent questions in the series with ``yes'', without further | ||
| 1633 | user interaction. | ||
| 1634 | |||
| 1635 | @item N @r{(Upper-case)} | ||
| 1636 | to skip to the next buffer in multi-buffer replacements without | ||
| 1637 | replacing remaining occurrences in the current buffer. It answers | ||
| 1638 | this question ``no'', gives up on the questions for the current buffer, | ||
| 1639 | and continues to the next buffer in the sequence. | ||
| 1640 | |||
| 1381 | @item C-h | 1641 | @item C-h |
| 1642 | @itemx ? | ||
| 1643 | @itemx @key{F1} | ||
| 1382 | to display a message summarizing these options. Then you must type | 1644 | to display a message summarizing these options. Then you must type |
| 1383 | another character to specify what to do with this occurrence. | 1645 | another character to specify what to do with this occurrence. |
| 1384 | @end table | 1646 | @end table |
| 1385 | 1647 | ||
| 1386 | Some other characters are aliases for the ones listed above: @kbd{y}, | ||
| 1387 | @kbd{n} and @kbd{q} are equivalent to @key{SPC}, @key{DEL} and | ||
| 1388 | @key{RET}. | ||
| 1389 | |||
| 1390 | Aside from this, any other character exits the @code{query-replace}, | 1648 | Aside from this, any other character exits the @code{query-replace}, |
| 1391 | and is then reread as part of a key sequence. Thus, if you type | 1649 | and is then reread as part of a key sequence. Thus, if you type |
| 1392 | @kbd{C-k}, it exits the @code{query-replace} and then kills to end of | 1650 | @kbd{C-k}, it exits the @code{query-replace} and then kills to end of |
| 1393 | line. | 1651 | line. In particular, @kbd{C-g} simply exits the @code{query-replace}. |
| 1394 | 1652 | ||
| 1395 | To restart a @code{query-replace} once it is exited, use @kbd{C-x | 1653 | To restart a @code{query-replace} once it is exited, use @kbd{C-x |
| 1396 | @key{ESC} @key{ESC}}, which repeats the @code{query-replace} because it | 1654 | @key{ESC} @key{ESC}}, which repeats the @code{query-replace} because it |
| @@ -1454,12 +1712,17 @@ a multi-file incremental search is activated automatically. | |||
| 1454 | 1712 | ||
| 1455 | @cindex Occur mode | 1713 | @cindex Occur mode |
| 1456 | @cindex mode, Occur | 1714 | @cindex mode, Occur |
| 1715 | @cindex match (face name) | ||
| 1716 | @vindex list-matching-lines-default-context-lines | ||
| 1457 | @item M-x occur | 1717 | @item M-x occur |
| 1458 | Prompt for a regexp, and display a list showing each line in the | 1718 | Prompt for a regexp, and display a list showing each line in the |
| 1459 | buffer that contains a match for it. To limit the search to part of | 1719 | buffer that contains a match for it. The text that matched is |
| 1460 | the buffer, narrow to that part (@pxref{Narrowing}). A numeric | 1720 | highlighted using the @code{match} face. To limit the search to part |
| 1721 | of the buffer, narrow to that part (@pxref{Narrowing}). A numeric | ||
| 1461 | argument @var{n} specifies that @var{n} lines of context are to be | 1722 | argument @var{n} specifies that @var{n} lines of context are to be |
| 1462 | displayed before and after each matching line. | 1723 | displayed before and after each matching line. The default number of |
| 1724 | context lines is specified by the variable | ||
| 1725 | @code{list-matching-lines-default-context-lines}. | ||
| 1463 | 1726 | ||
| 1464 | @kindex RET @r{(Occur mode)} | 1727 | @kindex RET @r{(Occur mode)} |
| 1465 | @kindex o @r{(Occur mode)} | 1728 | @kindex o @r{(Occur mode)} |
| @@ -1526,3 +1789,89 @@ it never deletes lines that are only partially contained in the region | |||
| 1526 | 1789 | ||
| 1527 | If a match is split across lines, this command keeps all those lines. | 1790 | If a match is split across lines, this command keeps all those lines. |
| 1528 | @end table | 1791 | @end table |
| 1792 | |||
| 1793 | @node Search Customizations | ||
| 1794 | @section Tailoring Search to Your Needs | ||
| 1795 | @cindex search customizations | ||
| 1796 | |||
| 1797 | This section describes miscellaneous search-related customizations | ||
| 1798 | not described elsewhere. | ||
| 1799 | |||
| 1800 | @cindex default search mode | ||
| 1801 | @cindex search mode, default | ||
| 1802 | The default search mode for the incremental search is specified by | ||
| 1803 | the variable @code{search-default-regexp-mode}. It can be @code{nil}, | ||
| 1804 | @code{t}, or a function. If it is @code{nil}, the default mode is to | ||
| 1805 | do literal searches without character folding, but with case folding | ||
| 1806 | and lax-whitespace matches as determined by @code{case-fold-search} | ||
| 1807 | and @code{search-whitespace-regexp}, respectively (@pxref{Lax | ||
| 1808 | Search}). If the value is @code{t}, incremental search defaults to | ||
| 1809 | regexp searches. The default value specifies a function that causes | ||
| 1810 | the default search mode to perform character folding in addition to | ||
| 1811 | case folding and lax-whitespace matching. | ||
| 1812 | |||
| 1813 | @vindex search-highlight | ||
| 1814 | The current match of an on-going incremental search is highlighted | ||
| 1815 | using the @code{isearch} face. This highlighting can be disabled by | ||
| 1816 | setting the variable @code{search-highlight} to @code{nil}. | ||
| 1817 | |||
| 1818 | @cindex lazy highlighting customizations | ||
| 1819 | @vindex isearch-lazy-highlight | ||
| 1820 | @cindex lazy-highlight face | ||
| 1821 | The other matches for the search string that are visible on display | ||
| 1822 | are highlighted using the @code{lazy-highlight} face. Setting the | ||
| 1823 | variable @code{isearch-lazy-highlight} to @code{nil} disables this | ||
| 1824 | highlighting. Here are some other variables that customize the lazy | ||
| 1825 | highlighting: | ||
| 1826 | |||
| 1827 | @table @code | ||
| 1828 | @item lazy-highlight-initial-delay | ||
| 1829 | Time in seconds to wait before highlighting visible matches. | ||
| 1830 | |||
| 1831 | @item lazy-highlight-interval | ||
| 1832 | Time in seconds between highlighting successive matches. | ||
| 1833 | |||
| 1834 | @item lazy-highlight-max-at-a-time | ||
| 1835 | The maximum number of matches to highlight before checking for input. | ||
| 1836 | A large number can take some time to highlight, so if you want to | ||
| 1837 | continue searching and type @kbd{C-s} or @kbd{C-r} during that time, | ||
| 1838 | Emacs will not respond until it finishes highlighting all those | ||
| 1839 | matches. Thus, smaller values make Emacs more responsive. | ||
| 1840 | @end table | ||
| 1841 | |||
| 1842 | @vindex search-nonincremental-instead | ||
| 1843 | Normally, entering @key{RET} within incremental search when the | ||
| 1844 | search string is empty launches a nonincremental search. (Actually, | ||
| 1845 | it lets you edit the search string, and the next @key{RET} does the | ||
| 1846 | search.) However, if you customize the variable | ||
| 1847 | @code{search-nonincremental-instead} to @code{nil}, typing @key{RET} | ||
| 1848 | will always exit the incremental search, even if the search string is | ||
| 1849 | empty. | ||
| 1850 | |||
| 1851 | @vindex isearch-hide-immediately | ||
| 1852 | By default, incremental search and query-replace commands match | ||
| 1853 | invisible text, but hide any such matches as soon as the current match | ||
| 1854 | moves off the invisible text. If you customize the variable | ||
| 1855 | @code{isearch-hide-immediately} to @code{nil}, any invisible text | ||
| 1856 | where matches were found stays on display until the search or the | ||
| 1857 | replace command exits. | ||
| 1858 | |||
| 1859 | @cindex search display on slow terminals | ||
| 1860 | @vindex search-slow-speed | ||
| 1861 | @vindex search-slow-window-lines | ||
| 1862 | Searching incrementally on slow terminals, such as displays | ||
| 1863 | connected to remote machines over slow connection, could be annoying | ||
| 1864 | due to the need to redraw large portions of the display as the search | ||
| 1865 | proceeds. Emacs provides a special display mode for slow terminals, | ||
| 1866 | whereby search pops up a separate small window and displays the text | ||
| 1867 | surrounding the match in that window. Small windows display faster, | ||
| 1868 | so the annoying effect of slow speed is alleviated. The variable | ||
| 1869 | @code{search-slow-speed} determines the baud rate threshold below | ||
| 1870 | which Emacs will use this display mode. The variable | ||
| 1871 | @code{search-slow-window-lines} controls the number of lines in the | ||
| 1872 | window Emacs pops up for displaying the search results; the default is | ||
| 1873 | 1 line. Normally, this window will pop up at the bottom of the window | ||
| 1874 | that displays the buffer where you start searching, bit if the value | ||
| 1875 | of @code{search-slow-window-lines} is negative, that means to put the | ||
| 1876 | window at the top and give it the number of lines that is the absolute | ||
| 1877 | value of that value. | ||
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi index 087681b5618..4286cfeb737 100644 --- a/doc/emacs/trouble.texi +++ b/doc/emacs/trouble.texi | |||
| @@ -1065,7 +1065,7 @@ send it to the developers. Sending it to | |||
| 1065 | recommended, because that list is coupled to a tracking system that | 1065 | recommended, because that list is coupled to a tracking system that |
| 1066 | makes it easier to locate patches. If your patch is not complete and | 1066 | makes it easier to locate patches. If your patch is not complete and |
| 1067 | you think it needs more discussion, you might want to send it to | 1067 | you think it needs more discussion, you might want to send it to |
| 1068 | @email{emacs-devel@@gnu@@gnu.org} instead. If you revise your patch, | 1068 | @email{emacs-devel@@gnu.org} instead. If you revise your patch, |
| 1069 | send it as a followup to the initial topic. | 1069 | send it as a followup to the initial topic. |
| 1070 | 1070 | ||
| 1071 | We prefer to get the patches as plain text, either inline (be careful | 1071 | We prefer to get the patches as plain text, either inline (be careful |
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi index 45a21c8e806..55fa5bcd6f0 100644 --- a/doc/lispref/buffers.texi +++ b/doc/lispref/buffers.texi | |||
| @@ -716,7 +716,9 @@ The special commands of these modes bind @code{buffer-read-only} to | |||
| 716 | 716 | ||
| 717 | @defvar buffer-read-only | 717 | @defvar buffer-read-only |
| 718 | This buffer-local variable specifies whether the buffer is read-only. | 718 | This buffer-local variable specifies whether the buffer is read-only. |
| 719 | The buffer is read-only if this variable is non-@code{nil}. | 719 | The buffer is read-only if this variable is non-@code{nil}. However, |
| 720 | characters that have the @code{inhibit-read-only} text property can | ||
| 721 | still be modified. @xref{Special Properties, inhibit-read-only}. | ||
| 720 | @end defvar | 722 | @end defvar |
| 721 | 723 | ||
| 722 | @defvar inhibit-read-only | 724 | @defvar inhibit-read-only |
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi index ad248b116ed..d1ac85a7cab 100644 --- a/doc/lispref/display.texi +++ b/doc/lispref/display.texi | |||
| @@ -330,7 +330,7 @@ support them, then @code{message-box} uses the echo area, like | |||
| 330 | @code{message}. | 330 | @code{message}. |
| 331 | @end defun | 331 | @end defun |
| 332 | 332 | ||
| 333 | @defun display-message-or-buffer message &optional buffer-name not-this-window frame | 333 | @defun display-message-or-buffer message &optional buffer-name action frame |
| 334 | This function displays the message @var{message}, which may be either a | 334 | This function displays the message @var{message}, which may be either a |
| 335 | string or a buffer. If it is shorter than the maximum height of the | 335 | string or a buffer. If it is shorter than the maximum height of the |
| 336 | echo area, as defined by @code{max-mini-window-height}, it is displayed | 336 | echo area, as defined by @code{max-mini-window-height}, it is displayed |
| @@ -346,7 +346,7 @@ pop-up buffer is used, defaulting to @file{*Message*}. In the case | |||
| 346 | where @var{message} is a string and displayed in the echo area, it is | 346 | where @var{message} is a string and displayed in the echo area, it is |
| 347 | not specified whether the contents are inserted into the buffer anyway. | 347 | not specified whether the contents are inserted into the buffer anyway. |
| 348 | 348 | ||
| 349 | The optional arguments @var{not-this-window} and @var{frame} are as for | 349 | The optional arguments @var{action} and @var{frame} are as for |
| 350 | @code{display-buffer}, and only used if a buffer is displayed. | 350 | @code{display-buffer}, and only used if a buffer is displayed. |
| 351 | @end defun | 351 | @end defun |
| 352 | 352 | ||
| @@ -1889,12 +1889,13 @@ end of the result if it falls short of @var{width}. It is also used at | |||
| 1889 | the beginning of the result if one multi-column character in | 1889 | the beginning of the result if one multi-column character in |
| 1890 | @var{string} extends across the column @var{start-column}. | 1890 | @var{string} extends across the column @var{start-column}. |
| 1891 | 1891 | ||
| 1892 | @vindex truncate-string-ellipsis | ||
| 1892 | If @var{ellipsis} is non-@code{nil}, it should be a string which will | 1893 | If @var{ellipsis} is non-@code{nil}, it should be a string which will |
| 1893 | replace the end of @var{string} (including any padding) if it extends | 1894 | replace the end of @var{string} (including any padding) if it extends |
| 1894 | beyond @var{width}, unless the display width of @var{string} is equal | 1895 | beyond @var{width}, unless the display width of @var{string} is equal |
| 1895 | to or less than the display width of @var{ellipsis}. If | 1896 | to or less than the display width of @var{ellipsis}. If |
| 1896 | @var{ellipsis} is non-@code{nil} and not a string, it stands for | 1897 | @var{ellipsis} is non-@code{nil} and not a string, it stands for |
| 1897 | @code{"..."}. | 1898 | the value of the variable @code{truncate-string-ellipsis}. |
| 1898 | 1899 | ||
| 1899 | @example | 1900 | @example |
| 1900 | (truncate-string-to-width "\tab\t" 12 4) | 1901 | (truncate-string-to-width "\tab\t" 12 4) |
| @@ -3659,6 +3660,39 @@ tag (or @code{nil}, which stands for the default langsys), and each | |||
| 3659 | @end table | 3660 | @end table |
| 3660 | @end defun | 3661 | @end defun |
| 3661 | 3662 | ||
| 3663 | @cindex font information for layout | ||
| 3664 | The following four functions return size information about fonts used | ||
| 3665 | by various faces, allowing various layout considerations in Lisp | ||
| 3666 | programs. These functions take face remapping into consideration, | ||
| 3667 | returning information about the remapped face, if the face in question | ||
| 3668 | was remapped. @xref{Face Remapping}. | ||
| 3669 | |||
| 3670 | @defun default-font-width | ||
| 3671 | This function returns the average width in pixels of the font used by | ||
| 3672 | the current buffer's default face. | ||
| 3673 | @end defun | ||
| 3674 | |||
| 3675 | @defun default-font-height | ||
| 3676 | This function returns the height in pixels of the font used by the | ||
| 3677 | current buffer's default face. | ||
| 3678 | @end defun | ||
| 3679 | |||
| 3680 | @defun window-font-width &optional window face | ||
| 3681 | This function returns the average width in pixels for the font used by | ||
| 3682 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3683 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3684 | selected window, and @var{face} defaults to the default face in | ||
| 3685 | @var{window}. | ||
| 3686 | @end defun | ||
| 3687 | |||
| 3688 | @defun window-font-height &optional window face | ||
| 3689 | This function returns the height in pixels for the font used by | ||
| 3690 | @var{face} in @var{window}. The specified @var{window} must be a live | ||
| 3691 | window. If @code{nil} or omitted, @var{window} defaults to the | ||
| 3692 | selected window, and @var{face} defaults to the default face in | ||
| 3693 | @var{window}. | ||
| 3694 | @end defun | ||
| 3695 | |||
| 3662 | @node Fringes | 3696 | @node Fringes |
| 3663 | @section Fringes | 3697 | @section Fringes |
| 3664 | @cindex fringes | 3698 | @cindex fringes |
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi index 2d3548f65ba..56d303e2e9e 100644 --- a/doc/lispref/elisp.texi +++ b/doc/lispref/elisp.texi | |||
| @@ -467,6 +467,10 @@ Control Structures | |||
| 467 | * Generators:: Generic sequences and coroutines. | 467 | * Generators:: Generic sequences and coroutines. |
| 468 | * Nonlocal Exits:: Jumping out of a sequence. | 468 | * Nonlocal Exits:: Jumping out of a sequence. |
| 469 | 469 | ||
| 470 | Conditionals | ||
| 471 | |||
| 472 | * Pattern matching case statement:: How to use @code{pcase}. | ||
| 473 | |||
| 470 | Nonlocal Exits | 474 | Nonlocal Exits |
| 471 | 475 | ||
| 472 | * Catch and Throw:: Nonlocal exits for the program's own purposes. | 476 | * Catch and Throw:: Nonlocal exits for the program's own purposes. |
| @@ -535,6 +539,7 @@ Functions | |||
| 535 | * Function Cells:: Accessing or setting the function definition | 539 | * Function Cells:: Accessing or setting the function definition |
| 536 | of a symbol. | 540 | of a symbol. |
| 537 | * Closures:: Functions that enclose a lexical environment. | 541 | * Closures:: Functions that enclose a lexical environment. |
| 542 | * Advising Functions:: Adding to the definition of a function. | ||
| 538 | * Obsolete Functions:: Declaring functions obsolete. | 543 | * Obsolete Functions:: Declaring functions obsolete. |
| 539 | * Inline Functions:: Defining functions that the compiler | 544 | * Inline Functions:: Defining functions that the compiler |
| 540 | will expand inline. | 545 | will expand inline. |
| @@ -552,6 +557,13 @@ Lambda Expressions | |||
| 552 | * Argument List:: Details and special features of argument lists. | 557 | * Argument List:: Details and special features of argument lists. |
| 553 | * Function Documentation:: How to put documentation in a function. | 558 | * Function Documentation:: How to put documentation in a function. |
| 554 | 559 | ||
| 560 | Advising Emacs Lisp Functions | ||
| 561 | |||
| 562 | * Core Advising Primitives:: Primitives to manipulate advice. | ||
| 563 | * Advising Named Functions:: Advising named functions. | ||
| 564 | * Advice combinators:: Ways to compose advice. | ||
| 565 | * Porting old advice:: Adapting code using the old defadvice. | ||
| 566 | |||
| 555 | Macros | 567 | Macros |
| 556 | 568 | ||
| 557 | * Simple Macro:: A basic example. | 569 | * Simple Macro:: A basic example. |
| @@ -602,6 +614,7 @@ Loading | |||
| 602 | * Unloading:: How to unload a library that was loaded. | 614 | * Unloading:: How to unload a library that was loaded. |
| 603 | * Hooks for Loading:: Providing code to be run when | 615 | * Hooks for Loading:: Providing code to be run when |
| 604 | particular libraries are loaded. | 616 | particular libraries are loaded. |
| 617 | * Dynamic Modules:: Modules provide additional Lisp primitives. | ||
| 605 | 618 | ||
| 606 | Byte Compilation | 619 | Byte Compilation |
| 607 | 620 | ||
| @@ -1191,6 +1204,10 @@ Text Properties | |||
| 1191 | * Not Intervals:: Why text properties do not use | 1204 | * Not Intervals:: Why text properties do not use |
| 1192 | Lisp-visible text intervals. | 1205 | Lisp-visible text intervals. |
| 1193 | 1206 | ||
| 1207 | Parsing HTML and XML | ||
| 1208 | |||
| 1209 | * Document Object Model:: Access, manipulate and search the @acronym{DOM}. | ||
| 1210 | |||
| 1194 | Non-@acronym{ASCII} Characters | 1211 | Non-@acronym{ASCII} Characters |
| 1195 | 1212 | ||
| 1196 | * Text Representations:: How Emacs represents text. | 1213 | * Text Representations:: How Emacs represents text. |
| @@ -1530,9 +1547,12 @@ GNU Emacs Internals | |||
| 1530 | * Building Emacs:: How the dumped Emacs is made. | 1547 | * Building Emacs:: How the dumped Emacs is made. |
| 1531 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. | 1548 | * Pure Storage:: Kludge to make preloaded Lisp functions shareable. |
| 1532 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. | 1549 | * Garbage Collection:: Reclaiming space for Lisp objects no longer used. |
| 1550 | * Stack-allocated Objects:: Temporary conses and strings on C stack. | ||
| 1533 | * Memory Usage:: Info about total size of Lisp objects made so far. | 1551 | * Memory Usage:: Info about total size of Lisp objects made so far. |
| 1552 | * C Dialect:: What C variant Emacs is written in. | ||
| 1534 | * Writing Emacs Primitives:: Writing C code for Emacs. | 1553 | * Writing Emacs Primitives:: Writing C code for Emacs. |
| 1535 | * Object Internals:: Data formats of buffers, windows, processes. | 1554 | * Object Internals:: Data formats of buffers, windows, processes. |
| 1555 | * C Integer Types:: How C integer types are used inside Emacs. | ||
| 1536 | 1556 | ||
| 1537 | Object Internals | 1557 | Object Internals |
| 1538 | 1558 | ||
diff --git a/doc/lispref/eval.texi b/doc/lispref/eval.texi index 067dbd2d99f..dfad9fb709d 100644 --- a/doc/lispref/eval.texi +++ b/doc/lispref/eval.texi | |||
| @@ -780,7 +780,8 @@ to specify this function, but it is more robust to use the | |||
| 780 | @deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print | 780 | @deffn Command eval-buffer &optional buffer-or-name stream filename unibyte print |
| 781 | This is similar to @code{eval-region}, but the arguments provide | 781 | This is similar to @code{eval-region}, but the arguments provide |
| 782 | different optional features. @code{eval-buffer} operates on the | 782 | different optional features. @code{eval-buffer} operates on the |
| 783 | entire accessible portion of buffer @var{buffer-or-name}. | 783 | entire accessible portion of buffer @var{buffer-or-name} |
| 784 | (@pxref{Narrowing,,, emacs, The GNU Emacs Manual}). | ||
| 784 | @var{buffer-or-name} can be a buffer, a buffer name (a string), or | 785 | @var{buffer-or-name} can be a buffer, a buffer name (a string), or |
| 785 | @code{nil} (or omitted), which means to use the current buffer. | 786 | @code{nil} (or omitted), which means to use the current buffer. |
| 786 | @var{stream} is used as in @code{eval-region}, unless @var{stream} is | 787 | @var{stream} is used as in @code{eval-region}, unless @var{stream} is |
| @@ -833,9 +834,9 @@ The value of this variable is a list of the values returned by all the | |||
| 833 | expressions that were read, evaluated, and printed from buffers | 834 | expressions that were read, evaluated, and printed from buffers |
| 834 | (including the minibuffer) by the standard Emacs commands which do | 835 | (including the minibuffer) by the standard Emacs commands which do |
| 835 | this. (Note that this does @emph{not} include evaluation in | 836 | this. (Note that this does @emph{not} include evaluation in |
| 836 | @file{*ielm*} buffers, nor evaluation using @kbd{C-j} in | 837 | @file{*ielm*} buffers, nor evaluation using @kbd{C-j}, @kbd{C-x C-e}, |
| 837 | @code{lisp-interaction-mode}.) The elements are ordered most recent | 838 | and similar evaluation commands in @code{lisp-interaction-mode}.) The |
| 838 | first. | 839 | elements are ordered most recent first. |
| 839 | 840 | ||
| 840 | @example | 841 | @example |
| 841 | @group | 842 | @group |
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi index 9a1b2cd217f..918bf5becbd 100644 --- a/doc/lispref/files.texi +++ b/doc/lispref/files.texi | |||
| @@ -2030,11 +2030,6 @@ form. | |||
| 2030 | @end example | 2030 | @end example |
| 2031 | @end defun | 2031 | @end defun |
| 2032 | 2032 | ||
| 2033 | @defun directory-name-p filename | ||
| 2034 | This function returns non-@code{nil} if @var{filename} ends with a | ||
| 2035 | forward slash (@samp{/}) character. | ||
| 2036 | @end defun | ||
| 2037 | |||
| 2038 | @node Directory Names | 2033 | @node Directory Names |
| 2039 | @subsection Directory Names | 2034 | @subsection Directory Names |
| 2040 | @cindex directory name | 2035 | @cindex directory name |
| @@ -2076,6 +2071,13 @@ string (if it does not already end in one). | |||
| 2076 | @end example | 2071 | @end example |
| 2077 | @end defun | 2072 | @end defun |
| 2078 | 2073 | ||
| 2074 | @defun directory-name-p filename | ||
| 2075 | This function returns non-@code{nil} if @var{filename} ends with a | ||
| 2076 | directory separator character. This is the forward slash @samp{/} on | ||
| 2077 | Unix and GNU systems; MS-Windows and MS-DOS recognize both the forward | ||
| 2078 | slash and the backslash @samp{\} as directory separators. | ||
| 2079 | @end defun | ||
| 2080 | |||
| 2079 | @defun directory-file-name dirname | 2081 | @defun directory-file-name dirname |
| 2080 | This function returns a string representing @var{dirname} in a form | 2082 | This function returns a string representing @var{dirname} in a form |
| 2081 | that the operating system will interpret as the name of a file (a | 2083 | that the operating system will interpret as the name of a file (a |
| @@ -2632,12 +2634,20 @@ An error is signaled if @var{directory} is not the name of a directory | |||
| 2632 | that can be read. | 2634 | that can be read. |
| 2633 | @end defun | 2635 | @end defun |
| 2634 | 2636 | ||
| 2635 | @defun directory-files-recursively directory match &optional include-directories | 2637 | @defun directory-files-recursively directory regexp &optional include-directories |
| 2636 | Return all files under @var{directory} whose file names match | 2638 | Return all files under @var{directory} whose names match @var{regexp}. |
| 2637 | @var{match} recursively. The file names are returned depth first, | 2639 | This function searches the specified @var{directory} and its |
| 2638 | meaning that contents of sub-directories are returned before contents | 2640 | sub-directories, recursively, for files whose basenames (i.e., without |
| 2639 | of the directories. If @var{include-directories} is non-@code{nil}, | 2641 | the leading directories) match the specified @var{regexp}, and returns |
| 2640 | also return directory names that have matching names. | 2642 | a list of the absolute file names of the matching files |
| 2643 | (@pxref{Relative File Names, absolute file names}). The file names | ||
| 2644 | are returned in depth-first order, meaning that files in some | ||
| 2645 | sub-directory are returned before the files in its parent directory. | ||
| 2646 | In addition, matching files found in each subdirectory are sorted | ||
| 2647 | alphabetically by their basenames. By default, directories whose | ||
| 2648 | names match @var{regexp} are omitted from the list, but if the | ||
| 2649 | optional argument @var{include-directories} is non-@code{nil}, they | ||
| 2650 | are included. | ||
| 2641 | @end defun | 2651 | @end defun |
| 2642 | 2652 | ||
| 2643 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format | 2653 | @defun directory-files-and-attributes directory &optional full-name match-regexp nosort id-format |
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi index 3ae33082fc4..80a4af29f1a 100644 --- a/doc/lispref/frames.texi +++ b/doc/lispref/frames.texi | |||
| @@ -557,7 +557,7 @@ The top left corner of the native frame specifies the @dfn{native | |||
| 557 | position} of the frame. (1)--(3) in the drawing above indicate that | 557 | position} of the frame. (1)--(3) in the drawing above indicate that |
| 558 | position for the various builds: | 558 | position for the various builds: |
| 559 | 559 | ||
| 560 | @itemize @w | 560 | @itemize @w{} |
| 561 | @item (1) non-toolkit and terminal frames | 561 | @item (1) non-toolkit and terminal frames |
| 562 | 562 | ||
| 563 | @item (2) Lucid, Motif and Windows frames | 563 | @item (2) Lucid, Motif and Windows frames |
| @@ -1001,18 +1001,40 @@ parameters of @var{frame} and their values. If @var{frame} is | |||
| 1001 | @end defun | 1001 | @end defun |
| 1002 | 1002 | ||
| 1003 | @defun modify-frame-parameters frame alist | 1003 | @defun modify-frame-parameters frame alist |
| 1004 | This function alters the parameters of frame @var{frame} based on the | 1004 | This function alters the frame @var{frame} based on the elements of |
| 1005 | elements of @var{alist}. Each element of @var{alist} has the form | 1005 | @var{alist}. Each element of @var{alist} has the form |
| 1006 | @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a | 1006 | @code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming |
| 1007 | parameter. If you don't mention a parameter in @var{alist}, its value | 1007 | a parameter. If you don't mention a parameter in @var{alist}, its |
| 1008 | doesn't change. If @var{frame} is @code{nil}, it defaults to the selected | 1008 | value doesn't change. If @var{frame} is @code{nil}, it defaults to |
| 1009 | frame. | 1009 | the selected frame. |
| 1010 | |||
| 1011 | Some parameters are only meaningful for frames on certain kinds of | ||
| 1012 | display (@pxref{Frames}). If @var{alist} includes parameters that are | ||
| 1013 | not meaningful for the @var{frame}'s display, this function will | ||
| 1014 | change its value in the frame's parameter list, but will otherwise | ||
| 1015 | ignore it. | ||
| 1016 | |||
| 1017 | When @var{alist} specifies more than one parameter whose value can | ||
| 1018 | affect the new size of @var{frame}, the final size of the frame may | ||
| 1019 | differ according to the toolkit used. For example, specifying that a | ||
| 1020 | frame should from now on have a menu and/or tool bar instead of none and | ||
| 1021 | simultaneously specifying the new height of the frame will inevitably | ||
| 1022 | lead to a recalculation of the frame's height. Conceptually, in such | ||
| 1023 | case, this function will try to have the explicit height specification | ||
| 1024 | prevail. It cannot be excluded, however, that the addition (or removal) | ||
| 1025 | of the menu or tool bar, when eventually performed by the toolkit, will | ||
| 1026 | defeat this intention. | ||
| 1027 | |||
| 1028 | Sometimes, binding @code{frame-inhibit-implied-resize} (@pxref{Implied | ||
| 1029 | Frame Resizing}) to a non-@code{nil} value around calls to this function | ||
| 1030 | may fix the problem sketched here. Sometimes, however, exactly such | ||
| 1031 | binding may be hit by the problem. | ||
| 1010 | @end defun | 1032 | @end defun |
| 1011 | 1033 | ||
| 1012 | @defun set-frame-parameter frame parm value | 1034 | @defun set-frame-parameter frame parm value |
| 1013 | This function sets the frame parameter @var{parm} to the specified | 1035 | This function sets the frame parameter @var{parm} to the specified |
| 1014 | @var{value}. If @var{frame} is @code{nil}, it defaults to the | 1036 | @var{value}. If @var{frame} is @code{nil}, it defaults to the selected |
| 1015 | selected frame. | 1037 | frame. |
| 1016 | @end defun | 1038 | @end defun |
| 1017 | 1039 | ||
| 1018 | @defun modify-all-frames-parameters alist | 1040 | @defun modify-all-frames-parameters alist |
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi index 8835667b82d..7cc041fa77e 100644 --- a/doc/lispref/functions.texi +++ b/doc/lispref/functions.texi | |||
| @@ -861,15 +861,18 @@ into a list. @code{mapc} always returns @var{sequence}. | |||
| 861 | 861 | ||
| 862 | @defun mapconcat function sequence separator | 862 | @defun mapconcat function sequence separator |
| 863 | @code{mapconcat} applies @var{function} to each element of | 863 | @code{mapconcat} applies @var{function} to each element of |
| 864 | @var{sequence}: the results, which must be strings, are concatenated. | 864 | @var{sequence}; the results, which must be sequences of characters |
| 865 | Between each pair of result strings, @code{mapconcat} inserts the string | 865 | (strings, vectors, or lists), are concatenated into a single string |
| 866 | @var{separator}. Usually @var{separator} contains a space or comma or | 866 | return value. Between each pair of result sequences, @code{mapconcat} |
| 867 | other suitable punctuation. | 867 | inserts the characters from @var{separator}, which also must be a |
| 868 | string, or a vector or list of characters. @xref{Sequences Arrays | ||
| 869 | Vectors}. | ||
| 868 | 870 | ||
| 869 | The argument @var{function} must be a function that can take one | 871 | The argument @var{function} must be a function that can take one |
| 870 | argument and return a string. The argument @var{sequence} can be any | 872 | argument and returns a sequence of characters: a string, a vector, or |
| 871 | kind of sequence except a char-table; that is, a list, a vector, a | 873 | a list. The argument @var{sequence} can be any kind of sequence |
| 872 | bool-vector, or a string. | 874 | except a char-table; that is, a list, a vector, a bool-vector, or a |
| 875 | string. | ||
| 873 | 876 | ||
| 874 | @example | 877 | @example |
| 875 | @group | 878 | @group |
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi index 387587a4203..685995b395f 100644 --- a/doc/lispref/help.texi +++ b/doc/lispref/help.texi | |||
| @@ -352,16 +352,16 @@ string in Emacs Lisp. | |||
| 352 | @defvar text-quoting-style | 352 | @defvar text-quoting-style |
| 353 | @cindex curved quotes | 353 | @cindex curved quotes |
| 354 | @cindex curly quotes | 354 | @cindex curly quotes |
| 355 | The value of this variable specifies the style used to generate text | 355 | The value of this variable is a symbol that specifies the style Emacs |
| 356 | quotes. If the variable's value is @code{curve}, the style is | 356 | should use for single quotes in the wording of help and messages. |
| 357 | If the variable's value is @code{curve}, the style is | ||
| 357 | @t{‘like this’} with curved single quotes. If the value is | 358 | @t{‘like this’} with curved single quotes. If the value is |
| 358 | @code{straight}, the style is @t{'like this'} with straight | 359 | @code{straight}, the style is @t{'like this'} with straight |
| 359 | apostrophes. If the value is @code{grave}, the style is @t{`like | 360 | apostrophes. If the value is @code{grave}, the style is @t{`like |
| 360 | this'} with grave accent and apostrophe. The default value @code{nil} | 361 | this'} with grave accent and apostrophe, the standard style |
| 362 | before Emacs version 25. The default value @code{nil} | ||
| 361 | acts like @code{curve} if curved single quotes are displayable, and | 363 | acts like @code{curve} if curved single quotes are displayable, and |
| 362 | like @code{grave} otherwise. To use the traditional @code{grave} | 364 | like @code{grave} otherwise. |
| 363 | style, put the line @code{(setq text-quoting-style 'grave)} into your | ||
| 364 | @file{~/.emacs} file. | ||
| 365 | @end defvar | 365 | @end defvar |
| 366 | 366 | ||
| 367 | @defun substitute-command-keys string | 367 | @defun substitute-command-keys string |
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi index e620da0b4ff..e111d358ba0 100644 --- a/doc/lispref/internals.texi +++ b/doc/lispref/internals.texi | |||
| @@ -32,7 +32,9 @@ executable. You don't have to know this material to build and install | |||
| 32 | Emacs, since the makefiles do all these things automatically. This | 32 | Emacs, since the makefiles do all these things automatically. This |
| 33 | information is pertinent to Emacs developers. | 33 | information is pertinent to Emacs developers. |
| 34 | 34 | ||
| 35 | Compilation of the C source files in the @file{src} directory | 35 | Building Emacs requires GNU Make version 3.81 or later. |
| 36 | |||
| 37 | Compilation of the C source files in the @file{src} directory | ||
| 36 | produces an executable file called @file{temacs}, also called a | 38 | produces an executable file called @file{temacs}, also called a |
| 37 | @dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and | 39 | @dfn{bare impure Emacs}. It contains the Emacs Lisp interpreter and |
| 38 | I/O routines, but not the editing commands. | 40 | I/O routines, but not the editing commands. |
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi index 82de765876e..e01f3161731 100644 --- a/doc/lispref/loading.texi +++ b/doc/lispref/loading.texi | |||
| @@ -29,7 +29,15 @@ into a buffer and evaluated there. (Indeed, most code is tested this | |||
| 29 | way.) Most often, the forms are function definitions and variable | 29 | way.) Most often, the forms are function definitions and variable |
| 30 | definitions. | 30 | definitions. |
| 31 | 31 | ||
| 32 | For on-demand loading of external libraries, @pxref{Dynamic Libraries}. | 32 | Emacs can also load compiled dynamic modules: shared libraries that |
| 33 | provide additional functionality for use in Emacs Lisp programs, just | ||
| 34 | like a package written in Emacs Lisp would. When a dynamic module is | ||
| 35 | loaded, Emacs calls a specially-named initialization function which | ||
| 36 | the module needs to implement, and which exposes the additional | ||
| 37 | functions and variables to Emacs Lisp programs. | ||
| 38 | |||
| 39 | For on-demand loading of external libraries which are known in advance | ||
| 40 | to be required by certain Emacs primitives, @pxref{Dynamic Libraries}. | ||
| 33 | 41 | ||
| 34 | @menu | 42 | @menu |
| 35 | * How Programs Do Loading:: The @code{load} function and others. | 43 | * How Programs Do Loading:: The @code{load} function and others. |
| @@ -43,6 +51,7 @@ For on-demand loading of external libraries, @pxref{Dynamic Libraries}. | |||
| 43 | * Unloading:: How to unload a library that was loaded. | 51 | * Unloading:: How to unload a library that was loaded. |
| 44 | * Hooks for Loading:: Providing code to be run when | 52 | * Hooks for Loading:: Providing code to be run when |
| 45 | particular libraries are loaded. | 53 | particular libraries are loaded. |
| 54 | * Dynamic Modules:: Modules provide additional Lisp primitives. | ||
| 46 | @end menu | 55 | @end menu |
| 47 | 56 | ||
| 48 | @node How Programs Do Loading | 57 | @node How Programs Do Loading |
| @@ -1076,3 +1085,53 @@ defined in another library (those meant for outside use), you can do | |||
| 1076 | it immediately---there is no need to wait until the library is loaded. | 1085 | it immediately---there is no need to wait until the library is loaded. |
| 1077 | If you need to call functions defined by that library, you should load | 1086 | If you need to call functions defined by that library, you should load |
| 1078 | the library, preferably with @code{require} (@pxref{Named Features}). | 1087 | the library, preferably with @code{require} (@pxref{Named Features}). |
| 1088 | |||
| 1089 | @node Dynamic Modules | ||
| 1090 | @section Emacs Dynamic Modules | ||
| 1091 | @cindex dynamic modules | ||
| 1092 | |||
| 1093 | @c FIXME: This is intentionally incomplete, as the module integration | ||
| 1094 | @c is not yet finished. To be refined later. | ||
| 1095 | A @dfn{dynamic Emacs module} is a shared library that provides | ||
| 1096 | additional functionality for use in Emacs Lisp programs, just like a | ||
| 1097 | package written in Emacs Lisp would. | ||
| 1098 | |||
| 1099 | Functions that load Emacs Lisp packages can also load dynamic | ||
| 1100 | modules. They recognize dynamic modules by looking at their file-name | ||
| 1101 | extension, a.k.a.@: ``suffix''. This suffix is platform-dependent. | ||
| 1102 | |||
| 1103 | @defvar module-file-suffix | ||
| 1104 | This variable holds the system-dependent value of the file-name | ||
| 1105 | extension of the module files. Its value is @file{.so} on Posix hosts | ||
| 1106 | and @file{.dll} on MS-Windows. | ||
| 1107 | @end defvar | ||
| 1108 | |||
| 1109 | @findex emacs_module_init | ||
| 1110 | @vindex plugin_is_GPL_compatible | ||
| 1111 | Every dynamic module should export a C-callable function named | ||
| 1112 | @code{emacs_module_init}, which Emacs will call as part of the call to | ||
| 1113 | @code{load} or @code{require} which loads the module. It should also | ||
| 1114 | export a symbol named @code{plugin_is_GPL_compatible} to indicate that | ||
| 1115 | its code is released under the GPL or compatible license; Emacs will | ||
| 1116 | refuse to load modules that don't export such a symbol. | ||
| 1117 | |||
| 1118 | If a module needs to call Emacs functions, it should do so through the | ||
| 1119 | API defined and documented in the header file @file{emacs-module.h} | ||
| 1120 | that is part of the Emacs distribution. | ||
| 1121 | |||
| 1122 | @cindex user-ptr object | ||
| 1123 | Modules can create @code{user-ptr} Lisp objects that embed pointers to | ||
| 1124 | C struct's defined by the module. This is useful for keeping around | ||
| 1125 | complex data structures created by a module, to be passed back to the | ||
| 1126 | module's functions. User-ptr objects can also have associated | ||
| 1127 | @dfn{finalizers} -- functions to be run when the object is GC'ed; this | ||
| 1128 | is useful for freeing any resources allocated for the underlying data | ||
| 1129 | structure, such as memory, open file descriptors, etc. | ||
| 1130 | |||
| 1131 | @defun user-ptrp object | ||
| 1132 | This function returns @code{t} if its argument is a @code{user-ptr} | ||
| 1133 | object. | ||
| 1134 | @end defun | ||
| 1135 | |||
| 1136 | Loadable modules in Emacs are enabled by using the | ||
| 1137 | @kbd{--with-modules} option at configure time. | ||
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi index a1747707d11..3b8550e13b9 100644 --- a/doc/lispref/modes.texi +++ b/doc/lispref/modes.texi | |||
| @@ -2509,6 +2509,53 @@ Search-based fontification happens second. | |||
| 2509 | @node Font Lock Basics | 2509 | @node Font Lock Basics |
| 2510 | @subsection Font Lock Basics | 2510 | @subsection Font Lock Basics |
| 2511 | 2511 | ||
| 2512 | The Font Lock functionality is based on several basic functions. | ||
| 2513 | Each of these calls the function specified by the corresponding | ||
| 2514 | variable. This indirection allows major modes to modify the way | ||
| 2515 | fontification works in the buffers of that mode, and even use the Font | ||
| 2516 | Lock mechanisms for features that have nothing to do with | ||
| 2517 | fontification. (This is why the description below says ``should'' | ||
| 2518 | when it describes what the functions do: the major mode can customize | ||
| 2519 | the values of the corresponding variables to do something entirely | ||
| 2520 | different.) The variables mentioned below are described in @ref{Other | ||
| 2521 | Font Lock Variables}. | ||
| 2522 | |||
| 2523 | @ftable @code | ||
| 2524 | @item font-lock-fontify-buffer | ||
| 2525 | This function should fontify the current buffer's accessible portion, | ||
| 2526 | by calling the function specified by | ||
| 2527 | @code{font-lock-fontify-buffer-function}. | ||
| 2528 | |||
| 2529 | @item font-lock-unfontify-buffer | ||
| 2530 | Used when turning Font Lock off to remove the fontification. Calls | ||
| 2531 | the function specified by @code{font-lock-unfontify-buffer-function}. | ||
| 2532 | |||
| 2533 | @item font-lock-fontify-region beg end &optional loudly | ||
| 2534 | Should fontify the region between @var{beg} and @var{end}. If | ||
| 2535 | @var{loudly} is non-@code{nil}, should display status messages while | ||
| 2536 | fontifying. Calls the function specified by | ||
| 2537 | @code{font-lock-fontify-region-function}. | ||
| 2538 | |||
| 2539 | @item font-lock-unfontify-region beg end | ||
| 2540 | Should remove fontification from the region between @var{beg} and | ||
| 2541 | @var{end}. Calls the function specified by | ||
| 2542 | @code{font-lock-unfontify-region-function}. | ||
| 2543 | |||
| 2544 | @item font-lock-flush &optional beg end | ||
| 2545 | This function should mark the fontification of the region between | ||
| 2546 | @var{beg} and @var{end} as outdated. If not specified or @code{nil}, | ||
| 2547 | @var{beg} and @var{end} default to the beginning and end of the | ||
| 2548 | buffer's accessible portion. Calls the function specified by | ||
| 2549 | @code{font-lock-flush-function}. | ||
| 2550 | |||
| 2551 | @item font-lock-ensure &optional beg end | ||
| 2552 | This function should make sure the region between @var{beg} and | ||
| 2553 | @var{end} has been fontified. The optional arguments @var{beg} and | ||
| 2554 | @var{end} default to the beginning and the end of the buffer's | ||
| 2555 | accessible portion. Calls the function specified by | ||
| 2556 | @code{font-lock-ensure-function}. | ||
| 2557 | @end ftable | ||
| 2558 | |||
| 2512 | There are several variables that control how Font Lock mode highlights | 2559 | There are several variables that control how Font Lock mode highlights |
| 2513 | text. But major modes should not set any of these variables directly. | 2560 | text. But major modes should not set any of these variables directly. |
| 2514 | Instead, they should set @code{font-lock-defaults} as a buffer-local | 2561 | Instead, they should set @code{font-lock-defaults} as a buffer-local |
| @@ -2936,6 +2983,22 @@ arguments, the beginning and end of the region. The default value is | |||
| 2936 | @code{font-lock-default-unfontify-region}. | 2983 | @code{font-lock-default-unfontify-region}. |
| 2937 | @end defvar | 2984 | @end defvar |
| 2938 | 2985 | ||
| 2986 | @defvar font-lock-flush-function | ||
| 2987 | Function to use for declaring that a region's fontification is out of | ||
| 2988 | date. It takes two arguments, the beginning and end of the region. | ||
| 2989 | The default value of this variable is | ||
| 2990 | @code{font-lock-after-change-function}. | ||
| 2991 | @end defvar | ||
| 2992 | |||
| 2993 | @defvar font-lock-ensure-function | ||
| 2994 | Function to use for making sure a region of the current buffer has | ||
| 2995 | been fontified. It is called with two arguments, the beginning and | ||
| 2996 | end of the region. The default value of this variable is a function | ||
| 2997 | that calls @code{font-lock-default-fontify-buffer} if the buffer is | ||
| 2998 | not fontified; the effect is to make sure the entire accessible | ||
| 2999 | portion of the buffer is fontified. | ||
| 3000 | @end defvar | ||
| 3001 | |||
| 2939 | @defun jit-lock-register function &optional contextual | 3002 | @defun jit-lock-register function &optional contextual |
| 2940 | This function tells Font Lock mode to run the Lisp function | 3003 | This function tells Font Lock mode to run the Lisp function |
| 2941 | @var{function} any time it has to fontify or refontify part of the | 3004 | @var{function} any time it has to fontify or refontify part of the |
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 17a0b47ad06..92e3ee2b33c 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -902,6 +902,9 @@ Hewlett-Packard HPUX operating system. | |||
| 902 | @item irix | 902 | @item irix |
| 903 | Silicon Graphics Irix system. | 903 | Silicon Graphics Irix system. |
| 904 | 904 | ||
| 905 | @item nacl | ||
| 906 | Google Native Client (@acronym{NaCl}) sandboxing system. | ||
| 907 | |||
| 905 | @item ms-dos | 908 | @item ms-dos |
| 906 | Microsoft's DOS@. Emacs compiled with DJGPP for MS-DOS binds | 909 | Microsoft's DOS@. Emacs compiled with DJGPP for MS-DOS binds |
| 907 | @code{system-type} to @code{ms-dos} even when you run it on MS-Windows. | 910 | @code{system-type} to @code{ms-dos} even when you run it on MS-Windows. |
| @@ -911,7 +914,7 @@ AT&T Unix System V. | |||
| 911 | 914 | ||
| 912 | @item windows-nt | 915 | @item windows-nt |
| 913 | Microsoft Windows NT, 9X and later. The value of @code{system-type} | 916 | Microsoft Windows NT, 9X and later. The value of @code{system-type} |
| 914 | is always @code{windows-nt}, e.g., even on Windows 7. | 917 | is always @code{windows-nt}, e.g., even on Windows 10. |
| 915 | 918 | ||
| 916 | @end table | 919 | @end table |
| 917 | 920 | ||
| @@ -2922,6 +2925,18 @@ means complete; it is intended to give you an idea of the security | |||
| 2922 | issues involved, rather than to be a security checklist. | 2925 | issues involved, rather than to be a security checklist. |
| 2923 | 2926 | ||
| 2924 | @table @asis | 2927 | @table @asis |
| 2928 | @item File local variables | ||
| 2929 | @cindex file local variables | ||
| 2930 | A file that Emacs visits can contain variable settings that affects | ||
| 2931 | the buffer visiting that file; @xref{File Local Variables}. | ||
| 2932 | Similarly, a directory can specify local variable values common to all | ||
| 2933 | files in that directory; @xref{Directory Local Variables}. Although | ||
| 2934 | Emacs takes some effort to protect against misuse of these variables, | ||
| 2935 | a security hole can be created merely by a package setting | ||
| 2936 | @code{safe-local-variable} too optimistically, a problem that is all | ||
| 2937 | too common. To disable this feature for both files and directories, | ||
| 2938 | set @code{enable-local-variables} to @code{nil}. | ||
| 2939 | |||
| 2925 | @item Access control | 2940 | @item Access control |
| 2926 | Although Emacs normally respects access permissions of the underlying | 2941 | Although Emacs normally respects access permissions of the underlying |
| 2927 | operating system, in some cases it handles accesses specially. For | 2942 | operating system, in some cases it handles accesses specially. For |
diff --git a/doc/lispref/positions.texi b/doc/lispref/positions.texi index 72b76ce5c8f..9daf5cef059 100644 --- a/doc/lispref/positions.texi +++ b/doc/lispref/positions.texi | |||
| @@ -572,6 +572,18 @@ The value returned is the window line number point has moved to, with | |||
| 572 | the top line in the window numbered 0. | 572 | the top line in the window numbered 0. |
| 573 | @end deffn | 573 | @end deffn |
| 574 | 574 | ||
| 575 | @vindex move-to-window-group-line-function | ||
| 576 | @defun move-to-window-group-line count | ||
| 577 | This function is like @code{move-to-window-line}, except that when the | ||
| 578 | selected window is a part of a group of windows (@pxref{Window | ||
| 579 | Group}), @code{move-to-window-group-line} will move to a position with | ||
| 580 | respect to the entire group, not just the single window. This | ||
| 581 | condition holds when the buffer local variable | ||
| 582 | @code{move-to-window-group-line-function} is set to a function. In | ||
| 583 | this case, @code{move-to-window-group-line} calls the function with | ||
| 584 | the argument @var{count}, then returns its result. | ||
| 585 | @end defun | ||
| 586 | |||
| 575 | @defun compute-motion from frompos to topos width offsets window | 587 | @defun compute-motion from frompos to topos width offsets window |
| 576 | This function scans the current buffer, calculating screen positions. | 588 | This function scans the current buffer, calculating screen positions. |
| 577 | It scans the buffer forward from position @var{from}, assuming that is | 589 | It scans the buffer forward from position @var{from}, assuming that is |
diff --git a/doc/lispref/processes.texi b/doc/lispref/processes.texi index 0ce696ad533..41255e7e8d0 100644 --- a/doc/lispref/processes.texi +++ b/doc/lispref/processes.texi | |||
| @@ -737,10 +737,12 @@ If @var{stopped} is non-@code{nil}, start the process in the | |||
| 737 | stopped state. | 737 | stopped state. |
| 738 | 738 | ||
| 739 | @item :filter @var{filter} | 739 | @item :filter @var{filter} |
| 740 | Initialize the process filter to @var{filter}. | 740 | Initialize the process filter to @var{filter}. If not specified, a |
| 741 | default filter will be provided. @xref{Filter Functions}. | ||
| 741 | 742 | ||
| 742 | @item :sentinel @var{sentinel} | 743 | @item :sentinel @var{sentinel} |
| 743 | Initialize the process sentinel to @var{sentinel}. | 744 | Initialize the process sentinel to @var{sentinel}. If not specified, |
| 745 | a default sentinel will be used. @xref{Sentinels}. | ||
| 744 | 746 | ||
| 745 | @item :stderr @var{stderr} | 747 | @item :stderr @var{stderr} |
| 746 | Associate @var{stderr} with the standard error of the process. | 748 | Associate @var{stderr} with the standard error of the process. |
| @@ -789,10 +791,12 @@ If @var{stopped} is non-@code{nil}, start the process in the | |||
| 789 | stopped state. | 791 | stopped state. |
| 790 | 792 | ||
| 791 | @item :filter @var{filter} | 793 | @item :filter @var{filter} |
| 792 | Initialize the process filter to @var{filter}. | 794 | Initialize the process filter to @var{filter}. If not specified, a |
| 795 | default filter will be provided. @xref{Filter Functions}. | ||
| 793 | 796 | ||
| 794 | @item :sentinel @var{sentinel} | 797 | @item :sentinel @var{sentinel} |
| 795 | Initialize the process sentinel to @var{sentinel}. | 798 | Initialize the process sentinel to @var{sentinel}. If not specified, |
| 799 | a default sentinel will be used. @xref{Sentinels}. | ||
| 796 | @end table | 800 | @end table |
| 797 | 801 | ||
| 798 | The original argument list, modified with the actual connection | 802 | The original argument list, modified with the actual connection |
| @@ -922,9 +926,10 @@ For a network process, the values include (see | |||
| 922 | @item :buffer | 926 | @item :buffer |
| 923 | The associated value is the process buffer. | 927 | The associated value is the process buffer. |
| 924 | @item :filter | 928 | @item :filter |
| 925 | The associated value is the process filter function. | 929 | The associated value is the process filter function. @xref{Filter |
| 930 | Functions}. | ||
| 926 | @item :sentinel | 931 | @item :sentinel |
| 927 | The associated value is the process sentinel function. | 932 | The associated value is the process sentinel function. @xref{Sentinels}. |
| 928 | @item :remote | 933 | @item :remote |
| 929 | In a connection, the address in internal format of the remote peer. | 934 | In a connection, the address in internal format of the remote peer. |
| 930 | @item :local | 935 | @item :local |
| @@ -1379,6 +1384,7 @@ subprocess with a @code{SIGHUP} signal (@pxref{Signals to Processes}). | |||
| 1379 | @cindex filter function | 1384 | @cindex filter function |
| 1380 | @cindex process filter | 1385 | @cindex process filter |
| 1381 | 1386 | ||
| 1387 | @cindex default filter function of a process | ||
| 1382 | A process @dfn{filter function} is a function that receives the | 1388 | A process @dfn{filter function} is a function that receives the |
| 1383 | standard output from the associated process. @emph{All} output from | 1389 | standard output from the associated process. @emph{All} output from |
| 1384 | that process is passed to the filter. The default filter simply | 1390 | that process is passed to the filter. The default filter simply |
| @@ -1632,21 +1638,43 @@ also called if the process exits. The sentinel receives two | |||
| 1632 | arguments: the process for which the event occurred, and a string | 1638 | arguments: the process for which the event occurred, and a string |
| 1633 | describing the type of event. | 1639 | describing the type of event. |
| 1634 | 1640 | ||
| 1641 | @cindex default sentinel function of a process | ||
| 1642 | If no sentinel function was specified for a process, it will use the | ||
| 1643 | default sentinel function, which inserts a message in the process's | ||
| 1644 | buffer with the process name and the string describing the event. | ||
| 1645 | |||
| 1635 | The string describing the event looks like one of the following: | 1646 | The string describing the event looks like one of the following: |
| 1636 | 1647 | ||
| 1637 | @c FIXME? Also "killed\n" - see example below? | ||
| 1638 | @itemize @bullet | 1648 | @itemize @bullet |
| 1639 | @item | 1649 | @item |
| 1640 | @code{"finished\n"}. | 1650 | @code{"finished\n"}. |
| 1641 | 1651 | ||
| 1642 | @item | 1652 | @item |
| 1643 | @code{"exited abnormally with code @var{exitcode}\n"}. | 1653 | @code{"deleted\n"}. |
| 1654 | |||
| 1655 | @item | ||
| 1656 | @code{"exited abnormally with code @var{exitcode} (core dumped)\n"}. | ||
| 1657 | The ``core dumped'' part is optional, and only appears if the process | ||
| 1658 | dumped core. | ||
| 1659 | |||
| 1660 | @item | ||
| 1661 | @code{"failed with code @var{fail-code}\n"}. | ||
| 1662 | |||
| 1663 | @item | ||
| 1664 | @code{"@var{signal-description} (core dumped)\n"}. The | ||
| 1665 | @var{signal-description} is a system-dependent textual description of | ||
| 1666 | a signal, e.g., @code{"killed"} for @code{SIGKILL}. The ``core | ||
| 1667 | dumped'' part is optional, and only appears if the process dumped | ||
| 1668 | core. | ||
| 1669 | |||
| 1670 | @item | ||
| 1671 | @code{"open from @var{host-name}\n"}. | ||
| 1644 | 1672 | ||
| 1645 | @item | 1673 | @item |
| 1646 | @code{"@var{name-of-signal}\n"}. | 1674 | @code{"open\n"}. |
| 1647 | 1675 | ||
| 1648 | @item | 1676 | @item |
| 1649 | @code{"@var{name-of-signal} (core dumped)\n"}. | 1677 | @code{"connection broken by remote peer\n"}. |
| 1650 | @end itemize | 1678 | @end itemize |
| 1651 | 1679 | ||
| 1652 | A sentinel runs only while Emacs is waiting (e.g., for terminal | 1680 | A sentinel runs only while Emacs is waiting (e.g., for terminal |
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi index f8685d9312c..8aa4539bd78 100644 --- a/doc/lispref/strings.texi +++ b/doc/lispref/strings.texi | |||
| @@ -465,6 +465,7 @@ Representations}. | |||
| 465 | @code{string-equal} is another name for @code{string=}. | 465 | @code{string-equal} is another name for @code{string=}. |
| 466 | @end defun | 466 | @end defun |
| 467 | 467 | ||
| 468 | @cindex locale-dependent string equivalence | ||
| 468 | @defun string-collate-equalp string1 string2 &optional locale ignore-case | 469 | @defun string-collate-equalp string1 string2 &optional locale ignore-case |
| 469 | This function returns @code{t} if @var{string1} and @var{string2} are | 470 | This function returns @code{t} if @var{string1} and @var{string2} are |
| 470 | equal with respect to collation rules. A collation rule is not only | 471 | equal with respect to collation rules. A collation rule is not only |
| @@ -493,6 +494,7 @@ systems. | |||
| 493 | If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case | 494 | If @var{ignore-case} is non-@code{nil}, characters are converted to lower-case |
| 494 | before comparing them. | 495 | before comparing them. |
| 495 | 496 | ||
| 497 | @vindex w32-collate-ignore-punctuation | ||
| 496 | To emulate Unicode-compliant collation on MS-Windows systems, | 498 | To emulate Unicode-compliant collation on MS-Windows systems, |
| 497 | bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since | 499 | bind @code{w32-collate-ignore-punctuation} to a non-@code{nil} value, since |
| 498 | the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. | 500 | the codeset part of the locale cannot be @code{"UTF-8"} on MS-Windows. |
| @@ -518,7 +520,7 @@ optional argument @var{ignore-case} is non-@code{nil}, the comparison | |||
| 518 | ignores case differences. | 520 | ignores case differences. |
| 519 | @end defun | 521 | @end defun |
| 520 | 522 | ||
| 521 | @cindex lexical comparison | 523 | @cindex lexical comparison of strings |
| 522 | @defun string< string1 string2 | 524 | @defun string< string1 string2 |
| 523 | @c (findex string< causes problems for permuted index!!) | 525 | @c (findex string< causes problems for permuted index!!) |
| 524 | This function compares two strings a character at a time. It | 526 | This function compares two strings a character at a time. It |
| @@ -576,6 +578,7 @@ are used. | |||
| 576 | @code{string-lessp} is another name for @code{string<}. | 578 | @code{string-lessp} is another name for @code{string<}. |
| 577 | @end defun | 579 | @end defun |
| 578 | 580 | ||
| 581 | @cindex locale-dependent string comparison | ||
| 579 | @defun string-collate-lessp string1 string2 &optional locale ignore-case | 582 | @defun string-collate-lessp string1 string2 &optional locale ignore-case |
| 580 | This function returns @code{t} if @var{string1} is less than | 583 | This function returns @code{t} if @var{string1} is less than |
| 581 | @var{string2} in collation order. A collation order is not only | 584 | @var{string2} in collation order. A collation order is not only |
| @@ -594,15 +597,15 @@ for sorting (@pxref{Sequence Functions}): | |||
| 594 | @end group | 597 | @end group |
| 595 | @end example | 598 | @end example |
| 596 | 599 | ||
| 597 | This behavior is system-dependent; punctuation and whitespace are | 600 | This behavior is system-dependent; e.g., punctuation and whitespace |
| 598 | never ignored on Cygwin, regardless of locale. | 601 | are never ignored on Cygwin, regardless of locale. |
| 599 | 602 | ||
| 600 | The optional argument @var{locale}, a string, overrides the setting of | 603 | The optional argument @var{locale}, a string, overrides the setting of |
| 601 | your current locale identifier for collation. The value is system | 604 | your current locale identifier for collation. The value is system |
| 602 | dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX | 605 | dependent; a @var{locale} @code{"en_US.UTF-8"} is applicable on POSIX |
| 603 | systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows | 606 | systems, while it would be, e.g., @code{"enu_USA.1252"} on MS-Windows |
| 604 | systems. The @var{locale} @code{"POSIX"} lets @code{string-collate-lessp} | 607 | systems. The @var{locale} value of @code{"POSIX"} or @code{"C"} lets |
| 605 | behave like @code{string-lessp}: | 608 | @code{string-collate-lessp} behave like @code{string-lessp}: |
| 606 | 609 | ||
| 607 | @example | 610 | @example |
| 608 | @group | 611 | @group |
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi index 7a984e3d87b..831ebd12f55 100644 --- a/doc/lispref/syntax.texi +++ b/doc/lispref/syntax.texi | |||
| @@ -945,6 +945,14 @@ whitespace by the functions in this section and by @code{forward-sexp}, | |||
| 945 | The behavior of @code{parse-partial-sexp} is also affected by | 945 | The behavior of @code{parse-partial-sexp} is also affected by |
| 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). | 946 | @code{parse-sexp-lookup-properties} (@pxref{Syntax Properties}). |
| 947 | 947 | ||
| 948 | @defvar comment-end-can-be-escaped | ||
| 949 | If this buffer local variable is non-@code{nil}, a single character | ||
| 950 | which usually terminates a comment doesn't do so when that character | ||
| 951 | is escaped. This is used in C and C++ Modes, where line comments | ||
| 952 | starting with @samp{//} can be continued onto the next line by | ||
| 953 | escaping the newline with @samp{\}. | ||
| 954 | @end defvar | ||
| 955 | |||
| 948 | You can use @code{forward-comment} to move forward or backward over | 956 | You can use @code{forward-comment} to move forward or backward over |
| 949 | one comment or several comments. | 957 | one comment or several comments. |
| 950 | 958 | ||
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 6d9d26f0ad1..f3679a88f74 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -899,13 +899,25 @@ adds it to the most recent element. It determines automatically (using | |||
| 899 | @code{last-command}) whether the previous command was a kill command, | 899 | @code{last-command}) whether the previous command was a kill command, |
| 900 | and if so appends the killed text to the most recent entry. | 900 | and if so appends the killed text to the most recent entry. |
| 901 | 901 | ||
| 902 | @deffn Command kill-region start end | 902 | @cindex filtering killed text |
| 903 | This function kills the text in the region defined by @var{start} and | 903 | The commands described below can filter the killed text before they |
| 904 | @var{end}. The text is deleted but saved in the kill ring, along with | 904 | save it in the kill ring. They call @code{filter-buffer-substring} |
| 905 | its text properties. The value is always @code{nil}. | 905 | (@pxref{Buffer Contents}) to perform the filtering. By default, |
| 906 | there's no filtering, but major and minor modes and hook functions can | ||
| 907 | set up filtering, so that text saved in the kill ring is different | ||
| 908 | from what was in the buffer. | ||
| 909 | |||
| 910 | @deffn Command kill-region start end &optional region | ||
| 911 | This function kills the stretch of text between @var{start} and | ||
| 912 | @var{end}; but if the optional argument @var{region} is | ||
| 913 | non-@code{nil}, it ignores @var{start} and @var{end}, and kills the | ||
| 914 | text in the current region instead. The text is deleted but saved in | ||
| 915 | the kill ring, along with its text properties. The value is always | ||
| 916 | @code{nil}. | ||
| 906 | 917 | ||
| 907 | In an interactive call, @var{start} and @var{end} are point and | 918 | In an interactive call, @var{start} and @var{end} are point and |
| 908 | the mark. | 919 | the mark, and @var{region} is always non-@code{nil}, so the command |
| 920 | always kills the text in the current region. | ||
| 909 | 921 | ||
| 910 | If the buffer or text is read-only, @code{kill-region} modifies the kill | 922 | If the buffer or text is read-only, @code{kill-region} modifies the kill |
| 911 | ring just the same, then signals an error without modifying the buffer. | 923 | ring just the same, then signals an error without modifying the buffer. |
| @@ -919,18 +931,20 @@ error if the buffer or text is read-only. Instead, it simply returns, | |||
| 919 | updating the kill ring but not changing the buffer. | 931 | updating the kill ring but not changing the buffer. |
| 920 | @end defopt | 932 | @end defopt |
| 921 | 933 | ||
| 922 | @deffn Command copy-region-as-kill start end | 934 | @deffn Command copy-region-as-kill start end &optional region |
| 923 | This command saves the region defined by @var{start} and @var{end} on | 935 | This function saves the stretch of text between @var{start} and |
| 924 | the kill ring (including text properties), but does not delete the text | 936 | @var{end} on the kill ring (including text properties), but does not |
| 925 | from the buffer. It returns @code{nil}. | 937 | delete the text from the buffer. However, if the optional argument |
| 938 | @var{region} is non-@code{nil}, the function ignores @var{start} and | ||
| 939 | @var{end}, and saves the current region instead. It always returns | ||
| 940 | @code{nil}. | ||
| 941 | |||
| 942 | In an interactive call, @var{start} and @var{end} are point and | ||
| 943 | the mark, and @var{region} is always non-@code{nil}, so the command | ||
| 944 | always saves the text in the current region. | ||
| 926 | 945 | ||
| 927 | The command does not set @code{this-command} to @code{kill-region}, so a | 946 | The command does not set @code{this-command} to @code{kill-region}, so a |
| 928 | subsequent kill command does not append to the same kill ring entry. | 947 | subsequent kill command does not append to the same kill ring entry. |
| 929 | |||
| 930 | @c FIXME Why is it better? Why isn't copy-region-as-kill obsolete then? | ||
| 931 | @c Why is it used in many places in Emacs? | ||
| 932 | In Lisp programs, it is better to use @code{kill-new} or | ||
| 933 | @code{kill-append} instead of this command. @xref{Low-Level Kill Ring}. | ||
| 934 | @end deffn | 948 | @end deffn |
| 935 | 949 | ||
| 936 | @node Yanking | 950 | @node Yanking |
| @@ -1343,27 +1357,39 @@ This function places a boundary element in the undo list. The undo | |||
| 1343 | command stops at such a boundary, and successive undo commands undo | 1357 | command stops at such a boundary, and successive undo commands undo |
| 1344 | to earlier and earlier boundaries. This function returns @code{nil}. | 1358 | to earlier and earlier boundaries. This function returns @code{nil}. |
| 1345 | 1359 | ||
| 1346 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1347 | before executing each key sequence, so that each undo normally undoes | ||
| 1348 | the effects of one command. As an exception, the command | ||
| 1349 | @code{self-insert-command}, which produces self-inserting input | ||
| 1350 | characters (@pxref{Commands for Insertion}), may remove the boundary | ||
| 1351 | inserted by the command loop: a boundary is accepted for the first | ||
| 1352 | such character, the next 19 consecutive self-inserting input | ||
| 1353 | characters do not have boundaries, and then the 20th does; and so on | ||
| 1354 | as long as the self-inserting characters continue. Hence, sequences | ||
| 1355 | of consecutive character insertions can be undone as a group. | ||
| 1356 | |||
| 1357 | All buffer modifications add a boundary whenever the previous undoable | ||
| 1358 | change was made in some other buffer. This is to ensure that | ||
| 1359 | each command makes a boundary in each buffer where it makes changes. | ||
| 1360 | |||
| 1361 | Calling this function explicitly is useful for splitting the effects of | 1360 | Calling this function explicitly is useful for splitting the effects of |
| 1362 | a command into more than one unit. For example, @code{query-replace} | 1361 | a command into more than one unit. For example, @code{query-replace} |
| 1363 | calls @code{undo-boundary} after each replacement, so that the user can | 1362 | calls @code{undo-boundary} after each replacement, so that the user can |
| 1364 | undo individual replacements one by one. | 1363 | undo individual replacements one by one. |
| 1364 | |||
| 1365 | Mostly, however, this function is called automatically at an | ||
| 1366 | appropriate time. | ||
| 1367 | @end defun | ||
| 1368 | |||
| 1369 | @defun undo-auto-amalgamate | ||
| 1370 | @cindex amalgamating commands, and undo | ||
| 1371 | The editor command loop automatically calls @code{undo-boundary} just | ||
| 1372 | before executing each key sequence, so that each undo normally undoes | ||
| 1373 | the effects of one command. A few exceptional commands are | ||
| 1374 | @dfn{amalgamating}: these commands generally cause small changes to | ||
| 1375 | buffers, so with these a boundary is inserted only every 20th command, | ||
| 1376 | allowing to undo them as a group. By default, commands | ||
| 1377 | @code{self-insert-command}, which produces self-inserting input | ||
| 1378 | characters (@pxref{Commands for Insertion}), and @code{delete-char} | ||
| 1379 | which deletes characters (@pxref{Deletion}) are amalgamating. | ||
| 1380 | Where a command affects the contents of several buffers, as may happen, | ||
| 1381 | for example, when a function on the @code{post-command-hook} affects a | ||
| 1382 | buffer other than the @code{current-buffer}, then @code{undo-boundary} | ||
| 1383 | will be called in each of the affected buffers. | ||
| 1365 | @end defun | 1384 | @end defun |
| 1366 | 1385 | ||
| 1386 | @defvar undo-auto-current-boundary-timer | ||
| 1387 | Some buffers, such as process buffers, can change even when no | ||
| 1388 | commands are executing. In these cases, @code{undo-boundary} is | ||
| 1389 | normally called periodically by the timer in this variable. Setting | ||
| 1390 | this variable to non-@code{nil} prevents this behavior. | ||
| 1391 | @end defvar | ||
| 1392 | |||
| 1367 | @defvar undo-in-progress | 1393 | @defvar undo-in-progress |
| 1368 | This variable is normally @code{nil}, but the undo commands bind it to | 1394 | This variable is normally @code{nil}, but the undo commands bind it to |
| 1369 | @code{t}. This is so that various kinds of change hooks can tell when | 1395 | @code{t}. This is so that various kinds of change hooks can tell when |
| @@ -2336,6 +2362,84 @@ already indented, it calls @code{completion-at-point} to complete the | |||
| 2336 | text at point (@pxref{Completion in Buffers}). | 2362 | text at point (@pxref{Completion in Buffers}). |
| 2337 | @end defopt | 2363 | @end defopt |
| 2338 | 2364 | ||
| 2365 | @cindex literate programming | ||
| 2366 | @cindex multi-mode indentation | ||
| 2367 | Some major modes need to support embedded regions of text whose | ||
| 2368 | syntax belongs to a different major mode. Examples include | ||
| 2369 | @dfn{literate programming} source files that combine documentation and | ||
| 2370 | snippets of source code, Yacc/Bison programs that include snippets of | ||
| 2371 | plain C code, etc. To correctly indent the embedded chunks, the major | ||
| 2372 | mode needs to delegate the indentation to another mode's indentation | ||
| 2373 | engine (e.g., call @code{c-indent-defun} for C code or | ||
| 2374 | @code{python-indent-line} for Python), while providing it with some | ||
| 2375 | context to guide the indentation. The following facilities support | ||
| 2376 | such multi-mode indentation. | ||
| 2377 | |||
| 2378 | @defvar prog-indentation-context | ||
| 2379 | This variable, when non-@code{nil}, holds the indentation context for | ||
| 2380 | the sub-mode's indentation engine provided by the superior major mode. | ||
| 2381 | The value should be a list of the form @code{(@var{first-column} | ||
| 2382 | @w{(@var{start} . @var{end})} @code{prev-chunk})}. The members of the | ||
| 2383 | list have the following meaning: | ||
| 2384 | |||
| 2385 | @table @var | ||
| 2386 | @item first-column | ||
| 2387 | The column to be used for top-level constructs. This replaces the | ||
| 2388 | default value of the top-level column used by the sub-mode, usually | ||
| 2389 | zero. | ||
| 2390 | @item start | ||
| 2391 | @itemx end | ||
| 2392 | The region of the code chunk to be indented by the sub-mode. The | ||
| 2393 | value of @var{end} can be @code{nil}, which stands for the value of | ||
| 2394 | @code{point-max}. | ||
| 2395 | @item prev-chunk | ||
| 2396 | If this is non-@code{nil}, it should provide the sub-mode's | ||
| 2397 | indentation engine with a virtual context of the code chunk. Valid | ||
| 2398 | values include: | ||
| 2399 | |||
| 2400 | @itemize @minus | ||
| 2401 | @item | ||
| 2402 | A string whose contents is the text the sub-mode's indentation engine | ||
| 2403 | should consider to precede the code chunk. The sub-mode's indentation | ||
| 2404 | engine can add text properties to that string, to be reused in | ||
| 2405 | repeated calls with the same string, thus using it as a cache. An | ||
| 2406 | example where this is useful is code chunks that need to be indented | ||
| 2407 | as function bodies, but lack the function's preamble---the string | ||
| 2408 | could then include that missing preamble. | ||
| 2409 | @item | ||
| 2410 | A function. It is expected to be called with the start position of | ||
| 2411 | the current chunk, and should return a cons cell | ||
| 2412 | @w{@code{(@var{prev-start} . @var{prev-end})}} that specifies the | ||
| 2413 | region of the previous code chunk, or @code{nil} if there is no previous | ||
| 2414 | chunk. This is useful in literate-programming sources, where code is | ||
| 2415 | split into chunks, and correct indentation needs to access previous | ||
| 2416 | chunks. | ||
| 2417 | @end itemize | ||
| 2418 | @end table | ||
| 2419 | @end defvar | ||
| 2420 | |||
| 2421 | The following convenience functions should be used by major mode's | ||
| 2422 | indentation engine in support of invocations as sub-modes of another | ||
| 2423 | major mode. | ||
| 2424 | |||
| 2425 | @defun prog-first-column | ||
| 2426 | Call this function instead of using a literal value (usually, zero) of | ||
| 2427 | the column number for indenting top-level program constructs. The | ||
| 2428 | function's value is the column number to use for top-level constructs. | ||
| 2429 | When no superior mode is in effect, this function returns zero. | ||
| 2430 | @end defun | ||
| 2431 | |||
| 2432 | @defun prog-widen | ||
| 2433 | Call this function instead of @code{widen} to remove any restrictions | ||
| 2434 | imposed by the mode's indentation engine and restore the restrictions | ||
| 2435 | recorded in @code{prog-indentation-context}. This prevents the | ||
| 2436 | indentation engine of a sub-mode from inadvertently operating on text | ||
| 2437 | outside of the chunk it was supposed to indent, and preserves the | ||
| 2438 | restriction imposed by the superior mode. When no superior mode is in | ||
| 2439 | effect, this function just calls @code{widen}. | ||
| 2440 | @end defun | ||
| 2441 | |||
| 2442 | |||
| 2339 | @node Region Indent | 2443 | @node Region Indent |
| 2340 | @subsection Indenting an Entire Region | 2444 | @subsection Indenting an Entire Region |
| 2341 | 2445 | ||
| @@ -3256,8 +3360,8 @@ and then remove the property. @xref{Read Only Buffers}. | |||
| 3256 | 3360 | ||
| 3257 | @item inhibit-read-only | 3361 | @item inhibit-read-only |
| 3258 | @kindex inhibit-read-only @r{(text property)} | 3362 | @kindex inhibit-read-only @r{(text property)} |
| 3259 | If a character has the property @code{inhibit-read-only}, and the | 3363 | Characters that have the property @code{inhibit-read-only} can be |
| 3260 | buffer is read-only, editing the character in question is allowed. | 3364 | edited even in read-only buffers. @xref{Read Only Buffers}. |
| 3261 | 3365 | ||
| 3262 | @item invisible | 3366 | @item invisible |
| 3263 | @kindex invisible @r{(text property)} | 3367 | @kindex invisible @r{(text property)} |
diff --git a/doc/lispref/tips.texi b/doc/lispref/tips.texi index d9cbf473306..ffce920bf4e 100644 --- a/doc/lispref/tips.texi +++ b/doc/lispref/tips.texi | |||
| @@ -14,11 +14,17 @@ it gives advice on making effective use of the features described in the | |||
| 14 | previous chapters, and describes conventions Emacs Lisp programmers | 14 | previous chapters, and describes conventions Emacs Lisp programmers |
| 15 | should follow. | 15 | should follow. |
| 16 | 16 | ||
| 17 | @findex checkdoc | ||
| 18 | @findex checkdoc-current-buffer | ||
| 19 | @findex checkdoc-file | ||
| 17 | You can automatically check some of the conventions described below by | 20 | You can automatically check some of the conventions described below by |
| 18 | running the command @kbd{M-x checkdoc RET} when visiting a Lisp file. | 21 | running the command @kbd{M-x checkdoc RET} when visiting a Lisp file. |
| 19 | It cannot check all of the conventions, and not all the warnings it | 22 | It cannot check all of the conventions, and not all the warnings it |
| 20 | gives necessarily correspond to problems, but it is worth examining them | 23 | gives necessarily correspond to problems, but it is worth examining them |
| 21 | all. | 24 | all. Alternatively, use the command @kbd{M-x checkdoc-current-buffer RET} |
| 25 | to check the conventions in the current buffer, or @code{checkdoc-file} | ||
| 26 | when you want to check a file in batch mode, e.g., with a command run by | ||
| 27 | @kbd{@w{M-x compile RET}}. | ||
| 22 | 28 | ||
| 23 | @menu | 29 | @menu |
| 24 | * Coding Conventions:: Conventions for clean and robust programs. | 30 | * Coding Conventions:: Conventions for clean and robust programs. |
| @@ -1007,8 +1013,14 @@ of multiple files, we recommend not writing the version in every file, | |||
| 1007 | but only the main one. | 1013 | but only the main one. |
| 1008 | 1014 | ||
| 1009 | @item Keywords | 1015 | @item Keywords |
| 1016 | @vindex checkdoc-package-keywords-flag | ||
| 1017 | @findex checkdoc-package-keywords | ||
| 1010 | This line lists keywords for the @code{finder-by-keyword} help command. | 1018 | This line lists keywords for the @code{finder-by-keyword} help command. |
| 1011 | Please use that command to see a list of the meaningful keywords. | 1019 | Please use that command to see a list of the meaningful keywords. The |
| 1020 | command @kbd{M-x checkdoc-package-keywords RET} will find and display | ||
| 1021 | any keywords that are not in @code{finder-known-keywords}. If you set | ||
| 1022 | the variable @code{checkdoc-package-keywords-flag} non-@code{nil}, | ||
| 1023 | checkdoc commands will include the keyword verification in its checks. | ||
| 1012 | 1024 | ||
| 1013 | This field is how people will find your package when they're looking | 1025 | This field is how people will find your package when they're looking |
| 1014 | for things by topic. To separate the keywords, you can use spaces, | 1026 | for things by topic. To separate the keywords, you can use spaces, |
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi index 357247ef433..e45201b0570 100644 --- a/doc/lispref/windows.texi +++ b/doc/lispref/windows.texi | |||
| @@ -133,6 +133,30 @@ This function returns the selected window (which is always a live | |||
| 133 | window). | 133 | window). |
| 134 | @end defun | 134 | @end defun |
| 135 | 135 | ||
| 136 | @anchor{Window Group}Sometimes several windows collectively and | ||
| 137 | cooperatively display a buffer, for example, under the management of | ||
| 138 | Follow Mode (@pxref{Follow Mode,,, emacs}), where the windows together | ||
| 139 | display a bigger portion of the buffer than one window could alone. | ||
| 140 | It is often useful to consider such a @dfn{window group} as a single | ||
| 141 | entity. Several functions such as @code{window-group-start} | ||
| 142 | (@pxref{Window Start and End}) allow you to do this by supplying, as | ||
| 143 | an argument, one of the windows as a stand in for the whole group. | ||
| 144 | |||
| 145 | @defun selected-window-group | ||
| 146 | @vindex selected-window-group-function | ||
| 147 | When the selected window is a member of a group of windows, this | ||
| 148 | function returns a list of the windows in the group, ordered such that | ||
| 149 | the first window in the list is displaying the earliest part of the | ||
| 150 | buffer, and so on. Otherwise the function returns a list containing | ||
| 151 | just the selected window. | ||
| 152 | |||
| 153 | The selected window is considered part of a group when the buffer | ||
| 154 | local variable @code{selected-window-group-function} is set to a | ||
| 155 | function. In this case, @code{selected-window-group} calls it with no | ||
| 156 | arguments and returns its result (which should be the list of windows | ||
| 157 | in the group). | ||
| 158 | @end defun | ||
| 159 | |||
| 136 | @node Windows and Frames | 160 | @node Windows and Frames |
| 137 | @section Windows and Frames | 161 | @section Windows and Frames |
| 138 | 162 | ||
| @@ -521,9 +545,9 @@ its pixel height is the pixel height of the screen areas spanned by its | |||
| 521 | children. | 545 | children. |
| 522 | @end defun | 546 | @end defun |
| 523 | 547 | ||
| 524 | @cindex window pixel height | 548 | @cindex window pixel width |
| 525 | @cindex pixel height of a window | 549 | @cindex pixel width of a window |
| 526 | @cindex total pixel height of a window | 550 | @cindex total pixel width of a window |
| 527 | 551 | ||
| 528 | @defun window-pixel-width &optional Lisp_Object &optional window | 552 | @defun window-pixel-width &optional Lisp_Object &optional window |
| 529 | This function returns the width of window @var{window} in pixels. | 553 | This function returns the width of window @var{window} in pixels. |
| @@ -558,7 +582,6 @@ that of the root window on that frame. If @var{window} is omitted or | |||
| 558 | 582 | ||
| 559 | @cindex window body height | 583 | @cindex window body height |
| 560 | @cindex body height of a window | 584 | @cindex body height of a window |
| 561 | @cindex window body width | ||
| 562 | The @dfn{body height} of a window is the height of its text area, which | 585 | The @dfn{body height} of a window is the height of its text area, which |
| 563 | does not include a mode or header line, a horizontal scroll bar, or a | 586 | does not include a mode or header line, a horizontal scroll bar, or a |
| 564 | bottom divider. | 587 | bottom divider. |
| @@ -578,9 +601,8 @@ counted. It also means that the height of a window's body can never | |||
| 578 | exceed its total height as returned by @code{window-total-height}. | 601 | exceed its total height as returned by @code{window-total-height}. |
| 579 | @end defun | 602 | @end defun |
| 580 | 603 | ||
| 604 | @cindex window body width | ||
| 581 | @cindex body width of a window | 605 | @cindex body width of a window |
| 582 | @cindex body size of a window | ||
| 583 | @cindex window body size | ||
| 584 | The @dfn{body width} of a window is the width of its text area, which | 606 | The @dfn{body width} of a window is the width of its text area, which |
| 585 | does not include the scroll bar, fringes, margins or a right divider. | 607 | does not include the scroll bar, fringes, margins or a right divider. |
| 586 | 608 | ||
| @@ -599,6 +621,8 @@ counted. It also means that the width of a window's body can never | |||
| 599 | exceed its total width as returned by @code{window-total-width}. | 621 | exceed its total width as returned by @code{window-total-width}. |
| 600 | @end defun | 622 | @end defun |
| 601 | 623 | ||
| 624 | @cindex window body size | ||
| 625 | @cindex body size of a window | ||
| 602 | @defun window-body-size &optional window horizontal pixelwise | 626 | @defun window-body-size &optional window horizontal pixelwise |
| 603 | This function returns the body height or body width of @var{window}. If | 627 | This function returns the body height or body width of @var{window}. If |
| 604 | @var{horizontal} is omitted or @code{nil}, it is equivalent to calling | 628 | @var{horizontal} is omitted or @code{nil}, it is equivalent to calling |
| @@ -607,7 +631,7 @@ to calling @code{window-body-width}. In either case, the optional | |||
| 607 | argument @var{pixelwise} is passed to the function called. | 631 | argument @var{pixelwise} is passed to the function called. |
| 608 | @end defun | 632 | @end defun |
| 609 | 633 | ||
| 610 | For compatibility with previous versions of Emacs, | 634 | For compatibility with previous versions of Emacs, |
| 611 | @code{window-height} is an alias for @code{window-total-height}, and | 635 | @code{window-height} is an alias for @code{window-total-height}, and |
| 612 | @code{window-width} is an alias for @code{window-body-width}. These | 636 | @code{window-width} is an alias for @code{window-body-width}. These |
| 613 | aliases are considered obsolete and will be removed in the future. | 637 | aliases are considered obsolete and will be removed in the future. |
| @@ -635,6 +659,22 @@ Functions for retrieving the height and/or width of window dividers | |||
| 635 | (@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are | 659 | (@pxref{Scroll Bars}), and display margins (@pxref{Display Margins}) are |
| 636 | described in the corresponding sections. | 660 | described in the corresponding sections. |
| 637 | 661 | ||
| 662 | If your Lisp program needs to make layout decisions, you will find the | ||
| 663 | following function useful: | ||
| 664 | |||
| 665 | @defun window-max-chars-per-line &optional window face | ||
| 666 | This function returns the number of characters displayed in the | ||
| 667 | specified @var{face} in the specified @var{window} (which must be a | ||
| 668 | live window). If @var{face} was remapped (@pxref{Face Remapping}), | ||
| 669 | the information is returned for the remapped face. If omitted or | ||
| 670 | @code{nil}, @var{face} defaults to the default face, and @var{window} | ||
| 671 | defaults to the selected window. Unlike @code{window-body-width}, | ||
| 672 | this function accounts for the actual size of the @var{face}'s font, | ||
| 673 | instead of working in units of frame's canonical character width. It | ||
| 674 | also accounts for space used by the continuation glyph, if | ||
| 675 | @var{window} lacks one or both of its fringes. | ||
| 676 | @end defun | ||
| 677 | |||
| 638 | @cindex fixed-size window | 678 | @cindex fixed-size window |
| 639 | @vindex window-min-height | 679 | @vindex window-min-height |
| 640 | @vindex window-min-width | 680 | @vindex window-min-width |
| @@ -643,7 +683,7 @@ or split them (@pxref{Splitting Windows}), obey the variables | |||
| 643 | @code{window-min-height} and @code{window-min-width}, which specify the | 683 | @code{window-min-height} and @code{window-min-width}, which specify the |
| 644 | smallest allowable window height and width. They also obey the variable | 684 | smallest allowable window height and width. They also obey the variable |
| 645 | @code{window-size-fixed}, with which a window can be @dfn{fixed} in | 685 | @code{window-size-fixed}, with which a window can be @dfn{fixed} in |
| 646 | size: | 686 | size (@pxref{Preserving Window Sizes}). |
| 647 | 687 | ||
| 648 | @defopt window-min-height | 688 | @defopt window-min-height |
| 649 | This option specifies the minimum total height, in lines, of any window. | 689 | This option specifies the minimum total height, in lines, of any window. |
| @@ -3082,6 +3122,17 @@ window-start position; if you move point, do not expect the window-start | |||
| 3082 | position to change in response until after the next redisplay. | 3122 | position to change in response until after the next redisplay. |
| 3083 | @end defun | 3123 | @end defun |
| 3084 | 3124 | ||
| 3125 | @defun window-group-start &optional window | ||
| 3126 | @vindex window-group-start-function | ||
| 3127 | This function is like @code{window-start}, except that when | ||
| 3128 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3129 | @code{window-group-start} returns the start position of the entire | ||
| 3130 | group. This condition holds when the buffer local variable | ||
| 3131 | @code{window-group-start-function} is set to a function. In this | ||
| 3132 | case, @code{window-group-start} calls the function with the single | ||
| 3133 | argument @var{window}, then returns its result. | ||
| 3134 | @end defun | ||
| 3135 | |||
| 3085 | @cindex window end position | 3136 | @cindex window end position |
| 3086 | @defun window-end &optional window update | 3137 | @defun window-end &optional window update |
| 3087 | This function returns the position where display of its buffer ends in | 3138 | This function returns the position where display of its buffer ends in |
| @@ -3108,6 +3159,18 @@ way real redisplay would do. It does not alter the | |||
| 3108 | text will end if scrolling is not required. | 3159 | text will end if scrolling is not required. |
| 3109 | @end defun | 3160 | @end defun |
| 3110 | 3161 | ||
| 3162 | @vindex window-group-end-function | ||
| 3163 | @defun window-group-end window update | ||
| 3164 | This function is like @code{window-end}, except that when @var{window} | ||
| 3165 | is a part of a group of windows (@pxref{Window Group}), | ||
| 3166 | @code{window-group-end} returns the end position of the entire group. | ||
| 3167 | This condition holds when the buffer local variable | ||
| 3168 | @code{window-group-end-function} is set to a function. In this case, | ||
| 3169 | @code{window-group-end} calls the function with the two arguments | ||
| 3170 | @var{window} and @var{update}, then returns its result. The argument | ||
| 3171 | @var{update} has the same meaning as in @code{window-end}. | ||
| 3172 | @end defun | ||
| 3173 | |||
| 3111 | @defun set-window-start window position &optional noforce | 3174 | @defun set-window-start window position &optional noforce |
| 3112 | This function sets the display-start position of @var{window} to | 3175 | This function sets the display-start position of @var{window} to |
| 3113 | @var{position} in @var{window}'s buffer. It returns @var{position}. | 3176 | @var{position} in @var{window}'s buffer. It returns @var{position}. |
| @@ -3171,6 +3234,19 @@ off screen at the next redisplay, then redisplay computes a new window-start | |||
| 3171 | position that works well with point, and thus @var{position} is not used. | 3234 | position that works well with point, and thus @var{position} is not used. |
| 3172 | @end defun | 3235 | @end defun |
| 3173 | 3236 | ||
| 3237 | @vindex set-window-group-start-function | ||
| 3238 | @defun set-window-group-start window position &optional noforce | ||
| 3239 | This function is like @code{set-window-start}, except that when | ||
| 3240 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3241 | @code{set-window-group-start} sets the start position of the entire | ||
| 3242 | group. This condition holds when the buffer local variable | ||
| 3243 | @code{set-window-group-start-function} is set to a function. In this | ||
| 3244 | case, @code{set-window-group-start} calls the function with the three | ||
| 3245 | arguments @var{window}, @var{position}, and @var{noforce}, then | ||
| 3246 | returns its result. The arguments @var{position} and @var{noforce} in | ||
| 3247 | this function have the same meaning as in @code{set-window-start}. | ||
| 3248 | @end defun | ||
| 3249 | |||
| 3174 | @defun pos-visible-in-window-p &optional position window partially | 3250 | @defun pos-visible-in-window-p &optional position window partially |
| 3175 | This function returns non-@code{nil} if @var{position} is within the | 3251 | This function returns non-@code{nil} if @var{position} is within the |
| 3176 | range of text currently visible on the screen in @var{window}. It | 3252 | range of text currently visible on the screen in @var{window}. It |
| @@ -3212,6 +3288,21 @@ Here is an example: | |||
| 3212 | @end example | 3288 | @end example |
| 3213 | @end defun | 3289 | @end defun |
| 3214 | 3290 | ||
| 3291 | @vindex pos-visible-in-window-group-p-function | ||
| 3292 | @defun pos-visible-in-window-group-p &optional position window partially | ||
| 3293 | This function is like @code{pos-visible-in-window-p}, except that when | ||
| 3294 | @var{window} is a part of a group of windows (@pxref{Window Group}), | ||
| 3295 | @code{pos-visible-in-window-group-p} tests the visibility of @var{pos} | ||
| 3296 | in the entire group, not just in the single @var{window}. This | ||
| 3297 | condition holds when the buffer local variable | ||
| 3298 | @code{pos-visible-in-window-group-p-function} is set to a function. | ||
| 3299 | In this case @code{pos-visible-in-window-group-p} calls the function | ||
| 3300 | with the three arguments @var{position}, @var{window}, and | ||
| 3301 | @var{partially}, then returns its result. The arguments | ||
| 3302 | @var{position} and @var{partially} have the same meaning as in | ||
| 3303 | @code{pos-visible-in-window-p}. | ||
| 3304 | @end defun | ||
| 3305 | |||
| 3215 | @defun window-line-height &optional line window | 3306 | @defun window-line-height &optional line window |
| 3216 | This function returns the height of text line @var{line} in | 3307 | This function returns the height of text line @var{line} in |
| 3217 | @var{window}. If @var{line} is one of @code{header-line} or | 3308 | @var{window}. If @var{line} is one of @code{header-line} or |
| @@ -3455,6 +3546,19 @@ the top of the window. The command @code{recenter-top-bottom} offers | |||
| 3455 | a more convenient way to achieve this. | 3546 | a more convenient way to achieve this. |
| 3456 | @end deffn | 3547 | @end deffn |
| 3457 | 3548 | ||
| 3549 | @vindex recenter-window-group-function | ||
| 3550 | @defun recenter-window-group &optional count | ||
| 3551 | This function is like @code{recenter}, except that when the selected | ||
| 3552 | window is part of a group of windows (@pxref{Window Group}), | ||
| 3553 | @code{recenter-window-group} scrolls the entire group. This condition | ||
| 3554 | holds when the buffer local variable | ||
| 3555 | @code{recenter-window-group-function} is set to a function. In this | ||
| 3556 | case, @code{recenter-window-group} calls the function with the | ||
| 3557 | argument @var{count}, then returns its result. The argument | ||
| 3558 | @var{count} has the same meaning as in @code{recenter}, but with | ||
| 3559 | respect to the entire window group. | ||
| 3560 | @end defun | ||
| 3561 | |||
| 3458 | @defopt recenter-redisplay | 3562 | @defopt recenter-redisplay |
| 3459 | If this variable is non-@code{nil}, calling @code{recenter} with a | 3563 | If this variable is non-@code{nil}, calling @code{recenter} with a |
| 3460 | @code{nil} argument redraws the frame. The default value is | 3564 | @code{nil} argument redraws the frame. The default value is |
| @@ -4264,10 +4368,10 @@ work. | |||
| 4264 | @end defvar | 4368 | @end defvar |
| 4265 | 4369 | ||
| 4266 | @defvar window-size-change-functions | 4370 | @defvar window-size-change-functions |
| 4267 | This variable holds a list of functions to be called if the size of any | 4371 | This variable holds a list of functions to be called if the size of |
| 4268 | window changes for any reason. The functions are called just once per | 4372 | any window changes for any reason. The functions are called at the |
| 4269 | redisplay, and just once for each frame on which size changes have | 4373 | beginning of a redisplay cycle, and just once for each frame on which |
| 4270 | occurred. | 4374 | size changes have occurred. |
| 4271 | 4375 | ||
| 4272 | Each function receives the frame as its sole argument. There is no | 4376 | Each function receives the frame as its sole argument. There is no |
| 4273 | direct way to find out which windows on that frame have changed size, or | 4377 | direct way to find out which windows on that frame have changed size, or |
diff --git a/doc/man/etags.1 b/doc/man/etags.1 index fab8901427d..7cb6b6cb6ab 100644 --- a/doc/man/etags.1 +++ b/doc/man/etags.1 | |||
| @@ -51,7 +51,7 @@ format understood by | |||
| 51 | \&. Both forms of the program understand | 51 | \&. Both forms of the program understand |
| 52 | the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang, | 52 | the syntax of C, Objective C, C++, Java, Fortran, Ada, Cobol, Erlang, |
| 53 | Forth, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl, | 53 | Forth, HTML, LaTeX, Emacs Lisp/Common Lisp, Lua, Makefile, Pascal, Perl, |
| 54 | PHP, PostScript, Python, Prolog, Scheme and | 54 | Ruby, PHP, PostScript, Python, Prolog, Scheme and |
| 55 | most assembler\-like syntaxes. | 55 | most assembler\-like syntaxes. |
| 56 | Both forms read the files specified on the command line, and write a tag | 56 | Both forms read the files specified on the command line, and write a tag |
| 57 | table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for | 57 | table (defaults: \fBTAGS\fP for \fBetags\fP, \fBtags\fP for |
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi index 8579d0f16f5..02f94469c71 100644 --- a/doc/misc/calc.texi +++ b/doc/misc/calc.texi | |||
| @@ -12597,7 +12597,6 @@ in this mode. Explicit simplification commands, such as @kbd{=} or | |||
| 12597 | @xref{Algebraic Definitions}, for a sample use of | 12597 | @xref{Algebraic Definitions}, for a sample use of |
| 12598 | No-Simplification mode. | 12598 | No-Simplification mode. |
| 12599 | 12599 | ||
| 12600 | |||
| 12601 | @kindex m N | 12600 | @kindex m N |
| 12602 | @pindex calc-num-simplify-mode | 12601 | @pindex calc-num-simplify-mode |
| 12603 | The @kbd{m N} (@code{calc-num-simplify-mode}) command turns off simplification | 12602 | The @kbd{m N} (@code{calc-num-simplify-mode}) command turns off simplification |
| @@ -22463,7 +22462,6 @@ Hyperbolic prefix @kbd{H} can be used similarly; the @kbd{H a s} will | |||
| 22463 | replace any hyperbolic functions in the formula with the appropriate | 22462 | replace any hyperbolic functions in the formula with the appropriate |
| 22464 | combinations of @samp{sinh}s and @samp{cosh}s before simplifying. | 22463 | combinations of @samp{sinh}s and @samp{cosh}s before simplifying. |
| 22465 | 22464 | ||
| 22466 | |||
| 22467 | @menu | 22465 | @menu |
| 22468 | * Basic Simplifications:: | 22466 | * Basic Simplifications:: |
| 22469 | * Algebraic Simplifications:: | 22467 | * Algebraic Simplifications:: |
| @@ -28032,7 +28030,7 @@ column of the Units Table. | |||
| 28032 | @noindent | 28030 | @noindent |
| 28033 | The definitions of many units have changed over the years. For example, | 28031 | The definitions of many units have changed over the years. For example, |
| 28034 | the meter was originally defined in 1791 as one ten-millionth of the | 28032 | the meter was originally defined in 1791 as one ten-millionth of the |
| 28035 | distance from the equator to the north pole. In order to be more | 28033 | distance from the Equator to the North Pole. In order to be more |
| 28036 | precise, the definition was adjusted several times, and now a meter is | 28034 | precise, the definition was adjusted several times, and now a meter is |
| 28037 | defined as the distance that light will travel in a vacuum in | 28035 | defined as the distance that light will travel in a vacuum in |
| 28038 | 1/299792458 of a second; consequently, the speed of light in a | 28036 | 1/299792458 of a second; consequently, the speed of light in a |
| @@ -28071,13 +28069,8 @@ of the various temperature scales. | |||
| 28071 | The unit of volume ``liters'' can be referred to by either the lower-case | 28069 | The unit of volume ``liters'' can be referred to by either the lower-case |
| 28072 | @code{l} or the upper-case @code{L}. | 28070 | @code{l} or the upper-case @code{L}. |
| 28073 | 28071 | ||
| 28074 | The unit @code{A} stands for Amperes; the name @code{Ang} is used | 28072 | The unit @code{A} stands for amperes; the name @code{Ang} is used |
| 28075 | @tex | 28073 | for angstroms. |
| 28076 | for \AA ngstroms. | ||
| 28077 | @end tex | ||
| 28078 | @ifnottex | ||
| 28079 | for Angstroms. | ||
| 28080 | @end ifnottex | ||
| 28081 | 28074 | ||
| 28082 | The unit @code{pt} stands for pints; the name @code{point} stands for | 28075 | The unit @code{pt} stands for pints; the name @code{point} stands for |
| 28083 | a typographical point, defined by @samp{72 point = 1 in}. This is | 28076 | a typographical point, defined by @samp{72 point = 1 in}. This is |
| @@ -28099,7 +28092,6 @@ use the @samp{tex} prefix; the unit name for a @TeX{} point will be | |||
| 28099 | the unit names for pint and parsec will simply be @samp{pint} and | 28092 | the unit names for pint and parsec will simply be @samp{pint} and |
| 28100 | @samp{parsec} instead of @samp{pt} and @samp{pc}. | 28093 | @samp{parsec} instead of @samp{pt} and @samp{pc}. |
| 28101 | 28094 | ||
| 28102 | |||
| 28103 | The unit @code{e} stands for the elementary (electron) unit of charge; | 28095 | The unit @code{e} stands for the elementary (electron) unit of charge; |
| 28104 | because algebra command could mistake this for the special constant | 28096 | because algebra command could mistake this for the special constant |
| 28105 | @expr{e}, Calc provides the alternate unit name @code{ech} which is | 28097 | @expr{e}, Calc provides the alternate unit name @code{ech} which is |
| @@ -28496,7 +28488,6 @@ a frequency or a midi number to scientific pitch notation. For | |||
| 28496 | example, @code{500 Hz} gets converted to | 28488 | example, @code{500 Hz} gets converted to |
| 28497 | @code{B_4 + 21.3094853649 cents} and @code{84} to @code{C_6}. | 28489 | @code{B_4 + 21.3094853649 cents} and @code{84} to @code{C_6}. |
| 28498 | 28490 | ||
| 28499 | |||
| 28500 | @kindex l m | 28491 | @kindex l m |
| 28501 | @pindex calc-midi | 28492 | @pindex calc-midi |
| 28502 | @tindex midi | 28493 | @tindex midi |
| @@ -28527,7 +28518,6 @@ notation @code{B_3 + 99.9962592773 cents}; with the default value of | |||
| 28527 | @code{1}, Calc converts @code{261.625 Hz} to @code{C_4}. | 28518 | @code{1}, Calc converts @code{261.625 Hz} to @code{C_4}. |
| 28528 | 28519 | ||
| 28529 | 28520 | ||
| 28530 | |||
| 28531 | @node Store and Recall, Graphics, Units, Top | 28521 | @node Store and Recall, Graphics, Units, Top |
| 28532 | @chapter Storing and Recalling | 28522 | @chapter Storing and Recalling |
| 28533 | 28523 | ||
| @@ -29907,7 +29897,7 @@ The @kbd{C-y} command can be given a prefix, which will interpret the | |||
| 29907 | text being yanked with a different radix. If the text being yanked can be | 29897 | text being yanked with a different radix. If the text being yanked can be |
| 29908 | interpreted as a binary, octal, hexadecimal, or decimal number, then a | 29898 | interpreted as a binary, octal, hexadecimal, or decimal number, then a |
| 29909 | prefix of @kbd{2}, @kbd{8}, @kbd{6} or @kbd{0} will have Calc | 29899 | prefix of @kbd{2}, @kbd{8}, @kbd{6} or @kbd{0} will have Calc |
| 29910 | interpret the yanked text as a number in the appropriate base. For example, | 29900 | interpret the yanked text as a number in the appropriate base. For example, |
| 29911 | if @samp{111} has just been killed and is yanked into Calc with a command | 29901 | if @samp{111} has just been killed and is yanked into Calc with a command |
| 29912 | of @kbd{C-2 C-y}, then the number @samp{7} will be put on the stack. | 29902 | of @kbd{C-2 C-y}, then the number @samp{7} will be put on the stack. |
| 29913 | If you use the plain prefix @kbd{C-u}, then you will be prompted for a | 29903 | If you use the plain prefix @kbd{C-u}, then you will be prompted for a |
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index 9b488cb3125..7415da5d5bd 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi | |||
| @@ -2461,7 +2461,7 @@ handled a little differently from the other style variables. It's | |||
| 2461 | default global binding is the empty list @code{nil}, rather than | 2461 | default global binding is the empty list @code{nil}, rather than |
| 2462 | @code{set-from-style}. Before the style system is initialized, you | 2462 | @code{set-from-style}. Before the style system is initialized, you |
| 2463 | can add individual elements to @code{c-offsets-alist} by calling | 2463 | can add individual elements to @code{c-offsets-alist} by calling |
| 2464 | @code{c-set-offset}(@pxref{c-offsets-alist}) just like you would set | 2464 | @code{c-set-offset} (@pxref{c-offsets-alist}) just like you would set |
| 2465 | other style variables with @code{setq}. Those elements will then | 2465 | other style variables with @code{setq}. Those elements will then |
| 2466 | prevail when the style system later initializes a buffer-local copy of | 2466 | prevail when the style system later initializes a buffer-local copy of |
| 2467 | @code{c-offsets-alist}. | 2467 | @code{c-offsets-alist}. |
| @@ -5234,13 +5234,13 @@ This command changes the entry for a syntactic symbol in the current | |||
| 5234 | binding of @code{c-offsets-alist}, or it inserts a new entry if there | 5234 | binding of @code{c-offsets-alist}, or it inserts a new entry if there |
| 5235 | isn't already one for that syntactic symbol. | 5235 | isn't already one for that syntactic symbol. |
| 5236 | 5236 | ||
| 5237 | You can use @code{c-set-offsets} interactively within a @ccmode{} | 5237 | You can use @code{c-set-offset} interactively within a @ccmode{} |
| 5238 | buffer to make experimental changes to your indentation settings. | 5238 | buffer to make experimental changes to your indentation settings. |
| 5239 | @kbd{C-c C-o} prompts you for the syntactic symbol to change | 5239 | @kbd{C-c C-o} prompts you for the syntactic symbol to change |
| 5240 | (defaulting to that of the current line) and the new offset | 5240 | (defaulting to that of the current line) and the new offset |
| 5241 | (defaulting to the current offset). | 5241 | (defaulting to the current offset). |
| 5242 | 5242 | ||
| 5243 | @code{c-set-offsets} takes two arguments when used programmatically: | 5243 | @code{c-set-offset} takes two arguments when used programmatically: |
| 5244 | @var{symbol}, the syntactic element symbol to change and @var{offset}, | 5244 | @var{symbol}, the syntactic element symbol to change and @var{offset}, |
| 5245 | the new offset for that syntactic element. You can call the command | 5245 | the new offset for that syntactic element. You can call the command |
| 5246 | in your @file{.emacs} to change the global binding of | 5246 | in your @file{.emacs} to change the global binding of |
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index 1f38ca98c62..0ab2477b86d 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi | |||
| @@ -2937,7 +2937,7 @@ error if the argument is not an integer. | |||
| 2937 | 2937 | ||
| 2938 | @defun cl-digit-char-p char radix | 2938 | @defun cl-digit-char-p char radix |
| 2939 | Test if @var{char} is a digit in the specified @var{radix} (default is | 2939 | Test if @var{char} is a digit in the specified @var{radix} (default is |
| 2940 | 10). If true return the decimal value of digit @var{char} in | 2940 | 10). If it is, return the numerical value of digit @var{char} in |
| 2941 | @var{radix}. | 2941 | @var{radix}. |
| 2942 | @end defun | 2942 | @end defun |
| 2943 | 2943 | ||
| @@ -3027,9 +3027,10 @@ of @code{cl-truncate}. | |||
| 3027 | This function implements the Common Lisp @code{parse-integer} | 3027 | This function implements the Common Lisp @code{parse-integer} |
| 3028 | function. It parses an integer in the specified @var{radix} from the | 3028 | function. It parses an integer in the specified @var{radix} from the |
| 3029 | substring of @var{string} between @var{start} and @var{end}. Any | 3029 | substring of @var{string} between @var{start} and @var{end}. Any |
| 3030 | leading and trailing whitespace chars are ignored. It signals an error | 3030 | leading and trailing whitespace chars are ignored. The function |
| 3031 | if the substring between @var{start} and @var{end} cannot be parsed as | 3031 | signals an error if the substring between @var{start} and @var{end} |
| 3032 | an integer unless @var{junk-allowed} is non-nil. | 3032 | cannot be parsed as an integer, unless @var{junk-allowed} is |
| 3033 | non-@code{nil}. | ||
| 3033 | @end defun | 3034 | @end defun |
| 3034 | 3035 | ||
| 3035 | @node Random Numbers | 3036 | @node Random Numbers |
diff --git a/doc/misc/ert.texi b/doc/misc/ert.texi index 35d315c64b8..c2363237b97 100644 --- a/doc/misc/ert.texi +++ b/doc/misc/ert.texi | |||
| @@ -283,6 +283,15 @@ with a zero exit status if all tests passed, or nonzero if any tests | |||
| 283 | failed or if anything else went wrong. It will also print progress | 283 | failed or if anything else went wrong. It will also print progress |
| 284 | messages and error diagnostics to standard output. | 284 | messages and error diagnostics to standard output. |
| 285 | 285 | ||
| 286 | You can also redirect the above output to a log file, say | ||
| 287 | @file{output.log}, and use the | ||
| 288 | @code{ert-summarize-tests-batch-and-exit} function to produce a neat | ||
| 289 | summary as shown below: | ||
| 290 | |||
| 291 | @example | ||
| 292 | emacs -batch -l ert -f ert-summarize-tests-batch-and-exit output.log | ||
| 293 | @end example | ||
| 294 | |||
| 286 | If ERT is not part of your Emacs distribution, you may need to use | 295 | If ERT is not part of your Emacs distribution, you may need to use |
| 287 | @code{-L /path/to/ert/} so that Emacs can find it. You may need | 296 | @code{-L /path/to/ert/} so that Emacs can find it. You may need |
| 288 | additional @code{-L} flags to ensure that @code{my-tests.el} and all the | 297 | additional @code{-L} flags to ensure that @code{my-tests.el} and all the |
diff --git a/doc/misc/eudc.texi b/doc/misc/eudc.texi index 33c9a0eb3a9..8d59e97b44e 100644 --- a/doc/misc/eudc.texi +++ b/doc/misc/eudc.texi | |||
| @@ -9,11 +9,10 @@ | |||
| 9 | @c %**end of header | 9 | @c %**end of header |
| 10 | 10 | ||
| 11 | @copying | 11 | @copying |
| 12 | This file documents EUDC v1.30b. | 12 | This file documents EUDC version 1.40.0. |
| 13 | 13 | ||
| 14 | EUDC is the Emacs Unified Directory Client, a common interface to | 14 | EUDC is the Emacs Unified Directory Client, a common interface to |
| 15 | directory servers using various protocols such as LDAP or the CCSO white | 15 | directory servers and contact information. |
| 16 | pages directory system (PH/QI) | ||
| 17 | 16 | ||
| 18 | Copyright @copyright{} 1998, 2000--2015 Free Software Foundation, Inc. | 17 | Copyright @copyright{} 1998, 2000--2015 Free Software Foundation, Inc. |
| 19 | 18 | ||
| @@ -32,7 +31,7 @@ modify this GNU manual.'' | |||
| 32 | 31 | ||
| 33 | @dircategory Emacs network features | 32 | @dircategory Emacs network features |
| 34 | @direntry | 33 | @direntry |
| 35 | * EUDC: (eudc). Emacs client for directory servers (LDAP, PH). | 34 | * EUDC: (eudc). Emacs client for directory servers (LDAP, BBDB). |
| 36 | @end direntry | 35 | @end direntry |
| 37 | 36 | ||
| 38 | @footnotestyle end | 37 | @footnotestyle end |
| @@ -41,7 +40,7 @@ modify this GNU manual.'' | |||
| 41 | @title EUDC Manual | 40 | @title EUDC Manual |
| 42 | @subtitle The Emacs Unified Directory Client | 41 | @subtitle The Emacs Unified Directory Client |
| 43 | @author by Oscar Figueiredo | 42 | @author by Oscar Figueiredo |
| 44 | @code{1.30b} | 43 | @code{1.40.0} |
| 45 | 44 | ||
| 46 | @page | 45 | @page |
| 47 | @vskip 0pt plus 1fill | 46 | @vskip 0pt plus 1fill |
| @@ -83,8 +82,6 @@ Currently supported back-ends are: | |||
| 83 | @item | 82 | @item |
| 84 | LDAP, Lightweight Directory Access Protocol | 83 | LDAP, Lightweight Directory Access Protocol |
| 85 | @item | 84 | @item |
| 86 | CCSO PH/QI | ||
| 87 | @item | ||
| 88 | BBDB, Big Brother's Insidious Database | 85 | BBDB, Big Brother's Insidious Database |
| 89 | @end itemize | 86 | @end itemize |
| 90 | 87 | ||
| @@ -109,7 +106,6 @@ Interface to BBDB to let you insert server records into your own BBDB database | |||
| 109 | 106 | ||
| 110 | @menu | 107 | @menu |
| 111 | * LDAP:: What is LDAP ? | 108 | * LDAP:: What is LDAP ? |
| 112 | * CCSO PH/QI:: What is CCSO, PH, QI ? | ||
| 113 | * BBDB:: What is BBDB ? | 109 | * BBDB:: What is BBDB ? |
| 114 | @end menu | 110 | @end menu |
| 115 | 111 | ||
| @@ -141,30 +137,6 @@ EUDC requires external support to access LDAP directory servers | |||
| 141 | (@pxref{LDAP Configuration}) | 137 | (@pxref{LDAP Configuration}) |
| 142 | 138 | ||
| 143 | 139 | ||
| 144 | @node CCSO PH/QI | ||
| 145 | @section CCSO PH/QI | ||
| 146 | |||
| 147 | The Central Computing Services Office (CCSO) of the University of | ||
| 148 | Illinois at Urbana Champaign created and freely distributed a | ||
| 149 | directory system that was used by many organizations in the 1990s. | ||
| 150 | The system records information about people such as their address, | ||
| 151 | phone number, email, academic information or any other details it was | ||
| 152 | configured to. Nowadays this system is not widely used. | ||
| 153 | |||
| 154 | The system consists of two parts: a database server traditionally called | ||
| 155 | @samp{qi} and a command-line client called @samp{ph}. | ||
| 156 | @ignore | ||
| 157 | Until 2010, the code could be downloaded from | ||
| 158 | @url{http://www-dev.cites.uiuc.edu/ph/}. | ||
| 159 | @end ignore | ||
| 160 | |||
| 161 | The original command-line @samp{ph} client that came with the | ||
| 162 | @samp{ph/qi} distribution provided additional features that are | ||
| 163 | not implemented in EUDC, like the possibility to communicate with the | ||
| 164 | server in login-mode, which made it possible to change records in the | ||
| 165 | database. | ||
| 166 | |||
| 167 | |||
| 168 | @node BBDB | 140 | @node BBDB |
| 169 | @section BBDB | 141 | @section BBDB |
| 170 | 142 | ||
| @@ -175,14 +147,14 @@ and news readers. | |||
| 175 | 147 | ||
| 176 | It is often used as an enhanced email address book. | 148 | It is often used as an enhanced email address book. |
| 177 | 149 | ||
| 178 | EUDC considers BBDB as a directory server back end just like LDAP or | 150 | EUDC considers BBDB as a directory server back end just like LDAP, |
| 179 | PH/QI servers, though BBDB has no client/server protocol and thus always | 151 | though BBDB has no client/server protocol and thus always resides |
| 180 | resides locally on your machine. The point in this is not to offer an | 152 | locally on your machine. The point in this is not to offer an |
| 181 | alternate way to query your BBDB database (BBDB itself provides much | 153 | alternate way to query your BBDB database (BBDB itself provides much |
| 182 | more flexible ways to do that), but rather to offer an interface to your | 154 | more flexible ways to do that), but rather to offer an interface to |
| 183 | local directory that is consistent with the interface to external | 155 | your local directory that is consistent with the interface to external |
| 184 | directories (LDAP, PH/QI). This is particularly interesting when | 156 | LDAP directories. This is particularly interesting when performing |
| 185 | performing queries on multiple servers. | 157 | queries on multiple servers. |
| 186 | 158 | ||
| 187 | EUDC also offers a means to insert results from directory queries into | 159 | EUDC also offers a means to insert results from directory queries into |
| 188 | your own local BBDB (@pxref{Creating BBDB Records}) | 160 | your own local BBDB (@pxref{Creating BBDB Records}) |
| @@ -473,7 +445,7 @@ it will be ignored anyway. | |||
| 473 | 445 | ||
| 474 | @defvar eudc-protocol | 446 | @defvar eudc-protocol |
| 475 | The directory protocol to use to query the server. Currently supported | 447 | The directory protocol to use to query the server. Currently supported |
| 476 | protocols in this version of EUDC are @code{ph}, @code{ldap} and @code{bbdb}. | 448 | protocols in this version of EUDC are @code{ldap} and @code{bbdb}. |
| 477 | @end defvar | 449 | @end defvar |
| 478 | 450 | ||
| 479 | @deffn Command eudc-set-server | 451 | @deffn Command eudc-set-server |
| @@ -510,11 +482,8 @@ attributes are ignored. Default is @code{t}. | |||
| 510 | 482 | ||
| 511 | Directory standards may authorize different instances of the same | 483 | Directory standards may authorize different instances of the same |
| 512 | attribute in a record. For instance the record of a person may contain | 484 | attribute in a record. For instance the record of a person may contain |
| 513 | several email fields containing different email addresses. When using | 485 | several email fields containing different email addresses, in which |
| 514 | a QI directory server this is difficult to distinguish from attributes | 486 | case EUDC will consider the attribute duplicated. |
| 515 | having multi-line values such as the postal address that may contain a | ||
| 516 | line for the street and another one for the zip code and city name. In | ||
| 517 | both cases, EUDC will consider the attribute duplicated. | ||
| 518 | 487 | ||
| 519 | EUDC has several methods to deal with duplicated attributes. The | 488 | EUDC has several methods to deal with duplicated attributes. The |
| 520 | available methods are: | 489 | available methods are: |
| @@ -956,39 +925,6 @@ convenience functions to parse phones and addresses. | |||
| 956 | @end table | 925 | @end table |
| 957 | @end defvar | 926 | @end defvar |
| 958 | 927 | ||
| 959 | The default value of the PH-specific value of that variable is | ||
| 960 | @code{eudc-ph-bbdb-conversion-alist}: | ||
| 961 | |||
| 962 | @lisp | ||
| 963 | ((name . name) | ||
| 964 | (net . email) | ||
| 965 | (address . (eudc-bbdbify-address address "Address")) | ||
| 966 | (phone . ((eudc-bbdbify-phone phone "Phone") | ||
| 967 | (eudc-bbdbify-phone office_phone "Office Phone")))) | ||
| 968 | @end lisp | ||
| 969 | |||
| 970 | This means that: | ||
| 971 | |||
| 972 | @itemize @bullet | ||
| 973 | @item | ||
| 974 | the @code{name} field of the BBDB record gets its value | ||
| 975 | from the @code{name} attribute of the directory record | ||
| 976 | @item | ||
| 977 | the @code{net} field of the BBDB record gets its value | ||
| 978 | from the @code{email} attribute of the directory record | ||
| 979 | @item | ||
| 980 | the @code{address} field of the BBDB record is obtained by parsing the | ||
| 981 | @code{address} attribute of the directory record with the function | ||
| 982 | @code{eudc-bbdbify-address} | ||
| 983 | @item | ||
| 984 | two @code{phone} fields are created (when possible) in the BBDB record. | ||
| 985 | The first one has @cite{Phone} for location and its value is obtained by | ||
| 986 | parsing the @code{phone} attribute of the PH/QI record with the function | ||
| 987 | @code{eudc-bbdbify-phone}. The second one has @cite{Office Phone} for location | ||
| 988 | its value is obtained by parsing the @code{office_phone} attribute of the | ||
| 989 | PH/QI record with the function @code{eudc-bbdbify-phone}. | ||
| 990 | @end itemize | ||
| 991 | |||
| 992 | @defun eudc-bbdbify-phone phone location | 928 | @defun eudc-bbdbify-phone phone location |
| 993 | This is a convenience function provided for use in | 929 | This is a convenience function provided for use in |
| 994 | @code{eudc-bbdb-conversion-alist}. It parses @var{phone} into a vector | 930 | @code{eudc-bbdb-conversion-alist}. It parses @var{phone} into a vector |
diff --git a/doc/misc/ido.texi b/doc/misc/ido.texi index afc323888c3..e06d248becc 100644 --- a/doc/misc/ido.texi +++ b/doc/misc/ido.texi | |||
| @@ -706,7 +706,8 @@ packages. | |||
| 706 | @noindent | 706 | @noindent |
| 707 | After @kbd{C-x b} (@code{ido-switch-buffer}), the buffer at the head | 707 | After @kbd{C-x b} (@code{ido-switch-buffer}), the buffer at the head |
| 708 | of the list can be killed by pressing @kbd{C-k}. If the buffer needs | 708 | of the list can be killed by pressing @kbd{C-k}. If the buffer needs |
| 709 | saving, you will be queried before the buffer is killed. | 709 | saving, you will be queried before the buffer is killed. @kbd{C-S-b} |
| 710 | buries the buffer at the head of the list. | ||
| 710 | 711 | ||
| 711 | Likewise, after @kbd{C-x C-f}, you can delete (i.e., physically | 712 | Likewise, after @kbd{C-x C-f}, you can delete (i.e., physically |
| 712 | remove) the file at the head of the list with @kbd{C-k}. You will | 713 | remove) the file at the head of the list with @kbd{C-k}. You will |
diff --git a/doc/misc/ses.texi b/doc/misc/ses.texi index 2f92e3ea836..fe6d5ab5422 100644 --- a/doc/misc/ses.texi +++ b/doc/misc/ses.texi | |||
| @@ -377,6 +377,7 @@ Undo previous action (@code{(undo)}). | |||
| 377 | @findex ses-read-cell-printer | 377 | @findex ses-read-cell-printer |
| 378 | @findex ses-read-column-printer | 378 | @findex ses-read-column-printer |
| 379 | @findex ses-read-default-printer | 379 | @findex ses-read-default-printer |
| 380 | @findex ses-define-local-printer | ||
| 380 | @findex ses-center | 381 | @findex ses-center |
| 381 | @findex ses-center-span | 382 | @findex ses-center-span |
| 382 | @findex ses-dashfill | 383 | @findex ses-dashfill |
| @@ -435,13 +436,43 @@ Centering with dashes and spill-over. | |||
| 435 | Centering with tildes (~) and spill-over. | 436 | Centering with tildes (~) and spill-over. |
| 436 | @end table | 437 | @end table |
| 437 | 438 | ||
| 438 | You can define printer function local to a sheet with command | 439 | You can define printer function local to a sheet with the command |
| 439 | @code{ses-define-local-printer}. For instance define printer | 440 | @code{ses-define-local-printer}. For instance, define a printer |
| 440 | @samp{foo} to @code{"%.2f"} and then use symbol @samp{foo} as a | 441 | @samp{foo} to @code{"%.2f"}, and then use symbol @samp{foo} as a |
| 441 | printer function. Then, if you call again | 442 | printer function. Then, if you call again |
| 442 | @code{ses-define-local-printer} on @samp{foo} to redefine it as | 443 | @code{ses-define-local-printer} on @samp{foo} to redefine it as |
| 443 | @code{"%.3f"} all the cells using printer @samp{foo} will be reprinted | 444 | @code{"%.3f"}, all the cells using printer @samp{foo} will be |
| 444 | accordingly. | 445 | reprinted accordingly. |
| 446 | |||
| 447 | When you define a printer function with a lambda expression taking one | ||
| 448 | argument, please take care that the returned value is a string, or a | ||
| 449 | list containing a string, even when the input argument has an | ||
| 450 | unexpected value. Here is an example: | ||
| 451 | |||
| 452 | @example | ||
| 453 | (lambda (val) | ||
| 454 | (cond | ||
| 455 | ((null val) "") | ||
| 456 | ((and (numberp val) (>= val 0)) (format "%.1f" val)) | ||
| 457 | (t (ses-center-span (format "%S" val) ?#)))) | ||
| 458 | @end example | ||
| 459 | |||
| 460 | This example will: | ||
| 461 | @itemize | ||
| 462 | @item | ||
| 463 | When the cell is empty (ie.@: when @code{val} is @code{nil}), print an | ||
| 464 | empty string @code{""} | ||
| 465 | @item | ||
| 466 | When the cell value is a non negative number, format the the value in | ||
| 467 | fixed-point notation with one decimal after point | ||
| 468 | @item | ||
| 469 | Otherwise, handle the value as erroneous by printing it as an | ||
| 470 | s-expression (using @code{prin1}), centered and surrounded by @code{#} | ||
| 471 | filling. | ||
| 472 | @end itemize | ||
| 473 | |||
| 474 | |||
| 475 | |||
| 445 | 476 | ||
| 446 | @node Clearing cells | 477 | @node Clearing cells |
| 447 | @section Clearing cells | 478 | @section Clearing cells |
diff --git a/doc/misc/texinfo.tex b/doc/misc/texinfo.tex index f555ce3f659..34fd353a9dc 100644 --- a/doc/misc/texinfo.tex +++ b/doc/misc/texinfo.tex | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | % Load plain if necessary, i.e., if running under initex. | 3 | % Load plain if necessary, i.e., if running under initex. |
| 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi | 4 | \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi |
| 5 | % | 5 | % |
| 6 | \def\texinfoversion{2015-10-29.16} | 6 | \def\texinfoversion{2015-12-17.20} |
| 7 | % | 7 | % |
| 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, | 8 | % Copyright 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, |
| 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, | 9 | % 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, |
| @@ -158,22 +158,10 @@ | |||
| 158 | \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi | 158 | \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi |
| 159 | \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi | 159 | \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi |
| 160 | 160 | ||
| 161 | % Since the category of space is not known, we have to be careful. | 161 | % Give the space character the catcode for a space. |
| 162 | \chardef\spacecat = 10 | 162 | \def\spaceisspace{\catcode`\ =10\relax} |
| 163 | \def\spaceisspace{\catcode`\ =\spacecat} | ||
| 164 | 163 | ||
| 165 | % sometimes characters are active, so we need control sequences. | ||
| 166 | \chardef\ampChar = `\& | ||
| 167 | \chardef\colonChar = `\: | ||
| 168 | \chardef\commaChar = `\, | ||
| 169 | \chardef\dashChar = `\- | 164 | \chardef\dashChar = `\- |
| 170 | \chardef\dotChar = `\. | ||
| 171 | \chardef\exclamChar= `\! | ||
| 172 | \chardef\hashChar = `\# | ||
| 173 | \chardef\lquoteChar= `\` | ||
| 174 | \chardef\questChar = `\? | ||
| 175 | \chardef\rquoteChar= `\' | ||
| 176 | \chardef\semiChar = `\; | ||
| 177 | \chardef\slashChar = `\/ | 165 | \chardef\slashChar = `\/ |
| 178 | \chardef\underChar = `\_ | 166 | \chardef\underChar = `\_ |
| 179 | 167 | ||
| @@ -271,11 +259,18 @@ | |||
| 271 | % | 259 | % |
| 272 | % Another complication is to let the user choose whether \thischapter | 260 | % Another complication is to let the user choose whether \thischapter |
| 273 | % (\thissection) refers to the chapter (section) in effect at the top | 261 | % (\thissection) refers to the chapter (section) in effect at the top |
| 274 | % of a page, or that at the bottom of a page. The solution is | 262 | % of a page, or that at the bottom of a page. |
| 275 | % described on page 260 of The TeXbook. It involves outputting two | 263 | |
| 276 | % marks for the sectioning macros, one before the section break, and | 264 | % \domark is called twice inside \chapmacro, to add one |
| 277 | % one after. I won't pretend I can describe this better than DEK... | 265 | % mark before the section break, and one after. |
| 278 | % | 266 | % In the second call \prevchapterdefs is the same as \lastchapterdefs, |
| 267 | % and \prevsectiondefs is the same as \lastsectiondefs. | ||
| 268 | % Then if the page is not broken at the mark, some of the previous | ||
| 269 | % section appears on the page, and we can get the name of this section | ||
| 270 | % from \firstmark for @everyheadingmarks top. | ||
| 271 | % @everyheadingmarks bottom uses \botmark. | ||
| 272 | % | ||
| 273 | % See page 260 of The TeXbook. | ||
| 279 | \def\domark{% | 274 | \def\domark{% |
| 280 | \toks0=\expandafter{\lastchapterdefs}% | 275 | \toks0=\expandafter{\lastchapterdefs}% |
| 281 | \toks2=\expandafter{\lastsectiondefs}% | 276 | \toks2=\expandafter{\lastsectiondefs}% |
| @@ -283,13 +278,14 @@ | |||
| 283 | \toks6=\expandafter{\prevsectiondefs}% | 278 | \toks6=\expandafter{\prevsectiondefs}% |
| 284 | \toks8=\expandafter{\lastcolordefs}% | 279 | \toks8=\expandafter{\lastcolordefs}% |
| 285 | \mark{% | 280 | \mark{% |
| 286 | \the\toks0 \the\toks2 % 0: top marks (\last...) | 281 | \the\toks0 \the\toks2 % 0: marks for @everyheadingmarks top |
| 287 | \noexpand\or \the\toks4 \the\toks6 % 1: bottom marks (default, \prev...) | 282 | \noexpand\or \the\toks4 \the\toks6 % 1: for @everyheadingmarks bottom |
| 288 | \noexpand\else \the\toks8 % 2: color marks | 283 | \noexpand\else \the\toks8 % 2: color marks |
| 289 | }% | 284 | }% |
| 290 | } | 285 | } |
| 291 | 286 | ||
| 292 | % \gettopheadingmarks, \getbottomheadingmarks - extract needed part of mark. | 287 | % \gettopheadingmarks, \getbottomheadingmarks, |
| 288 | % \getcolormarks - extract needed part of mark. | ||
| 293 | % | 289 | % |
| 294 | % \topmark doesn't work for the very first chapter (after the title | 290 | % \topmark doesn't work for the very first chapter (after the title |
| 295 | % page or the contents), so we use \firstmark there -- this gets us | 291 | % page or the contents), so we use \firstmark there -- this gets us |
| @@ -345,28 +341,21 @@ | |||
| 345 | % values in \headline and \footline. | 341 | % values in \headline and \footline. |
| 346 | % | 342 | % |
| 347 | % This is used to check if we are on the first page of a chapter. | 343 | % This is used to check if we are on the first page of a chapter. |
| 348 | \ifcase0\topmark\fi | 344 | \ifcase1\topmark\fi |
| 349 | \ifx\thischapter\empty | 345 | \let\prevchaptername\thischaptername |
| 350 | % See comment for \gettopheadingmarks | 346 | \ifcase0\firstmark\fi |
| 351 | \ifcase0\firstmark\fi | 347 | \let\curchaptername\thischaptername |
| 352 | \let\curchaptername\thischaptername | ||
| 353 | \ifcase1\firstmark\fi | ||
| 354 | \let\prevchaptername\thischaptername | ||
| 355 | \else | ||
| 356 | \let\curchaptername\thischaptername | ||
| 357 | \ifcase1\topmark\fi | ||
| 358 | \let\prevchaptername\thischaptername | ||
| 359 | \fi | ||
| 360 | % | 348 | % |
| 361 | \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi | 349 | \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi |
| 362 | \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi | 350 | \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi |
| 363 | % | 351 | % |
| 364 | \ifx\curchaptername\prevchaptername | 352 | \ifx\curchaptername\prevchaptername |
| 353 | \let\thischapterheading\thischapter | ||
| 365 | \else | 354 | \else |
| 366 | % If on the first page of a chapter, clear @thischapter so it | 355 | % \thischapterheading is the same as \thischapter except it is blank |
| 367 | % doesn't appear in the headline, because the chapter is already | 356 | % for the first page of a chapter. This is to prevent the chapter name |
| 368 | % shown in the chapter heading. | 357 | % being shown twice. |
| 369 | \def\thischapter{}% | 358 | \def\thischapterheading{}% |
| 370 | \fi | 359 | \fi |
| 371 | % | 360 | % |
| 372 | \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% | 361 | \global\setbox\headlinebox = \vbox{\commmonheadfootline \makeheadline}% |
| @@ -1164,8 +1153,8 @@ output) for that.)} | |||
| 1164 | \def\rgbDarkRed{0.50 0.09 0.12} | 1153 | \def\rgbDarkRed{0.50 0.09 0.12} |
| 1165 | \def\rgbBlack{0 0 0} | 1154 | \def\rgbBlack{0 0 0} |
| 1166 | % | 1155 | % |
| 1167 | % k sets the color for filling (usual text, etc.); | 1156 | % rg sets the color for filling (usual text, etc.); |
| 1168 | % K sets the color for stroking (thin rules, e.g., normal _'s). | 1157 | % RG sets the color for stroking (thin rules, e.g., normal _'s). |
| 1169 | \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} | 1158 | \def\pdfsetcolor#1{\pdfliteral{#1 rg #1 RG}} |
| 1170 | % | 1159 | % |
| 1171 | % Set color, and create a mark which defines \thiscolor accordingly, | 1160 | % Set color, and create a mark which defines \thiscolor accordingly, |
| @@ -1416,7 +1405,6 @@ output) for that.)} | |||
| 1416 | \normalturnoffactive | 1405 | \normalturnoffactive |
| 1417 | \def\@{@}% | 1406 | \def\@{@}% |
| 1418 | \let\/=\empty | 1407 | \let\/=\empty |
| 1419 | \let\xprocessmacroarg=\eatspaces % in case we are in a macro expansion | ||
| 1420 | \makevalueexpandable | 1408 | \makevalueexpandable |
| 1421 | % do we want to go so far as to use \indexnofonts instead of just | 1409 | % do we want to go so far as to use \indexnofonts instead of just |
| 1422 | % special-casing \var here? | 1410 | % special-casing \var here? |
| @@ -2452,8 +2440,8 @@ end | |||
| 2452 | % | 2440 | % |
| 2453 | \catcode`@=11 | 2441 | \catcode`@=11 |
| 2454 | \def\plainfrenchspacing{% | 2442 | \def\plainfrenchspacing{% |
| 2455 | \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m | 2443 | \sfcode`\.=\@m \sfcode`\?=\@m \sfcode`\!=\@m |
| 2456 | \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m | 2444 | \sfcode`\:=\@m \sfcode`\;=\@m \sfcode`\,=\@m |
| 2457 | \def\endofsentencespacefactor{1000}% for @. and friends | 2445 | \def\endofsentencespacefactor{1000}% for @. and friends |
| 2458 | } | 2446 | } |
| 2459 | \def\plainnonfrenchspacing{% | 2447 | \def\plainnonfrenchspacing{% |
| @@ -2641,9 +2629,9 @@ end | |||
| 2641 | 2629 | ||
| 2642 | % Allow line breaks around only a few characters (only). | 2630 | % Allow line breaks around only a few characters (only). |
| 2643 | \def\urefcatcodes{% | 2631 | \def\urefcatcodes{% |
| 2644 | \catcode\ampChar=\active \catcode\dotChar=\active | 2632 | \catcode`\&=\active \catcode`\.=\active |
| 2645 | \catcode\hashChar=\active \catcode\questChar=\active | 2633 | \catcode`\#=\active \catcode`\?=\active |
| 2646 | \catcode\slashChar=\active | 2634 | \catcode`\/=\active |
| 2647 | } | 2635 | } |
| 2648 | { | 2636 | { |
| 2649 | \urefcatcodes | 2637 | \urefcatcodes |
| @@ -2852,23 +2840,24 @@ end | |||
| 2852 | \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} | 2840 | \def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} |
| 2853 | % | 2841 | % |
| 2854 | \def\math{% | 2842 | \def\math{% |
| 2855 | \tex | 2843 | \ifmmode\else % only go into math if not in math mode already |
| 2856 | \mathunderscore | 2844 | \tex |
| 2857 | \let\\ = \mathbackslash | 2845 | \mathunderscore |
| 2858 | \mathactive | 2846 | \let\\ = \mathbackslash |
| 2859 | % make the texinfo accent commands work in math mode | 2847 | \mathactive |
| 2860 | \let\"=\ddot | 2848 | % make the texinfo accent commands work in math mode |
| 2861 | \let\'=\acute | 2849 | \let\"=\ddot |
| 2862 | \let\==\bar | 2850 | \let\'=\acute |
| 2863 | \let\^=\hat | 2851 | \let\==\bar |
| 2864 | \let\`=\grave | 2852 | \let\^=\hat |
| 2865 | \let\u=\breve | 2853 | \let\`=\grave |
| 2866 | \let\v=\check | 2854 | \let\u=\breve |
| 2867 | \let\~=\tilde | 2855 | \let\v=\check |
| 2868 | \let\dotaccent=\dot | 2856 | \let\~=\tilde |
| 2869 | % have to provide another name for sup operator | 2857 | \let\dotaccent=\dot |
| 2870 | \let\mathopsup=\sup | 2858 | % have to provide another name for sup operator |
| 2871 | $\finishmath | 2859 | \let\mathopsup=\sup |
| 2860 | $\expandafter\finishmath\fi | ||
| 2872 | } | 2861 | } |
| 2873 | \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. | 2862 | \def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. |
| 2874 | 2863 | ||
| @@ -3517,7 +3506,7 @@ end | |||
| 3517 | \global\evenfootline={\hfil} | 3506 | \global\evenfootline={\hfil} |
| 3518 | \global\oddfootline={\hfil} | 3507 | \global\oddfootline={\hfil} |
| 3519 | \global\evenheadline={\line{\folio\hfil\thistitle}} | 3508 | \global\evenheadline={\line{\folio\hfil\thistitle}} |
| 3520 | \global\oddheadline={\line{\thischapter\hfil\folio}} | 3509 | \global\oddheadline={\line{\thischapterheading\hfil\folio}} |
| 3521 | \global\let\contentsalignmacro = \chapoddpage | 3510 | \global\let\contentsalignmacro = \chapoddpage |
| 3522 | } | 3511 | } |
| 3523 | \let\contentsalignmacro = \chappager | 3512 | \let\contentsalignmacro = \chappager |
| @@ -3528,8 +3517,8 @@ end | |||
| 3528 | \global\pageno=1 | 3517 | \global\pageno=1 |
| 3529 | \global\evenfootline={\hfil} | 3518 | \global\evenfootline={\hfil} |
| 3530 | \global\oddfootline={\hfil} | 3519 | \global\oddfootline={\hfil} |
| 3531 | \global\evenheadline={\line{\thischapter\hfil\folio}} | 3520 | \global\evenheadline={\line{\thischapterheading\hfil\folio}} |
| 3532 | \global\oddheadline={\line{\thischapter\hfil\folio}} | 3521 | \global\oddheadline={\line{\thischapterheading\hfil\folio}} |
| 3533 | \global\let\contentsalignmacro = \chappager | 3522 | \global\let\contentsalignmacro = \chappager |
| 3534 | } | 3523 | } |
| 3535 | \def\HEADINGSon{\HEADINGSdouble} | 3524 | \def\HEADINGSon{\HEADINGSdouble} |
| @@ -3540,7 +3529,7 @@ end | |||
| 3540 | \global\evenfootline={\hfil} | 3529 | \global\evenfootline={\hfil} |
| 3541 | \global\oddfootline={\hfil} | 3530 | \global\oddfootline={\hfil} |
| 3542 | \global\evenheadline={\line{\folio\hfil\thistitle}} | 3531 | \global\evenheadline={\line{\folio\hfil\thistitle}} |
| 3543 | \global\oddheadline={\line{\thischapter\hfil\folio}} | 3532 | \global\oddheadline={\line{\thischapterheading\hfil\folio}} |
| 3544 | \global\let\contentsalignmacro = \chapoddpage | 3533 | \global\let\contentsalignmacro = \chapoddpage |
| 3545 | } | 3534 | } |
| 3546 | 3535 | ||
| @@ -3548,8 +3537,8 @@ end | |||
| 3548 | \def\HEADINGSsinglex{% | 3537 | \def\HEADINGSsinglex{% |
| 3549 | \global\evenfootline={\hfil} | 3538 | \global\evenfootline={\hfil} |
| 3550 | \global\oddfootline={\hfil} | 3539 | \global\oddfootline={\hfil} |
| 3551 | \global\evenheadline={\line{\thischapter\hfil\folio}} | 3540 | \global\evenheadline={\line{\thischapterheading\hfil\folio}} |
| 3552 | \global\oddheadline={\line{\thischapter\hfil\folio}} | 3541 | \global\oddheadline={\line{\thischapterheading\hfil\folio}} |
| 3553 | \global\let\contentsalignmacro = \chappager | 3542 | \global\let\contentsalignmacro = \chappager |
| 3554 | } | 3543 | } |
| 3555 | 3544 | ||
| @@ -4676,16 +4665,6 @@ end | |||
| 4676 | \definedummyword\verb | 4665 | \definedummyword\verb |
| 4677 | \definedummyword\w | 4666 | \definedummyword\w |
| 4678 | \definedummyword\xref | 4667 | \definedummyword\xref |
| 4679 | % | ||
| 4680 | % Consider: | ||
| 4681 | % @macro mkind{arg1,arg2} | ||
| 4682 | % @cindex \arg2\ | ||
| 4683 | % @end macro | ||
| 4684 | % @mkind{foo, bar} | ||
| 4685 | % The space after the comma will end up in the temporary definition | ||
| 4686 | % that we make for arg2 (see \parsemargdef ff.). We want all this to be | ||
| 4687 | % expanded for the sake of the index, so we end up just seeing "bar". | ||
| 4688 | \let\xprocessmacroarg\eatspaces | ||
| 4689 | } | 4668 | } |
| 4690 | 4669 | ||
| 4691 | % For testing: output @{ and @} in index sort strings as \{ and \}. | 4670 | % For testing: output @{ and @} in index sort strings as \{ and \}. |
| @@ -5212,16 +5191,12 @@ end | |||
| 5212 | % from @* into spaces. The user might give these in long section | 5191 | % from @* into spaces. The user might give these in long section |
| 5213 | % titles, for instance. | 5192 | % titles, for instance. |
| 5214 | \def\*{\unskip\space\ignorespaces}% | 5193 | \def\*{\unskip\space\ignorespaces}% |
| 5215 | \def\entrybreak{\hfil\break}% | 5194 | \def\entrybreak{\hfil\break}% An undocumented command |
| 5216 | % | 5195 | % |
| 5217 | % A bit of stretch before each entry for the benefit of balancing | 5196 | % A bit of stretch before each entry for the benefit of balancing |
| 5218 | % columns. | 5197 | % columns. |
| 5219 | \vskip 0pt plus0.5pt | 5198 | \vskip 0pt plus0.5pt |
| 5220 | % | 5199 | % |
| 5221 | % Badness calculation for paragraph affected by - | ||
| 5222 | % How much \indexdotfill is stretched, or how much \parfillskip is shrunk | ||
| 5223 | % Number of lines (\linepenalty) | ||
| 5224 | % | ||
| 5225 | % Swallow the left brace of the text (first parameter): | 5200 | % Swallow the left brace of the text (first parameter): |
| 5226 | \afterassignment\doentry | 5201 | \afterassignment\doentry |
| 5227 | \let\temp = | 5202 | \let\temp = |
| @@ -5255,16 +5230,23 @@ end | |||
| 5255 | % | 5230 | % |
| 5256 | \ifpdf | 5231 | \ifpdf |
| 5257 | \pdfgettoks#1.% | 5232 | \pdfgettoks#1.% |
| 5258 | \hskip\skip\thinshrinkable\the\toksA | 5233 | \bgroup\let\domark\relax |
| 5234 | \hskip\skip\thinshrinkable\the\toksA | ||
| 5235 | \egroup | ||
| 5236 | % The redefinion of \domark stops marks being added in \pdflink to | ||
| 5237 | % preserve coloured links across page boundaries. Otherwise the marks | ||
| 5238 | % would get in the way of \lastbox in \insertindexentrybox. | ||
| 5259 | \else | 5239 | \else |
| 5260 | \hskip\skip\thinshrinkable #1% | 5240 | \hskip\skip\thinshrinkable #1% |
| 5261 | \fi | 5241 | \fi |
| 5262 | \fi | 5242 | \fi |
| 5263 | \egroup % end \boxA | 5243 | \egroup % end \boxA |
| 5264 | \ifdim\wd\boxB = 0pt | 5244 | \ifdim\wd\boxB = 0pt |
| 5265 | \global\setbox\entryindexbox=\box\boxA | 5245 | \global\setbox\entryindexbox=\vbox{\unhbox\boxA}% |
| 5266 | \else | 5246 | \else |
| 5267 | \global\setbox\entryindexbox=\vbox\bgroup\noindent | 5247 | \global\setbox\entryindexbox=\vbox\bgroup |
| 5248 | \prevdepth=\entrylinedepth | ||
| 5249 | \noindent | ||
| 5268 | % We want the text of the entries to be aligned to the left, and the | 5250 | % We want the text of the entries to be aligned to the left, and the |
| 5269 | % page numbers to be aligned to the right. | 5251 | % page numbers to be aligned to the right. |
| 5270 | % | 5252 | % |
| @@ -5333,10 +5315,21 @@ end | |||
| 5333 | 5315 | ||
| 5334 | \newbox\entryindexbox | 5316 | \newbox\entryindexbox |
| 5335 | \def\insertindexentrybox{% | 5317 | \def\insertindexentrybox{% |
| 5336 | \lineskip=.7ex plus .5ex % This comes into effect when the \vbox has a large | 5318 | \copy\entryindexbox |
| 5337 | % height due to the paragraph in it having several | 5319 | % The following gets the depth of the last box. This is for even |
| 5338 | % lines. | 5320 | % line spacing when entries span several lines. |
| 5339 | \box\entryindexbox} | 5321 | \setbox\dummybox\vbox{% |
| 5322 | \unvbox\entryindexbox | ||
| 5323 | \nointerlineskip | ||
| 5324 | \lastbox | ||
| 5325 | \global\entrylinedepth=\prevdepth | ||
| 5326 | }% | ||
| 5327 | % Note that we couldn't simply \unvbox\entryindexbox followed by | ||
| 5328 | % \nointerlineskip\lastbox to remove the last box and then reinstate it, | ||
| 5329 | % because this resets how far the box has been \moveleft'ed to 0. \unvbox | ||
| 5330 | % doesn't affect \prevdepth either. | ||
| 5331 | } | ||
| 5332 | \newdimen\entrylinedepth | ||
| 5340 | 5333 | ||
| 5341 | % Default is no penalty | 5334 | % Default is no penalty |
| 5342 | \let\entryorphanpenalty\egroup | 5335 | \let\entryorphanpenalty\egroup |
| @@ -5387,16 +5380,35 @@ end | |||
| 5387 | % Define two-column mode, which we use to typeset indexes. | 5380 | % Define two-column mode, which we use to typeset indexes. |
| 5388 | % Adapted from the TeXbook, page 416, which is to say, | 5381 | % Adapted from the TeXbook, page 416, which is to say, |
| 5389 | % the manmac.tex format used to print the TeXbook itself. | 5382 | % the manmac.tex format used to print the TeXbook itself. |
| 5390 | \catcode`\@=11 | 5383 | \catcode`\@=11 % private names |
| 5391 | 5384 | ||
| 5392 | \newbox\partialpage | 5385 | \newbox\partialpage |
| 5393 | \newdimen\doublecolumnhsize | 5386 | \newdimen\doublecolumnhsize |
| 5394 | \newdimen\doublecolumntopgap | 5387 | \newdimen\doublecolumntopgap |
| 5395 | \doublecolumntopgap = 0pt | 5388 | \doublecolumntopgap = 0pt |
| 5396 | 5389 | ||
| 5397 | \newtoks\savedtopmark % Used in \begindoublecolumns | 5390 | % Use inside an output routine to save \topmark and \firstmark |
| 5391 | \def\savemarks{% | ||
| 5392 | \global\savedtopmark=\expandafter{\topmark }% | ||
| 5393 | \global\savedfirstmark=\expandafter{\firstmark }% | ||
| 5394 | } | ||
| 5395 | \newtoks\savedtopmark | ||
| 5398 | \newtoks\savedfirstmark | 5396 | \newtoks\savedfirstmark |
| 5399 | 5397 | ||
| 5398 | % Set \topmark and \firstmark for next time \output runs. | ||
| 5399 | % Can't be run from withinside \output (because any material | ||
| 5400 | % added while an output routine is active, including | ||
| 5401 | % penalties, is saved for after it finishes). The page so far | ||
| 5402 | % should be empty, otherwise what's on it will be thrown away. | ||
| 5403 | \def\restoremarks{% | ||
| 5404 | \mark{\the\savedtopmark}% | ||
| 5405 | \bgroup\output = {% | ||
| 5406 | \setbox\dummybox=\box\PAGE | ||
| 5407 | }abc\eject\egroup | ||
| 5408 | % "abc" because output routine doesn't fire for a completely empty page. | ||
| 5409 | \mark{\the\savedfirstmark}% | ||
| 5410 | } | ||
| 5411 | |||
| 5400 | \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns | 5412 | \def\begindoublecolumns{\begingroup % ended by \enddoublecolumns |
| 5401 | % Grab any single-column material above us. | 5413 | % Grab any single-column material above us. |
| 5402 | \output = {% | 5414 | \output = {% |
| @@ -5417,22 +5429,15 @@ end | |||
| 5417 | \unvbox\PAGE | 5429 | \unvbox\PAGE |
| 5418 | \kern-\topskip \kern\baselineskip | 5430 | \kern-\topskip \kern\baselineskip |
| 5419 | }% | 5431 | }% |
| 5420 | % Save \topmark and \firstmark | 5432 | \savemarks |
| 5421 | \global\savedtopmark=\expandafter{\topmark}% | ||
| 5422 | \global\savedfirstmark=\expandafter{\firstmark}% | ||
| 5423 | }% | 5433 | }% |
| 5424 | \eject % run that output routine to set \partialpage | 5434 | \eject % run that output routine to set \partialpage |
| 5435 | \restoremarks | ||
| 5425 | % | 5436 | % |
| 5426 | % We recover the two marks that the last output routine saved in order | 5437 | % We recover the two marks that the last output routine saved in order |
| 5427 | % to propagate the information in marks added around a chapter heading, | 5438 | % to propagate the information in marks added around a chapter heading, |
| 5428 | % which could be otherwise be lost by the time the final page is output. | 5439 | % which could be otherwise be lost by the time the final page is output. |
| 5429 | % | 5440 | % |
| 5430 | \mark{\the\savedtopmark}% Only mark in page passed to following \output. | ||
| 5431 | \output = {% | ||
| 5432 | \setbox0=\box\PAGE % clear box 255 | ||
| 5433 | }abc\eject | ||
| 5434 | % | ||
| 5435 | \mark{\the\savedfirstmark}% | ||
| 5436 | % | 5441 | % |
| 5437 | % Use the double-column output routine for subsequent pages. | 5442 | % Use the double-column output routine for subsequent pages. |
| 5438 | \output = {\doublecolumnout}% | 5443 | \output = {\doublecolumnout}% |
| @@ -5465,12 +5470,14 @@ end | |||
| 5465 | \global\advance\vsize by -1\doublecolumntopgap | 5470 | \global\advance\vsize by -1\doublecolumntopgap |
| 5466 | \vsize = 2\vsize | 5471 | \vsize = 2\vsize |
| 5467 | \topskip=0pt | 5472 | \topskip=0pt |
| 5473 | \global\entrylinedepth=0pt\relax | ||
| 5468 | } | 5474 | } |
| 5469 | 5475 | ||
| 5470 | % The double-column output routine for all double-column pages except | 5476 | % The double-column output routine for all double-column pages except |
| 5471 | % the last, which is done by \balancecolumns. | 5477 | % the last, which is done by \balancecolumns. |
| 5472 | % | 5478 | % |
| 5473 | \def\doublecolumnout{% | 5479 | \def\doublecolumnout{% |
| 5480 | % | ||
| 5474 | \splittopskip=\topskip \splitmaxdepth=\maxdepth | 5481 | \splittopskip=\topskip \splitmaxdepth=\maxdepth |
| 5475 | % Get the available space for the double columns -- the normal | 5482 | % Get the available space for the double columns -- the normal |
| 5476 | % (undoubled) page height minus any material left over from the | 5483 | % (undoubled) page height minus any material left over from the |
| @@ -5532,6 +5539,7 @@ end | |||
| 5532 | \output = {% | 5539 | \output = {% |
| 5533 | % Split the last of the double-column material. Leave it on the | 5540 | % Split the last of the double-column material. Leave it on the |
| 5534 | % current page, no automatic page break. | 5541 | % current page, no automatic page break. |
| 5542 | \savemarks | ||
| 5535 | \balancecolumns | 5543 | \balancecolumns |
| 5536 | % | 5544 | % |
| 5537 | % If we end up splitting too much material for the current page, | 5545 | % If we end up splitting too much material for the current page, |
| @@ -5545,6 +5553,8 @@ end | |||
| 5545 | }% | 5553 | }% |
| 5546 | \eject | 5554 | \eject |
| 5547 | \endgroup % started in \begindoublecolumns | 5555 | \endgroup % started in \begindoublecolumns |
| 5556 | \restoremarks | ||
| 5557 | \box\balancedcolumns | ||
| 5548 | % | 5558 | % |
| 5549 | % \pagegoal was set to the doubled \vsize above, since we restarted | 5559 | % \pagegoal was set to the doubled \vsize above, since we restarted |
| 5550 | % the current page. We're now back to normal single-column | 5560 | % the current page. We're now back to normal single-column |
| @@ -5552,6 +5562,8 @@ end | |||
| 5552 | % \endgroup where \vsize got restored). | 5562 | % \endgroup where \vsize got restored). |
| 5553 | \pagegoal = \vsize | 5563 | \pagegoal = \vsize |
| 5554 | } | 5564 | } |
| 5565 | \newbox\balancedcolumns | ||
| 5566 | \setbox\balancedcolumns=\vbox{shouldnt see this}% | ||
| 5555 | % | 5567 | % |
| 5556 | % Only called for the last of the double column material. \doublecolumnout | 5568 | % Only called for the last of the double column material. \doublecolumnout |
| 5557 | % does the others. | 5569 | % does the others. |
| @@ -5595,7 +5607,7 @@ end | |||
| 5595 | \fi | 5607 | \fi |
| 5596 | \fi | 5608 | \fi |
| 5597 | % | 5609 | % |
| 5598 | \pagesofar | 5610 | \global\setbox\balancedcolumns=\vbox{\pagesofar}% |
| 5599 | } | 5611 | } |
| 5600 | \catcode`\@ = \other | 5612 | \catcode`\@ = \other |
| 5601 | 5613 | ||
| @@ -7612,8 +7624,7 @@ end | |||
| 7612 | % Argument is macro body with arguments substituted | 7624 | % Argument is macro body with arguments substituted |
| 7613 | \def\scanmacro#1{% | 7625 | \def\scanmacro#1{% |
| 7614 | \newlinechar`\^^M | 7626 | \newlinechar`\^^M |
| 7615 | % Reduce doubled backslashes to one | 7627 | \def\xprocessmacroarg{\eatspaces}% |
| 7616 | \def\xprocessmacroarg{\passargtomacro\eatspaces}% | ||
| 7617 | % | 7628 | % |
| 7618 | % Process the macro body under the current catcode regime. | 7629 | % Process the macro body under the current catcode regime. |
| 7619 | \scantokens{#1\texinfoc}\aftermacro% | 7630 | \scantokens{#1\texinfoc}\aftermacro% |
| @@ -7629,6 +7640,7 @@ end | |||
| 7629 | % to allow macros to open or close groups themselves. | 7640 | % to allow macros to open or close groups themselves. |
| 7630 | } | 7641 | } |
| 7631 | 7642 | ||
| 7643 | % Used for copying and captions | ||
| 7632 | \def\scanexp#1{% | 7644 | \def\scanexp#1{% |
| 7633 | \bgroup | 7645 | \bgroup |
| 7634 | % Undo catcode changes of \startcontents and \printindex | 7646 | % Undo catcode changes of \startcontents and \printindex |
| @@ -7733,6 +7745,7 @@ end | |||
| 7733 | % an argument to another Texinfo command. | 7745 | % an argument to another Texinfo command. |
| 7734 | \def\macroargctxt{% | 7746 | \def\macroargctxt{% |
| 7735 | \scanctxt | 7747 | \scanctxt |
| 7748 | \catcode`\ =\active | ||
| 7736 | \catcode`\^^M=\other | 7749 | \catcode`\^^M=\other |
| 7737 | \catcode`\\=\active | 7750 | \catcode`\\=\active |
| 7738 | } | 7751 | } |
| @@ -8127,16 +8140,23 @@ end | |||
| 8127 | \egroup\noexpand\scanmacro{\macrobody}}% | 8140 | \egroup\noexpand\scanmacro{\macrobody}}% |
| 8128 | \else | 8141 | \else |
| 8129 | \ifnum\paramno<10\relax % at most 9 | 8142 | \ifnum\paramno<10\relax % at most 9 |
| 8143 | % See non-recursive section below for comments | ||
| 8130 | \expandafter\xdef\csname\the\macname\endcsname{% | 8144 | \expandafter\xdef\csname\the\macname\endcsname{% |
| 8131 | \bgroup\noexpand\macroargctxt | 8145 | \bgroup |
| 8132 | \noexpand\csname\the\macname @@\endcsname}% | 8146 | \noexpand\expandafter |
| 8147 | \noexpand\macroargctxt | ||
| 8148 | \noexpand\expandafter | ||
| 8149 | \expandafter\noexpand\csname\the\macname @@\endcsname}% | ||
| 8133 | \expandafter\xdef\csname\the\macname @@\endcsname##1{% | 8150 | \expandafter\xdef\csname\the\macname @@\endcsname##1{% |
| 8134 | \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}% | 8151 | \noexpand\passargtomacro |
| 8152 | \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% | ||
| 8153 | \expandafter\xdef\csname\the\macname @@@\endcsname##1{% | ||
| 8154 | \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% | ||
| 8135 | \expandafter\expandafter | 8155 | \expandafter\expandafter |
| 8136 | \expandafter\xdef | 8156 | \expandafter\xdef |
| 8137 | \expandafter\expandafter | 8157 | \expandafter\expandafter |
| 8138 | \csname\the\macname @@@\endcsname | 8158 | \csname\the\macname @@@@\endcsname\paramlist{% |
| 8139 | \paramlist{\egroup\noexpand\scanmacro{\macrobody}}% | 8159 | \egroup\noexpand\scanmacro{\macrobody}}% |
| 8140 | \else % 10 or more | 8160 | \else % 10 or more |
| 8141 | \expandafter\xdef\csname\the\macname\endcsname{% | 8161 | \expandafter\xdef\csname\the\macname\endcsname{% |
| 8142 | \noexpand\getargvals@{\the\macname}{\argl}% | 8162 | \noexpand\getargvals@{\the\macname}{\argl}% |
| @@ -8166,19 +8186,27 @@ end | |||
| 8166 | }% | 8186 | }% |
| 8167 | \else % at most 9 | 8187 | \else % at most 9 |
| 8168 | \ifnum\paramno<10\relax | 8188 | \ifnum\paramno<10\relax |
| 8189 | % @MACNAME sets the context for reading the macro argument | ||
| 8190 | % @MACNAME@@ gets the argument, processes backslashes and appends a | ||
| 8191 | % comma. | ||
| 8192 | % @MACNAME@@@ removes braces surrounding the argument list. | ||
| 8193 | % @MACNAME@@@@ scans the macro body with arguments substituted. | ||
| 8169 | \expandafter\xdef\csname\the\macname\endcsname{% | 8194 | \expandafter\xdef\csname\the\macname\endcsname{% |
| 8170 | \bgroup\noexpand\macroargctxt | 8195 | \bgroup |
| 8171 | \expandafter\noexpand\csname\the\macname @@\endcsname}% | 8196 | \noexpand\expandafter % This \expandafter skip any spaces after the |
| 8197 | \noexpand\macroargctxt % macro before we change the catcode of space. | ||
| 8198 | \noexpand\expandafter | ||
| 8199 | \expandafter\noexpand\csname\the\macname @@\endcsname}% | ||
| 8172 | \expandafter\xdef\csname\the\macname @@\endcsname##1{% | 8200 | \expandafter\xdef\csname\the\macname @@\endcsname##1{% |
| 8173 | \expandafter\noexpand\csname\the\macname @@@\endcsname ##1,}% | 8201 | \noexpand\passargtomacro |
| 8202 | \expandafter\noexpand\csname\the\macname @@@\endcsname{##1,}}% | ||
| 8203 | \expandafter\xdef\csname\the\macname @@@\endcsname##1{% | ||
| 8204 | \expandafter\noexpand\csname\the\macname @@@@\endcsname ##1}% | ||
| 8174 | \expandafter\expandafter | 8205 | \expandafter\expandafter |
| 8175 | \expandafter\xdef | 8206 | \expandafter\xdef |
| 8176 | \expandafter\expandafter | 8207 | \expandafter\expandafter |
| 8177 | \csname\the\macname @@@\endcsname | 8208 | \csname\the\macname @@@@\endcsname\paramlist{% |
| 8178 | \paramlist{% | 8209 | \egroup\noexpand\scanmacro{\macrobody}}% |
| 8179 | \egroup | ||
| 8180 | \noexpand\scanmacro{\macrobody}% | ||
| 8181 | }% | ||
| 8182 | \else % 10 or more: | 8210 | \else % 10 or more: |
| 8183 | \expandafter\xdef\csname\the\macname\endcsname{% | 8211 | \expandafter\xdef\csname\the\macname\endcsname{% |
| 8184 | \noexpand\getargvals@{\the\macname}{\argl}% | 8212 | \noexpand\getargvals@{\the\macname}{\argl}% |
| @@ -8194,71 +8222,96 @@ end | |||
| 8194 | \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} | 8222 | \def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} |
| 8195 | 8223 | ||
| 8196 | 8224 | ||
| 8197 | {\catcode`\@=0 \catcode`\\=13 | 8225 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
| 8198 | @catcode`@_=11 | 8226 | % |
| 8227 | {\catcode`\@=0 \catcode`\\=13 % We need to manipulate \ so use @ as escape | ||
| 8228 | @catcode`@_=11 % private names | ||
| 8229 | @catcode`@!=11 % used as argument separator | ||
| 8199 | 8230 | ||
| 8231 | % \passargtomacro#1#2 - | ||
| 8200 | % Call #1 with a list of tokens #2, with any doubled backslashes in #2 | 8232 | % Call #1 with a list of tokens #2, with any doubled backslashes in #2 |
| 8201 | % compressed to one. | 8233 | % compressed to one. |
| 8234 | % | ||
| 8235 | % This implementation works by expansion, and not execution (so we cannot use | ||
| 8236 | % \def or similar). This reduces the risk of this failing in contexts where | ||
| 8237 | % complete expansion is done with no execution (for example, in writing out to | ||
| 8238 | % an auxiliary file for an index entry). | ||
| 8239 | % | ||
| 8240 | % State is kept in the input stream: the argument passed to | ||
| 8241 | % @look_ahead, @gobble_and_check_finish and @add_segment is | ||
| 8242 | % | ||
| 8243 | % THE_MACRO ARG_RESULT ! {PENDING_BS} NEXT_TOKEN (... rest of input) | ||
| 8244 | % | ||
| 8245 | % where: | ||
| 8246 | % THE_MACRO - name of the macro we want to call | ||
| 8247 | % ARG_RESULT - argument list we build to pass to that macro | ||
| 8248 | % PENDING_BS - either a backslash or nothing | ||
| 8249 | % NEXT_TOKEN - used to look ahead in the input stream to see what's coming next | ||
| 8250 | |||
| 8202 | @gdef@passargtomacro#1#2{% | 8251 | @gdef@passargtomacro#1#2{% |
| 8203 | @def@the_macro{#1}% | 8252 | @add_segment #1!{}@relax#2\@_finish\% |
| 8204 | @def@pending_backslash{}% | ||
| 8205 | @def@finish{@finish}% | ||
| 8206 | @def@arg_result{}% | ||
| 8207 | @let@next_token=@relax | ||
| 8208 | @add_segment#2\@finish\% | ||
| 8209 | } | ||
| 8210 | |||
| 8211 | % Input stream is just after a backslash. If the next token is not a | ||
| 8212 | % backslash, process the rest of the argument; otherwise, remove the next | ||
| 8213 | % token. | ||
| 8214 | @gdef@look_ahead{% | ||
| 8215 | @futurelet@next_token@look_aheadzzz} | ||
| 8216 | @gdef@look_aheadzzz{% | ||
| 8217 | @ifx@next_token\% | ||
| 8218 | @let@next=@gobble_and_check_finish | ||
| 8219 | @else | ||
| 8220 | @let@next=@add_segment | ||
| 8221 | @fi@next | ||
| 8222 | } | 8253 | } |
| 8254 | @gdef@_finish{@_finishx} @global@let@_finishx@relax | ||
| 8223 | 8255 | ||
| 8224 | % Double backslash found. Add a single backslash here. | 8256 | % #1 - THE_MACRO ARG_RESULT |
| 8225 | @gdef@gobble_and_check_finish#1{% | 8257 | % #2 - PENDING_BS |
| 8226 | @add_the_backslash | 8258 | % #3 - NEXT_TOKEN |
| 8227 | @def@pending_backslash{}% | 8259 | % #4 used to look ahead |
| 8228 | @futurelet@next_token@add_segment | 8260 | % |
| 8261 | % If the next token is not a backslash, process the rest of the argument; | ||
| 8262 | % otherwise, remove the next token. | ||
| 8263 | @gdef@look_ahead#1!#2#3#4{% | ||
| 8264 | @ifx#4\% | ||
| 8265 | @expandafter@gobble_and_check_finish | ||
| 8266 | @else | ||
| 8267 | @expandafter@add_segment | ||
| 8268 | @fi#1!{#2}#4#4% | ||
| 8229 | } | 8269 | } |
| 8230 | 8270 | ||
| 8231 | % append a backslash to \arg_result | 8271 | % #1 - THE_MACRO ARG_RESULT |
| 8232 | @gdef@add_the_backslash{% | 8272 | % #2 - PENDING_BS |
| 8233 | @expandafter@gdef@expandafter@arg_result@expandafter{@arg_result\}% | 8273 | % #3 - NEXT_TOKEN |
| 8274 | % #4 should be a backslash, which is gobbled. | ||
| 8275 | % #5 looks ahead | ||
| 8276 | % | ||
| 8277 | % Double backslash found. Add a single backslash, and look ahead. | ||
| 8278 | @gdef@gobble_and_check_finish#1!#2#3#4#5{% | ||
| 8279 | @add_segment#1\!{}#5#5% | ||
| 8234 | } | 8280 | } |
| 8235 | 8281 | ||
| 8282 | @gdef@is_fi{@fi} | ||
| 8283 | |||
| 8284 | % #1 - THE_MACRO ARG_RESULT | ||
| 8285 | % #2 - PENDING_BS | ||
| 8286 | % #3 - NEXT_TOKEN | ||
| 8287 | % #4 is input stream until next backslash | ||
| 8288 | % | ||
| 8236 | % Input stream is either at the start of the argument, or just after a | 8289 | % Input stream is either at the start of the argument, or just after a |
| 8237 | % backslash sequence, either a lone backslash, or a doubled backslash. | 8290 | % backslash sequence, either a lone backslash, or a doubled backslash. |
| 8238 | % \next_token contains the first token in the input stream: if it is \finish, | 8291 | % NEXT_TOKEN contains the first token in the input stream: if it is \finish, |
| 8239 | % finish; otherwise, append to \arg_result the segment of the argument up until | 8292 | % finish; otherwise, append to ARG_RESULT the segment of the argument up until |
| 8240 | % the next backslash. \pending_backslash contains a backslash to represent | 8293 | % the next backslash. PENDING_BACKSLASH contains a backslash to represent |
| 8241 | % a backslash just before the start of the input stream that has not been | 8294 | % a backslash just before the start of the input stream that has not been |
| 8242 | % added to \arg_result. | 8295 | % added to ARG_RESULT. |
| 8243 | @gdef@add_segment#1\{% | 8296 | @gdef@add_segment#1!#2#3#4\{% |
| 8244 | @ifx@next_token@finish | 8297 | @ifx#3@_finish |
| 8245 | @let@next=@call_the_macro% | 8298 | @call_the_macro#1!% |
| 8246 | @else | 8299 | @else |
| 8247 | @let@next=@look_ahead | 8300 | % append the pending backslash to the result, followed by the next segment |
| 8248 | % | 8301 | @expandafter@is_fi@look_ahead#1#2#4!{\}@fi |
| 8249 | % append to @arg_result | 8302 | % this @fi is discarded by @look_ahead. |
| 8250 | % token list registers might be better | 8303 | % we can't get rid of it with \expandafter because we don't know how |
| 8251 | @expandafter@expandafter@expandafter@gdef | 8304 | % long #4 is. |
| 8252 | @expandafter@expandafter@expandafter@arg_result | 8305 | } |
| 8253 | @expandafter@expandafter@expandafter{% | ||
| 8254 | @expandafter@arg_result | ||
| 8255 | @pending_backslash#1}% | ||
| 8256 | @def@pending_backslash{\}% | ||
| 8257 | @fi@next} | ||
| 8258 | 8306 | ||
| 8259 | @gdef@call_the_macro{@expandafter@the_macro@expandafter{@arg_result}} | 8307 | % #1 - THE_MACRO |
| 8308 | % #2 - ARG_RESULT | ||
| 8309 | % #3 discards the res of the conditional in @add_segment, and @is_fi ends the | ||
| 8310 | % conditional. | ||
| 8311 | @gdef@call_the_macro#1#2!#3@fi{@is_fi #1{#2}} | ||
| 8260 | 8312 | ||
| 8261 | } | 8313 | } |
| 8314 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | ||
| 8262 | 8315 | ||
| 8263 | % \braceorline MAC is used for a one-argument macro MAC. It checks | 8316 | % \braceorline MAC is used for a one-argument macro MAC. It checks |
| 8264 | % whether the next non-whitespace character is a {. It sets the context | 8317 | % whether the next non-whitespace character is a {. It sets the context |
| @@ -10818,11 +10871,12 @@ directory should work if nowhere else does.} | |||
| 10818 | % this is not a problem. | 10871 | % this is not a problem. |
| 10819 | \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} | 10872 | \def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} |
| 10820 | 10873 | ||
| 10821 | % Turn off all special characters except @ | 10874 | % Set catcodes for Texinfo file |
| 10822 | % (and those which the user can use as if they were ordinary). | 10875 | |
| 10876 | % Active characters for printing the wanted glyph. | ||
| 10823 | % Most of these we simply print from the \tt font, but for some, we can | 10877 | % Most of these we simply print from the \tt font, but for some, we can |
| 10824 | % use math or other variants that look better in normal text. | 10878 | % use math or other variants that look better in normal text. |
| 10825 | 10879 | % | |
| 10826 | \catcode`\"=\active | 10880 | \catcode`\"=\active |
| 10827 | \def\activedoublequote{{\tt\char34}} | 10881 | \def\activedoublequote{{\tt\char34}} |
| 10828 | \let"=\activedoublequote | 10882 | \let"=\activedoublequote |
| @@ -10832,12 +10886,10 @@ directory should work if nowhere else does.} | |||
| 10832 | 10886 | ||
| 10833 | \catcode`\_=\active | 10887 | \catcode`\_=\active |
| 10834 | \def_{\ifusingtt\normalunderscore\_} | 10888 | \def_{\ifusingtt\normalunderscore\_} |
| 10835 | \let\realunder=_ | ||
| 10836 | % Subroutine for the previous macro. | ||
| 10837 | \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } | 10889 | \def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } |
| 10890 | \let\realunder=_ | ||
| 10838 | 10891 | ||
| 10839 | \catcode`\|=\active | 10892 | \catcode`\|=\active \def|{{\tt\char124}} |
| 10840 | \def|{{\tt\char124}} | ||
| 10841 | 10893 | ||
| 10842 | \chardef \less=`\< | 10894 | \chardef \less=`\< |
| 10843 | \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless | 10895 | \catcode`\<=\active \def\activeless{{\tt \less}}\let< = \activeless |
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 07d34bd4d2f..bd7d921cefe 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -98,6 +98,7 @@ copy and modify this GNU manual.'' | |||
| 98 | 98 | ||
| 99 | @contents | 99 | @contents |
| 100 | 100 | ||
| 101 | |||
| 101 | @ifnottex | 102 | @ifnottex |
| 102 | @node Top, Overview, (dir), (dir) | 103 | @node Top, Overview, (dir), (dir) |
| 103 | @top @value{tramp} version @value{trampver} User Manual | 104 | @top @value{tramp} version @value{trampver} User Manual |
| @@ -176,7 +177,9 @@ For the end user: | |||
| 176 | 177 | ||
| 177 | For the developer: | 178 | For the developer: |
| 178 | 179 | ||
| 179 | * Files directories and localnames:: How file names, directories and localnames are mangled and managed. | 180 | * Files directories and localnames:: |
| 181 | How file names, directories and localnames | ||
| 182 | are mangled and managed. | ||
| 180 | * Traces and Profiles:: How to Customize Traces. | 183 | * Traces and Profiles:: How to Customize Traces. |
| 181 | * Issues:: Debatable Issues and What Was Decided. | 184 | * Issues:: Debatable Issues and What Was Decided. |
| 182 | 185 | ||
| @@ -198,7 +201,7 @@ Installing @value{tramp} with your @value{emacsname} | |||
| 198 | 201 | ||
| 199 | Configuring @value{tramp} for use | 202 | Configuring @value{tramp} for use |
| 200 | 203 | ||
| 201 | * Connection types:: Types of connections made to remote hosts. | 204 | * Connection types:: Types of connections to remote hosts. |
| 202 | * Inline methods:: Inline methods. | 205 | * Inline methods:: Inline methods. |
| 203 | * External methods:: External methods. | 206 | * External methods:: External methods. |
| 204 | @ifset emacsgvfs | 207 | @ifset emacsgvfs |
| @@ -246,149 +249,138 @@ How file names, directories and localnames are mangled and managed | |||
| 246 | @chapter An overview of @value{tramp} | 249 | @chapter An overview of @value{tramp} |
| 247 | @cindex overview | 250 | @cindex overview |
| 248 | 251 | ||
| 249 | After the installation of @value{tramp} into your @value{emacsname}, you | 252 | @value{tramp} is for transparently accessing remote files from within |
| 250 | will be able to access files on remote hosts as though they were | 253 | @value{emacsname}. @value{tramp} enables an easy, convenient, and |
| 251 | local. Access to the remote file system for editing files, version | 254 | consistent interface to remote files as if they are local files. |
| 252 | control, and @code{dired} are transparently enabled. | 255 | @value{tramp}'s transparency extends to editing, version control, and |
| 253 | 256 | @code{dired}. | |
| 254 | Your access to the remote host can be with the @command{rsh}, | 257 | |
| 255 | @command{rlogin}, @command{telnet} programs or with any similar | 258 | @value{tramp} can access remote hosts using any number of access |
| 256 | connection method. This connection must pass @acronym{ASCII} | 259 | methods, such as @command{rsh}, @command{rlogin}, @command{telnet}, |
| 257 | successfully to be usable but need not be 8-bit clean. | 260 | and related programs. If these programs can successfully pass |
| 258 | 261 | @acronym{ASCII]} characters, @value{tramp} can use them. | |
| 259 | The package provides support for @command{ssh} connections out of the | 262 | @value{tramp} does not require or mandate 8-bit clean connections. |
| 260 | box, one of the more common uses of the package. This allows | 263 | |
| 261 | relatively secure access to hosts, especially if @command{ftp} | 264 | @value{tramp}'s most common access method is through @command{ssh}, a |
| 262 | access is disabled. | 265 | more secure alternative to @command{ftp} and other older access |
| 263 | 266 | methods. | |
| 264 | Under Windows, @value{tramp} is integrated with the PuTTY package, | 267 | |
| 265 | using the @command{plink} program. | 268 | @value{tramp} on Windows operating systems is integrated with the |
| 266 | 269 | PuTTY package, and uses the @command{plink} program. | |
| 267 | The majority of activity carried out by @value{tramp} requires only that | 270 | |
| 268 | the remote login is possible and is carried out at the terminal. In | 271 | @value{tramp} mostly operates transparently in the background using |
| 269 | order to access remote files @value{tramp} needs to transfer their content | 272 | the connection programs. As long as these programs enable remote login |
| 270 | to the local host temporarily. | 273 | and can use the terminal, @value{tramp} can adapt them for seamless |
| 271 | 274 | and transparent access. | |
| 272 | @value{tramp} can transfer files between the hosts in a variety of ways. | 275 | |
| 273 | The details are easy to select, depending on your needs and the | 276 | @value{tramp} temporarily transfers a remote file's contents to the |
| 274 | hosts in question. | 277 | local host editing and related operations. @value{tramp} can also |
| 275 | 278 | transfer files between hosts using standard Emacs interfaces, a | |
| 276 | The fastest transfer methods for large files rely on a remote file | 279 | benefit of direct integration of @value{tramp} in @value{emacsname}. |
| 277 | transfer package such as @command{rcp}, @command{scp}, @command{rsync} | 280 | |
| 278 | or (under Windows) @command{pscp}. | 281 | @value{tramp} can transfer files using any number of available host |
| 279 | 282 | programs for remote files, such as @command{rcp}, @command{scp}, | |
| 280 | If the remote copy methods are not suitable for you, @value{tramp} also | 283 | @command{rsync} or (under Windows) @command{pscp}. @value{tramp} |
| 281 | supports the use of encoded transfers directly through the shell. | 284 | provides easy ways to specify these programs and customize them to |
| 282 | This requires that the @command{mimencode} or @command{uuencode} tools | 285 | specific files, hosts, or access methods. |
| 283 | are available on the remote host. These methods are generally | 286 | |
| 284 | faster for small files. | 287 | For faster small-size file transfers, @value{tramp} supports encoded |
| 285 | 288 | transfers directly through the shell using @command{mimencode} or | |
| 286 | @value{tramp} is still under active development and any problems you encounter, | 289 | @command{uuencode} provided such tools are available on the remote |
| 287 | trivial or major, should be reported to the @value{tramp} developers. | 290 | host. |
| 288 | @xref{Bug Reports}. | ||
| 289 | 291 | ||
| 290 | 292 | ||
| 291 | @subsubheading Behind the scenes | 293 | @subsubheading @value{tramp} behind the scenes |
| 292 | @cindex behind the scenes | 294 | @cindex behind the scenes |
| 293 | @cindex details of operation | 295 | @cindex details of operation |
| 294 | @cindex how it works | 296 | @cindex how it works |
| 295 | 297 | ||
| 296 | This section tries to explain what goes on behind the scenes when you | 298 | Accessing a remote file through @value{tramp} entails a series of |
| 297 | access a remote file through @value{tramp}. | 299 | actions, many of which are transparent to the user. Yet some actions |
| 300 | may require user response (such as entering passwords or completing | ||
| 301 | file names). One typical scenario, opening a file on a remote host, is | ||
| 302 | presented here to illustrate the steps involved: | ||
| 298 | 303 | ||
| 299 | Suppose you type @kbd{C-x C-f} and enter part of an @value{tramp} file name, | 304 | @kbd{C-x C-f} to initiate find-file, enter part of the @value{tramp} |
| 300 | then hit @kbd{@key{TAB}} for completion. Suppose further that this is | 305 | file name, then hit @kbd{@key{TAB}} for completion. If this is the |
| 301 | the first time that @value{tramp} is invoked for the host in question. Here's | 306 | first time connection to that host, here's what happens: |
| 302 | what happens: | ||
| 303 | 307 | ||
| 304 | @itemize | 308 | @itemize |
| 305 | @item | 309 | @item |
| 306 | @value{tramp} discovers that it needs a connection to the host. So it | 310 | @value{tramp} invokes @samp{telnet @var{host}} or @samp{rsh @var{host} |
| 307 | invokes @samp{telnet @var{host}} or @samp{rsh @var{host} -l | 311 | -l @var{user}} and establishes an external process to connect to the |
| 308 | @var{user}} or a similar tool to connect to the remote host. | 312 | remote host. @value{tramp} communicates with the process through an |
| 309 | Communication with this process happens through an | 313 | @value{emacsname} buffer, which also shows output from the remote |
| 310 | @value{emacsname} buffer, that is, the output from the remote end | 314 | host. |
| 311 | goes into a buffer. | ||
| 312 | 315 | ||
| 313 | @item | 316 | @item |
| 314 | The remote host may prompt for a login name (for @command{telnet}). | 317 | The remote host may prompt for a login name (for @command{telnet}, for |
| 315 | The login name is given in the file name, so @value{tramp} sends the | 318 | example) in the buffer. If on the other hand, the login name was |
| 316 | login name and a newline. | 319 | included in the file name portion, @value{tramp} sends the login name |
| 320 | followed by a newline. | ||
| 317 | 321 | ||
| 318 | @item | 322 | @item |
| 319 | The remote host may prompt for a password or pass phrase (for | 323 | The remote host may then prompt for a password or pass phrase (for |
| 320 | @command{rsh} or for @command{telnet} after sending the login name). | 324 | @command{rsh} or for @command{telnet}). @value{tramp} displays the |
| 321 | @value{tramp} displays the prompt in the minibuffer, asking you for the | 325 | password prompt in the minibuffer. @value{tramp} then sends whatever |
| 322 | password or pass phrase. | 326 | is entered to the remote host, followed by a newline. |
| 323 | |||
| 324 | You enter the password or pass phrase. @value{tramp} sends it to the remote | ||
| 325 | host, followed by a newline. | ||
| 326 | 327 | ||
| 327 | @item | 328 | @item |
| 328 | @value{tramp} now waits for the shell prompt or for a message that the login | 329 | @value{tramp} now waits for either the shell prompt or a failed login |
| 329 | failed. | 330 | message. |
| 330 | 331 | ||
| 331 | If @value{tramp} sees neither of them after a certain period of time | 332 | If @value{tramp} does not receive any messages within a timeout period |
| 332 | (a minute, say), then it issues an error message saying that it | 333 | (a minute, for example), then @value{tramp} responds with an error |
| 333 | couldn't find the remote shell prompt and shows you what the remote | 334 | message about not finding the remote shell prompt. If any messages |
| 334 | host has sent. | 335 | from the remote host, @value{tramp} displays them in the buffer. |
| 335 | 336 | ||
| 336 | If @value{tramp} sees a @samp{login failed} message, it tells you so, | 337 | For any @samp{login failed} message from the remote host, |
| 337 | aborts the login attempt and allows you to try again. | 338 | @value{tramp} aborts the login attempt, and repeats the login steps |
| 339 | again. | ||
| 338 | 340 | ||
| 339 | @item | 341 | @item |
| 340 | Suppose that the login was successful and @value{tramp} sees the shell prompt | 342 | Upon successful login and @value{tramp} recognizes the shell prompt |
| 341 | from the remote host. Now @value{tramp} invokes @command{/bin/sh} because | 343 | from the remote host, @value{tramp} prepares the shell environment by |
| 342 | Bourne shells and C shells have different command | 344 | turning off echoing, setting shell prompt, and other housekeeping |
| 343 | syntaxes.@footnote{Invoking @command{/bin/sh} will fail if your login | 345 | chores. |
| 344 | shell doesn't recognize @samp{exec /bin/sh} as a valid command. | ||
| 345 | Maybe you use the Scheme shell @command{scsh}@dots{}} | ||
| 346 | 346 | ||
| 347 | After the Bourne shell has come up, @value{tramp} sends a few commands to | 347 | @strong{Note} that for the remote shell, @value{tramp} invokes |
| 348 | ensure a good working environment. It turns off echoing, it sets the | 348 | @command{/bin/sh}. The remote host must recognize @samp{exec /bin/sh} |
| 349 | shell prompt, and a few other things. | 349 | and execute the appropriate shell. This shell must support Bourne |
| 350 | shell syntax. | ||
| 350 | 351 | ||
| 351 | @item | 352 | @item |
| 352 | Now the remote shell is up and it good working order. Remember, what | 353 | @value{tramp} executes @command{cd} and @command{ls} commands to find |
| 353 | was supposed to happen is that @value{tramp} tries to find out what files exist | 354 | which files exist on the remote host. @value{tramp} sometimes uses |
| 354 | on the remote host so that it can do file name completion. | 355 | @command{echo} with globbing. @value{tramp} checks if a file or |
| 355 | 356 | directory is writable with @command{test}. After each command, | |
| 356 | So, @value{tramp} basically issues @command{cd} and @command{ls} commands and | 357 | @value{tramp} parses the output from the remote host for completing |
| 357 | also sometimes @command{echo} with globbing. Another command that is | 358 | the next operation. |
| 358 | often used is @command{test} to find out whether a file is writable or a | ||
| 359 | directory or the like. The output of each command is parsed for the | ||
| 360 | necessary operation. | ||
| 361 | 359 | ||
| 362 | @item | 360 | @item |
| 363 | Suppose you are finished with file name completion, have entered @kbd{C-x | 361 | After remote file name completion, @value{tramp} transfers the file |
| 364 | C-f}, a full file name and hit @kbd{@key{RET}}. Now comes the time to | 362 | contents from the remote host. |
| 365 | transfer the file contents from the remote host to the local host so | ||
| 366 | that you can edit them. | ||
| 367 | |||
| 368 | See above for an explanation of how @value{tramp} transfers the file contents. | ||
| 369 | 363 | ||
| 370 | For inline transfers, @value{tramp} issues a command like @samp{mimencode -b | 364 | For inline transfers, @value{tramp} sends a command, such as |
| 371 | /path/to/remote/file}, waits until the output has accumulated in the | 365 | @samp{mimencode -b /path/to/remote/file}, waits until the output has |
| 372 | buffer that's used for communication, then decodes that output to | 366 | accumulated in the buffer, decodes that output to produce the file's |
| 373 | produce the file contents. | 367 | contents. |
| 374 | 368 | ||
| 375 | For external transfers, @value{tramp} issues a command like the | 369 | For external transfers, @value{tramp} sends a command as follows: |
| 376 | following: | ||
| 377 | @example | 370 | @example |
| 378 | rcp user@@host:/path/to/remote/file /tmp/tramp.4711 | 371 | rcp user@@host:/path/to/remote/file /tmp/tramp.4711 |
| 379 | @end example | 372 | @end example |
| 380 | It then reads the local temporary file @file{/tmp/tramp.4711} into a | 373 | @value{tramp} reads the local temporary file @file{/tmp/tramp.4711} |
| 381 | buffer and deletes the temporary file. | 374 | into a buffer, and then deletes the temporary file. |
| 382 | 375 | ||
| 383 | @item | 376 | @item |
| 384 | You now edit the buffer contents, blithely unaware of what has happened | 377 | Edit, modify, change the buffer contents as normal, and then save the |
| 385 | behind the scenes. (Unless you have read this section, that is.) When | 378 | buffer wth @kbd{C-x C-s}. |
| 386 | you are finished, you type @kbd{C-x C-s} to save the buffer. | ||
| 387 | 379 | ||
| 388 | @item | 380 | @item |
| 389 | Again, @value{tramp} transfers the file contents to the remote host | 381 | @value{tramp} transfers the buffer contents to the remote host in |
| 390 | either inline or external. This is the reverse of what happens when | 382 | a reverse of the process using the appropriate inline or external |
| 391 | reading the file. | 383 | program. |
| 392 | @end itemize | 384 | @end itemize |
| 393 | 385 | ||
| 394 | I hope this has provided you with a basic overview of what happens | 386 | I hope this has provided you with a basic overview of what happens |
| @@ -400,28 +392,23 @@ behind the scenes when you open a file with @value{tramp}. | |||
| 400 | @chapter Obtaining Tramp. | 392 | @chapter Obtaining Tramp. |
| 401 | @cindex obtaining Tramp | 393 | @cindex obtaining Tramp |
| 402 | 394 | ||
| 403 | @value{tramp} is freely available on the Internet and the latest | 395 | @value{tramp} is included as part of Emacs (since Emacs version 22.1). |
| 404 | release may be downloaded from @uref{ftp://ftp.gnu.org/gnu/tramp/}. | ||
| 405 | This release includes the full documentation and code for | ||
| 406 | @value{tramp}, suitable for installation. But Emacs (22 or later) | ||
| 407 | includes @value{tramp} already, and there is a @value{tramp} package | ||
| 408 | for XEmacs, as well. So maybe it is easier to just use those. But if | ||
| 409 | you want the bleeding edge, read on@dots{} | ||
| 410 | 396 | ||
| 411 | For the especially brave, @value{tramp} is available from Git. The Git | 397 | @value{tramp} is also freely packaged for download on the Internet at |
| 412 | version is the latest version of the code and may contain incomplete | 398 | @uref{ftp://ftp.gnu.org/gnu/tramp/}. |
| 413 | features or new issues. Use these versions at your own risk. | ||
| 414 | 399 | ||
| 415 | Instructions for obtaining the latest development version of @value{tramp} | 400 | @value{tramp} development versions are available on Git servers. |
| 416 | from Git can be found by going to the Savannah project page at the | 401 | Development versions contain new and incomplete features. |
| 417 | following URL and then clicking on the Git link in the navigation bar | 402 | |
| 418 | at the top. | 403 | One way to obtain from Git server is to visit the Savannah project |
| 404 | page at the following URL and then clicking on the Git link in the | ||
| 405 | navigation bar at the top. | ||
| 419 | 406 | ||
| 420 | @noindent | 407 | @noindent |
| 421 | @uref{http://savannah.gnu.org/projects/tramp/} | 408 | @uref{http://savannah.gnu.org/projects/tramp/} |
| 422 | 409 | ||
| 423 | @noindent | 410 | @noindent |
| 424 | Or follow the example session below: | 411 | Another way is to follow the terminal session below: |
| 425 | 412 | ||
| 426 | @example | 413 | @example |
| 427 | ] @strong{cd ~/@value{emacsdir}} | 414 | ] @strong{cd ~/@value{emacsdir}} |
| @@ -429,7 +416,7 @@ Or follow the example session below: | |||
| 429 | @end example | 416 | @end example |
| 430 | 417 | ||
| 431 | @noindent | 418 | @noindent |
| 432 | If you reside behind a firewall, you could use | 419 | From behind a firewall: |
| 433 | 420 | ||
| 434 | @example | 421 | @example |
| 435 | ] @strong{git config --global http.proxy http://user:pwd@@proxy.server.com:8080} | 422 | ] @strong{git config --global http.proxy http://user:pwd@@proxy.server.com:8080} |
| @@ -437,16 +424,18 @@ If you reside behind a firewall, you could use | |||
| 437 | @end example | 424 | @end example |
| 438 | 425 | ||
| 439 | @noindent | 426 | @noindent |
| 440 | Tramp developers use instead | 427 | Tramp developers: |
| 441 | 428 | ||
| 442 | @example | 429 | @example |
| 443 | ] @strong{git clone login@@git.sv.gnu.org:/srv/git/tramp.git} | 430 | ] @strong{git clone login@@git.sv.gnu.org:/srv/git/tramp.git} |
| 444 | @end example | 431 | @end example |
| 445 | 432 | ||
| 446 | @noindent | 433 | @noindent |
| 447 | You should now have a directory @file{~/@value{emacsdir}/tramp} | 434 | After one of the above commands, @file{~/@value{emacsdir}/tramp} will |
| 448 | containing the latest version of @value{tramp}. You can fetch the latest | 435 | containing the latest version of @value{tramp}. |
| 449 | updates from the repository by issuing the command: | 436 | |
| 437 | @noindent | ||
| 438 | To fetch updates from the repository, use git pull: | ||
| 450 | 439 | ||
| 451 | @example | 440 | @example |
| 452 | ] @strong{cd ~/@value{emacsdir}/tramp} | 441 | ] @strong{cd ~/@value{emacsdir}/tramp} |
| @@ -454,9 +443,8 @@ updates from the repository by issuing the command: | |||
| 454 | @end example | 443 | @end example |
| 455 | 444 | ||
| 456 | @noindent | 445 | @noindent |
| 457 | Once you've got updated files from the Git repository, you need to run | 446 | Run @command{autoconf} as follows to generate an up-to-date |
| 458 | @command{autoconf} in order to get an up-to-date @file{configure} | 447 | @file{configure} script: |
| 459 | script: | ||
| 460 | 448 | ||
| 461 | @example | 449 | @example |
| 462 | ] @strong{cd ~/@value{emacsdir}/tramp} | 450 | ] @strong{cd ~/@value{emacsdir}/tramp} |
| @@ -469,36 +457,32 @@ script: | |||
| 469 | @cindex history | 457 | @cindex history |
| 470 | @cindex development history | 458 | @cindex development history |
| 471 | 459 | ||
| 472 | Development was started end of November 1998. The package was called | 460 | @value{tramp} development started at the end of November 1998 as |
| 473 | @file{rssh.el}, back then. It only provided one method to access a | 461 | @file{rssh.el}. It provided only one method of access. It used |
| 474 | file, using @command{ssh} to log in to a remote host and using | 462 | @command{ssh} for login and @command{scp} to transfer file contents. |
| 475 | @command{scp} to transfer the file contents. After a while, the name | 463 | The name was changed to @file{rcp.el} before it got its preset name |
| 476 | was changed to @file{rcp.el}, and now it's @value{tramp}. Along the way, | 464 | @value{tramp}. New methods of remote access were added, so was support |
| 477 | many more methods for getting a remote shell and for transferring the | 465 | for version control. |
| 478 | file contents were added. Support for VC was added. | 466 | |
| 479 | 467 | April 2000 was the first time when multi-hop methods were added. In | |
| 480 | After that, there were added the multi-hop methods in April 2000 and | 468 | July 2002, @value{tramp} unified file names with Ange-FTP@. In July |
| 481 | the unification of @value{tramp} and Ange-FTP file names in July 2002. | 469 | 2004, proxy hosts replaced multi-hop methods. Running commands on |
| 482 | In July 2004, multi-hop methods have been replaced by proxy hosts. | 470 | remote hosts was introduced in December 2005. |
| 483 | Running commands on remote hosts was introduced in December 2005. | ||
| 484 | @ifset emacsgw | 471 | @ifset emacsgw |
| 485 | Support of gateways exists since April 2007. | 472 | Support for gateways since April 2007. |
| 486 | @end ifset | 473 | @end ifset |
| 487 | @ifset emacsgvfs | 474 | @ifset emacsgvfs |
| 488 | GVFS integration started in February 2009. | 475 | GVFS integration started in February 2009. |
| 489 | @end ifset | 476 | @end ifset |
| 490 | @ifset emacs | 477 | @ifset emacs |
| 491 | Remote commands on Windows hosts are available since September 2011. | 478 | Remote commands on Windows hosts since September 2011. |
| 492 | @end ifset | 479 | @end ifset |
| 493 | Ad-hoc multi-hop methods (with a changed syntax) have been reenabled | 480 | Ad-hoc multi-hop methods (with a changed syntax) re-enabled in November |
| 494 | in November 2011. In November 2012, Juergen Hoetzel's | 481 | 2011. |
| 495 | @file{tramp-adb.el} has been added. | ||
| 496 | 482 | ||
| 497 | In December 2001, @value{tramp} has been added to the XEmacs package | 483 | In November 2012, added Juergen Hoetzel's @file{tramp-adb.el}. |
| 498 | repository. Being part of the Emacs repository happened in June 2002, | ||
| 499 | the first release including @value{tramp} was Emacs 22.1. | ||
| 500 | 484 | ||
| 501 | @value{tramp} is also a Debian GNU/Linux package since February 2001. | 485 | In December 2001, XEmacs package repository adds @value{tramp}. |
| 502 | 486 | ||
| 503 | 487 | ||
| 504 | @c Installation chapter is necessary only in case of standalone | 488 | @c Installation chapter is necessary only in case of standalone |
| @@ -509,33 +493,25 @@ the first release including @value{tramp} was Emacs 22.1. | |||
| 509 | 493 | ||
| 510 | 494 | ||
| 511 | @node Configuration | 495 | @node Configuration |
| 512 | @chapter Configuring @value{tramp} for use | 496 | @chapter Configuring @value{tramp} |
| 513 | @cindex configuration | 497 | @cindex configuration |
| 514 | |||
| 515 | @cindex default configuration | 498 | @cindex default configuration |
| 516 | @value{tramp} is (normally) fully functional when it is initially | 499 | |
| 517 | installed. It is initially configured to use the @command{scp} | 500 | @value{tramp} is initially configured to use the @command{scp} program |
| 518 | program to connect to the remote host. So in the easiest case, you | 501 | to connect to the remote host. Just type @kbd{C-x C-f} and then enter |
| 519 | just type @kbd{C-x C-f} and then enter the file name | 502 | file name @file{@trampfn{, user, host, /path/to.file}}. For details, |
| 520 | @file{@trampfn{, user, host, /path/to.file}}. | 503 | see @xref{Default Method}. |
| 521 | 504 | ||
| 522 | On some hosts, there are problems with opening a connection. These are | 505 | For problems related to the behavior of remote shell, see @ref{Remote |
| 523 | related to the behavior of the remote shell. See @xref{Remote shell | 506 | shell setup} for details. |
| 524 | setup}, for details on this. | 507 | |
| 525 | 508 | For changing the connection type and file access method from the | |
| 526 | If you do not wish to use these commands to connect to the remote | 509 | defaults to one of several other options, see (@pxref{Connection |
| 527 | host, you should change the default connection and transfer method | 510 | types}). |
| 528 | that @value{tramp} uses. There are several different methods that @value{tramp} | 511 | |
| 529 | can use to connect to remote hosts and transfer files | 512 | @strong{Note} that some user options and variables described in these |
| 530 | (@pxref{Connection types}). | 513 | examples are not auto loaded by @value{emacsname}. All examples |
| 531 | 514 | require @value{tramp} is installed and loaded: | |
| 532 | If you don't know which method is right for you, see @xref{Default | ||
| 533 | Method}. | ||
| 534 | |||
| 535 | @strong{Note} that the following descriptions reference the setting of | ||
| 536 | user options or variables, not all of which are autoloaded by | ||
| 537 | @value{emacsname}. All examples assume that you have loaded | ||
| 538 | @value{tramp} first: | ||
| 539 | 515 | ||
| 540 | @lisp | 516 | @lisp |
| 541 | (require 'tramp) | 517 | (require 'tramp) |
| @@ -543,7 +519,7 @@ user options or variables, not all of which are autoloaded by | |||
| 543 | 519 | ||
| 544 | 520 | ||
| 545 | @menu | 521 | @menu |
| 546 | * Connection types:: Types of connections made to remote hosts. | 522 | * Connection types:: Types of connections to remote hosts. |
| 547 | * Inline methods:: Inline methods. | 523 | * Inline methods:: Inline methods. |
| 548 | * External methods:: External methods. | 524 | * External methods:: External methods. |
| 549 | @ifset emacsgvfs | 525 | @ifset emacsgvfs |
| @@ -574,35 +550,26 @@ user options or variables, not all of which are autoloaded by | |||
| 574 | 550 | ||
| 575 | 551 | ||
| 576 | @node Connection types | 552 | @node Connection types |
| 577 | @section Types of connections made to remote hosts | 553 | @section Types of connections to remote hosts |
| 578 | @cindex connection types, overview | 554 | @cindex connection types, overview |
| 579 | 555 | ||
| 580 | There are two basic types of transfer methods, each with its own | 556 | @dfn{Inline method} and @dfn{external method} are the two basic types |
| 581 | advantages and limitations. Both types of connection make use of a | 557 | of access methods. While they both use the same remote shell access |
| 582 | remote shell access program such as @command{rsh}, @command{ssh} or | 558 | programs, such as @command{rsh}, @command{ssh}, or @command{telnet}, |
| 583 | @command{telnet} to connect to the remote host. | 559 | they differ in the file access methods. Choosing the right method |
| 584 | 560 | becomes important for editing files, transferring large files, or | |
| 585 | This connection is used to perform many of the operations that @value{tramp} | 561 | operating on a large number of files. |
| 586 | requires to make the remote file system transparently accessible from | ||
| 587 | the local host. It is only when visiting files that the methods | ||
| 588 | differ. | ||
| 589 | 562 | ||
| 590 | @cindex inline methods | 563 | @cindex inline methods |
| 591 | @cindex external methods | 564 | @cindex external methods |
| 592 | @cindex methods, inline | 565 | @cindex methods, inline |
| 593 | @cindex methods, external | 566 | @cindex methods, external |
| 594 | Loading or saving a remote file requires that the content of the file | ||
| 595 | be transferred between the two hosts. The content of the file can | ||
| 596 | be transferred using one of two methods: the @dfn{inline method} over | ||
| 597 | the same connection used to log in to the remote host, or the | ||
| 598 | @dfn{external method} through another connection using a remote copy | ||
| 599 | program such as @command{rcp}, @command{scp} or @command{rsync}. | ||
| 600 | 567 | ||
| 601 | The performance of the external methods is generally better than that | 568 | The performance of the external methods is generally better than that |
| 602 | of the inline methods, at least for large files. This is caused by | 569 | of the inline methods, at least for large files. This is caused by |
| 603 | the need to encode and decode the data when transferring inline. | 570 | the need to encode and decode the data when transferring inline. |
| 604 | 571 | ||
| 605 | The one exception to this rule are the @command{scp} based transfer | 572 | The one exception to this rule are the @option{scp}-based access |
| 606 | methods. While these methods do see better performance when actually | 573 | methods. While these methods do see better performance when actually |
| 607 | transferring files, the overhead of the cryptographic negotiation at | 574 | transferring files, the overhead of the cryptographic negotiation at |
| 608 | startup may drown out the improvement in file transfer times. | 575 | startup may drown out the improvement in file transfer times. |
| @@ -621,68 +588,60 @@ action. | |||
| 621 | @cindex inline methods | 588 | @cindex inline methods |
| 622 | @cindex methods, inline | 589 | @cindex methods, inline |
| 623 | 590 | ||
| 624 | The inline methods in @value{tramp} are quite powerful and can work in | 591 | Inline methods use the same login connection to transfer file |
| 625 | situations where you cannot use an external transfer program to | 592 | contents. Inline methods are quick and easy for small files. They |
| 626 | connect. There are also strange inline methods which allow you to | 593 | depend on the availability of suitable encoding and decoding programs |
| 627 | transfer files between @emph{user identities} rather than hosts, see | 594 | on the remote host. For local source and destination, @value{tramp} |
| 628 | below. | 595 | may use built-in equivalents of such programs in @value{emacsname}. |
| 629 | 596 | ||
| 630 | These methods depend on the existence of a suitable encoding and | 597 | Inline methods can work in situations where an external transfer |
| 631 | decoding command on remote host. Locally, @value{tramp} may be able to | 598 | program is unavailable. Inline methods also work when transferring |
| 632 | use features of @value{emacsname} to decode and encode the files or | 599 | files between different @emph{user identities} on the same host. |
| 633 | it may require access to external commands to perform that task. | ||
| 634 | 600 | ||
| 635 | @cindex uuencode | 601 | @cindex uuencode |
| 636 | @cindex mimencode | 602 | @cindex mimencode |
| 637 | @cindex base-64 encoding | 603 | @cindex base-64 encoding |
| 638 | @value{tramp} checks the availability and usability of commands like | ||
| 639 | @command{mimencode} (part of the @command{metamail} package) or | ||
| 640 | @command{uuencode} on the remote host. The first reliable command | ||
| 641 | will be used. The search path can be customized, see @ref{Remote | ||
| 642 | programs}. | ||
| 643 | 604 | ||
| 644 | If both commands aren't available on the remote host, @value{tramp} | 605 | @value{tramp} checks the remote host for the availability and |
| 645 | transfers a small piece of Perl code to the remote host, and tries to | 606 | usability of @command{mimencode} (part of the @command{metamail} |
| 646 | apply it for encoding and decoding. | 607 | package) or @command{uuencode}. @value{tramp} uses the first reliable |
| 608 | command it finds. @value{tramp}'s search path can be customized, see | ||
| 609 | @ref{Remote programs}. | ||
| 647 | 610 | ||
| 648 | The variable @var{tramp-inline-compress-start-size} controls, whether | 611 | In case both @command{mimencode} and @command{uuencode} are |
| 649 | a file shall be compressed before encoding. This could increase | 612 | unavailable, @value{tramp} first transfers a small Perl program to the |
| 650 | transfer speed for large text files. | 613 | remote host, and then tries that program for encoding and decoding. |
| 651 | 614 | ||
| 615 | To increase transfer speeds for large text files, use compression | ||
| 616 | before encoding. The variable @var{tramp-inline-compress-start-size} | ||
| 617 | specifies the file size for such optimization. | ||
| 652 | 618 | ||
| 653 | @table @asis | 619 | @table @asis |
| 654 | @item @option{rsh} | 620 | @item @option{rsh} |
| 655 | @cindex method rsh | 621 | @cindex method rsh |
| 656 | @cindex rsh method | 622 | @cindex rsh method |
| 657 | 623 | ||
| 658 | Connect to the remote host with @command{rsh}. Due to the unsecure | 624 | @command{rsh} is an option for connecting to hosts within local |
| 659 | connection it is recommended for very local host topology only. | 625 | networks since @command{rsh} is not as secure as other methods. |
| 660 | |||
| 661 | On operating systems which provide the command @command{remsh} instead | ||
| 662 | of @command{rsh}, you can use the method @option{remsh}. This is true | ||
| 663 | for HP-UX or Cray UNICOS, for example. | ||
| 664 | 626 | ||
| 665 | 627 | ||
| 666 | @item @option{ssh} | 628 | @item @option{ssh} |
| 667 | @cindex method ssh | 629 | @cindex method ssh |
| 668 | @cindex ssh method | 630 | @cindex ssh method |
| 669 | 631 | ||
| 670 | Connect to the remote host with @command{ssh}. This is identical to | 632 | @command{ssh} is a more secure option than others to connect to a |
| 671 | the previous option except that the @command{ssh} package is used, | 633 | remote host. |
| 672 | making the connection more secure. | ||
| 673 | |||
| 674 | All the methods based on @command{ssh} have an additional feature: you | ||
| 675 | can specify a host name which looks like @file{host#42} (the real host | ||
| 676 | name, then a hash sign, then a port number). This means to connect to | ||
| 677 | the given host but to also pass @code{-p 42} as arguments to the | ||
| 678 | @command{ssh} command. | ||
| 679 | 634 | ||
| 635 | @command{ssh} can also take extra parameters as port numbers. For | ||
| 636 | example, a host on port 42 is specified as @file{host#42} (the real | ||
| 637 | host name, a hash sign, then a port number). It is the same as passing | ||
| 638 | @code{-p 42} to the @command{ssh} command. | ||
| 680 | 639 | ||
| 681 | @item @option{telnet} | 640 | @item @option{telnet} |
| 682 | @cindex method telnet | 641 | @cindex method telnet |
| 683 | @cindex telnet method | 642 | @cindex telnet method |
| 684 | 643 | ||
| 685 | Connect to the remote host with @command{telnet}. This is as unsecure | 644 | Connecting to a remote host with @command{telnet} is as insecure |
| 686 | as the @option{rsh} method. | 645 | as the @option{rsh} method. |
| 687 | 646 | ||
| 688 | 647 | ||
| @@ -690,63 +649,46 @@ as the @option{rsh} method. | |||
| 690 | @cindex method su | 649 | @cindex method su |
| 691 | @cindex su method | 650 | @cindex su method |
| 692 | 651 | ||
| 693 | This method does not connect to a remote host at all, rather it uses | 652 | Instead of connecting to a remote host, @command{su} program allows |
| 694 | the @command{su} program to allow you to edit files as another user. | 653 | editing as another user. The host can be either @samp{localhost} or |
| 695 | That means, the specified host name in the file name must be either | 654 | the host returned by the function @command{(system-name)}. See |
| 696 | @samp{localhost} or the host name as returned by the function | 655 | @ref{Multi-hops} for an exception to this behavior. |
| 697 | @command{(system-name)}. For an exception of this rule see | ||
| 698 | @ref{Multi-hops}. | ||
| 699 | |||
| 700 | 656 | ||
| 701 | @item @option{sudo} | 657 | @item @option{sudo} |
| 702 | @cindex method sudo | 658 | @cindex method sudo |
| 703 | @cindex sudo method | 659 | @cindex sudo method |
| 704 | 660 | ||
| 705 | This is similar to the @option{su} method, but it uses @command{sudo} | 661 | Similar to @option{su} method, @option{sudo} uses @command{sudo}. |
| 706 | rather than @command{su} to become a different user. | 662 | @command{sudo} must have sufficient rights to start a shell. |
| 707 | |||
| 708 | Note that @command{sudo} must be configured to allow you to start a | ||
| 709 | shell as the user. It would be nice if it was sufficient if | ||
| 710 | @command{ls} and @command{mimencode} were allowed, but that is not | ||
| 711 | easy to implement, so I haven't got around to it, yet. | ||
| 712 | |||
| 713 | 663 | ||
| 714 | @item @option{sshx} | 664 | @item @option{sshx} |
| 715 | @cindex method sshx | 665 | @cindex method sshx |
| 716 | @cindex sshx method | 666 | @cindex sshx method |
| 717 | 667 | ||
| 718 | As you would expect, this is similar to @option{ssh}, only a little | 668 | Works like @option{ssh} but without the extra authentication prompts. |
| 719 | different. Whereas @option{ssh} opens a normal interactive shell on | 669 | @option{sshx} uses @samp{ssh -t -t @var{host} -l @var{user} /bin/sh} |
| 720 | the remote host, this option uses @samp{ssh -t -t @var{host} -l | 670 | to open a connection with a ``standard'' login shell. |
| 721 | @var{user} /bin/sh} to open a connection. This is useful for users | ||
| 722 | where the normal login shell is set up to ask them a number of | ||
| 723 | questions when logging in. This procedure avoids these questions, and | ||
| 724 | just gives @value{tramp} a more-or-less ``standard'' login shell to work | ||
| 725 | with. | ||
| 726 | |||
| 727 | Note that this procedure does not eliminate questions asked by | ||
| 728 | @command{ssh} itself. For example, @command{ssh} might ask ``Are you | ||
| 729 | sure you want to continue connecting?'' if the host key of the remote | ||
| 730 | host is not known. @value{tramp} does not know how to deal with such a | ||
| 731 | question (yet), therefore you will need to make sure that you can log | ||
| 732 | in without such questions. | ||
| 733 | 671 | ||
| 734 | This is also useful for Windows users where @command{ssh}, when | 672 | @strong{Note} that @option{sshx} does not bypass authentication |
| 735 | invoked from an @value{emacsname} buffer, tells them that it is not | 673 | questions. For example, if the host key of the remote host is not |
| 736 | allocating a pseudo tty. When this happens, the login shell is wont | 674 | known, @option{sshx} will still ask ``Are you sure you want to |
| 737 | to not print any shell prompt, which confuses @value{tramp} mightily. | 675 | continue connecting?''. @value{tramp} cannot handle such questions. |
| 676 | Connections will have to be setup where logins can proceed without | ||
| 677 | such questions. | ||
| 738 | 678 | ||
| 739 | This supports the @samp{-p} argument. | 679 | @option{sshx} is useful for Windows users when @command{ssh} triggers |
| 680 | an error about allocating a pseudo tty. This happens due to missing | ||
| 681 | shell prompts that confuses @value{tramp}. | ||
| 740 | 682 | ||
| 683 | @option{sshx} supports the @samp{-p} argument. | ||
| 741 | 684 | ||
| 742 | @item @option{krlogin} | 685 | @item @option{krlogin} |
| 743 | @cindex method krlogin | 686 | @cindex method krlogin |
| 744 | @cindex krlogin method | 687 | @cindex krlogin method |
| 745 | @cindex Kerberos (with krlogin method) | 688 | @cindex Kerberos (with krlogin method) |
| 746 | 689 | ||
| 747 | This method is also similar to @option{ssh}. It only uses the | 690 | This method is also similar to @option{ssh}. It uses the |
| 748 | @command{krlogin -x} command to log in to the remote host. | 691 | @command{krlogin -x} command only for remote host login. |
| 749 | |||
| 750 | 692 | ||
| 751 | @item @option{ksu} | 693 | @item @option{ksu} |
| 752 | @cindex method ksu | 694 | @cindex method ksu |
| @@ -760,26 +702,26 @@ This is another method from the Kerberos suite. It behaves like @option{su}. | |||
| 760 | @cindex method plink | 702 | @cindex method plink |
| 761 | @cindex plink method | 703 | @cindex plink method |
| 762 | 704 | ||
| 763 | This method is mostly interesting for Windows users using the PuTTY | 705 | @option{plink} method is for Windows users with the PuTTY |
| 764 | implementation of SSH@. It uses @samp{plink -ssh} to log in to the | 706 | implementation of SSH@. It uses @samp{plink -ssh} to log in to the |
| 765 | remote host. | 707 | remote host. |
| 766 | 708 | ||
| 767 | With a recent PuTTY, it is recommended to check the @samp{Share SSH | 709 | Check the @samp{Share SSH connections if possible} control for that |
| 768 | connections if possible} control for that session. | 710 | session. |
| 769 | 711 | ||
| 770 | This method supports the @samp{-P} argument. | 712 | @option{plink} method supports the @samp{-P} argument. |
| 771 | 713 | ||
| 772 | 714 | ||
| 773 | @item @option{plinkx} | 715 | @item @option{plinkx} |
| 774 | @cindex method plinkx | 716 | @cindex method plinkx |
| 775 | @cindex plinkx method | 717 | @cindex plinkx method |
| 776 | 718 | ||
| 777 | Another method using PuTTY on Windows. Instead of host names, it | 719 | Another method using PuTTY on Windows with session names instead of |
| 778 | expects PuTTY session names, calling @samp{plink -load @var{session} | 720 | host names. @option{plinkx} calls @samp{plink -load @var{session} -t}. |
| 779 | -t}. User names and port numbers must be defined in the session. | 721 | User names and port numbers must be defined in the session. |
| 780 | 722 | ||
| 781 | With a recent PuTTY, it is recommended to check the @samp{Share SSH | 723 | Check the @samp{Share SSH connections if possible} control for that |
| 782 | connections if possible} control for that session. | 724 | session. |
| 783 | 725 | ||
| 784 | @end table | 726 | @end table |
| 785 | 727 | ||
| @@ -789,17 +731,16 @@ connections if possible} control for that session. | |||
| 789 | @cindex methods, external | 731 | @cindex methods, external |
| 790 | @cindex external methods | 732 | @cindex external methods |
| 791 | 733 | ||
| 792 | The external methods operate through multiple channels, using the | 734 | External methods operate over multiple channels, using the remote |
| 793 | remote shell connection for many actions while delegating file | 735 | shell connection for some actions while delegating file transfers to |
| 794 | transfers to an external transfer utility. | 736 | an external transfer program. |
| 795 | 737 | ||
| 796 | This saves the overhead of encoding and decoding that multiplexing the | 738 | External methods save on the overhead of encoding and decoding of |
| 797 | transfer through the one connection has with the inline methods. | 739 | inline methods. |
| 798 | 740 | ||
| 799 | Since external methods need their own overhead opening a new channel, | 741 | Since external methods have the overhead of opening a new channel, |
| 800 | all files which are smaller than @var{tramp-copy-size-limit} are still | 742 | files smaller than @var{tramp-copy-size-limit} still use inline |
| 801 | transferred with the corresponding inline method. It should provide a | 743 | methods. |
| 802 | fair trade-off between both approaches. | ||
| 803 | 744 | ||
| 804 | @table @asis | 745 | @table @asis |
| 805 | @item @option{rcp}---@command{rsh} and @command{rcp} | 746 | @item @option{rcp}---@command{rsh} and @command{rcp} |
| @@ -808,14 +749,12 @@ fair trade-off between both approaches. | |||
| 808 | @cindex rcp (with rcp method) | 749 | @cindex rcp (with rcp method) |
| 809 | @cindex rsh (with rcp method) | 750 | @cindex rsh (with rcp method) |
| 810 | 751 | ||
| 811 | This method uses the @command{rsh} and @command{rcp} commands to connect | 752 | This method uses the @command{rsh} and @command{rcp} commands to |
| 812 | to the remote host and transfer files. This is probably the fastest | 753 | connect to the remote host and transfer files. This is the fastest |
| 813 | connection method available. | 754 | access method available. |
| 814 | 755 | ||
| 815 | The alternative method @option{remcp} uses the @command{remsh} and | 756 | The alternative method @option{remcp} uses the @command{remsh} and |
| 816 | @command{rcp} commands. It should be applied on hosts where | 757 | @command{rcp} commands. |
| 817 | @command{remsh} is used instead of @command{rsh}. | ||
| 818 | |||
| 819 | 758 | ||
| 820 | @item @option{scp}---@command{ssh} and @command{scp} | 759 | @item @option{scp}---@command{ssh} and @command{scp} |
| 821 | @cindex method scp | 760 | @cindex method scp |
| @@ -823,22 +762,16 @@ The alternative method @option{remcp} uses the @command{remsh} and | |||
| 823 | @cindex scp (with scp method) | 762 | @cindex scp (with scp method) |
| 824 | @cindex ssh (with scp method) | 763 | @cindex ssh (with scp method) |
| 825 | 764 | ||
| 826 | Using @command{ssh} to connect to the remote host and @command{scp} to | 765 | Using a combination of @command{ssh} to connect and @command{scp} to |
| 827 | transfer files between the hosts is the best method for securely | 766 | transfer is the most secure. While the performance is good, it is |
| 828 | connecting to a remote host and accessing files. | 767 | slower than the inline methods for smaller files. Though there is no |
| 829 | 768 | overhead of encoding and decoding of the inline methods, | |
| 830 | The performance of this option is also quite good. It may be slower than | 769 | @command{scp}'s cryptographic handshake negates those speed gains. |
| 831 | the inline methods when you often open and close small files however. | ||
| 832 | The cost of the cryptographic handshake at the start of an @command{scp} | ||
| 833 | session can begin to absorb the advantage that the lack of encoding and | ||
| 834 | decoding presents. | ||
| 835 | |||
| 836 | All the @command{ssh} based methods support the @samp{-p} feature | ||
| 837 | where you can specify a port number to connect to in the host name. | ||
| 838 | For example, the host name @file{host#42} tells @value{tramp} to | ||
| 839 | specify @samp{-p 42} in the argument list for @command{ssh}, and to | ||
| 840 | specify @samp{-P 42} in the argument list for @command{scp}. | ||
| 841 | 770 | ||
| 771 | @option{ssh}-based methods support @samp{-p} feature for specifying | ||
| 772 | port numbers. For example, @file{host#42} passes @samp{-p 42} in the | ||
| 773 | argument list to @command{ssh}, and @samp{-P 42} in the argument list | ||
| 774 | to @command{scp}. | ||
| 842 | 775 | ||
| 843 | @item @option{rsync}---@command{ssh} and @command{rsync} | 776 | @item @option{rsync}---@command{ssh} and @command{rsync} |
| 844 | @cindex method rsync | 777 | @cindex method rsync |
| @@ -846,17 +779,12 @@ specify @samp{-P 42} in the argument list for @command{scp}. | |||
| 846 | @cindex rsync (with rsync method) | 779 | @cindex rsync (with rsync method) |
| 847 | @cindex ssh (with rsync method) | 780 | @cindex ssh (with rsync method) |
| 848 | 781 | ||
| 849 | Using the @command{ssh} command to connect securely to the remote | 782 | @command{ssh} command to connect in combination with @command{rsync} |
| 850 | host and the @command{rsync} command to transfer files is almost | 783 | command to transfer is similar to the @option{scp} method. |
| 851 | identical to the @option{scp} method. | ||
| 852 | 784 | ||
| 853 | While @command{rsync} performs much better than @command{scp} when | 785 | @command{rsync} performs much better than @command{scp} when |
| 854 | transferring files that exist on both hosts, this advantage is lost if | 786 | transferring files that exist on both hosts. However, this advantage |
| 855 | the file exists only on one side of the connection. A file can exists | 787 | is lost if the file exists only on one side of the connection. |
| 856 | on both the remote and local host, when you copy a file from/to a | ||
| 857 | remote host. When you just open a file from the remote host (or write | ||
| 858 | a file there), a temporary file on the local side is kept as long as | ||
| 859 | the corresponding buffer, visiting this file, is alive. | ||
| 860 | 788 | ||
| 861 | This method supports the @samp{-p} argument. | 789 | This method supports the @samp{-p} argument. |
| 862 | 790 | ||
| @@ -867,19 +795,13 @@ This method supports the @samp{-p} argument. | |||
| 867 | @cindex scp (with scpx method) | 795 | @cindex scp (with scpx method) |
| 868 | @cindex ssh (with scpx method) | 796 | @cindex ssh (with scpx method) |
| 869 | 797 | ||
| 870 | As you would expect, this is similar to @option{scp}, only a little | 798 | @option{scpx} is useful to avoid login shell questions. It is similar |
| 871 | different. Whereas @option{scp} opens a normal interactive shell on | 799 | in performance to @option{scp}. @option{scpx} uses @samp{ssh -t -t |
| 872 | the remote host, this option uses @samp{ssh -t -t @var{host} -l | 800 | @var{host} -l @var{user} /bin/sh} to open a connection. |
| 873 | @var{user} /bin/sh} to open a connection. This is useful for users | ||
| 874 | where the normal login shell is set up to ask them a number of | ||
| 875 | questions when logging in. This procedure avoids these questions, and | ||
| 876 | just gives @value{tramp} a more-or-less ``standard'' login shell to work | ||
| 877 | with. | ||
| 878 | 801 | ||
| 879 | This is also useful for Windows users where @command{ssh}, when | 802 | @option{sshx} is useful for Windows users when @command{ssh} triggers |
| 880 | invoked from an @value{emacsname} buffer, tells them that it is not | 803 | an error about allocating a pseudo tty. This happens due to missing |
| 881 | allocating a pseudo tty. When this happens, the login shell is wont | 804 | shell prompts that confuses @value{tramp}. |
| 882 | to not print any shell prompt, which confuses @value{tramp} mightily. | ||
| 883 | 805 | ||
| 884 | This method supports the @samp{-p} argument. | 806 | This method supports the @samp{-p} argument. |
| 885 | 807 | ||
| @@ -902,8 +824,8 @@ use the @command{plink} command to connect to the remote host, and | |||
| 902 | they use @command{pscp} or @command{psftp} for transferring the files. | 824 | they use @command{pscp} or @command{psftp} for transferring the files. |
| 903 | These programs are part of PuTTY, an SSH implementation for Windows. | 825 | These programs are part of PuTTY, an SSH implementation for Windows. |
| 904 | 826 | ||
| 905 | With a recent PuTTY, it is recommended to configure the @samp{Share | 827 | Check the @samp{Share SSH connections if possible} control for that |
| 906 | SSH connections if possible} control for that session. | 828 | session. |
| 907 | 829 | ||
| 908 | These methods support the @samp{-P} argument. | 830 | These methods support the @samp{-P} argument. |
| 909 | 831 | ||
| @@ -914,27 +836,22 @@ These methods support the @samp{-P} argument. | |||
| 914 | @cindex fsh (with fcp method) | 836 | @cindex fsh (with fcp method) |
| 915 | @cindex fcp (with fcp method) | 837 | @cindex fcp (with fcp method) |
| 916 | 838 | ||
| 917 | This method is similar to @option{scp}, but it uses the @command{fsh} | 839 | This method is similar to @option{scp}, but uses @command{fsh} to |
| 918 | command to connect to the remote host, and it uses @command{fcp} for | 840 | connect and @command{fcp} to transfer files. @command{fsh/fcp}, a |
| 919 | transferring the files. @command{fsh/fcp} are a front-end for | 841 | front-end for @command{ssh}, reuse @command{ssh} session by |
| 920 | @command{ssh} which allow for reusing the same @command{ssh} session | 842 | submitting several commands. This avoids the startup overhead due to |
| 921 | for submitting several commands. This avoids the startup overhead of | 843 | @command{scp}'s secure connection. Inline methods have similar |
| 922 | @command{scp} (which has to establish a secure connection whenever it | 844 | benefits. |
| 923 | is called). Note, however, that you can also use one of the inline | ||
| 924 | methods to achieve a similar effect. | ||
| 925 | 845 | ||
| 926 | This method uses the command @samp{fsh @var{host} -l @var{user} | 846 | The command used for this connection is: @samp{fsh @var{host} -l |
| 927 | /bin/sh -i} to establish the connection, it does not work to just say | 847 | @var{user} /bin/sh -i} |
| 928 | @command{fsh @var{host} -l @var{user}}. | ||
| 929 | 848 | ||
| 930 | @cindex method fsh | 849 | @cindex method fsh |
| 931 | @cindex fsh method | 850 | @cindex fsh method |
| 932 | 851 | ||
| 933 | There is no inline method using @command{fsh} as the multiplexing | 852 | @option{fsh} has no inline method since the multiplexing it offers is |
| 934 | provided by the program is not very useful in our context. @value{tramp} | 853 | not useful for @value{tramp}. @command{fsh} connects to remote host |
| 935 | opens just one connection to the remote host and then keeps it open, | 854 | and @value{tramp} keeps that one connection open. |
| 936 | anyway. | ||
| 937 | |||
| 938 | 855 | ||
| 939 | @item @option{nc}---@command{telnet} and @command{nc} | 856 | @item @option{nc}---@command{telnet} and @command{nc} |
| 940 | @cindex method nc | 857 | @cindex method nc |
| @@ -942,21 +859,22 @@ anyway. | |||
| 942 | @cindex nc (with nc method) | 859 | @cindex nc (with nc method) |
| 943 | @cindex telnet (with nc method) | 860 | @cindex telnet (with nc method) |
| 944 | 861 | ||
| 945 | Using @command{telnet} to connect to the remote host and @command{nc} | 862 | Using @command{telnet} to connect and @command{nc} to transfer files |
| 946 | for file transfer is often the only possibility to access dumb | 863 | is sometimes the only combination suitable for accessing routers or |
| 947 | devices, like routers or NAS hosts. Those hosts have just a | 864 | NAS hosts. These dumb devices have severely restricted local shells, |
| 948 | restricted @command{busybox} as local shell, and there is no program | 865 | such as the @command{busybox} and do not host any other encode or |
| 949 | to encode and decode files for transfer. | 866 | decode programs. |
| 950 | |||
| 951 | 867 | ||
| 952 | @item @option{ftp} | 868 | @item @option{ftp} |
| 953 | @cindex method ftp | 869 | @cindex method ftp |
| 954 | @cindex ftp method | 870 | @cindex ftp method |
| 955 | 871 | ||
| 956 | This is not a native @value{tramp} method. Instead, it forwards all | 872 | When @value{tramp} uses @option{ftp}, it forwards requests to whatever |
| 957 | requests to @value{ftppackagename}. | 873 | ftp program is specified by @value{ftppackagename}. This external |
| 874 | program must be capable of servicing requests from @value{tramp}. | ||
| 875 | |||
| 958 | @ifset xemacs | 876 | @ifset xemacs |
| 959 | This works only for unified file names, see @ref{Issues}. | 877 | This method works only for unified file names, see @ref{Issues}. |
| 960 | @end ifset | 878 | @end ifset |
| 961 | 879 | ||
| 962 | 880 | ||
| @@ -964,83 +882,107 @@ This works only for unified file names, see @ref{Issues}. | |||
| 964 | @cindex method smb | 882 | @cindex method smb |
| 965 | @cindex smb method | 883 | @cindex smb method |
| 966 | 884 | ||
| 967 | This is another not native @value{tramp} method. It uses the | 885 | This is another non-native @value{tramp} method. @command{smbclient} |
| 968 | @command{smbclient} command on different Unices in order to connect to | 886 | connects to any host with SMB/CIFS protocol, such as MS Windows and |
| 969 | an SMB server. An SMB server might be a Samba (or CIFS) server on | 887 | Samba Servers running on Unixes. Tests show this @value{tramp} method |
| 970 | another UNIX host or, more interesting, a host running MS Windows. So | 888 | works with MS Windows NT, MS Windows 2000, MS Windows XP, MS Windows |
| 971 | far, it is tested against MS Windows NT, MS Windows 2000, MS Windows | 889 | Vista, and MS Windows 7. |
| 972 | XP, MS Windows Vista, and MS Windows 7. | 890 | |
| 973 | 891 | Using @command{smbclient} requires a few tweaks when working with | |
| 974 | The first directory in the localname must be a share name on the remote | 892 | @value{tramp}: |
| 975 | host. Remember that the @code{$} character, in which default shares | 893 | |
| 976 | usually end, must be written @code{$$} due to environment variable | 894 | The first directory in the localname must be a share name on the |
| 977 | substitution in file names. If no share name is given (i.e., remote | 895 | remote host. |
| 978 | directory @code{/}), all available shares are listed. | 896 | |
| 979 | 897 | Since smb shares end in the @code{$} character, @value{tramp} must use | |
| 980 | Since authorization is done on share level, you will always be | 898 | @code{$$} when specifying those shares to avoid environment variable |
| 981 | prompted for a password if you access another share on the same host. | 899 | substitutions. |
| 982 | This can be suppressed by @ref{Password handling}. | 900 | |
| 983 | 901 | When @value{tramp} is not specific about the share name or uses the | |
| 984 | For authorization, MS Windows uses both a user name and a domain name. | 902 | generic remote directory @code{/}, @command{smbclient} returns all |
| 985 | Because of this, the @value{tramp} syntax has been extended: you can | 903 | available shares. |
| 986 | specify a user name which looks like @code{user%domain} (the real user | 904 | |
| 987 | name, then a percent sign, then the domain name). So, to connect to | 905 | Since SMB authentication is based on each SMB share, @value{tramp} |
| 988 | the host @code{melancholia} as user @code{daniel} of the domain | 906 | prompts for a password even when accessing a different share on the |
| 989 | @code{BIZARRE}, and edit @file{.emacs} in the home directory (share | 907 | same SMB host. This prompting can be suppressed by @ref{Password |
| 990 | @code{daniel$}) I would specify the file name @file{@trampfn{smb, | 908 | handling}. |
| 991 | daniel%BIZARRE, melancholia, /daniel$$/.emacs}}. | 909 | |
| 992 | 910 | To accommodate user name/domain name syntax required by MS Windows | |
| 993 | Depending on the Windows domain configuration, a Windows user might be | 911 | authorization, @value{tramp} provides for an extended syntax in |
| 994 | considered as domain user per default. In order to connect as local | 912 | @code{user%domain} format (where user is username, @code{%} is the |
| 995 | user, the WINS name of that host must be given as domain name. | 913 | percent symbol, and domain is the windows domain name). An example: |
| 996 | Usually, it is the host name in capital letters. In the example | 914 | |
| 997 | above, the local user @code{daniel} would be specified as | 915 | @example |
| 998 | @file{@trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs}}. | 916 | @trampfn{smb, daniel%BIZARRE, melancholia, /daniel$$/.emacs} |
| 999 | 917 | @end example | |
| 1000 | The domain name as well as the user name are optional. If no user | 918 | |
| 1001 | name is specified at all, the anonymous user (without password | 919 | where user @code{daniel} connects as a domain user to the SMB host |
| 1002 | prompting) is assumed. This is different from all other @value{tramp} | 920 | @code{melancholia} in the windows domain @code{BIZARRE} to edit |
| 1003 | methods, where in such a case the local user name is taken. | 921 | @file{.emacs} located in the home directory (share @code{daniel$}). |
| 1004 | 922 | ||
| 1005 | The @option{smb} method supports the @samp{-p} argument. | 923 | Alternatively, for local WINS users (as opposed to domain users), |
| 1006 | 924 | substitute the domain name with the name of the local host in | |
| 1007 | @strong{Please note:} If @value{emacsname} runs locally under MS | 925 | UPPERCASE as shown here: |
| 1008 | Windows, this method isn't available. Instead, you can use UNC | 926 | |
| 1009 | file names like @file{//melancholia/daniel$$/.emacs}. The only | 927 | @example |
| 1010 | disadvantage is that there's no possibility to specify another user | 928 | @trampfn{smb, daniel%MELANCHOLIA, melancholia, /daniel$$/.emacs} |
| 1011 | name. | 929 | @end example |
| 930 | |||
| 931 | where user @code{daniel} connects as local user to the SMB host | ||
| 932 | @code{melancholia} in the local domain @code{MELANCHOLIA} to edit | ||
| 933 | @file{.emacs} located in the home directory (share @code{daniel$}). | ||
| 934 | |||
| 935 | The domain name and user name are optional for @command{smbclient} | ||
| 936 | authentication. When user name is not specified, @command{smbclient} | ||
| 937 | uses the anonymous user (without prompting for password). This | ||
| 938 | behavior is unlike other @value{tramp} methods, where local user name | ||
| 939 | is substituted. | ||
| 940 | |||
| 941 | @option{smb} method is unavailable if @value{emacsname} is run under a | ||
| 942 | local user authentication context in MS Windows. However such users | ||
| 943 | can still access remote files using UNC file names instead of @value{tramp}: | ||
| 944 | |||
| 945 | @example | ||
| 946 | //melancholia/daniel$$/.emacs | ||
| 947 | @end example | ||
| 948 | |||
| 949 | UNC file name specification does not allow to specify a different user | ||
| 950 | name for authentication like the @command{smbclient} can. | ||
| 1012 | 951 | ||
| 1013 | 952 | ||
| 1014 | @item @option{adb} | 953 | @item @option{adb} |
| 1015 | @cindex method adb | 954 | @cindex method adb |
| 1016 | @cindex adb method | 955 | @cindex adb method |
| 1017 | 956 | ||
| 1018 | This special method uses the Android Debug Bridge for accessing | 957 | This method uses Android Debug Bridge program for accessing Android |
| 1019 | Android devices. The Android Debug Bridge must be installed locally. | 958 | devices. The Android Debug Bridge must be installed locally for |
| 1020 | Some GNU/Linux distributions offer it for installation, otherwise it | 959 | @value{tramp} to work. Some GNU/Linux distributions provide Android |
| 1021 | can be installed as part of the Android SDK@. If the @command{adb} | 960 | Debug Bridge as an installation package. Alternatively, the program is |
| 1022 | program is not found via the @env{PATH} environment variable, the | 961 | installed as part of the Android SDK@. @value{tramp} finds the |
| 1023 | variable @var{tramp-adb-program} must point to its absolute path. | 962 | @command{adb} program either via the @env{PATH} environment variable |
| 1024 | 963 | or the absolute path set in the variable @var{tramp-adb-program}. | |
| 1025 | @value{tramp} does not connect Android devices to @command{adb}, | 964 | |
| 1026 | unless the custom option @option{tramp-adb-connect-if-not-connected} | 965 | @value{tramp} connects to Android devices with @option{adb} only when |
| 1027 | is non-@code{nil}. If there is exactly one Android device connected | 966 | the custom option @option{tramp-adb-connect-if-not-connected} is not |
| 1028 | to @command{adb}, a host name is not needed in the remote file name. | 967 | @code{nil}. Otherwise, the connection must be established outside |
| 1029 | The default @value{tramp} name to be used is @file{@trampfn{adb, , ,}}, | 968 | @value{emacsname}. |
| 1030 | therefore. Otherwise, one could find potential host names with the | 969 | |
| 1031 | command @command{adb devices}. | 970 | @value{tramp} does not require a host name part of the remote file |
| 1032 | 971 | name when a single Android device is connected to @command{adb}. | |
| 1033 | Usually, the @command{adb} method does not need any user name. It | 972 | @value{tramp} instead uses @file{@trampfn{adb, , ,}} as the default |
| 1034 | runs under the permissions of the @command{adbd} process on the | 973 | name. @command{adb devices} shows available host names. |
| 1035 | Android device. If a user name is specified, @value{tramp} applies an | 974 | |
| 1036 | @command{su} on the device. This does not work with all Android | 975 | @option{adb} method normally does not need user name to authenticate |
| 1037 | devices, especially with unrooted ones. In that case, an error | 976 | on the Andriod device because it runs under the @command{adbd} |
| 1038 | message is displayed. | 977 | process. But when a user name is specified, however, @value{tramp} |
| 1039 | 978 | applies an @command{su} in the syntax. When authentication does not | |
| 1040 | If a device shall be connected via TCP/IP, it is possible to declare | 979 | succeed, especially on un-rooted Android devices, @value{tramp} |
| 1041 | the port number to be used like @file{device#42}. Without a port | 980 | displays login errors. |
| 1042 | number, the default value as declared in @command{adb} will be used. | 981 | |
| 1043 | Port numbers are not applicable to Android devices connected via USB. | 982 | For Andriod devices connected through TCP/IP, a port number can be |
| 983 | specified using @file{device#42} host name syntax or @value{tramp} can | ||
| 984 | use the default value as declared in @command{adb} command. Port | ||
| 985 | numbers are not applicable to Android devices connected through USB@. | ||
| 1044 | 986 | ||
| 1045 | @end table | 987 | @end table |
| 1046 | 988 | ||
| @@ -1052,75 +994,68 @@ Port numbers are not applicable to Android devices connected via USB. | |||
| 1052 | @cindex gvfs based methods | 994 | @cindex gvfs based methods |
| 1053 | @cindex dbus | 995 | @cindex dbus |
| 1054 | 996 | ||
| 1055 | The connection methods described in this section are based on GVFS | 997 | GVFS is the virtual file system for the Gnome Desktop, |
| 1056 | @uref{http://en.wikipedia.org/wiki/GVFS}. Via GVFS, the remote | 998 | @uref{http://en.wikipedia.org/wiki/GVFS}. Remote files on GVFS are |
| 1057 | filesystem is mounted locally through FUSE@. @value{tramp} uses | 999 | mounted locally through FUSE and @value{tramp} uses this locally |
| 1058 | this local mounted directory internally. | 1000 | mounted directory internally. |
| 1059 | 1001 | ||
| 1060 | The communication with GVFS is implemented via D-Bus messages. | 1002 | @value{emacsname} uses the D-Bus mechanism to communicate with GVFS@. |
| 1061 | Therefore, your @value{emacsname} must have D-Bus integration, | 1003 | @value{emacsname} must have the message bus system, D-Bus integration |
| 1062 | @pxref{Top, , D-Bus, dbus}. | 1004 | active, @pxref{Top, , D-Bus, dbus}. |
| 1063 | 1005 | ||
| 1064 | @table @asis | 1006 | @table @asis |
| 1065 | @item @option{afp} | 1007 | @item @option{afp} |
| 1066 | @cindex method afp | 1008 | @cindex method afp |
| 1067 | @cindex afp method | 1009 | @cindex afp method |
| 1068 | 1010 | ||
| 1069 | Access to Mac OS X volumes via the Apple Filing Protocol is offered by | 1011 | This method is for connecting to remote hosts with the Apple Filing |
| 1070 | this method. The access must always be performed with a leading | 1012 | Protocol for accessing files on Mac OS X volumes. @value{tramp} access |
| 1071 | volume (share) name, like @file{@trampfn{afp, user, host, /volume}}. | 1013 | syntax requires a leading volume (share) name, for example: |
| 1072 | 1014 | @file{@trampfn{afp, user, host, /volume}}. | |
| 1073 | |||
| 1074 | 1015 | ||
| 1075 | @item @option{dav} | 1016 | @item @option{dav} |
| 1017 | @item @option{davs} | ||
| 1076 | @cindex method dav | 1018 | @cindex method dav |
| 1077 | @cindex method davs | 1019 | @cindex method davs |
| 1078 | @cindex dav method | 1020 | @cindex dav method |
| 1079 | @cindex davs method | 1021 | @cindex davs method |
| 1080 | 1022 | ||
| 1081 | This method provides access to WebDAV files and directories. There | 1023 | @option{dav} method provides access to WebDAV files and directories |
| 1082 | exists also the external method @option{davs}, which uses SSL | 1024 | based on standard protocols, such as HTTP@. @option{davs} does the same |
| 1083 | encryption for the access. | 1025 | but with SSL encryption. Both methods support the port numbers. |
| 1084 | |||
| 1085 | Both methods support the port number specification as discussed above. | ||
| 1086 | |||
| 1087 | 1026 | ||
| 1088 | @item @option{obex} | 1027 | @item @option{obex} |
| 1089 | @cindex method obex | 1028 | @cindex method obex |
| 1090 | @cindex obex method | 1029 | @cindex obex method |
| 1091 | 1030 | ||
| 1092 | OBEX is an FTP-like access protocol for simple devices, like cell | 1031 | OBEX is an FTP-like access protocol for cell phones and similar simple |
| 1093 | phones. For the time being, @value{tramp} only supports OBEX over Bluetooth. | 1032 | devices. @value{tramp} supports OBEX over Bluetooth. |
| 1094 | 1033 | ||
| 1095 | 1034 | ||
| 1096 | @item @option{sftp} | 1035 | @item @option{sftp} |
| 1097 | @cindex method sftp | 1036 | @cindex method sftp |
| 1098 | @cindex sftp method | 1037 | @cindex sftp method |
| 1099 | 1038 | ||
| 1100 | As you might expect, this method uses @command{sftp} in order to | 1039 | This method uses @command{sftp} in order to securely access remote |
| 1101 | access the remote host. Contrary to the @option{ssh} and @option{scp} | 1040 | hosts. @command{sftp} is a more secure option for connecting to hosts |
| 1102 | methods, it doesn't open an @command{ssh} session for login. | 1041 | that for security reasons refuse @command{ssh} connections. |
| 1103 | Therefore, it could be used to access to remote hosts which refuse | ||
| 1104 | @command{ssh} for security reasons. | ||
| 1105 | |||
| 1106 | 1042 | ||
| 1107 | @item @option{synce} | 1043 | @item @option{synce} |
| 1108 | @cindex method synce | 1044 | @cindex method synce |
| 1109 | @cindex synce method | 1045 | @cindex synce method |
| 1110 | 1046 | ||
| 1111 | The @option{synce} method allows communication with Windows Mobile | 1047 | @option{synce} method allows connecting to Windows Mobile devices. It |
| 1112 | devices. Beside GVFS for mounting remote files and directories via | 1048 | uses GVFS for mounting remote files and directories via FUSE and |
| 1113 | FUSE, it also needs the SYNCE-GVFS plugin. | 1049 | requires the SYNCE-GVFS plugin. |
| 1114 | 1050 | ||
| 1115 | @end table | 1051 | @end table |
| 1116 | 1052 | ||
| 1117 | @vindex tramp-gvfs-methods | ||
| 1118 | @defopt tramp-gvfs-methods | 1053 | @defopt tramp-gvfs-methods |
| 1119 | This custom option, a list, defines the external methods which shall | 1054 | @vindex tramp-gvfs-methods |
| 1120 | be used with GVFS@. Per default, these are @option{afp}, | 1055 | This custom option is a list of external methods for GVFS@. By |
| 1121 | @option{dav}, @option{davs}, @option{obex}, @option{sftp} and | 1056 | default, this list includes @option{afp}, @option{dav}, @option{davs}, |
| 1122 | @option{synce}. Other possible values are @option{ftp} and | 1057 | @option{obex}, @option{sftp} and @option{synce}. Other methods to |
| 1123 | @option{smb}. | 1058 | include are: @option{ftp} and @option{smb}. |
| 1124 | @end defopt | 1059 | @end defopt |
| 1125 | @end ifset | 1060 | @end ifset |
| 1126 | 1061 | ||
| @@ -1131,20 +1066,19 @@ be used with GVFS@. Per default, these are @option{afp}, | |||
| 1131 | @cindex methods, gateway | 1066 | @cindex methods, gateway |
| 1132 | @cindex gateway methods | 1067 | @cindex gateway methods |
| 1133 | 1068 | ||
| 1134 | Gateway methods are not methods to access a remote host directly. | 1069 | Gateway methods are for proxy host declarations (@pxref{Multi-hops}) |
| 1135 | These methods are intended to pass firewalls or proxy servers. | 1070 | so as to pass through firewalls and proxy servers. They are not like |
| 1136 | Therefore, they can be used for proxy host declarations | 1071 | the other methods that declare direct connections to a remote host. |
| 1137 | (@pxref{Multi-hops}) only. | ||
| 1138 | 1072 | ||
| 1139 | A gateway method must always come along with a method which supports | 1073 | A gateway method always comes with a port setting. @value{tramp} |
| 1140 | port setting. This is because @value{tramp} targets the accompanied | 1074 | targets the port number with the gateway method |
| 1141 | method to @file{localhost#random_port}, from where the firewall or | 1075 | @file{localhost#random_port} from where the firewall or proxy server |
| 1142 | proxy server is accessed. | 1076 | is accessed. |
| 1143 | 1077 | ||
| 1144 | Gateway methods support user name and password declarations. These | 1078 | Gateway methods support user name and password declarations for |
| 1145 | are used to authenticate towards the corresponding firewall or proxy | 1079 | authenticating the corresponding firewall or proxy server. Such |
| 1146 | server. They can be passed only if your friendly administrator has | 1080 | authentication can be passed through only if granted access by system |
| 1147 | granted your access. | 1081 | administrators. |
| 1148 | 1082 | ||
| 1149 | @table @asis | 1083 | @table @asis |
| 1150 | @item @option{tunnel} | 1084 | @item @option{tunnel} |
| @@ -1152,23 +1086,22 @@ granted your access. | |||
| 1152 | @cindex tunnel method | 1086 | @cindex tunnel method |
| 1153 | 1087 | ||
| 1154 | This method implements an HTTP tunnel via the @command{CONNECT} | 1088 | This method implements an HTTP tunnel via the @command{CONNECT} |
| 1155 | command (see RFC 2616, 2817). Any HTTP 1.1 compliant (proxy) server | 1089 | command (conforming to RFC 2616, 2817 specifications). Proxy servers |
| 1156 | shall support this command. | 1090 | using HTTP version 1.1 or later protocol support this command. |
| 1157 | 1091 | ||
| 1158 | As authentication method, only @option{Basic Authentication} (see RFC | 1092 | For authentication, this protocol uses only @option{Basic |
| 1159 | 2617) is implemented so far. If no port number is given in the | 1093 | Authentication} (see RFC 2617). When no port number is specified, this |
| 1160 | declaration, port @option{8080} is used for the proxy server. | 1094 | protocol defaults to @option{8080}. |
| 1161 | 1095 | ||
| 1162 | 1096 | ||
| 1163 | @item @option{socks} | 1097 | @item @option{socks} |
| 1164 | @cindex method socks | 1098 | @cindex method socks |
| 1165 | @cindex socks method | 1099 | @cindex socks method |
| 1166 | 1100 | ||
| 1167 | The @command{socks} method provides access to SOCKSv5 servers (see | 1101 | The @option{socks} method connects to SOCKSv5 servers (see RFC 1928) |
| 1168 | RFC 1928). @option{Username/Password Authentication} according to RFC | 1102 | and supports @option{Username/Password Authentication}. |
| 1169 | 1929 is supported. | ||
| 1170 | 1103 | ||
| 1171 | The default port number of the socks server is @option{1080}, if not | 1104 | The default port number for the socks server is @option{1080}, if not |
| 1172 | specified otherwise. | 1105 | specified otherwise. |
| 1173 | 1106 | ||
| 1174 | @end table | 1107 | @end table |
| @@ -1178,21 +1111,23 @@ specified otherwise. | |||
| 1178 | @node Default Method | 1111 | @node Default Method |
| 1179 | @section Selecting a default method | 1112 | @section Selecting a default method |
| 1180 | @cindex default method | 1113 | @cindex default method |
| 1181 | |||
| 1182 | @vindex tramp-default-method | 1114 | @vindex tramp-default-method |
| 1183 | When you select an appropriate transfer method for your typical usage | 1115 | @vindex tramp-default-method-alist |
| 1184 | you should set the variable @code{tramp-default-method} to reflect that | 1116 | |
| 1185 | choice. This variable controls which method will be used when a method | 1117 | Default method is for transferring files. The variable |
| 1186 | is not specified in the @value{tramp} file name. For example: | 1118 | @code{tramp-default-method} sets it. @value{tramp} uses this variable |
| 1119 | to determine the default method for tramp file names that do not have | ||
| 1120 | one specified. | ||
| 1187 | 1121 | ||
| 1188 | @lisp | 1122 | @lisp |
| 1189 | (setq tramp-default-method "ssh") | 1123 | (setq tramp-default-method "ssh") |
| 1190 | @end lisp | 1124 | @end lisp |
| 1191 | 1125 | ||
| 1192 | @vindex tramp-default-method-alist | 1126 | Default methods for transferring files can be customized for specific |
| 1193 | You can also specify different methods for certain user/host | 1127 | user and host combinations through the alist variable |
| 1194 | combinations, via the variable @code{tramp-default-method-alist}. For | 1128 | @code{tramp-default-method-alist}. |
| 1195 | example, the following two lines specify to use the @option{ssh} | 1129 | |
| 1130 | For example, the following two lines specify to use the @option{ssh} | ||
| 1196 | method for all user names matching @samp{john} and the @option{rsync} | 1131 | method for all user names matching @samp{john} and the @option{rsync} |
| 1197 | method for all host names matching @samp{lily}. The third line | 1132 | method for all host names matching @samp{lily}. The third line |
| 1198 | specifies to use the @option{su} method for the user @samp{root} on | 1133 | specifies to use the @option{su} method for the user @samp{root} on |
| @@ -1207,95 +1142,82 @@ the host @samp{localhost}. | |||
| 1207 | 1142 | ||
| 1208 | @noindent | 1143 | @noindent |
| 1209 | See the documentation for the variable | 1144 | See the documentation for the variable |
| 1210 | @code{tramp-default-method-alist} for more details. | 1145 | @code{tramp-default-method-alist} for details. |
| 1211 | 1146 | ||
| 1212 | External methods are normally preferable to inline methods, giving | 1147 | @noindent |
| 1213 | better performance. | 1148 | External methods performance faster for large files. |
| 1214 | 1149 | ||
| 1150 | @noindent | ||
| 1215 | @xref{Inline methods}. | 1151 | @xref{Inline methods}. |
| 1216 | @xref{External methods}. | 1152 | @xref{External methods}. |
| 1217 | 1153 | ||
| 1218 | Another consideration with the selection of transfer methods is the | 1154 | Choosing the access method also depends on the security environment. |
| 1219 | environment you will use them in and, especially when used over the | 1155 | For example, @option{rsh} and @option{telnet} methods that use clear |
| 1220 | Internet, the security implications of your preferred method. | 1156 | text password transfers are inappropriate for over the Internet |
| 1157 | connections. Secure remote connections should use @option{ssh} that | ||
| 1158 | provide encryption. | ||
| 1221 | 1159 | ||
| 1222 | The @option{rsh} and @option{telnet} methods send your password as | ||
| 1223 | plain text as you log in to the remote host, as well as | ||
| 1224 | transferring the files in such a way that the content can easily be | ||
| 1225 | read from other hosts. | ||
| 1226 | 1160 | ||
| 1227 | If you need to connect to remote systems that are accessible from the | 1161 | @subsection Which method to use? |
| 1228 | Internet, you should give serious thought to using @option{ssh} based | 1162 | @cindex choosing the right method |
| 1229 | methods to connect. These provide a much higher level of security, | ||
| 1230 | making it a non-trivial exercise for someone to obtain your password | ||
| 1231 | or read the content of the files you are editing. | ||
| 1232 | 1163 | ||
| 1164 | @value{tramp} provides maximum number of choices for maximum | ||
| 1165 | flexibility. Choosing which method depends on the hosts, clients, | ||
| 1166 | network speeds, and the security context. | ||
| 1233 | 1167 | ||
| 1234 | @subsection Which method is the right one for me? | 1168 | Start by using an inline method. |
| 1235 | @cindex choosing the right method | ||
| 1236 | 1169 | ||
| 1237 | Given all of the above, you are probably thinking that this is all fine | 1170 | External methods might be more efficient for large files, but most |
| 1238 | and good, but it's not helping you to choose a method! Right you are. | 1171 | @value{tramp} users edit small files more often than large files. |
| 1239 | As a developer, we don't want to boss our users around but give them | ||
| 1240 | maximum freedom instead. However, the reality is that some users would | ||
| 1241 | like to have some guidance, so here I'll try to give you this guidance | ||
| 1242 | without bossing you around. You tell me whether it works @dots{} | ||
| 1243 | |||
| 1244 | My suggestion is to use an inline method. For large files, external | ||
| 1245 | methods might be more efficient, but I guess that most people will | ||
| 1246 | want to edit mostly small files. And if you access large text files, | ||
| 1247 | compression (driven by @var{tramp-inline-compress-start-size}) shall | ||
| 1248 | still result in good performance. | ||
| 1249 | |||
| 1250 | I guess that these days, most people can access a remote host by | ||
| 1251 | using @command{ssh}. So I suggest that you use the @option{ssh} | ||
| 1252 | method. So, type @kbd{C-x C-f @trampfn{ssh, root, otherhost, | ||
| 1253 | /etc/motd} @key{RET}} to edit the @file{/etc/motd} file on the other | ||
| 1254 | host. | ||
| 1255 | 1172 | ||
| 1256 | If you can't use @option{ssh} to log in to the remote host, then | 1173 | Enable compression, @var{tramp-inline-compress-start-size}, for a |
| 1257 | select a method that uses a program that works. For instance, Windows | 1174 | performance boost for large files. |
| 1258 | users might like the @option{plink} method which uses the PuTTY | ||
| 1259 | implementation of @command{ssh}. Or you use Kerberos and thus like | ||
| 1260 | @option{krlogin}. | ||
| 1261 | 1175 | ||
| 1262 | For the special case of editing files on the local host as another | 1176 | Since @command{ssh} has become the most common method of remote host |
| 1263 | user, see the @option{su} or @option{sudo} methods. They offer | 1177 | access and it has the most reasonable security protocols, use |
| 1264 | shortened syntax for the @samp{root} account, like | 1178 | @option{ssh} method. Typical @option{ssh} usage to edit the |
| 1265 | @file{@trampfn{su, , , /etc/motd}}. | 1179 | @file{/etc/motd} file on the otherhost: |
| 1266 | 1180 | ||
| 1267 | People who edit large files may want to consider @option{scp} instead | 1181 | @example |
| 1268 | of @option{ssh}, or @option{pscp} instead of @option{plink}. These | 1182 | @kbd{C-x C-f @trampfn{ssh, root, otherhost,/etc/motd} @key{RET}} |
| 1269 | external methods are faster than inline methods for large files. | 1183 | @end example |
| 1270 | Note, however, that external methods suffer from some limitations. | 1184 | |
| 1271 | Please try first whether you really get a noticeable speed advantage | 1185 | If @option{ssh} is unavailable for whatever reason, look for other |
| 1272 | from using an external method! Maybe even for large files, inline | 1186 | obvious options. For Windows, try the @option{plink} method. For |
| 1273 | methods are fast enough. | 1187 | Kerberos, try @option{krlogin}. |
| 1188 | |||
| 1189 | For editing local files as @option{su} or @option{sudo} methods, try | ||
| 1190 | the shortened syntax of @samp{root}: | ||
| 1191 | |||
| 1192 | @example | ||
| 1193 | @kbd{C-x C-f @trampfn{su, , , /etc/motd} @key{RET}} | ||
| 1194 | @end example | ||
| 1195 | |||
| 1196 | For editing large files, @option{scp} is faster than @option{ssh}. | ||
| 1197 | @option{pscp} is faster than @option{plink}. But this speed | ||
| 1198 | improvement is not always true. | ||
| 1274 | 1199 | ||
| 1275 | 1200 | ||
| 1276 | @node Default User | 1201 | @node Default User |
| 1277 | @section Selecting a default user | 1202 | @section Selecting a default user |
| 1278 | @cindex default user | 1203 | @cindex default user |
| 1204 | @vindex tramp-default-user | ||
| 1205 | @vindex tramp-default-user-alist | ||
| 1279 | 1206 | ||
| 1280 | The user part of a @value{tramp} file name can be omitted. Usually, | 1207 | @value{tramp} file name can omit the user name part since |
| 1281 | it is replaced by the user name you are logged in. Often, this is not | 1208 | @value{tramp} substitutes the currently logged-in user name. However |
| 1282 | what you want. A typical use of @value{tramp} might be to edit some | 1209 | this substitution can be overridden with @code{tramp-default-user}. |
| 1283 | files with root permissions on the local host. This case, you should | ||
| 1284 | set the variable @code{tramp-default-user} to reflect that choice. | ||
| 1285 | For example: | 1210 | For example: |
| 1286 | 1211 | ||
| 1287 | @lisp | 1212 | @lisp |
| 1288 | (setq tramp-default-user "root") | 1213 | (setq tramp-default-user "root") |
| 1289 | @end lisp | 1214 | @end lisp |
| 1290 | 1215 | ||
| 1291 | @code{tramp-default-user} is regarded as obsolete, and will be removed | 1216 | Instead of a single default user, @code{tramp-default-user-alist} |
| 1292 | soon. | 1217 | allows multiple default user values based on access method or host |
| 1293 | 1218 | name combinations. The alist can hold multiple values. For example, to | |
| 1294 | @vindex tramp-default-user-alist | 1219 | use the @samp{john} as the default user for the domain |
| 1295 | You can also specify different users for certain method/host | 1220 | @samp{somewhere.else} only: |
| 1296 | combinations, via the variable @code{tramp-default-user-alist}. For | ||
| 1297 | example, if you always have to use the user @samp{john} in the domain | ||
| 1298 | @samp{somewhere.else}, you can specify the following: | ||
| 1299 | 1221 | ||
| 1300 | @lisp | 1222 | @lisp |
| 1301 | (add-to-list 'tramp-default-user-alist | 1223 | (add-to-list 'tramp-default-user-alist |
| @@ -1306,69 +1228,54 @@ example, if you always have to use the user @samp{john} in the domain | |||
| 1306 | See the documentation for the variable @code{tramp-default-user-alist} | 1228 | See the documentation for the variable @code{tramp-default-user-alist} |
| 1307 | for more details. | 1229 | for more details. |
| 1308 | 1230 | ||
| 1309 | One trap to fall in must be known. If @value{tramp} finds a default | 1231 | A Caution: @value{tramp} will override any default user specified in |
| 1310 | user, this user will be passed always to the connection command as | 1232 | the configuration files outside @value{emacsname}, such as |
| 1311 | parameter (for example @command{ssh here.somewhere.else -l john}. If | 1233 | @file{~/.ssh/config}. To stop @value{tramp} from applying the default |
| 1312 | you have specified another user for your command in its configuration | 1234 | value, set the corresponding alist entry to nil: |
| 1313 | files, @value{tramp} cannot know it, and the remote access will fail. | ||
| 1314 | If you have specified in the given example in @file{~/.ssh/config} the | ||
| 1315 | lines | ||
| 1316 | |||
| 1317 | @example | ||
| 1318 | Host here.somewhere.else | ||
| 1319 | User lily | ||
| 1320 | @end example | ||
| 1321 | |||
| 1322 | @noindent | ||
| 1323 | than you must discard selecting a default user by @value{tramp}. This | ||
| 1324 | will be done by setting it to @code{nil} (or @samp{lily}, likewise): | ||
| 1325 | 1235 | ||
| 1326 | @lisp | 1236 | @lisp |
| 1327 | (add-to-list 'tramp-default-user-alist | 1237 | (add-to-list 'tramp-default-user-alist |
| 1328 | '("ssh" "\\`here\\.somewhere\\.else\\'" nil)) | 1238 | '("ssh" "\\`here\\.somewhere\\.else\\'" nil)) |
| 1329 | @end lisp | 1239 | @end lisp |
| 1330 | 1240 | ||
| 1331 | The last entry in @code{tramp-default-user-alist} could be your | 1241 | The last entry in @code{tramp-default-user-alist} should be reserved |
| 1332 | default user you'll apply predominantly. You shall @emph{append} it | 1242 | for catch-all or most often used login. |
| 1333 | to that list at the end: | ||
| 1334 | 1243 | ||
| 1335 | @lisp | 1244 | @lisp |
| 1336 | (add-to-list 'tramp-default-user-alist '(nil nil "jonas") t) | 1245 | (add-to-list 'tramp-default-user-alist |
| 1246 | '(nil nil "jonas") t) | ||
| 1337 | @end lisp | 1247 | @end lisp |
| 1338 | 1248 | ||
| 1339 | 1249 | ||
| 1340 | @node Default Host | 1250 | @node Default Host |
| 1341 | @section Selecting a default host | 1251 | @section Selecting a default host |
| 1342 | @cindex default host | 1252 | @cindex default host |
| 1343 | |||
| 1344 | @vindex tramp-default-host | 1253 | @vindex tramp-default-host |
| 1345 | Finally, it is even possible to omit the host name part of a | 1254 | @vindex tramp-default-host-alist |
| 1346 | @value{tramp} file name. This case, the value of the variable | ||
| 1347 | @code{tramp-default-host} is used. Per default, it is initialized | ||
| 1348 | with the host name your local @value{emacsname} is running. | ||
| 1349 | 1255 | ||
| 1350 | If you, for example, use @value{tramp} mainly to contact the host | 1256 | When host name is omitted, @value{tramp} substitutes the value from |
| 1351 | @samp{target} as user @samp{john}, you can specify: | 1257 | the @code{tramp-default-host} variable. It is initially populated with |
| 1258 | the local hostname where @value{emacsname} is running. Both the | ||
| 1259 | default user and default host can be overridden as follows: | ||
| 1352 | 1260 | ||
| 1353 | @lisp | 1261 | @lisp |
| 1354 | (setq tramp-default-user "john" | 1262 | (setq tramp-default-user "john" |
| 1355 | tramp-default-host "target") | 1263 | tramp-default-host "target") |
| 1356 | @end lisp | 1264 | @end lisp |
| 1357 | 1265 | ||
| 1358 | Then the simple file name @samp{@trampfn{ssh, , ,}} will connect you | 1266 | With both defaults set, @samp{@trampfn{ssh, , ,}} will connect |
| 1359 | to John's home directory on target. | 1267 | @value{tramp} to John's home directory on target. |
| 1268 | |||
| 1360 | @ifset emacs | 1269 | @ifset emacs |
| 1361 | Note, however, that the most simplification @samp{/::} won't work, | 1270 | @strong{Note} @samp{/::} won't work, because @samp{/:} is the prefix |
| 1362 | because @samp{/:} is the prefix for quoted file names. | 1271 | for quoted file names. |
| 1363 | @end ifset | 1272 | @end ifset |
| 1364 | 1273 | ||
| 1365 | @vindex tramp-default-host-alist | 1274 | Instead of a single default host, @code{tramp-default-host-alist} |
| 1366 | Like with methods and users, you can also specify different default | 1275 | allows multiple default host values based on access method or user |
| 1367 | hosts for certain method/user combinations via the variable | 1276 | name combinations. The alist can hold multiple values. While |
| 1368 | @code{tramp-default-host-alist}. Usually, this isn't necessary, | 1277 | @code{tramp-default-host} is sufficient in most cases, some methods, |
| 1369 | because @code{tramp-default-host} should be sufficient. For some | 1278 | like @option{adb}, require defaults overwritten. |
| 1370 | methods, like @option{adb}, that default value must be overwritten, | ||
| 1371 | which is already the initial value of @code{tramp-default-host-alist}. | ||
| 1372 | 1279 | ||
| 1373 | @noindent | 1280 | @noindent |
| 1374 | See the documentation for the variable @code{tramp-default-host-alist} | 1281 | See the documentation for the variable @code{tramp-default-host-alist} |
| @@ -1380,28 +1287,27 @@ for more details. | |||
| 1380 | @cindex multi-hop | 1287 | @cindex multi-hop |
| 1381 | @cindex proxy hosts | 1288 | @cindex proxy hosts |
| 1382 | 1289 | ||
| 1383 | Sometimes, the methods described before are not sufficient. | 1290 | Multi-hops are methods to reach hosts behind firewalls or to reach the |
| 1384 | Sometimes, it is not possible to connect to a remote host using a | 1291 | outside world from inside a bastion host. With multi-hops, |
| 1385 | simple command. For example, if you are in a secured network, you | 1292 | @value{tramp} can negotiate these hops with the appropriate user/host |
| 1386 | might have to log in to a bastion host first before you can connect to | 1293 | authentication at each hop. All methods until now have been the single |
| 1387 | the outside world. Of course, the target host may also require a | 1294 | hop kind, where the start and end points of the connection did not |
| 1388 | bastion host. | 1295 | have intermediate check points. |
| 1389 | 1296 | ||
| 1390 | @vindex tramp-default-proxies-alist | ||
| 1391 | @defopt tramp-default-proxies-alist | 1297 | @defopt tramp-default-proxies-alist |
| 1392 | In order to specify multiple hops, it is possible to define a proxy | 1298 | @vindex tramp-default-proxies-alist |
| 1393 | host to pass through, via the custom option | 1299 | @option{tramp-default-proxies-alist} specifies proxy hosts to pass |
| 1394 | @option{tramp-default-proxies-alist}. This variable keeps a list of | 1300 | through. This variable is list of triples consisting of (@var{host} |
| 1395 | triples (@var{host} @var{user} @var{proxy}). | 1301 | @var{user} @var{proxy}). |
| 1396 | 1302 | ||
| 1397 | The first matching item specifies the proxy host to be passed for a | 1303 | The first match is the proxy host through which passes the file name |
| 1398 | file name located on a remote target matching @var{user}@@@var{host}. | 1304 | and the target host matching @var{user}@@@var{host}. @var{host} and |
| 1399 | @var{host} and @var{user} are regular expressions or @code{nil}, which | 1305 | @var{user} are regular expressions or @code{nil}, interpreted as a |
| 1400 | is interpreted as a regular expression which always matches. | 1306 | regular expression which always matches. |
| 1401 | 1307 | ||
| 1402 | @var{proxy} must be a Tramp file name which localname part is ignored. | 1308 | @var{proxy} is a literal @value{tramp} file name whose local name part |
| 1403 | Method and user name on @var{proxy} are optional, which is interpreted | 1309 | is ignored, and the method and user name parts are optional. |
| 1404 | with the default values. | 1310 | |
| 1405 | @ifset emacsgw | 1311 | @ifset emacsgw |
| 1406 | The method must be an inline or gateway method (@pxref{Inline | 1312 | The method must be an inline or gateway method (@pxref{Inline |
| 1407 | methods}, @pxref{Gateway methods}). | 1313 | methods}, @pxref{Gateway methods}). |
| @@ -1412,9 +1318,8 @@ The method must be an inline method (@pxref{Inline methods}). | |||
| 1412 | If @var{proxy} is @code{nil}, no additional hop is required reaching | 1318 | If @var{proxy} is @code{nil}, no additional hop is required reaching |
| 1413 | @var{user}@@@var{host}. | 1319 | @var{user}@@@var{host}. |
| 1414 | 1320 | ||
| 1415 | If you, for example, must pass the host @samp{bastion.your.domain} as | 1321 | For example, to pass through the host @samp{bastion.your.domain} as |
| 1416 | user @samp{bird} for any remote host which is not located in your local | 1322 | user @samp{bird} to reach remote hosts outside the local domain: |
| 1417 | domain, you can set | ||
| 1418 | 1323 | ||
| 1419 | @lisp | 1324 | @lisp |
| 1420 | (add-to-list 'tramp-default-proxies-alist | 1325 | (add-to-list 'tramp-default-proxies-alist |
| @@ -1423,13 +1328,12 @@ domain, you can set | |||
| 1423 | '("\\.your\\.domain\\'" nil nil)) | 1328 | '("\\.your\\.domain\\'" nil nil)) |
| 1424 | @end lisp | 1329 | @end lisp |
| 1425 | 1330 | ||
| 1426 | Please note the order of the code. @code{add-to-list} adds elements at the | 1331 | @strong{Note}: @code{add-to-list} adds elements at the beginning of a |
| 1427 | beginning of a list. Therefore, most relevant rules must be added last. | 1332 | list. Therefore, most relevant rules must come last in the list. |
| 1428 | 1333 | ||
| 1429 | Proxy hosts can be cascaded. If there is another host called | 1334 | Proxy hosts can be cascaded in the alist. If there is another host |
| 1430 | @samp{jump.your.domain}, which is the only one in your local domain who | 1335 | called @samp{jump.your.domain}, which is the only host allowed to |
| 1431 | is allowed connecting @samp{bastion.your.domain}, you can add another | 1336 | connect to @samp{bastion.your.domain}, then: |
| 1432 | rule: | ||
| 1433 | 1337 | ||
| 1434 | @lisp | 1338 | @lisp |
| 1435 | (add-to-list 'tramp-default-proxies-alist | 1339 | (add-to-list 'tramp-default-proxies-alist |
| @@ -1438,31 +1342,31 @@ rule: | |||
| 1438 | "@trampfn{ssh, , jump.your.domain,}")) | 1342 | "@trampfn{ssh, , jump.your.domain,}")) |
| 1439 | @end lisp | 1343 | @end lisp |
| 1440 | 1344 | ||
| 1441 | @var{proxy} can contain the patterns @code{%h} or @code{%u}. These | 1345 | @var{proxy} can take patterns @code{%h} or @code{%u} for @var{host} or |
| 1442 | patterns are replaced by the strings matching @var{host} or | 1346 | @var{user} respectively. |
| 1443 | @var{user}, respectively. | ||
| 1444 | 1347 | ||
| 1445 | If you, for example, wants to work as @samp{root} on hosts in the | 1348 | To login as @samp{root} on remote hosts in the domain |
| 1446 | domain @samp{your.domain}, but login as @samp{root} is disabled for | 1349 | @samp{your.domain}, but login as @samp{root} is disabled for non-local |
| 1447 | non-local access, you might add the following rule: | 1350 | access, then use this alist entry: |
| 1448 | 1351 | ||
| 1449 | @lisp | 1352 | @lisp |
| 1450 | (add-to-list 'tramp-default-proxies-alist | 1353 | (add-to-list 'tramp-default-proxies-alist |
| 1451 | '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}")) | 1354 | '("\\.your\\.domain\\'" "\\`root\\'" "@trampfn{ssh, , %h,}")) |
| 1452 | @end lisp | 1355 | @end lisp |
| 1453 | 1356 | ||
| 1454 | Opening @file{@trampfn{sudo, , randomhost.your.domain,}} would connect | 1357 | Opening @file{@trampfn{sudo, , randomhost.your.domain,}} first |
| 1455 | first @samp{randomhost.your.domain} via @code{ssh} under your account | 1358 | connects to @samp{randomhost.your.domain} via @code{ssh} under your |
| 1456 | name, and perform @code{sudo -u root} on that host afterwards. It is | 1359 | account name, and then perform @code{sudo -u root} on that host. |
| 1457 | important to know that the given method is applied on the host which | ||
| 1458 | has been reached so far. @code{sudo -u root}, applied on your local | ||
| 1459 | host, wouldn't be useful here. | ||
| 1460 | 1360 | ||
| 1461 | @var{host}, @var{user} and @var{proxy} can also be Lisp forms. These | 1361 | It is key for the sudo method in the above example to be applied on |
| 1462 | forms are evaluated, and must return a string, or @code{nil}. The | 1362 | the host after reaching it and not on the local host. |
| 1463 | previous example could be generalized then: For all hosts except my | 1363 | |
| 1464 | local one connect via @command{ssh} first, and apply @command{sudo -u | 1364 | @var{host}, @var{user} and @var{proxy} can also take Lisp forms. These |
| 1465 | root} afterwards: | 1365 | forms when evaluated must return either a string or @code{nil}. |
| 1366 | |||
| 1367 | To generalize (from the previous example): For all hosts, except my | ||
| 1368 | local one, first connect via @command{ssh}, and then apply | ||
| 1369 | @command{sudo -u root}: | ||
| 1466 | 1370 | ||
| 1467 | @lisp | 1371 | @lisp |
| 1468 | (add-to-list 'tramp-default-proxies-alist | 1372 | (add-to-list 'tramp-default-proxies-alist |
| @@ -1471,46 +1375,45 @@ root} afterwards: | |||
| 1471 | '((regexp-quote (system-name)) nil nil)) | 1375 | '((regexp-quote (system-name)) nil nil)) |
| 1472 | @end lisp | 1376 | @end lisp |
| 1473 | 1377 | ||
| 1474 | This is the recommended configuration to work as @samp{root} on remote | 1378 | The above configuration allows @value{tramp} connection as @samp{root} |
| 1475 | Ubuntu hosts. | 1379 | to remote Ubuntu hosts. |
| 1476 | 1380 | ||
| 1477 | @ifset emacsgw | 1381 | @ifset emacsgw |
| 1478 | Finally, @code{tramp-default-proxies-alist} can be used to pass | 1382 | @code{tramp-default-proxies-alist} is also used for passing through |
| 1479 | firewalls or proxy servers. Imagine your local network has a host | 1383 | firewalls or proxy servers. |
| 1480 | @samp{proxy.your.domain} which is used on port 3128 as HTTP proxy to | 1384 | |
| 1481 | the outer world. Your friendly administrator has granted you access | 1385 | For example, the local host @samp{proxy.your.domain} on port 3128 |
| 1482 | under your user name to @samp{host.other.domain} on that proxy | 1386 | serves as HTTP proxy to the outer world. User has access rights to |
| 1483 | server.@footnote{HTTP tunnels are intended for secure SSL/TLS | 1387 | another proxy server on @samp{host.other.domain}.@footnote{HTTP tunnels |
| 1484 | communication. Therefore, many proxy server restrict the tunnels to | 1388 | are intended for secure SSL/TLS communication. Therefore, many proxy |
| 1485 | related target ports. You might need to run your ssh server on your | 1389 | servers restrict the tunnels to related target ports. You might need |
| 1486 | target host @samp{host.other.domain} on such a port, like 443 (https). | 1390 | to run your ssh server on your target host @samp{host.other.domain} on |
| 1487 | See @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall} | 1391 | such a port, like 443 (https). See |
| 1488 | for discussion of ethical issues.} You would need to add the | 1392 | @uref{http://savannah.gnu.org/maintenance/CvsFromBehindFirewall} for |
| 1489 | following rule: | 1393 | discussion of ethical issues.} Then the configuration is: |
| 1490 | 1394 | ||
| 1491 | @lisp | 1395 | @lisp |
| 1492 | (add-to-list 'tramp-default-proxies-alist | 1396 | (add-to-list 'tramp-default-proxies-alist |
| 1493 | '("\\`host\\.other\\.domain\\'" nil | 1397 | '("\\`host\\.other\\.domain\\'" nil |
| 1494 | "@trampfn{tunnel, , proxy.your.domain#3128,}")) | 1398 | "@trampfn{tunnel, , proxy.your.domain#3128,}")) |
| 1495 | @end lisp | 1399 | @end lisp |
| 1496 | 1400 | ||
| 1497 | Gateway methods can be declared as first hop only in a multiple hop | 1401 | Gateway methods in a multiple hop chain can be declared only as the first hop. |
| 1498 | chain. | ||
| 1499 | @end ifset | 1402 | @end ifset |
| 1500 | @end defopt | 1403 | @end defopt |
| 1501 | 1404 | ||
| 1502 | Hops to be passed tend to be restricted firewalls and alike. | 1405 | Passing through hops involves dealing with restricted shells, such as |
| 1503 | Sometimes they offer limited features only, like running @command{rbash} | 1406 | @command{rbash}. If @value{tramp} is made aware, then it would use |
| 1504 | (restricted bash). This must be told to @value{tramp}. | 1407 | them for proxies only. |
| 1505 | 1408 | ||
| 1506 | @vindex tramp-restricted-shell-hosts-alist | ||
| 1507 | @defopt tramp-restricted-shell-hosts-alist | 1409 | @defopt tramp-restricted-shell-hosts-alist |
| 1508 | This custom option keeps a list of regular expressions, which denote | 1410 | @vindex tramp-restricted-shell-hosts-alist |
| 1509 | hosts running a registered shell like @command{rbash}. Those hosts | 1411 | An alist of regular expressions of hosts running restricted shells, |
| 1510 | can be used as proxies only. | 1412 | such as @command{rbash}. @value{tramp} will then use them only as |
| 1413 | proxies. | ||
| 1511 | 1414 | ||
| 1512 | If the bastion host from the example above runs a restricted shell, | 1415 | To specify the bastion host from the example above as running a |
| 1513 | you shall apply | 1416 | restricted shell: |
| 1514 | 1417 | ||
| 1515 | @lisp | 1418 | @lisp |
| 1516 | (add-to-list 'tramp-restricted-shell-hosts-alist | 1419 | (add-to-list 'tramp-restricted-shell-hosts-alist |
| @@ -1525,11 +1428,10 @@ you shall apply | |||
| 1525 | @cindex using non-standard methods | 1428 | @cindex using non-standard methods |
| 1526 | @cindex create your own methods | 1429 | @cindex create your own methods |
| 1527 | 1430 | ||
| 1528 | There is a variable @code{tramp-methods} which you can change if the | 1431 | The @code{tramp-methods} variable currently has an exhaustive list of |
| 1529 | predefined methods don't seem right. | 1432 | predefined methods. Any part of this list can be modified with more |
| 1530 | 1433 | suitable settings. Refer to the Lisp documentation of that variable, | |
| 1531 | For the time being, I'll refer you to the Lisp documentation of that | 1434 | accessible with @kbd{C-h v tramp-methods @key{RET}}. |
| 1532 | variable, accessible with @kbd{C-h v tramp-methods @key{RET}}. | ||
| 1533 | 1435 | ||
| 1534 | 1436 | ||
| 1535 | @node Customizing Completion | 1437 | @node Customizing Completion |
| @@ -1538,15 +1440,14 @@ variable, accessible with @kbd{C-h v tramp-methods @key{RET}}. | |||
| 1538 | @cindex selecting config files | 1440 | @cindex selecting config files |
| 1539 | @vindex tramp-completion-function-alist | 1441 | @vindex tramp-completion-function-alist |
| 1540 | 1442 | ||
| 1541 | The variable @code{tramp-completion-function-alist} is intended to | 1443 | @code{tramp-completion-function-alist} uses predefined files for user |
| 1542 | customize which files are taken into account for user and host name | 1444 | and host name completion (@pxref{File name completion}). For each |
| 1543 | completion (@pxref{File name completion}). For every method, it keeps | 1445 | method, it keeps a set of configuration files and a function that can |
| 1544 | a set of configuration files, accompanied by a Lisp function able to | 1446 | parse that file. Each entry in @code{tramp-completion-function-alist} |
| 1545 | parse that file. Entries in @code{tramp-completion-function-alist} | 1447 | is of the form (@var{method} @var{pair1} @var{pair2} @dots{}). |
| 1546 | have the form (@var{method} @var{pair1} @var{pair2} @dots{}). | ||
| 1547 | 1448 | ||
| 1548 | Each @var{pair} is composed of (@var{function} @var{file}). | 1449 | Each @var{pair} is composed of (@var{function} @var{file}). |
| 1549 | @var{function} is responsible to extract user names and host names | 1450 | @var{function} is responsible for extracting user names and host names |
| 1550 | from @var{file} for completion. There are two functions which access | 1451 | from @var{file} for completion. There are two functions which access |
| 1551 | this variable: | 1452 | this variable: |
| 1552 | 1453 | ||
| @@ -1619,31 +1520,28 @@ case, hosts names are coded in file names | |||
| 1619 | @item @code{tramp-parse-hosts} | 1520 | @item @code{tramp-parse-hosts} |
| 1620 | @findex tramp-parse-hosts | 1521 | @findex tramp-parse-hosts |
| 1621 | 1522 | ||
| 1622 | A function dedicated to @file{/etc/hosts} style files. It returns | 1523 | A function dedicated to @file{/etc/hosts} for host names. |
| 1623 | host names only. | ||
| 1624 | 1524 | ||
| 1625 | @item @code{tramp-parse-passwd} | 1525 | @item @code{tramp-parse-passwd} |
| 1626 | @findex tramp-parse-passwd | 1526 | @findex tramp-parse-passwd |
| 1627 | 1527 | ||
| 1628 | A function which parses @file{/etc/passwd} like files. Obviously, it | 1528 | A function which parses @file{/etc/passwd} files for user names. |
| 1629 | can return user names only. | ||
| 1630 | 1529 | ||
| 1631 | @item @code{tramp-parse-netrc} | 1530 | @item @code{tramp-parse-netrc} |
| 1632 | @findex tramp-parse-netrc | 1531 | @findex tramp-parse-netrc |
| 1633 | 1532 | ||
| 1634 | Finally, a function which parses @file{~/.netrc} like files. This | 1533 | A function which parses @file{~/.netrc} and @file{~/.authinfo}-style files. |
| 1635 | includes also @file{~/.authinfo}-style files. | ||
| 1636 | 1534 | ||
| 1637 | @end table | 1535 | @end table |
| 1638 | 1536 | ||
| 1639 | If you want to keep your own data in a file, with your own structure, | 1537 | To keep a custom file with custom data in a custom structure, a custom |
| 1640 | you might provide such a function as well. This function must meet | 1538 | function has to be provided. This function must meet the following |
| 1641 | the following conventions: | 1539 | conventions: |
| 1642 | 1540 | ||
| 1643 | @defun my-tramp-parse file | 1541 | @defun my-tramp-parse file |
| 1644 | @var{file} must be either a file name on your host, or @code{nil}. | 1542 | @var{file} must be either a file on the host, or @code{nil}. The |
| 1645 | The function must return a list of (@var{user} @var{host}), which are | 1543 | function must return a list of (@var{user} @var{host}), which are |
| 1646 | taken as candidates for user and host name completion. | 1544 | taken as candidates for completion for user and host names. |
| 1647 | 1545 | ||
| 1648 | Example: | 1546 | Example: |
| 1649 | @example | 1547 | @example |
| @@ -1658,144 +1556,127 @@ Example: | |||
| 1658 | @section Reusing passwords for several connections | 1556 | @section Reusing passwords for several connections |
| 1659 | @cindex passwords | 1557 | @cindex passwords |
| 1660 | 1558 | ||
| 1661 | Sometimes it is necessary to connect to the same remote host several | 1559 | To avoid repeated prompts for passwords, consider native caching |
| 1662 | times. Reentering passwords again and again would be annoying, when | 1560 | mechanisms, such as @command{ssh-agent} for @option{ssh}-like |
| 1663 | the chosen method does not support access without password prompt | ||
| 1664 | through own configuration. | ||
| 1665 | |||
| 1666 | The best recommendation is to use the method's own mechanism for | ||
| 1667 | password handling. Consider @command{ssh-agent} for @option{ssh}-like | ||
| 1668 | methods, or @command{pageant} for @option{plink}-like methods. | 1561 | methods, or @command{pageant} for @option{plink}-like methods. |
| 1669 | 1562 | ||
| 1670 | However, if you cannot apply such native password handling, | 1563 | @value{tramp} offers alternatives when native solutions cannot meet |
| 1671 | @value{tramp} offers alternatives. | 1564 | the need. |
| 1672 | 1565 | ||
| 1673 | 1566 | ||
| 1674 | @anchor{Using an authentication file} | 1567 | @anchor{Using an authentication file} |
| 1675 | @subsection Using an authentication file | 1568 | @subsection Using an authentication file |
| 1676 | |||
| 1677 | @vindex auth-sources | 1569 | @vindex auth-sources |
| 1678 | The package @file{auth-source.el}, originally developed in No Gnus, | 1570 | |
| 1679 | offers the possibility to read passwords from a file, like FTP does it | 1571 | The package @file{auth-source.el}, originally developed for No Gnus, |
| 1680 | from @file{~/.netrc}. The default authentication file is | 1572 | reads passwords from different sources, @xref{Help for users, , |
| 1681 | @file{~/.authinfo.gpg}, this can be changed via the variable | 1573 | auth-source, auth}. The default authentication file is |
| 1574 | @file{~/.authinfo.gpg}, but this can be changed via the variable | ||
| 1682 | @code{auth-sources}. | 1575 | @code{auth-sources}. |
| 1683 | 1576 | ||
| 1684 | @noindent | 1577 | @noindent |
| 1685 | A typical entry in the authentication file would be | 1578 | A typical entry in the authentication file: |
| 1686 | 1579 | ||
| 1687 | @example | 1580 | @example |
| 1688 | machine melancholia port scp login daniel password geheim | 1581 | machine melancholia port scp login daniel password geheim |
| 1689 | @end example | 1582 | @end example |
| 1690 | 1583 | ||
| 1691 | The port can be any @value{tramp} method (@pxref{Inline methods}, | 1584 | The port can take any @value{tramp} method (@pxref{Inline methods}, |
| 1692 | @pxref{External methods}), to match only this method. When you omit | 1585 | @pxref{External methods}). Omitting port values matches all |
| 1693 | the port, you match all @value{tramp} methods. | 1586 | @value{tramp} methods. |
| 1694 | 1587 | ||
| 1695 | In case of problems, setting @code{auth-source-debug} to @code{t} | 1588 | Setting @code{auth-source-debug} to @code{t} to debug messages. |
| 1696 | gives useful debug messages. | ||
| 1697 | 1589 | ||
| 1698 | 1590 | ||
| 1699 | @anchor{Caching passwords} | 1591 | @anchor{Caching passwords} |
| 1700 | @subsection Caching passwords | 1592 | @subsection Caching passwords |
| 1701 | 1593 | ||
| 1702 | If there is no authentication file, @value{tramp} caches the passwords | 1594 | @value{tramp} can cache passwords as entered and reuse when needed for |
| 1703 | entered by you. They will be reused next time if a connection needs | 1595 | the same user or host name independent of the access method. |
| 1704 | them for the same user name and host name, independently of the | ||
| 1705 | connection method. | ||
| 1706 | 1596 | ||
| 1707 | @vindex password-cache-expiry | 1597 | @vindex password-cache-expiry |
| 1708 | Passwords are not saved permanently, that means the password caching | 1598 | |
| 1709 | is limited to the lifetime of your @value{emacsname} session. You | 1599 | @code{password-cache-expiry} sets the duration (in seconds) the |
| 1710 | can influence the lifetime of password caching by customizing the | 1600 | passwords are remembered. Passwords are never saved permanently nor |
| 1711 | variable @code{password-cache-expiry}. The value is the number of | 1601 | can they extend beyond the lifetime of the current @value{emacsname} |
| 1712 | seconds how long passwords are cached. Setting it to @code{nil} | 1602 | session. Set @code{password-cache-expiry} to @code{nil} to disable |
| 1713 | disables the expiration. | 1603 | expiration. |
| 1714 | 1604 | ||
| 1715 | @vindex password-cache | 1605 | @vindex password-cache |
| 1716 | If you don't like this feature for security reasons, password caching | ||
| 1717 | can be disabled totally by customizing the variable | ||
| 1718 | @code{password-cache} (setting it to @code{nil}). | ||
| 1719 | 1606 | ||
| 1720 | Implementation Note: password caching is based on the package | 1607 | Set @code{password-cache} to @code{nil} to disable password caching. |
| 1721 | @file{password-cache.el}. For the time being, it is activated only | 1608 | |
| 1722 | when this package is seen in the @code{load-path} while loading | 1609 | @strong{Implementation Note}: password caching depends on |
| 1723 | @value{tramp}. | 1610 | @file{password-cache.el} package. @value{tramp} activates password |
| 1611 | caching only if @value{tramp} can discover, while @value{emacsname} is | ||
| 1612 | loading, the package through @code{load-path}. | ||
| 1613 | |||
| 1724 | @ifset installchapter | 1614 | @ifset installchapter |
| 1725 | If you don't use No Gnus, you can take @file{password.el} from the | 1615 | @file{password.el} is available from No Gnus or from the @value{tramp} |
| 1726 | @value{tramp} @file{contrib} directory, see @ref{Installation | 1616 | @file{contrib} directory, see @ref{Installation parameters}. |
| 1727 | parameters}. | ||
| 1728 | @end ifset | 1617 | @end ifset |
| 1729 | 1618 | ||
| 1730 | 1619 | ||
| 1731 | @node Connection caching | 1620 | @node Connection caching |
| 1732 | @section Reusing connection related information | 1621 | @section Reusing connection related information |
| 1733 | @cindex caching | 1622 | @cindex caching |
| 1734 | |||
| 1735 | @vindex tramp-persistency-file-name | 1623 | @vindex tramp-persistency-file-name |
| 1736 | In order to reduce initial connection time, @value{tramp} stores | 1624 | |
| 1737 | connection related information persistently. The variable | 1625 | For faster initial connection times, @value{tramp} stores previous |
| 1738 | @code{tramp-persistency-file-name} keeps the file name where these | 1626 | connection properties in a file specified by the variable |
| 1739 | information are written. Its default value is | 1627 | @code{tramp-persistency-file-name}. |
| 1628 | |||
| 1629 | The default file name for @code{tramp-persistency-file-name} is: | ||
| 1740 | @ifset emacs | 1630 | @ifset emacs |
| 1741 | @file{~/.emacs.d/tramp}. | 1631 | @file{~/.emacs.d/tramp}. |
| 1742 | @end ifset | 1632 | @end ifset |
| 1743 | @ifset xemacs | 1633 | @ifset xemacs |
| 1744 | @file{~/.xemacs/tramp}. | 1634 | @file{~/.xemacs/tramp}. |
| 1745 | @end ifset | 1635 | @end ifset |
| 1746 | It is recommended to choose a local file name. | ||
| 1747 | |||
| 1748 | @value{tramp} reads this file during startup, and writes it when | ||
| 1749 | exiting @value{emacsname}. You can simply remove this file if | ||
| 1750 | @value{tramp} shall be urged to recompute these information next | ||
| 1751 | @value{emacsname} startup time. | ||
| 1752 | |||
| 1753 | Using such persistent information can be disabled by setting | ||
| 1754 | @code{tramp-persistency-file-name} to @code{nil}. | ||
| 1755 | |||
| 1756 | Once consequence of reusing connection related information is that | ||
| 1757 | @value{tramp} needs to distinguish hosts. If you, for example, run a | ||
| 1758 | local @code{sshd} on port 3001, which tunnels @command{ssh} to another | ||
| 1759 | host, you could access both @file{@trampfn{ssh, , localhost,}} and | ||
| 1760 | @file{@trampfn{ssh, , localhost#3001,}}. @value{tramp} would use the | ||
| 1761 | same host related information (like paths, Perl variants, etc) for | ||
| 1762 | both connections, although the information is valid only for one of | ||
| 1763 | them. | ||
| 1764 | 1636 | ||
| 1765 | In order to avoid trouble, you must use another host name for one of | 1637 | @value{tramp} reads this file during @value{emacsname} startup, and |
| 1766 | the connections, like introducing a @option{Host} section in | 1638 | writes to it when exiting @value{emacsname}. Delete this file for |
| 1767 | @file{~/.ssh/config} (@pxref{Frequently Asked Questions}) or applying | 1639 | @value{tramp} to recreate a new one on next @value{emacsname} startup. |
| 1768 | multiple hops (@pxref{Multi-hops}). | 1640 | |
| 1641 | Set @code{tramp-persistency-file-name} to @code{nil} to disable | ||
| 1642 | storing connections persistently. | ||
| 1769 | 1643 | ||
| 1770 | When @value{tramp} detects a changed operating system version on a | 1644 | To reuse connection information from the persistent list, |
| 1771 | remote host (via the command @command{uname -sr}), it flushes all | 1645 | @value{tramp} needs to uniquely identify every host. However in some |
| 1772 | connection related information for this host, and opens the | 1646 | cases, two different connections may result in the same persistent |
| 1773 | connection again. | 1647 | information. For example, connecting to a host using @command{ssh} and |
| 1648 | connecting to the same host through @code{sshd} on port 3001. Both | ||
| 1649 | access methods result in nearly identical persistent specifications | ||
| 1650 | @file{@trampfn{ssh, , localhost,}} and @file{@trampfn{ssh, , | ||
| 1651 | localhost#3001,}}. | ||
| 1652 | |||
| 1653 | Changing host names could avoid duplicates. One way is to add a | ||
| 1654 | @option{Host} section in @file{~/.ssh/config} (@pxref{Frequently Asked | ||
| 1655 | Questions}). Another way is to apply multiple hops (@pxref{Multi-hops}). | ||
| 1656 | |||
| 1657 | When @value{tramp} detects a change in the operating system version in | ||
| 1658 | a remote host (via the command @command{uname -sr}), it flushes all | ||
| 1659 | connection related information for that host and creates a new entry. | ||
| 1774 | 1660 | ||
| 1775 | 1661 | ||
| 1776 | @node Predefined connection information | 1662 | @node Predefined connection information |
| 1777 | @section Setting own connection related information | 1663 | @section Setting own connection related information |
| 1664 | @vindex tramp-connection-properties | ||
| 1778 | 1665 | ||
| 1779 | Sometimes, method specific arguments in @code{tramp-methods} do not | 1666 | For more precise customization, parameters specified by |
| 1780 | fit your needs. Sometimes, @value{tramp} is not able to detect | 1667 | @code{tramp-methods} can be overwritten manually. |
| 1781 | correct connection related information. In such cases, you could tell | ||
| 1782 | @value{tramp} which value it has to take. Since this could result in | ||
| 1783 | errors, it has to be used with care. | ||
| 1784 | 1668 | ||
| 1785 | @vindex tramp-connection-properties | 1669 | Set @code{tramp-connection-properties} to manually override |
| 1786 | Such settings can be performed via the list | 1670 | @code{tramp-methods}. Properties in this list are in the form |
| 1787 | @code{tramp-connection-properties}. An entry in this list has the | 1671 | @code{(@var{regexp} @var{property} @var{value})}. @var{regexp} matches |
| 1788 | form @code{(@var{regexp} @var{property} @var{value})}. @var{regexp} | 1672 | remote file names. Use @code{nil} to match all. @var{property} is the |
| 1789 | matches remote file names for which a property shall be predefined. | 1673 | property's name, and @var{value} is the property's value. |
| 1790 | It can be @code{nil}. @var{property} is a string, and @var{value} the | 1674 | |
| 1791 | corresponding value. | 1675 | @var{property} is any method specific parameter contained in |
| 1792 | 1676 | @code{tramp-methods}. The parameter key in @code{tramp-methods} is a | |
| 1793 | @var{property} could be any method specific parameter found in | 1677 | symbol name @code{tramp-<foo>}. To overwrite that property, use the |
| 1794 | @code{tramp-methods}. The parameter key in @code{tramp-methods} is a | 1678 | string @samp{<foo>} for @var{property}. For example, this changes the |
| 1795 | symbol name @code{tramp-<foo>}. In order to overwrite it, | 1679 | remote shell: |
| 1796 | @var{property} must be the string @samp{<foo>}. If you, for example, | ||
| 1797 | want to change the remote shell to be used on a remote machine, you | ||
| 1798 | could apply | ||
| 1799 | 1680 | ||
| 1800 | @lisp | 1681 | @lisp |
| 1801 | (add-to-list 'tramp-connection-properties | 1682 | (add-to-list 'tramp-connection-properties |
| @@ -1806,17 +1687,15 @@ could apply | |||
| 1806 | "remote-shell-login" '("-"))) | 1687 | "remote-shell-login" '("-"))) |
| 1807 | @end lisp | 1688 | @end lisp |
| 1808 | 1689 | ||
| 1809 | This would overwrite the @code{tramp-remote-shell} and | 1690 | The parameters @code{tramp-remote-shell} and |
| 1810 | @code{tramp-remote-shell-login} parameters in @code{tramp-methods}, to | 1691 | @code{tramp-remote-shell-login} in @code{tramp-methods} now have new |
| 1811 | be used on that remote host. | 1692 | values for the remote host. |
| 1812 | 1693 | ||
| 1813 | @var{property} could also be any property found in the file | 1694 | @var{property} could also be any property found in |
| 1814 | @code{tramp-persistency-file-name}. | 1695 | @code{tramp-persistency-file-name}. |
| 1815 | 1696 | ||
| 1816 | A special property is @samp{busybox}. This must be set, if the remote | 1697 | To get around how restricted shells randomly drop connections, set the |
| 1817 | host runs a very restricted busybox as shell, which closes the | 1698 | special property @samp{busybox}. For example: |
| 1818 | connection at will. Since there is no reliable test for this, | ||
| 1819 | @value{tramp} must be indicated this way. Example: | ||
| 1820 | 1699 | ||
| 1821 | @lisp | 1700 | @lisp |
| 1822 | (add-to-list 'tramp-connection-properties | 1701 | (add-to-list 'tramp-connection-properties |
| @@ -1828,69 +1707,55 @@ connection at will. Since there is no reliable test for this, | |||
| 1828 | @node Remote programs | 1707 | @node Remote programs |
| 1829 | @section How @value{tramp} finds and uses programs on the remote host | 1708 | @section How @value{tramp} finds and uses programs on the remote host |
| 1830 | 1709 | ||
| 1831 | @value{tramp} depends on a number of programs on the remote host in order to | 1710 | @value{tramp} requires access to and rights to several commands on |
| 1832 | function, including @command{ls}, @command{test}, @command{find} and | 1711 | remote hosts: @command{ls}, @command{test}, @command{find} and |
| 1833 | @command{cat}. | 1712 | @command{cat}. |
| 1834 | 1713 | ||
| 1835 | In addition to these required tools, there are various tools that may be | 1714 | Besides there are other required programs for @ref{Inline methods} and |
| 1836 | required based on the connection method. See @ref{Inline methods} and | 1715 | @ref{External methods} of connection. |
| 1837 | @ref{External methods} for details on these. | ||
| 1838 | 1716 | ||
| 1839 | Certain other tools, such as @command{perl} (or @command{perl5}) and | 1717 | To improve performance and accuracy of remote file access, |
| 1840 | @command{grep} will be used if they can be found. When they are | 1718 | @value{tramp} uses @command{perl} (or @command{perl5}) and |
| 1841 | available, they are used to improve the performance and accuracy of | 1719 | @command{grep} when available. |
| 1842 | remote file access. | ||
| 1843 | 1720 | ||
| 1721 | @defopt tramp-remote-path | ||
| 1844 | @vindex tramp-remote-path | 1722 | @vindex tramp-remote-path |
| 1845 | @vindex tramp-default-remote-path | 1723 | @vindex tramp-default-remote-path |
| 1846 | @vindex tramp-own-remote-path | 1724 | @vindex tramp-own-remote-path |
| 1847 | @defopt tramp-remote-path | 1725 | @option{tramp-remote-path} specifies which remote directory paths |
| 1848 | When @value{tramp} connects to the remote host, it searches for the | 1726 | @value{tramp} can search for @ref{Remote programs}. |
| 1849 | programs that it can use. The custom option | ||
| 1850 | @option{tramp-remote-path} controls the directories searched on the | ||
| 1851 | remote host. | ||
| 1852 | 1727 | ||
| 1853 | By default, this is set to a reasonable set of defaults for most | 1728 | @value{tramp} uses standard defaults, such as @file{/bin} and |
| 1854 | hosts. The symbol @code{tramp-default-remote-path} is a place | 1729 | @file{/usr/bin}, which are reasonable for most hosts. To accommodate |
| 1855 | holder, it is replaced by the list of directories received via the | 1730 | differences in hosts and paths, for example, @file{/bin:/usr/bin} on |
| 1856 | command @command{getconf PATH} on your remote host. For example, | 1731 | Debian GNU/Linux or |
| 1857 | on Debian GNU/Linux this is @file{/bin:/usr/bin}, whereas on Solaris | 1732 | @file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin} on |
| 1858 | this is @file{/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/opt/SUNWspro/bin}. | 1733 | Solaris, @value{tramp} queries the remote host with @command{getconf |
| 1859 | It is recommended to apply this symbol on top of | 1734 | PATH} and updates the symbol @code{tramp-default-remote-path}. |
| 1860 | @option{tramp-remote-path}. | ||
| 1861 | 1735 | ||
| 1862 | It is possible, however, that your local (or remote ;) system | 1736 | For instances where hosts keep obscure locations for paths for |
| 1863 | administrator has put the tools you want in some obscure local | 1737 | security reasons, manually add such paths to local @file{.emacs} as |
| 1864 | directory. | 1738 | shown below for @value{tramp} to use when connecting. |
| 1865 | |||
| 1866 | In this case, you can still use them with @value{tramp}. You simply | ||
| 1867 | need to add code to your @file{.emacs} to add the directory to the | ||
| 1868 | remote path. This will then be searched by @value{tramp} when you | ||
| 1869 | connect and the software found. | ||
| 1870 | |||
| 1871 | To add a directory to the remote search path, you could use code such | ||
| 1872 | as: | ||
| 1873 | 1739 | ||
| 1874 | @lisp | 1740 | @lisp |
| 1875 | (add-to-list 'tramp-remote-path "/usr/local/perl/bin") | 1741 | (add-to-list 'tramp-remote-path "/usr/local/perl/bin") |
| 1876 | @end lisp | 1742 | @end lisp |
| 1877 | 1743 | ||
| 1878 | Another possibility is to reuse the path settings of your remote | 1744 | Another way to find the remote path is to use the path assigned to the |
| 1879 | account when you log in. Usually, these settings are overwritten, | 1745 | remote user by the remote host. @value{tramp} does not normally retain |
| 1880 | because they might not be useful for @value{tramp}. The place holder | 1746 | this remote path after logging. However, @code{tramp-own-remote-path} |
| 1881 | @code{tramp-own-remote-path} preserves these settings. You can | 1747 | preserves the path value, which can be used to update |
| 1882 | activate it via | 1748 | @code{tramp-remote-path}. |
| 1883 | 1749 | ||
| 1884 | @lisp | 1750 | @lisp |
| 1885 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) | 1751 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) |
| 1886 | @end lisp | 1752 | @end lisp |
| 1887 | @end defopt | 1753 | @end defopt |
| 1888 | 1754 | ||
| 1889 | @value{tramp} caches several information, like the Perl binary | 1755 | When remote search paths are changed, local @value{tramp} caches must |
| 1890 | location. The changed remote search path wouldn't affect these | 1756 | be recomputed. To force @value{tramp} to recompute afresh, exit |
| 1891 | settings. In order to force @value{tramp} to recompute these values, | 1757 | @value{emacsname}, remove the persistent file (@pxref{Connection |
| 1892 | you must exit @value{emacsname}, remove your persistency file | 1758 | caching}), and restart @value{emacsname}. |
| 1893 | (@pxref{Connection caching}), and restart @value{emacsname}. | ||
| 1894 | 1759 | ||
| 1895 | 1760 | ||
| 1896 | @node Remote shell setup | 1761 | @node Remote shell setup |
| @@ -1900,77 +1765,44 @@ you must exit @value{emacsname}, remove your persistency file | |||
| 1900 | @cindex @file{.login} file | 1765 | @cindex @file{.login} file |
| 1901 | @cindex shell init files | 1766 | @cindex shell init files |
| 1902 | 1767 | ||
| 1903 | As explained in the @ref{Overview} section, @value{tramp} connects to the | 1768 | @value{tramp} checks for the availability of standard programs in the |
| 1904 | remote host and talks to the shell it finds there. Of course, when you | 1769 | usual locations. Common tactics include successively trying |
| 1905 | log in, the shell executes its init files. Suppose your init file | 1770 | @command{test -e}, @command{/usr/bin/test -e}, and @command{/bin/test |
| 1906 | requires you to enter the birth date of your mother; clearly @value{tramp} | 1771 | -e}. @command{ls -d} is another approach. But these approaches do not |
| 1907 | does not know this and hence fails to log you in to that host. | 1772 | help with these new login patterns. |
| 1908 | |||
| 1909 | There are different possible strategies for pursuing this problem. One | ||
| 1910 | strategy is to enable @value{tramp} to deal with all possible situations. | ||
| 1911 | This is a losing battle, since it is not possible to deal with | ||
| 1912 | @emph{all} situations. The other strategy is to require you to set up | ||
| 1913 | the remote host such that it behaves like @value{tramp} expects. This might | ||
| 1914 | be inconvenient because you have to invest a lot of effort into shell | ||
| 1915 | setup before you can begin to use @value{tramp}. | ||
| 1916 | |||
| 1917 | The package, therefore, pursues a combined approach. It tries to | ||
| 1918 | figure out some of the more common setups, and only requires you to | ||
| 1919 | avoid really exotic stuff. For example, it looks through a list of | ||
| 1920 | directories to find some programs on the remote host. And also, it | ||
| 1921 | knows that it is not obvious how to check whether a file exists, and | ||
| 1922 | therefore it tries different possibilities. (On some hosts and | ||
| 1923 | shells, the command @command{test -e} does the trick, on some hosts | ||
| 1924 | the shell builtin doesn't work but the program @command{/usr/bin/test | ||
| 1925 | -e} or @command{/bin/test -e} works. And on still other hosts, | ||
| 1926 | @command{ls -d} is the right way to do this.) | ||
| 1927 | |||
| 1928 | Below you find a discussion of a few things that @value{tramp} does not deal | ||
| 1929 | with, and that you therefore have to set up correctly. | ||
| 1930 | 1773 | ||
| 1931 | @table @asis | 1774 | When @value{tramp} encounters two-factor logins or additional challenge |
| 1932 | @item @var{shell-prompt-pattern} | 1775 | questions, such as entering birth date or security code or passphrase, |
| 1933 | @vindex shell-prompt-pattern | 1776 | @value{tramp} needs a few more configuration steps to accommodate |
| 1934 | 1777 | them. | |
| 1935 | After logging in to the remote host, @value{tramp} has to wait for the remote | ||
| 1936 | shell startup to finish before it can send commands to the remote | ||
| 1937 | shell. The strategy here is to wait for the shell prompt. In order to | ||
| 1938 | recognize the shell prompt, the variable @code{shell-prompt-pattern} has | ||
| 1939 | to be set correctly to recognize the shell prompt on the remote host. | ||
| 1940 | |||
| 1941 | Note that @value{tramp} requires the match for @code{shell-prompt-pattern} | ||
| 1942 | to be at the end of the buffer. Many people have something like the | ||
| 1943 | following as the value for the variable: @samp{^[^>$][>$] *}. Now | ||
| 1944 | suppose your shell prompt is @code{a <b> c $ }. In this case, | ||
| 1945 | @value{tramp} recognizes the @code{>} character as the end of the prompt, | ||
| 1946 | but it is not at the end of the buffer. | ||
| 1947 | 1778 | ||
| 1779 | The difference between a password prompt and a passphrase prompt is | ||
| 1780 | that the password for completing the login while the passphrase is | ||
| 1781 | for authorizing access to local authentication information, such as | ||
| 1782 | the ssh key. | ||
| 1783 | |||
| 1784 | There is no one configuration to accommodate all the variations in | ||
| 1785 | login security, especially not the exotic ones. However, @value{tramp} | ||
| 1786 | provides a few tweaks to address the most common ones. | ||
| 1787 | |||
| 1788 | @table @asis | ||
| 1948 | @item @var{tramp-shell-prompt-pattern} | 1789 | @item @var{tramp-shell-prompt-pattern} |
| 1949 | @vindex tramp-shell-prompt-pattern | 1790 | @vindex tramp-shell-prompt-pattern |
| 1950 | 1791 | ||
| 1951 | This regular expression is used by @value{tramp} in the same way as | 1792 | @code{tramp-shell-prompt-pattern} is for remote login shell prompt, |
| 1952 | @code{shell-prompt-pattern}, to match prompts from the remote shell. | 1793 | which may not be the same as the local login shell prompt, |
| 1953 | This second variable exists because the prompt from the remote shell | 1794 | @code{shell-prompt-pattern}. Since most hosts use identical prompts, |
| 1954 | might be different from the prompt from a local shell---after all, | 1795 | @value{tramp} sets a similar default value for both prompts. |
| 1955 | the whole point of @value{tramp} is to log in to remote hosts as a | ||
| 1956 | different user. The default value of | ||
| 1957 | @code{tramp-shell-prompt-pattern} is the same as the default value of | ||
| 1958 | @code{shell-prompt-pattern}, which is reported to work well in many | ||
| 1959 | circumstances. | ||
| 1960 | 1796 | ||
| 1961 | @item @var{tramp-password-prompt-regexp} | 1797 | @item @var{tramp-password-prompt-regexp} |
| 1798 | @item @var{tramp-wrong-passwd-regexp} | ||
| 1962 | @vindex tramp-password-prompt-regexp | 1799 | @vindex tramp-password-prompt-regexp |
| 1963 | @vindex tramp-wrong-passwd-regexp | 1800 | @vindex tramp-wrong-passwd-regexp |
| 1964 | 1801 | ||
| 1965 | During login, @value{tramp} might be forced to enter a password or a | 1802 | @value{tramp} uses @var{tramp-password-prompt-regexp} to distinguish |
| 1966 | passphrase. The difference between both is that a password is | 1803 | between prompts for passwords and prompts for passphrases. By default, |
| 1967 | requested from the shell on the remote host, while a passphrase is | 1804 | @var{tramp-password-prompt-regexp} handles the detection in English |
| 1968 | needed for accessing local authentication information, like your ssh | 1805 | language environments. See a localization example below: |
| 1969 | key. | ||
| 1970 | |||
| 1971 | @var{tramp-password-prompt-regexp} handles the detection of such | ||
| 1972 | requests for English environments. When you use another localization | ||
| 1973 | of your (local or remote) host, you might need to adapt this. Example: | ||
| 1974 | 1806 | ||
| 1975 | @lisp | 1807 | @lisp |
| 1976 | (setq | 1808 | (setq |
| @@ -1988,29 +1820,29 @@ of your (local or remote) host, you might need to adapt this. Example: | |||
| 1988 | ".*:\0? *")) | 1820 | ".*:\0? *")) |
| 1989 | @end lisp | 1821 | @end lisp |
| 1990 | 1822 | ||
| 1991 | In parallel, it might also be necessary to adapt | 1823 | Similar localization may be necessary for handling wrong password |
| 1992 | @var{tramp-wrong-passwd-regexp}. | 1824 | prompts, for which @value{tramp} uses @var{tramp-wrong-passwd-regexp}. |
| 1993 | 1825 | ||
| 1994 | @item @command{tset} and other questions | 1826 | @item @command{tset} and other questions |
| 1995 | @cindex Unix command tset | 1827 | @cindex Unix command tset |
| 1996 | @cindex tset Unix command | 1828 | @cindex tset Unix command |
| 1829 | @vindex tramp-terminal-type | ||
| 1997 | 1830 | ||
| 1998 | Some people invoke the @command{tset} program from their shell startup | 1831 | To suppress inappropriate prompts for terminal type, @value{tramp} |
| 1999 | scripts which asks the user about the terminal type of the shell. | 1832 | sets the @env{TERM} to @code{dumb} before the remote login process |
| 2000 | Maybe some shells ask other questions when they are started. | 1833 | begins via the variable @code{tramp-terminal-type}. This will silence |
| 2001 | @value{tramp} does not know how to answer these questions. There are | 1834 | common @command{tset} related prompts. |
| 2002 | two approaches for dealing with this problem. One approach is to take | ||
| 2003 | care that the shell does not ask any questions when invoked from | ||
| 2004 | @value{tramp}. You can do this by checking the @env{TERM} | ||
| 2005 | environment variable, it will be set to @code{dumb} when connecting. | ||
| 2006 | 1835 | ||
| 2007 | @vindex tramp-terminal-type | 1836 | @value{tramp}'s strategy for handling such prompts (commonly triggered |
| 2008 | The variable @code{tramp-terminal-type} can be used to change this value | 1837 | from login scripts on remote hosts) is to set the environment |
| 2009 | to @code{dumb}. | 1838 | variables so that no prompts interrupt the shell initialization |
| 1839 | process. | ||
| 2010 | 1840 | ||
| 2011 | @vindex tramp-actions-before-shell | 1841 | @vindex tramp-actions-before-shell |
| 2012 | The other approach is to teach @value{tramp} about these questions. See | 1842 | |
| 2013 | the variable @code{tramp-actions-before-shell}. Example: | 1843 | An alternative approach is to configure @value{tramp} with strings |
| 1844 | that can identify such questions using | ||
| 1845 | @code{tramp-actions-before-shell}. Example: | ||
| 2014 | 1846 | ||
| 2015 | @lisp | 1847 | @lisp |
| 2016 | (defconst my-tramp-prompt-regexp | 1848 | (defconst my-tramp-prompt-regexp |
| @@ -2030,80 +1862,61 @@ the variable @code{tramp-actions-before-shell}. Example: | |||
| 2030 | @end lisp | 1862 | @end lisp |
| 2031 | 1863 | ||
| 2032 | 1864 | ||
| 2033 | @item Environment variables named like users in @file{.profile} | 1865 | @item Conflicting names for users and variables in @file{.profile} |
| 2034 | 1866 | ||
| 2035 | If you have a user named frumple and set the variable @env{FRUMPLE} in | 1867 | When a user name is the same as a variable name in a local file, such |
| 2036 | your shell environment, then this might cause trouble. Maybe rename | 1868 | as @file{.profile}, then @value{tramp} may send incorrect values for |
| 2037 | the variable to @env{FRUMPLE_DIR} or the like. | 1869 | environment variables. To avoid incorrect values, change the local |
| 2038 | 1870 | variable name to something different from the user name. For example, | |
| 2039 | This weird effect was actually reported by a @value{tramp} user! | 1871 | if the user name is @env{FRUMPLE}, then change the variable name to |
| 1872 | @env{FRUMPLE_DIR}. | ||
| 2040 | 1873 | ||
| 2041 | 1874 | ||
| 2042 | @item Non-Bourne commands in @file{.profile} | 1875 | @item Non-Bourne commands in @file{.profile} |
| 2043 | 1876 | ||
| 2044 | After logging in to the remote host, @value{tramp} issues the command | 1877 | When the remote host's @file{.profile} is also used for shells other |
| 2045 | @command{exec /bin/sh}. (Actually, the command is slightly | 1878 | than Bourne shell, then some incompatible syntaxes for commands in |
| 2046 | different.) When @command{/bin/sh} is executed, it reads some init | 1879 | @file{.profile} may trigger errors in Bourne shell on the host and may |
| 2047 | files, such as @file{~/.shrc} or @file{~/.profile}. | 1880 | not complete client's @value{tramp} connections. |
| 2048 | 1881 | ||
| 2049 | Now, some people have a login shell which is not @code{/bin/sh} but a | 1882 | One example of a Bourne shell incompatible syntax in @file{.profile}: |
| 2050 | Bourne-ish shell such as bash or ksh. Some of these people might put | 1883 | using @command{export FOO=bar} instead of @command{FOO=bar; export |
| 2051 | their shell setup into the files @file{~/.shrc} or @file{~/.profile}. | 1884 | FOO}. After remote login, @value{tramp} will trigger an error during |
| 2052 | This way, it is possible for non-Bourne constructs to end up in those | 1885 | its execution of @command{/bin/sh} on the remote host because Bourne |
| 2053 | files. Then, @command{exec /bin/sh} might cause the Bourne shell to | 1886 | shell does not recognize the export command as entered in |
| 2054 | barf on those constructs. | 1887 | @file{.profile}. |
| 2055 | 1888 | ||
| 2056 | As an example, imagine somebody putting @command{export FOO=bar} into | 1889 | Likewise, (@code{~}) character in paths will cause errors because |
| 2057 | the file @file{~/.profile}. The standard Bourne shell does not | 1890 | Bourne shell does not do (@code{~}) character expansions. |
| 2058 | understand this syntax and will emit a syntax error when it reaches | 1891 | |
| 2059 | this line. | 1892 | One approach to avoiding these incompatibilities is to make all |
| 2060 | 1893 | commands in @file{~/.shrc} and @file{~/.profile} Bourne shell | |
| 2061 | Another example is the tilde (@code{~}) character, say when adding | 1894 | compatible so @value{tramp} can complete connections to that remote. |
| 2062 | @file{~/bin} to @env{PATH}. Many Bourne shells will not expand this | 1895 | To accommodate using non-Bourne shells on that remote, use other |
| 2063 | character, and since there is usually no directory whose name consists | 1896 | shell-specific config files. For example, bash can use |
| 2064 | of the single character tilde, strange things will happen. | 1897 | @file{~/.bash_profile} and ignore @file{.profile}. |
| 2065 | |||
| 2066 | What can you do about this? | ||
| 2067 | |||
| 2068 | Well, one possibility is to make sure that everything in | ||
| 2069 | @file{~/.shrc} and @file{~/.profile} on all remote hosts is | ||
| 2070 | Bourne-compatible. In the above example, instead of @command{export | ||
| 2071 | FOO=bar}, you might use @command{FOO=bar; export FOO} instead. | ||
| 2072 | |||
| 2073 | The other possibility is to put your non-Bourne shell setup into some | ||
| 2074 | other files. For example, bash reads the file @file{~/.bash_profile} | ||
| 2075 | instead of @file{~/.profile}, if the former exists. So bash | ||
| 2076 | aficionados just rename their @file{~/.profile} to | ||
| 2077 | @file{~/.bash_profile} on all remote hosts, and Bob's your uncle. | ||
| 2078 | |||
| 2079 | The @value{tramp} developers would like to circumvent this problem, so | ||
| 2080 | if you have an idea about it, please tell us. However, we are afraid | ||
| 2081 | it is not that simple: before saying @command{exec /bin/sh}, | ||
| 2082 | @value{tramp} does not know which kind of shell it might be talking | ||
| 2083 | to. It could be a Bourne-ish shell like ksh or bash, or it could be a | ||
| 2084 | csh derivative like tcsh, or it could be zsh, or even rc. If the | ||
| 2085 | shell is Bourne-ish already, then it might be prudent to omit the | ||
| 2086 | @command{exec /bin/sh} step. But how to find out if the shell is | ||
| 2087 | Bourne-ish? | ||
| 2088 | 1898 | ||
| 2089 | 1899 | ||
| 2090 | @item Interactive shell prompt | 1900 | @item Interactive shell prompt |
| 2091 | 1901 | ||
| 2092 | @value{tramp} redefines the shell prompt in order to parse the shell's | 1902 | @value{tramp} redefines the remote shell prompt internally for robust |
| 2093 | output robustly. When calling an interactive shell by @kbd{M-x | 1903 | parsing. This redefinition affects the looks of a prompt in an |
| 2094 | shell}, this doesn't look nice. | 1904 | interactive remote shell through commands, such as @kbd{M-x |
| 1905 | shell}. Such prompts, however, can be reset to something more readable | ||
| 1906 | and recognizable using these @value{tramp} variables. | ||
| 2095 | 1907 | ||
| 2096 | You can redefine the shell prompt by checking the environment variable | 1908 | @value{tramp} sets the @env{INSIDE_EMACS} variable in the startup |
| 2097 | @env{INSIDE_EMACS}, which is set by @value{tramp}, in your startup | 1909 | script file @file{~/.emacs_SHELLNAME}. |
| 2098 | script @file{~/.emacs_SHELLNAME}. @env{SHELLNAME} might be the string | 1910 | |
| 2099 | @code{bash} or similar, in case of doubt you could set it the | 1911 | @env{SHELLNAME} is @code{bash} or equivalent shell names. Change it by |
| 2100 | environment variable @env{ESHELL} in your @file{.emacs}: | 1912 | setting the environment variable @env{ESHELL} in the @file{.emacs} as |
| 1913 | follows: | ||
| 2101 | 1914 | ||
| 2102 | @lisp | 1915 | @lisp |
| 2103 | (setenv "ESHELL" "bash") | 1916 | (setenv "ESHELL" "bash") |
| 2104 | @end lisp | 1917 | @end lisp |
| 2105 | 1918 | ||
| 2106 | Your file @file{~/.emacs_SHELLNAME} could contain code like | 1919 | Then re-set the prompt string in @file{~/.emacs_SHELLNAME} as follows: |
| 2107 | 1920 | ||
| 2108 | @example | 1921 | @example |
| 2109 | # Reset the prompt for remote Tramp shells. | 1922 | # Reset the prompt for remote Tramp shells. |
| @@ -2122,18 +1935,16 @@ fi | |||
| 2122 | @cindex Unix command nc | 1935 | @cindex Unix command nc |
| 2123 | @cindex nc Unix command | 1936 | @cindex nc Unix command |
| 2124 | 1937 | ||
| 2125 | The @command{nc} command will be used with the @option{nc} method. On | 1938 | @value{tramp}'s @option{nc} method uses the @command{nc} command to |
| 2126 | the remote host, a listener will be installed. Unfortunately, the | 1939 | install and execute a listener as follows (see @code{tramp-methods}): |
| 2127 | command line syntax for this has been changed with the different | ||
| 2128 | @command{busybox} versions. @value{tramp} uses the following syntax | ||
| 2129 | (see @code{tramp-methods}): | ||
| 2130 | 1940 | ||
| 2131 | @example | 1941 | @example |
| 2132 | # nc -l -p 42 | 1942 | # nc -l -p 42 |
| 2133 | @end example | 1943 | @end example |
| 2134 | 1944 | ||
| 2135 | If your remote @command{nc} refuses to accept the @command{-p} | 1945 | The above command-line syntax has changed with @command{busybox} |
| 2136 | parameter, you could overwrite the syntax with the following form: | 1946 | versions. If @command{nc} refuses the @command{-p} parameter, then |
| 1947 | overwrite as follows: | ||
| 2137 | 1948 | ||
| 2138 | @lisp | 1949 | @lisp |
| 2139 | (add-to-list | 1950 | (add-to-list |
| @@ -2142,7 +1953,7 @@ parameter, you could overwrite the syntax with the following form: | |||
| 2142 | @end lisp | 1953 | @end lisp |
| 2143 | 1954 | ||
| 2144 | @noindent | 1955 | @noindent |
| 2145 | with @samp{192.168.0.1} being the IP address of your remote host | 1956 | where @samp{192.168.0.1} is the remote host IP address |
| 2146 | (@pxref{Predefined connection information}). | 1957 | (@pxref{Predefined connection information}). |
| 2147 | 1958 | ||
| 2148 | @end table | 1959 | @end table |
| @@ -2152,18 +1963,17 @@ with @samp{192.168.0.1} being the IP address of your remote host | |||
| 2152 | @section Android shell setup hints | 1963 | @section Android shell setup hints |
| 2153 | @cindex android shell setup | 1964 | @cindex android shell setup |
| 2154 | 1965 | ||
| 2155 | Android devices use a restricted shell. They can be accessed via the | 1966 | @value{tramp} uses the @option{adb} method to access Android |
| 2156 | @option{adb} method. However, this restricts the access to a USB | 1967 | devices. Android devices provide a restricted shell access through an |
| 2157 | connection, and it requires the installation of the Android SDK on the | 1968 | USB connection. The local host must have Andriod SDK installed. |
| 2158 | local host. | ||
| 2159 | 1969 | ||
| 2160 | When an @command{sshd} process runs on the Android device, like | 1970 | Applications such as @code{SSHDroid} that run @command{sshd} process |
| 2161 | provided by the @code{SSHDroid} app, any @option{ssh}-based method can | 1971 | on the Android device can accept any @option{ssh}-based methods |
| 2162 | be used. This requires some special settings. | 1972 | provided these settings are adjusted: |
| 2163 | 1973 | ||
| 2164 | The default shell @code{/bin/sh} does not exist. Instead, you shall | 1974 | @code{sh} must be specified for remote shell since Android devices do |
| 2165 | use just @code{sh}, which invokes the shell installed on the device. | 1975 | not provide @code{/bin/sh}. @code{sh} will then invoke whatever shell is |
| 2166 | You can instruct @value{tramp} by this form: | 1976 | installed on the device with this setting: |
| 2167 | 1977 | ||
| 2168 | @lisp | 1978 | @lisp |
| 2169 | (add-to-list 'tramp-connection-properties | 1979 | (add-to-list 'tramp-connection-properties |
| @@ -2171,13 +1981,12 @@ You can instruct @value{tramp} by this form: | |||
| 2171 | @end lisp | 1981 | @end lisp |
| 2172 | 1982 | ||
| 2173 | @noindent | 1983 | @noindent |
| 2174 | with @samp{192.168.0.26} being the IP address of your Android device | 1984 | where @samp{192.168.0.26} is the Android device's IP address. |
| 2175 | (@pxref{Predefined connection information}). | 1985 | (@pxref{Predefined connection information}). |
| 2176 | 1986 | ||
| 2177 | The user settings for the @env{PATH} environment variable must be | 1987 | @value{tramp} requires preserving @env{PATH} environment variable from |
| 2178 | preserved. It has also been reported, that the commands in | 1988 | user settings. Android devices prefer @file{/system/xbin} path over |
| 2179 | @file{/system/xbin} are better suited than the ones in | 1989 | @file{/system/bin}. Both of these are set as follows: |
| 2180 | @file{/system/bin}. Add these setting: | ||
| 2181 | 1990 | ||
| 2182 | @lisp | 1991 | @lisp |
| 2183 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) | 1992 | (add-to-list 'tramp-remote-path 'tramp-own-remote-path) |
| @@ -2185,20 +1994,20 @@ preserved. It has also been reported, that the commands in | |||
| 2185 | @end lisp | 1994 | @end lisp |
| 2186 | 1995 | ||
| 2187 | @noindent | 1996 | @noindent |
| 2188 | If the Android device is not @samp{rooted}, you must give the shell a | 1997 | When the Android device is not @samp{rooted}, specify a writable |
| 2189 | writable directory for temporary files: | 1998 | directory for temporary files: |
| 2190 | 1999 | ||
| 2191 | @lisp | 2000 | @lisp |
| 2192 | (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") | 2001 | (add-to-list 'tramp-remote-process-environment "TMPDIR=$HOME") |
| 2193 | @end lisp | 2002 | @end lisp |
| 2194 | 2003 | ||
| 2195 | @noindent | 2004 | @noindent |
| 2196 | Now you shall be able to open a remote connection with @kbd{C-x C-f | 2005 | Open a remote connection with the command @kbd{C-x C-f @trampfn{ssh, , |
| 2197 | @trampfn{ssh, , 192.168.0.26#2222, }}, given that @command{sshd} | 2006 | 192.168.0.26#2222, }}, where @command{sshd} is listening on port |
| 2198 | listens on port @samp{2222}. | 2007 | @samp{2222}. |
| 2199 | 2008 | ||
| 2200 | It is also recommended to add a corresponding entry to your | 2009 | To add a corresponding entry to the @file{~/.ssh/config} file |
| 2201 | @file{~/.ssh/config} for that connection, like | 2010 | (recommended), use this: |
| 2202 | 2011 | ||
| 2203 | @example | 2012 | @example |
| 2204 | Host android | 2013 | Host android |
| @@ -2208,7 +2017,8 @@ Host android | |||
| 2208 | @end example | 2017 | @end example |
| 2209 | 2018 | ||
| 2210 | @noindent | 2019 | @noindent |
| 2211 | In this case, you must change the setting for the remote shell to | 2020 | To use the host name @samp{android} instead of the IP address shown in |
| 2021 | the previous example, fix the connection properties as follows: | ||
| 2212 | 2022 | ||
| 2213 | @lisp | 2023 | @lisp |
| 2214 | (add-to-list 'tramp-connection-properties | 2024 | (add-to-list 'tramp-connection-properties |
| @@ -2216,8 +2026,8 @@ In this case, you must change the setting for the remote shell to | |||
| 2216 | @end lisp | 2026 | @end lisp |
| 2217 | 2027 | ||
| 2218 | @noindent | 2028 | @noindent |
| 2219 | You would open the connection with @kbd{C-x C-f @trampfn{ssh, , | 2029 | Open a remote connection with a more concise command @kbd{C-x C-f |
| 2220 | android, }} then. | 2030 | @trampfn{ssh, , android, }}. |
| 2221 | 2031 | ||
| 2222 | 2032 | ||
| 2223 | @node Auto-save and Backup | 2033 | @node Auto-save and Backup |
| @@ -2231,22 +2041,24 @@ android, }} then. | |||
| 2231 | @vindex bkup-backup-directory-info | 2041 | @vindex bkup-backup-directory-info |
| 2232 | @end ifset | 2042 | @end ifset |
| 2233 | 2043 | ||
| 2234 | Normally, @value{emacsname} writes backup files to the same directory | 2044 | To avoid @value{tramp} from saving backup files owned by root to |
| 2235 | as the original files, but this behavior can be changed via the | 2045 | locations accessible to others, default backup settings in |
| 2236 | variable | ||
| 2237 | @ifset emacs | 2046 | @ifset emacs |
| 2238 | @code{backup-directory-alist}. | 2047 | @code{backup-directory-alist} |
| 2239 | @end ifset | 2048 | @end ifset |
| 2240 | @ifset xemacs | 2049 | @ifset xemacs |
| 2241 | @code{bkup-backup-directory-info}. | 2050 | @code{bkup-backup-directory-info} |
| 2242 | @end ifset | 2051 | @end ifset |
| 2243 | In connection with @value{tramp}, this can have unexpected side | 2052 | have to be altered. |
| 2244 | effects. Suppose that you specify that all backups should go to the | 2053 | |
| 2245 | directory @file{~/.emacs.d/backups/}, and then you edit the file | 2054 | Here's a scenario where files could be inadvertently |
| 2246 | @file{@trampfn{su, root, localhost, /etc/secretfile}}. The effect is | 2055 | exposed. @value{emacsname} by default writes backup files to the same |
| 2247 | that the backup file will be owned by you and not by root, thus | 2056 | directory as the original files unless changed to another location, |
| 2248 | possibly enabling others to see it even if they were not intended to | 2057 | such as @file{~/.emacs.d/backups/}. Such a directory will also be used |
| 2249 | see it. | 2058 | by default by @value{tramp} when using, say, a restricted file |
| 2059 | @file{@trampfn{su, root, localhost, /etc/secretfile}}. The backup file | ||
| 2060 | of the secretfile is now owned by the user logged in from tramp and | ||
| 2061 | not root. | ||
| 2250 | 2062 | ||
| 2251 | When | 2063 | When |
| 2252 | @ifset emacs | 2064 | @ifset emacs |
| @@ -2257,16 +2069,8 @@ When | |||
| 2257 | @end ifset | 2069 | @end ifset |
| 2258 | is @code{nil} (the default), such problems do not occur. | 2070 | is @code{nil} (the default), such problems do not occur. |
| 2259 | 2071 | ||
| 2260 | Therefore, it is useful to set special values for @value{tramp} | 2072 | To ``turns off'' the backup feature for @value{tramp} files and stop |
| 2261 | files. For example, the following statement effectively ``turns off'' | 2073 | @value{tramp} from saving to the backup directory, use this: |
| 2262 | the effect of | ||
| 2263 | @ifset emacs | ||
| 2264 | @code{backup-directory-alist} | ||
| 2265 | @end ifset | ||
| 2266 | @ifset xemacs | ||
| 2267 | @code{bkup-backup-directory-info} | ||
| 2268 | @end ifset | ||
| 2269 | for @value{tramp} files: | ||
| 2270 | 2074 | ||
| 2271 | @ifset emacs | 2075 | @ifset emacs |
| 2272 | @lisp | 2076 | @lisp |
| @@ -2283,8 +2087,8 @@ for @value{tramp} files: | |||
| 2283 | @end ifset | 2087 | @end ifset |
| 2284 | 2088 | ||
| 2285 | @ifset emacs | 2089 | @ifset emacs |
| 2286 | It is also possible to disable backups depending on the used method. | 2090 | @noindent |
| 2287 | The following code disables backups for the @option{su} and | 2091 | Disabling backups can be targetted to just @option{su} and |
| 2288 | @option{sudo} methods: | 2092 | @option{sudo} methods: |
| 2289 | 2093 | ||
| 2290 | @lisp | 2094 | @lisp |
| @@ -2298,24 +2102,28 @@ The following code disables backups for the @option{su} and | |||
| 2298 | @end lisp | 2102 | @end lisp |
| 2299 | @end ifset | 2103 | @end ifset |
| 2300 | 2104 | ||
| 2301 | 2105 | Another option is to create better backup file naming with user and | |
| 2302 | Another possibility is to use the @value{tramp} variable | 2106 | host names prefixed to the file name. For example, transforming |
| 2107 | @file{/etc/secretfile} to | ||
| 2108 | @file{~/.emacs.d/backups/!su:root@@localhost:!etc!secretfile}, set the | ||
| 2109 | @value{tramp} variable | ||
| 2303 | @ifset emacs | 2110 | @ifset emacs |
| 2304 | @code{tramp-backup-directory-alist}. | 2111 | @code{tramp-backup-directory-alist} |
| 2305 | @end ifset | 2112 | @end ifset |
| 2306 | @ifset xemacs | 2113 | @ifset xemacs |
| 2307 | @code{tramp-bkup-backup-directory-info}. | 2114 | @code{tramp-bkup-backup-directory-info} |
| 2308 | @end ifset | 2115 | @end ifset |
| 2309 | This variable has the same meaning like | 2116 | from the existing variable |
| 2310 | @ifset emacs | 2117 | @ifset emacs |
| 2311 | @code{backup-directory-alist}. | 2118 | @code{backup-directory-alist}. |
| 2312 | @end ifset | 2119 | @end ifset |
| 2313 | @ifset xemacs | 2120 | @ifset xemacs |
| 2314 | @code{bkup-backup-directory-info}. | 2121 | @code{bkup-backup-directory-info}. |
| 2315 | @end ifset | 2122 | @end ifset |
| 2316 | If a @value{tramp} file is backed up, and DIRECTORY is an absolute | 2123 | |
| 2317 | local file name, DIRECTORY is prepended with the @value{tramp} file | 2124 | Then @value{tramp} backs up to a file name that is transformed with a |
| 2318 | name prefix of the file to be backed up. | 2125 | prefix consisting of the DIRECTORY name. This file name prefixing |
| 2126 | happens only when the DIRECTORY is an absolute local file name. | ||
| 2319 | 2127 | ||
| 2320 | @noindent | 2128 | @noindent |
| 2321 | Example: | 2129 | Example: |
| @@ -2348,101 +2156,98 @@ The backup file name of @file{@trampfn{su, root, localhost, | |||
| 2348 | ~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}} | 2156 | ~/.emacs.d/backups/![su!root@@localhost]!etc!secretfile~}} |
| 2349 | @end ifset | 2157 | @end ifset |
| 2350 | 2158 | ||
| 2351 | The same problem can happen with auto-saving files. | 2159 | Just as for backup files, similar issues of file naming affect |
| 2160 | auto-saving @value{tramp} files. | ||
| 2352 | @ifset emacs | 2161 | @ifset emacs |
| 2353 | The variable @code{auto-save-file-name-transforms} keeps information, | 2162 | Auto-saved files are saved in the directory specified by the variable |
| 2354 | on which directory an auto-saved file should go. By default, it is | 2163 | @code{auto-save-file-name-transforms}. By default this is set to the |
| 2355 | initialized for @value{tramp} files to the local temporary directory. | 2164 | local temporary directory. But in some versions of Debian GNU/Linux, |
| 2356 | 2165 | this points to the source directory where the @value{emacsname} was | |
| 2357 | On some versions of @value{emacsname}, namely the version built for | 2166 | compiled. Reset such values to a valid directory. |
| 2358 | Debian GNU/Linux, the variable @code{auto-save-file-name-transforms} | ||
| 2359 | contains the directory where @value{emacsname} was built. A | ||
| 2360 | workaround is to manually set the variable to a sane value. | ||
| 2361 | 2167 | ||
| 2362 | If auto-saved files should go into the same directory as the original | 2168 | Set @code{auto-save-file-name-transforms} to @code{nil} to save |
| 2363 | files, @code{auto-save-file-name-transforms} should be set to @code{nil}. | 2169 | auto-saved files to the same directory as the original file. |
| 2364 | 2170 | ||
| 2365 | Another possibility is to set the variable | 2171 | Alternatively, set the variable @code{tramp-auto-save-directory} to |
| 2366 | @code{tramp-auto-save-directory} to a proper value. | 2172 | direct all auto saves to that location. |
| 2367 | @end ifset | 2173 | @end ifset |
| 2368 | @ifset xemacs | 2174 | @ifset xemacs |
| 2369 | For this purpose you can set the variable @code{auto-save-directory} | 2175 | @code{auto-save-directory} can also be used here instead of other |
| 2370 | to a proper value. | 2176 | locations specfied above. |
| 2371 | @end ifset | 2177 | @end ifset |
| 2372 | 2178 | ||
| 2373 | |||
| 2374 | @node Windows setup hints | 2179 | @node Windows setup hints |
| 2375 | @section Issues with Cygwin ssh | 2180 | @section Issues with Cygwin ssh |
| 2376 | @cindex Cygwin, issues | 2181 | @cindex Cygwin, issues |
| 2377 | 2182 | ||
| 2378 | This section needs a lot of work! Please help. | 2183 | This section is incomplete. Please share your solutions. |
| 2379 | 2184 | ||
| 2380 | @cindex method sshx with Cygwin | 2185 | @cindex method sshx with Cygwin |
| 2381 | @cindex sshx method with Cygwin | 2186 | @cindex sshx method with Cygwin |
| 2382 | The recent Cygwin installation of @command{ssh} works only with a | 2187 | |
| 2383 | Cygwinized @value{emacsname}. You can check it by typing @kbd{M-x | 2188 | Cygwin's @command{ssh} works only with a Cygwin version of |
| 2384 | eshell}, and starting @kbd{ssh test.host}. The problem is evident | 2189 | @value{emacsname}. To check for compatibility: type @kbd{M-x eshell}, and |
| 2385 | if you see a message like this: | 2190 | start @kbd{ssh test.host}. Incompatbilities trigger this message: |
| 2386 | 2191 | ||
| 2387 | @example | 2192 | @example |
| 2388 | Pseudo-terminal will not be allocated because stdin is not a terminal. | 2193 | Pseudo-terminal will not be allocated because stdin is not a terminal. |
| 2389 | @end example | 2194 | @end example |
| 2390 | 2195 | ||
| 2391 | Older @command{ssh} versions of Cygwin are told to cooperate with | 2196 | Some older versions of Cygwin's @command{ssh} work with the |
| 2392 | @value{tramp} selecting @option{sshx} as the connection method. You | 2197 | @option{sshx} access method. Consult Cygwin's FAQ at |
| 2393 | can find information about setting up Cygwin in their FAQ at | 2198 | @uref{http://cygwin.com/faq/} for details. |
| 2394 | @uref{http://cygwin.com/faq/}. | 2199 | |
| 2395 | 2200 | ||
| 2396 | @cindex method scpx with Cygwin | 2201 | @cindex method scpx with Cygwin |
| 2397 | @cindex scpx method with Cygwin | 2202 | @cindex scpx method with Cygwin |
| 2398 | If you wish to use the @option{scpx} connection method, then you might | ||
| 2399 | have the problem that @value{emacsname} calls @command{scp} with a | ||
| 2400 | Windows file name such as @code{c:/foo}. The Cygwin version of | ||
| 2401 | @command{scp} does not know about Windows file names and interprets | ||
| 2402 | this as a remote file name on the host @code{c}. | ||
| 2403 | 2203 | ||
| 2404 | One possible workaround is to write a wrapper script for @option{scp} | 2204 | When using the @option{scpx} access method, @value{emacsname} may call |
| 2405 | which converts the Windows file name to a Cygwinized file name. | 2205 | @command{scp} with Windows file naming, such as @code{c:/foo}. But |
| 2206 | the version of @command{scp} that is installed with Cygwin does not | ||
| 2207 | know about Windows file naming, which causes it to incorrectly look | ||
| 2208 | for a host named @code{c}. | ||
| 2209 | |||
| 2210 | A workaround: write a wrapper script for @option{scp} to convert | ||
| 2211 | Windows file names to Cygwin file names. | ||
| 2406 | 2212 | ||
| 2407 | @cindex Cygwin and ssh-agent | 2213 | @cindex Cygwin and ssh-agent |
| 2408 | @cindex SSH_AUTH_SOCK and @value{emacsname} on Windows | 2214 | @cindex SSH_AUTH_SOCK and @value{emacsname} on Windows |
| 2409 | If you want to use either @option{ssh} based method on Windows, then | ||
| 2410 | you might encounter problems with @command{ssh-agent}. Using this | ||
| 2411 | program, you can avoid typing the pass-phrase every time you log in. | ||
| 2412 | However, if you start @value{emacsname} from a desktop shortcut, then | ||
| 2413 | the environment variable @env{SSH_AUTH_SOCK} is not set and so | ||
| 2414 | @value{emacsname} and thus @value{tramp} and thus @command{ssh} and | ||
| 2415 | @command{scp} started from @value{tramp} cannot communicate with | ||
| 2416 | @command{ssh-agent}. It works better to start @value{emacsname} from | ||
| 2417 | the shell. | ||
| 2418 | 2215 | ||
| 2419 | If anyone knows how to start @command{ssh-agent} under Windows in such a | 2216 | When using the @command{ssh-agent} on Windows for password-less |
| 2420 | way that desktop shortcuts can profit, please holler. I don't really | 2217 | interaction, @option{ssh} methods depend on the environment variable |
| 2421 | know anything at all about Windows@dots{} | 2218 | @env{SSH_AUTH_SOCK}. But this variable is not set when |
| 2219 | @value{emacsname} is started from a Desktop shortcut and | ||
| 2220 | authentication fails. | ||
| 2221 | |||
| 2222 | One workaround is to use a Windows based SSH Agent, such as | ||
| 2223 | Pageant. It is part of the Putty Suite of tools. | ||
| 2224 | |||
| 2225 | The fallback is to start @value{emacsname} from a shell. | ||
| 2422 | 2226 | ||
| 2423 | 2227 | ||
| 2424 | @node Usage | 2228 | @node Usage |
| 2425 | @chapter Using @value{tramp} | 2229 | @chapter Using @value{tramp} |
| 2426 | @cindex using @value{tramp} | 2230 | @cindex using @value{tramp} |
| 2427 | 2231 | ||
| 2428 | Once you have installed @value{tramp} it will operate fairly | 2232 | @value{tramp} operates transparently, accessing remote files as if |
| 2429 | transparently. You will be able to access files on any remote host | 2233 | they are local. However, @value{tramp} employs a formalized remote |
| 2430 | that you can log in to as though they were local. | 2234 | file naming syntax to perform its functions transparently. This |
| 2431 | 2235 | syntax consists of many parts specifying access methods, | |
| 2432 | Files are specified to @value{tramp} using a formalized syntax specifying the | 2236 | authentication, host names, and file names. |
| 2433 | details of the system to connect to. This is similar to the syntax used | 2237 | @ifset emacs |
| 2434 | by the @value{ftppackagename} package. | 2238 | @value{ftppackagename} uses a similar syntax. |
| 2239 | @end ifset | ||
| 2435 | 2240 | ||
| 2436 | @cindex type-ahead | 2241 | @cindex type-ahead |
| 2437 | Something that might happen which surprises you is that | 2242 | |
| 2438 | @value{emacsname} remembers all your keystrokes, so if you see a | 2243 | Unlike opening local files in @value{emacsname}, which are |
| 2439 | password prompt from @value{emacsname}, say, and hit @kbd{@key{RET}} | 2244 | instantaneous, opening remote files in @value{tramp} is slower at |
| 2440 | twice instead of once, then the second keystroke will be processed by | 2245 | first. Sometimes there is a noticable delay before the prompts for |
| 2441 | @value{emacsname} after @value{tramp} has done its thing. Why, this | 2246 | passwords or authentication appear in the minibuffer. Hitting |
| 2442 | type-ahead is normal behavior, you say. Right you are, but be aware | 2247 | @kbd{@key{RET}} or other keys during this gap will be processed by |
| 2443 | that opening a remote file might take quite a while, maybe half a | 2248 | @value{emacsname}. This type-ahead facility is a feature of |
| 2444 | minute when a connection needs to be opened. Maybe after half a | 2249 | @value{emacsname} that may cause missed prompts when using |
| 2445 | minute you have already forgotten that you hit that key! | 2250 | @value{tramp}. |
| 2446 | 2251 | ||
| 2447 | @menu | 2252 | @menu |
| 2448 | * File name Syntax:: @value{tramp} file name conventions. | 2253 | * File name Syntax:: @value{tramp} file name conventions. |
| @@ -2458,107 +2263,96 @@ minute you have already forgotten that you hit that key! | |||
| 2458 | @cindex file name syntax | 2263 | @cindex file name syntax |
| 2459 | @cindex file name examples | 2264 | @cindex file name examples |
| 2460 | 2265 | ||
| 2461 | To access the file @var{localname} on the remote host @var{host} | 2266 | @file{@trampfn{, , host, localfilename}} |
| 2462 | you would specify the file name @file{@trampfn{, , host, | 2267 | opens file @var{localfilename} on the remote host @var{host}, using |
| 2463 | localname}}. This will connect to @var{host} and transfer the file | 2268 | the default method. @xref{Default Method}. |
| 2464 | using the default method. @xref{Default Method}. | ||
| 2465 | |||
| 2466 | Some examples of @value{tramp} file names are shown below. | ||
| 2467 | 2269 | ||
| 2468 | @table @file | 2270 | @table @file |
| 2469 | @item @value{prefix}melancholia@value{postfix}.emacs | 2271 | @item @value{prefix}melancholia@value{postfix}.emacs |
| 2470 | Edit the file @file{.emacs} in your home directory on the host | 2272 | For the file @file{.emacs} located in the home directory, on the host |
| 2471 | @code{melancholia}. | 2273 | @code{melancholia}. |
| 2472 | 2274 | ||
| 2473 | @item @value{prefix}melancholia.danann.net@value{postfix}.emacs | 2275 | @item @value{prefix}melancholia.danann.net@value{postfix}.emacs |
| 2474 | This edits the same file, using the fully qualified domain name of | 2276 | For the file @file{.emacs} specified using the fully qualified domain name of |
| 2475 | the host. | 2277 | the host. |
| 2476 | 2278 | ||
| 2477 | @item @value{prefix}melancholia@value{postfix}~/.emacs | 2279 | @item @value{prefix}melancholia@value{postfix}~/.emacs |
| 2478 | This also edits the same file; the @file{~} is expanded to your | 2280 | For the file @file{.emacs} specified using the @file{~}, which is expanded. |
| 2479 | home directory on the remote host, just like it is locally. | ||
| 2480 | 2281 | ||
| 2481 | @item @value{prefix}melancholia@value{postfix}~daniel/.emacs | 2282 | @item @value{prefix}melancholia@value{postfix}~daniel/.emacs |
| 2482 | This edits the file @file{.emacs} in the home directory of the user | 2283 | For the file @file{.emacs} located in @code{daniel}'s home directory |
| 2483 | @code{daniel} on the host @code{melancholia}. The @file{~<user>} | 2284 | on the host, @code{melancholia}. The @file{~<user>} construct is |
| 2484 | construct is expanded to the home directory of that user on the remote | 2285 | expanded to the home directory of that user on the remote host. |
| 2485 | host. | ||
| 2486 | 2286 | ||
| 2487 | @item @value{prefix}melancholia@value{postfix}/etc/squid.conf | 2287 | @item @value{prefix}melancholia@value{postfix}/etc/squid.conf |
| 2488 | This edits the file @file{/etc/squid.conf} on the host | 2288 | For the file @file{/etc/squid.conf} on the host @code{melancholia}. |
| 2489 | @code{melancholia}. | ||
| 2490 | 2289 | ||
| 2491 | @end table | 2290 | @end table |
| 2492 | 2291 | ||
| 2493 | @var{host} can also be an IPv4 or IPv6 address, like in | 2292 | @var{host} can take IPv4 or IPv6 address, as in @file{@trampfn{, , |
| 2494 | @file{@trampfn{, , 127.0.0.1, .emacs}} or @file{@trampfn{, , | 2293 | 127.0.0.1, .emacs}} or @file{@trampfn{, , |
| 2495 | @value{ipv6prefix}::1@value{ipv6postfix}, .emacs}}. | 2294 | @value{ipv6prefix}::1@value{ipv6postfix}, .emacs}}. |
| 2496 | @ifset emacs | 2295 | @ifset emacs |
| 2497 | For syntactical reasons, IPv6 addresses must be embedded in square | 2296 | For syntactical reasons, IPv6 addresses must be embedded in square |
| 2498 | brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}. | 2297 | brackets @file{@value{ipv6prefix}} and @file{@value{ipv6postfix}}. |
| 2499 | @end ifset | 2298 | @end ifset |
| 2500 | 2299 | ||
| 2501 | Unless you specify a different name to use, @value{tramp} will use the | 2300 | By default, @value{tramp} will use the current local user name as the |
| 2502 | current local user name as the remote user name to log in with. If you | 2301 | remote user name for log in to the remote host. Specifying a different |
| 2503 | need to log in as a different user, you can specify the user name as | 2302 | name using the proper syntax will override this default behavior: |
| 2504 | part of the file name. | 2303 | |
| 2304 | @example | ||
| 2305 | @trampfn{, user, host, path/to.file} | ||
| 2306 | @end example | ||
| 2307 | |||
| 2308 | @file{@trampfn{, daniel, melancholia, .emacs}} is for file | ||
| 2309 | @file{.emacs} in @code{daniel}'s home directory on the host, | ||
| 2310 | @code{melancholia}. | ||
| 2505 | 2311 | ||
| 2506 | To log in to the remote host as a specific user, you use the syntax | 2312 | Specify other file access methods (@pxref{Inline methods}, |
| 2507 | @file{@trampfn{, user, host, path/to.file}}. That means that | 2313 | @pxref{External methods}) as part of the file name. |
| 2508 | connecting to @code{melancholia} as @code{daniel} and editing | ||
| 2509 | @file{.emacs} in your home directory you would specify | ||
| 2510 | @file{@trampfn{, daniel, melancholia, .emacs}}. | ||
| 2511 | 2314 | ||
| 2512 | It is also possible to specify other file transfer methods | ||
| 2513 | (@pxref{Inline methods}, @pxref{External methods}) as part of the | ||
| 2514 | file name. | ||
| 2515 | @ifset emacs | 2315 | @ifset emacs |
| 2516 | This is done by putting the method before the user and host name, as | 2316 | Method name comes before user name, as in |
| 2517 | in @file{@value{prefix}@var{method}@value{postfixhop}} (Note the | 2317 | @file{@value{prefix}@var{method}@value{postfixhop}} (Note the trailing |
| 2518 | trailing colon). | 2318 | colon). |
| 2519 | @end ifset | 2319 | @end ifset |
| 2520 | @ifset xemacs | 2320 | @ifset xemacs |
| 2521 | This is done by replacing the initial @file{@value{prefix}} with | 2321 | This is done by replacing the initial @file{@value{prefix}} with |
| 2522 | @file{@value{prefix}<method>@value{postfixhop}}. (Note the trailing | 2322 | @file{@value{prefix}@var{method}@value{postfixhop}} (Note the trailing |
| 2523 | slash!). | 2323 | slash!). |
| 2524 | @end ifset | 2324 | @end ifset |
| 2525 | The user, host and file specification remain the same. | 2325 | The syntax specificaton for user, host, and file do not change. |
| 2526 | 2326 | ||
| 2527 | So, to connect to the host @code{melancholia} as @code{daniel}, | 2327 | To connect to the host @code{melancholia} as @code{daniel}, using |
| 2528 | using the @option{ssh} method to transfer files, and edit | 2328 | @option{ssh} method for @file{.emacs} in @code{daniel}'s home |
| 2529 | @file{.emacs} in my home directory I would specify the file name | 2329 | directory, the full specification is: @file{@trampfn{ssh, daniel, |
| 2530 | @file{@trampfn{ssh, daniel, melancholia, .emacs}}. | 2330 | melancholia, .emacs}}. |
| 2531 | 2331 | ||
| 2532 | @ifset emacs | 2332 | A remote file name containing a host name, which is the same string as |
| 2533 | A remote file name containing a host name only, which is equal to a | 2333 | a method name, is not allowed. |
| 2534 | method name, is not allowed. If such a host name is used, it must | ||
| 2535 | always be preceded by an explicit method name, like | ||
| 2536 | @file{@value{prefix}ssh@value{postfixhop}ssh@value{postfix}}. | ||
| 2537 | @end ifset | ||
| 2538 | 2334 | ||
| 2539 | Finally, for some methods it is possible to specify a different port | 2335 | For specifying port numbers, affix @file{#<port>} to the host |
| 2540 | number than the default one, given by the method. This is specified | 2336 | name. For example: @file{@trampfn{ssh, daniel, melancholia#42, |
| 2541 | by adding @file{#<port>} to the host name, like in @file{@trampfn{ssh, | 2337 | .emacs}}. |
| 2542 | daniel, melancholia#42, .emacs}}. | ||
| 2543 | 2338 | ||
| 2544 | 2339 | ||
| 2545 | @node File name completion | 2340 | @node File name completion |
| 2546 | @section File name completion | 2341 | @section File name completion |
| 2547 | @cindex file name completion | 2342 | @cindex file name completion |
| 2548 | 2343 | ||
| 2549 | File name completion works with @value{tramp} for completion of method | 2344 | @value{tramp} can complete the following @value{tramp} file name |
| 2550 | names, of user names and of host names as well as for completion of | 2345 | components: method names, user names, host names, and file names |
| 2551 | file names on remote hosts. | 2346 | located on remote hosts. |
| 2552 | @ifset emacs | 2347 | @ifset emacs |
| 2553 | In order to enable this, partial completion must be activated in your | 2348 | Enable this by activating partial completion in @file{.emacs}. |
| 2554 | @file{.emacs}. | ||
| 2555 | @ifinfo | 2349 | @ifinfo |
| 2556 | @xref{Completion Options, , , @value{emacsdir}}. | 2350 | @xref{Completion Options, , , @value{emacsdir}}. |
| 2557 | @end ifinfo | 2351 | @end ifinfo |
| 2558 | @end ifset | 2352 | @end ifset |
| 2559 | 2353 | ||
| 2560 | If you, for example, type @kbd{C-x C-f @value{prefix}t | 2354 | For example, type @kbd{C-x C-f @value{prefix}t @key{TAB}}, |
| 2561 | @key{TAB}}, @value{tramp} might give you as result the choice for | 2355 | @value{tramp} completion choices show up as |
| 2562 | 2356 | ||
| 2563 | @example | 2357 | @example |
| 2564 | @c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}} | 2358 | @c @multitable {@trampfn{telnet, , melancholia.danann.net,}} {@trampfn{telnet, , 192.168.0.1,}} |
| @@ -2580,12 +2374,11 @@ is a possible completion for the respective method, | |||
| 2580 | @end ifset | 2374 | @end ifset |
| 2581 | and @samp{@value{prefixhop}toto@value{postfix}} | 2375 | and @samp{@value{prefixhop}toto@value{postfix}} |
| 2582 | might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} | 2376 | might be a host @value{tramp} has detected in your @file{~/.ssh/known_hosts} |
| 2583 | file (given you're using default method @option{ssh}). | 2377 | file (when using @option{ssh} as default method). |
| 2584 | 2378 | ||
| 2585 | If you go on to type @kbd{e @key{TAB}}, the minibuffer is completed to | 2379 | Type @kbd{e @key{TAB}} for the minibuffer completion to |
| 2586 | @samp{@value{prefix}telnet@value{postfixhop}}. | 2380 | @samp{@value{prefix}telnet@value{postfixhop}}. Typing @kbd{@key{TAB}} |
| 2587 | Next @kbd{@key{TAB}} brings you all host names @value{tramp} detects in | 2381 | shows host names @value{tramp} from @file{/etc/hosts} file, for example. |
| 2588 | your @file{/etc/hosts} file, let's say | ||
| 2589 | 2382 | ||
| 2590 | @example | 2383 | @example |
| 2591 | @multitable @columnfractions .5 .5 | 2384 | @multitable @columnfractions .5 .5 |
| @@ -2596,21 +2389,20 @@ your @file{/etc/hosts} file, let's say | |||
| 2596 | @end multitable | 2389 | @end multitable |
| 2597 | @end example | 2390 | @end example |
| 2598 | 2391 | ||
| 2599 | Now you can choose the desired host, and you can continue to | 2392 | Choose a host from the above list and then continue to complete file |
| 2600 | complete file names on that host. | 2393 | names on that host. |
| 2601 | 2394 | ||
| 2602 | If the configuration files (@pxref{Customizing Completion}), which | 2395 | When the configuration (@pxref{Customizing Completion}) includes user |
| 2603 | @value{tramp} uses for analysis of completion, offer user names, those user | 2396 | names, then the completion lists will account for the user names as well. |
| 2604 | names will be taken into account as well. | ||
| 2605 | 2397 | ||
| 2606 | Remote hosts which have been visited in the past and kept | 2398 | Remote hosts previously visited or hosts whose connections are kept |
| 2607 | persistently (@pxref{Connection caching}) will be offered too. | 2399 | persistently (@pxref{Connection caching}) will be included in the |
| 2400 | completion lists. | ||
| 2608 | 2401 | ||
| 2609 | Once the remote host identification is completed, it comes to | 2402 | After remote host name completion comes completion of file names on |
| 2610 | file name completion on the remote host. This works pretty much like | 2403 | the remote host. It works the same as on loal host file completion |
| 2611 | for files on the local host, with the exception that minibuffer | 2404 | except when killing with double-slash @file{//} kills only the file |
| 2612 | killing via a double-slash works only on the file name part, except | 2405 | name part of the @value{tramp} file name syntax. |
| 2613 | that file name part starts with @file{//}. | ||
| 2614 | @ifset emacs | 2406 | @ifset emacs |
| 2615 | A triple-slash stands for the default behavior. | 2407 | A triple-slash stands for the default behavior. |
| 2616 | @end ifset | 2408 | @end ifset |
| @@ -2642,18 +2434,17 @@ Example: | |||
| 2642 | @end ifset | 2434 | @end ifset |
| 2643 | @end example | 2435 | @end example |
| 2644 | 2436 | ||
| 2645 | A remote directory might have changed its contents out of | 2437 | During file name completion, remote directory contents are re-read |
| 2646 | @value{emacsname} control, for example by creation or deletion of | 2438 | regularly to account for any changes in the filesystem that may affect |
| 2647 | files by other processes. Therefore, during file name completion, the | 2439 | the completion candidates. Such re-reads can account for changes to |
| 2648 | remote directory contents are reread regularly in order to detect such | 2440 | the file system by applications outside @value{emacsname} |
| 2649 | changes, which would be invisible otherwise (@pxref{Connection caching}). | 2441 | (@pxref{Connection caching}). |
| 2650 | 2442 | ||
| 2651 | @vindex tramp-completion-reread-directory-timeout | ||
| 2652 | @defopt tramp-completion-reread-directory-timeout | 2443 | @defopt tramp-completion-reread-directory-timeout |
| 2653 | This custom option defines the number of seconds since last remote | 2444 | @vindex tramp-completion-reread-directory-timeout |
| 2654 | command before rereading a directory contents. A value of 0 would | 2445 | The timeout is number of seconds since last remote command for |
| 2655 | require an immediate reread during file name completion, @code{nil} | 2446 | rereading remote directory contents. 0 re-reads immediately during |
| 2656 | means to use always cached values for the directory contents. | 2447 | file name completion, @code{nil} uses cached directory contents. |
| 2657 | @end defopt | 2448 | @end defopt |
| 2658 | 2449 | ||
| 2659 | 2450 | ||
| @@ -2662,17 +2453,15 @@ means to use always cached values for the directory contents. | |||
| 2662 | @cindex multi-hop, ad-hoc | 2453 | @cindex multi-hop, ad-hoc |
| 2663 | @cindex proxy hosts, ad-hoc | 2454 | @cindex proxy hosts, ad-hoc |
| 2664 | 2455 | ||
| 2665 | Multiple hops are configured with the variable | 2456 | @value{tramp} file name syntax can accommodate ad hoc specification of |
| 2666 | @code{tramp-default-proxies-alist} (@pxref{Multi-hops}). However, | 2457 | multiple proxies without using @code{tramp-default-proxies-alist} |
| 2667 | sometimes it is desirable to reach a remote host immediately, without | 2458 | configuration setup(@pxref{Multi-hops}). |
| 2668 | configuration changes. This can be reached by an ad-hoc specification | ||
| 2669 | of the proxies. | ||
| 2670 | 2459 | ||
| 2671 | A proxy looks like a remote file name specification without the local | 2460 | Each proxy is specified using the same syntax as the remote host |
| 2672 | file name part. It is prepended to the target remote file name, | 2461 | specification minus the file name part. Each hop is separated by a |
| 2673 | separated by @samp{|}. As an example, a remote file on | 2462 | @samp{|}. Chain the proxies from the starting host to the destination |
| 2674 | @samp{you@@remotehost}, passing the proxy @samp{bird@@bastion}, could | 2463 | remote host name and file name. For example, hopping over a single |
| 2675 | be opened by | 2464 | proxy @samp{bird@@bastion} to a remote file on @samp{you@@remotehost}: |
| 2676 | 2465 | ||
| 2677 | @example | 2466 | @example |
| 2678 | @c @kbd{C-x C-f @trampfn{ssh@value{postfixhop}bird@@bastion|ssh, you, | 2467 | @c @kbd{C-x C-f @trampfn{ssh@value{postfixhop}bird@@bastion|ssh, you, |
| @@ -2680,21 +2469,23 @@ be opened by | |||
| 2680 | @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path} | 2469 | @kbd{C-x C-f @value{prefix}ssh@value{postfixhop}bird@@bastion|ssh@value{postfixhop}you@@remotehost@value{postfix}/path} |
| 2681 | @end example | 2470 | @end example |
| 2682 | 2471 | ||
| 2683 | Multiple hops can be cascaded, separating all proxies by @samp{|}. | 2472 | Proxies can take patterns @code{%h} or @code{%u}. |
| 2684 | The proxies can also contain the patterns @code{%h} or @code{%u}. | ||
| 2685 | 2473 | ||
| 2686 | The ad-hoc definition is added on the fly to | 2474 | @value{tramp} adds the ad-hoc definitions on the fly to |
| 2687 | @code{tramp-default-proxies-alist}. Therefore, during the lifetime of | 2475 | @code{tramp-default-proxies-alist} and is available for re-use during |
| 2688 | the @value{emacsname} session it is not necessary to enter this ad-hoc | 2476 | that @value{emacsname} session. Subsequent @value{tramp} connections |
| 2689 | specification, again. The remote file name @samp{@trampfn{ssh, you, | 2477 | to the same remote host can then use the shortcut form: |
| 2690 | remotehost, /path}} would be sufficient from now on. | 2478 | @samp{@trampfn{ssh, you, remotehost, /path}}. |
| 2691 | 2479 | ||
| 2692 | @vindex tramp-save-ad-hoc-proxies | ||
| 2693 | @defopt tramp-save-ad-hoc-proxies | 2480 | @defopt tramp-save-ad-hoc-proxies |
| 2694 | This custom option controls whether ad-hoc definitions are kept | 2481 | @vindex tramp-save-ad-hoc-proxies |
| 2695 | persistently in @option{tramp-default-proxies-alist}. That means, | 2482 | For ad-hoc definitions to be saved automatically in |
| 2696 | those definitions are available also for future @value{emacsname} | 2483 | @option{tramp-default-proxies-alist} for future @value{emacsname} |
| 2697 | sessions. | 2484 | sessions, set @option{tramp-save-ad-hoc-proxies}. |
| 2485 | |||
| 2486 | @lisp | ||
| 2487 | (setq tramp-save-ad-hoc-proxies t) | ||
| 2488 | @end lisp | ||
| 2698 | @end defopt | 2489 | @end defopt |
| 2699 | 2490 | ||
| 2700 | 2491 | ||
| @@ -2703,11 +2494,14 @@ sessions. | |||
| 2703 | @cindex compile | 2494 | @cindex compile |
| 2704 | @cindex recompile | 2495 | @cindex recompile |
| 2705 | 2496 | ||
| 2706 | @value{tramp} supports running processes on a remote host. This | 2497 | @value{tramp} supports starting new running processes on the remote |
| 2707 | allows to exploit @value{emacsname} packages without modification for | 2498 | host for discovering remote file names. @value{emacsname} packages on |
| 2708 | remote file names. It does not work for the @option{ftp} method. | 2499 | the remote host need no specific modifications for @value{tramp}'s |
| 2709 | Association of a pty, as specified in @code{start-file-process}, is | 2500 | use. |
| 2710 | not supported. | 2501 | |
| 2502 | This type of integration does not work with the @option{ftp} method, | ||
| 2503 | and does not support the pty association as specified in | ||
| 2504 | @code{start-file-process}. | ||
| 2711 | 2505 | ||
| 2712 | @code{process-file} and @code{start-file-process} work on the remote | 2506 | @code{process-file} and @code{start-file-process} work on the remote |
| 2713 | host when the variable @code{default-directory} is remote: | 2507 | host when the variable @code{default-directory} is remote: |
| @@ -2718,51 +2512,53 @@ host when the variable @code{default-directory} is remote: | |||
| 2718 | "/bin/sh" "-c" "grep -e tramp *")) | 2512 | "/bin/sh" "-c" "grep -e tramp *")) |
| 2719 | @end lisp | 2513 | @end lisp |
| 2720 | 2514 | ||
| 2515 | |||
| 2721 | @ifset emacsgvfs | 2516 | @ifset emacsgvfs |
| 2722 | If the remote host is mounted via GVFS (see @ref{GVFS based methods}), | 2517 | Remote processes do not apply to GVFS (see @ref{GVFS based methods}) |
| 2723 | the remote filesystem is mounted locally. Therefore, there are no | 2518 | because the remote file system is mounted on the local host and |
| 2724 | remote processes; all processes run still locally on your host with | 2519 | @value{tramp} just accesses by changing the @code{default-directory}. |
| 2725 | an adapted @code{default-directory}. This section does not apply for | ||
| 2726 | such connection methods. | ||
| 2727 | @end ifset | 2520 | @end ifset |
| 2728 | 2521 | ||
| 2729 | Remote processes are started when a corresponding command is executed | 2522 | @value{tramp} starts a remote process when a command is executed in a |
| 2730 | from a buffer belonging to a remote file or directory. Up to now, the | 2523 | remote file or directory buffer. As of now, these packages have been |
| 2731 | packages @file{compile.el} (commands like @code{compile} and | 2524 | integrated to work with @value{tramp}: @file{compile.el} (commands |
| 2732 | @code{grep}) and @file{gud.el} (@code{gdb} or @code{perldb}) have been | 2525 | like @code{compile} and @code{grep}) and @file{gud.el} (@code{gdb} or |
| 2733 | integrated. Integration of further packages is planned, any help for | 2526 | @code{perldb}). |
| 2734 | this is welcome! | ||
| 2735 | 2527 | ||
| 2736 | When your program is not found in the default search path | 2528 | For @value{tramp} to find the command on the remote, it must be |
| 2737 | @value{tramp} sets on the remote host, you should either use an | 2529 | accessible through the default search path as setup by @value{tramp} |
| 2738 | absolute path, or extend @code{tramp-remote-path} (see @ref{Remote | 2530 | upon first connection. Alternatively, use an absolute path or extend |
| 2739 | programs}): | 2531 | @code{tramp-remote-path} (see @ref{Remote programs}): |
| 2740 | 2532 | ||
| 2741 | @lisp | 2533 | @lisp |
| 2742 | (add-to-list 'tramp-remote-path "~/bin") | 2534 | (add-to-list 'tramp-remote-path "~/bin") |
| 2743 | (add-to-list 'tramp-remote-path "/appli/pub/bin") | 2535 | (add-to-list 'tramp-remote-path "/appli/pub/bin") |
| 2744 | @end lisp | 2536 | @end lisp |
| 2745 | 2537 | ||
| 2746 | The environment for your program can be adapted by customizing | 2538 | Customize @code{tramp-remote-process-environment} to suit the remote |
| 2747 | @code{tramp-remote-process-environment}. This variable is a list of | 2539 | program's environment for the remote host. |
| 2748 | strings. It is structured like @code{process-environment}. Each | 2540 | @code{tramp-remote-process-environment} is a list of strings |
| 2749 | element is a string of the form @samp{ENVVARNAME=VALUE}. An entry | 2541 | structured similar to @code{process-environment}, where each element |
| 2750 | @samp{ENVVARNAME=} disables the corresponding environment variable, | 2542 | is a string of the form @samp{ENVVARNAME=VALUE}. |
| 2751 | which might have been set in your init file like @file{~/.profile}. | 2543 | |
| 2544 | To avoid any conflicts with local host variables set through local | ||
| 2545 | configuration files, such as @file{~/.profile}, use @samp{ENVVARNAME=} | ||
| 2546 | to unset them for the remote environment. | ||
| 2752 | 2547 | ||
| 2753 | @noindent | 2548 | @noindent |
| 2754 | Adding an entry can be performed via @code{add-to-list}: | 2549 | Use @code{add-to-list} to add entries: |
| 2755 | 2550 | ||
| 2756 | @lisp | 2551 | @lisp |
| 2757 | (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") | 2552 | (add-to-list 'tramp-remote-process-environment "JAVA_HOME=/opt/java") |
| 2758 | @end lisp | 2553 | @end lisp |
| 2759 | 2554 | ||
| 2760 | Changing or removing an existing entry is not encouraged. The default | 2555 | Modifying or deleting already existing values in the |
| 2761 | values are chosen for proper @value{tramp} work. Nevertheless, if for | 2556 | @code{tramp-remote-process-environment} list may not be feasible on |
| 2762 | example a paranoid system administrator disallows changing the | 2557 | restricted remote hosts. For example, some system administrators |
| 2763 | @env{HISTORY} environment variable, you can customize | 2558 | disallow changing @env{HISTORY} variable. To accommodate such |
| 2764 | @code{tramp-remote-process-environment}, or you can apply the | 2559 | restrictions when using @value{tramp}, fix the |
| 2765 | following code in your @file{.emacs}: | 2560 | @code{tramp-remote-process-environment} by the following code in the |
| 2561 | local @file{.emacs} file: | ||
| 2766 | 2562 | ||
| 2767 | @lisp | 2563 | @lisp |
| 2768 | (let ((process-environment tramp-remote-process-environment)) | 2564 | (let ((process-environment tramp-remote-process-environment)) |
| @@ -2770,31 +2566,29 @@ following code in your @file{.emacs}: | |||
| 2770 | (setq tramp-remote-process-environment process-environment)) | 2566 | (setq tramp-remote-process-environment process-environment)) |
| 2771 | @end lisp | 2567 | @end lisp |
| 2772 | 2568 | ||
| 2773 | When running @code{process-file} or @code{start-file-process} on a | 2569 | @value{tramp} does not use the defaults specified in |
| 2774 | remote @code{default-directory}, the default settings in | 2570 | @code{process-environment} for running @code{process-file} or |
| 2775 | @code{process-environment} are not used as it is the case for local | 2571 | @code{start-file-process} on remote hosts. When values from |
| 2776 | processes. However, if you need environment variables other than set | 2572 | @code{process-environment} are needed for remote processes, then set |
| 2777 | in @code{tramp-remote-process-environment}, you can let-bind them to | 2573 | them as follows: |
| 2778 | @code{process-environment}. Only those variables will be set then: | ||
| 2779 | 2574 | ||
| 2780 | @lisp | 2575 | @lisp |
| 2781 | (let ((process-environment (cons "HGPLAIN=1" process-environment))) | 2576 | (let ((process-environment (cons "HGPLAIN=1" process-environment))) |
| 2782 | (process-file @dots{})) | 2577 | (process-file @dots{})) |
| 2783 | @end lisp | 2578 | @end lisp |
| 2784 | 2579 | ||
| 2785 | This works only for environment variables which are not set already in | 2580 | This works only for environment variables not already set in the |
| 2786 | @code{process-environment}. | 2581 | @code{process-environment}. |
| 2787 | 2582 | ||
| 2788 | If you use other @value{emacsname} packages which do not run | 2583 | For integrating other @value{emacsname} packages so @value{tramp} can |
| 2789 | out-of-the-box on a remote host, please let us know. We will try to | 2584 | execute remotely, please file a bug report. @xref{Bug Reports}. |
| 2790 | integrate them as well. @xref{Bug Reports}. | ||
| 2791 | 2585 | ||
| 2792 | 2586 | ||
| 2793 | @subsection Running remote programs that create local X11 windows | 2587 | @subsection Running remote programs that create local X11 windows |
| 2794 | 2588 | ||
| 2795 | If you want to run a remote program, which shall connect the X11 | 2589 | To allow a remote program to create an X11 window on the local host, |
| 2796 | server you are using with your local host, you can set the | 2590 | set the @env{DISPLAY} environment variable for the remote host as |
| 2797 | @env{DISPLAY} environment variable on the remote host: | 2591 | follows in the local @file{.emacs} file: |
| 2798 | 2592 | ||
| 2799 | @lisp | 2593 | @lisp |
| 2800 | (add-to-list 'tramp-remote-process-environment | 2594 | (add-to-list 'tramp-remote-process-environment |
| @@ -2802,65 +2596,61 @@ server you are using with your local host, you can set the | |||
| 2802 | @end lisp | 2596 | @end lisp |
| 2803 | 2597 | ||
| 2804 | @noindent | 2598 | @noindent |
| 2805 | @code{(getenv "DISPLAY")} shall return a string containing a host | 2599 | @code{(getenv "DISPLAY")} should return a recognizable name for the |
| 2806 | name, which can be interpreted on the remote host; otherwise you might | 2600 | local host that the remote host can redirect X11 window |
| 2807 | use a fixed host name. Strings like @code{:0} cannot be used properly | 2601 | interactions. If querying for a recognizable name is not possible for |
| 2808 | on the remote host. | 2602 | whatever reason, then replace @code{(getenv "DISPLAY")} with a |
| 2809 | 2603 | hard-coded, fixed name. Note that using @code{:0} for X11 display name | |
| 2810 | Another trick might be that you put @code{ForwardX11 yes} or | 2604 | here will not work as expected. |
| 2811 | @code{ForwardX11Trusted yes} to your @file{~/.ssh/config} file for | 2605 | |
| 2812 | that host. | 2606 | An alternate approach is specify @code{ForwardX11 yes} or |
| 2607 | @code{ForwardX11Trusted yes} in the file @file{~/.ssh/config} on the | ||
| 2608 | local host. | ||
| 2813 | 2609 | ||
| 2814 | 2610 | ||
| 2815 | @subsection Running @code{shell} on a remote host | 2611 | @subsection Running @code{shell} on a remote host |
| 2816 | @cindex shell | 2612 | @cindex shell |
| 2817 | 2613 | ||
| 2818 | Calling @kbd{M-x shell} in a buffer related to a remote host runs the | 2614 | Set @option{explicit-shell-file-name} to the appropriate shell name |
| 2819 | local shell as defined in @option{shell-file-name}. This might be | 2615 | when using @value{tramp} between two hosts with different operating |
| 2820 | also a valid file name for a shell to be applied on the remote host, | 2616 | systems, such as @samp{windows-nt} and @samp{gnu/linux}. This option |
| 2821 | but it will fail at least when your local and remote hosts belong to | 2617 | ensures the correct name of the remote shell program. |
| 2822 | different system types, like @samp{windows-nt} and @samp{gnu/linux}. | ||
| 2823 | |||
| 2824 | You must set the variable @option{explicit-shell-file-name} to the | ||
| 2825 | shell file name on the remote host, in order to start that shell on | ||
| 2826 | the remote host. | ||
| 2827 | 2618 | ||
| 2828 | @ifset emacs | 2619 | @ifset emacs |
| 2829 | Starting with Emacs 24 this won't be necessary, if you call | 2620 | Starting with Emacs 24, when @option{explicit-shell-file-name} is |
| 2830 | @code{shell} interactively. You will be asked for the remote shell | 2621 | equal to @code{nil}, calling @code{shell} interactively will prompt |
| 2831 | file name, if you are on a remote buffer, and if | 2622 | for a shell name. |
| 2832 | @option{explicit-shell-file-name} is equal to @code{nil}. | ||
| 2833 | @end ifset | 2623 | @end ifset |
| 2834 | 2624 | ||
| 2835 | 2625 | ||
| 2836 | @subsection Running @code{shell-command} on a remote host | 2626 | @subsection Running @code{shell-command} on a remote host |
| 2837 | @cindex shell-command | 2627 | @cindex shell-command |
| 2838 | 2628 | ||
| 2839 | @code{shell-command} allows to execute commands in a shell, either | 2629 | @code{shell-command} executes commands synchronously or asynchronously |
| 2840 | synchronously, either asynchronously. This works also on remote | 2630 | on remote hosts and displays output in buffers on the local |
| 2841 | hosts. Example: | 2631 | host. Example: |
| 2842 | 2632 | ||
| 2843 | @example | 2633 | @example |
| 2844 | @kbd{C-x C-f @trampfn{sudo, , , } @key{RET}} | 2634 | @kbd{C-x C-f @trampfn{sudo, , , } @key{RET}} |
| 2845 | @kbd{M-! tail -f /var/log/syslog.log & @key{RET}} | 2635 | @kbd{M-! tail -f /var/log/syslog.log & @key{RET}} |
| 2846 | @end example | 2636 | @end example |
| 2847 | 2637 | ||
| 2848 | You will see the buffer @file{*Async Shell Command*}, containing the | 2638 | @command{tail} command outputs continuously to the local buffer, |
| 2849 | continuous output of the @command{tail} command. | 2639 | @file{*Async Shell Command*} |
| 2850 | 2640 | ||
| 2851 | @ifset emacs | 2641 | @ifset emacs |
| 2852 | A similar behavior can be reached by @kbd{M-x auto-revert-tail-mode}, | 2642 | @kbd{M-x auto-revert-tail-mode} runs similarly showing continuous output. |
| 2853 | if available. | ||
| 2854 | @end ifset | 2643 | @end ifset |
| 2855 | 2644 | ||
| 2856 | 2645 | ||
| 2857 | @subsection Running @code{eshell} on a remote host | 2646 | @subsection Running @code{eshell} on a remote host |
| 2858 | @cindex eshell | 2647 | @cindex eshell |
| 2859 | 2648 | ||
| 2860 | @value{tramp} is integrated into @file{eshell.el}. That is, you can | 2649 | @value{tramp} is integrated into @file{eshell.el}, which enables |
| 2861 | open an interactive shell on your remote host, and run commands there. | 2650 | interactive eshell sessions on remote hosts at the command prompt. |
| 2862 | After you have started @kbd{M-x eshell}, you could perform commands | 2651 | You must add the module @code{eshell-tramp} to |
| 2863 | like this: | 2652 | @code{eshell-modules-list}. Here's a sample interaction after opening |
| 2653 | @kbd{M-x eshell} on a remote host: | ||
| 2864 | 2654 | ||
| 2865 | @example | 2655 | @example |
| 2866 | @b{~ $} cd @trampfn{sudo, , , /etc} @key{RET} | 2656 | @b{~ $} cd @trampfn{sudo, , , /etc} @key{RET} |
| @@ -2874,12 +2664,11 @@ uid=0(root) gid=0(root) groups=0(root) | |||
| 2874 | @end example | 2664 | @end example |
| 2875 | 2665 | ||
| 2876 | @ifset emacs | 2666 | @ifset emacs |
| 2877 | Since @value{emacsname} 23.2, @code{eshell} has also an own | 2667 | @code{eshell} in @value{emacsname} 23.2 added custom @code{su} and |
| 2878 | implementation of the @code{su} and @code{sudo} commands. Both | 2668 | @code{sudo} commands that set the default directory correctly for the |
| 2879 | commands change the default directory of the @file{*eshell*} buffer to | 2669 | @file{*eshell*} buffer. @value{tramp} silently updates |
| 2880 | the value related to the user the command has switched to. This works | 2670 | @code{tramp-default-proxies-alist} with an entry for this directory |
| 2881 | even on remote hosts, adding silently a corresponding entry to the | 2671 | (@pxref{Multi-hops}): |
| 2882 | variable @code{tramp-default-proxies-alist} (@pxref{Multi-hops}): | ||
| 2883 | 2672 | ||
| 2884 | @example | 2673 | @example |
| 2885 | @b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET} | 2674 | @b{~ $} cd @trampfn{ssh, user, remotehost, /etc} @key{RET} |
| @@ -2902,56 +2691,51 @@ uid=0(root) gid=0(root) groups=0(root) | |||
| 2902 | @cindex gdb | 2691 | @cindex gdb |
| 2903 | @cindex perldb | 2692 | @cindex perldb |
| 2904 | 2693 | ||
| 2905 | @file{gud.el} offers a unified interface to several symbolic | 2694 | @file{gud.el} provides a unified interface to symbolic debuggers |
| 2906 | debuggers | ||
| 2907 | @ifset emacs | 2695 | @ifset emacs |
| 2908 | @ifinfo | 2696 | @ifinfo |
| 2909 | (@ref{Debuggers, , , @value{emacsdir}}). | 2697 | (@ref{Debuggers, , , @value{emacsdir}}). |
| 2910 | @end ifinfo | 2698 | @end ifinfo |
| 2911 | @end ifset | 2699 | @end ifset |
| 2912 | With @value{tramp}, it is possible to debug programs on | 2700 | @value{tramp} can run debug on remote hosts by calling @code{gdb} |
| 2913 | remote hosts. You can call @code{gdb} with a remote file name: | 2701 | with a remote file name: |
| 2914 | 2702 | ||
| 2915 | @example | 2703 | @example |
| 2916 | @kbd{M-x gdb @key{RET}} | 2704 | @kbd{M-x gdb @key{RET}} |
| 2917 | @b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, ~/myprog} @key{RET} | 2705 | @b{Run gdb (like this):} gdb --annotate=3 @trampfn{ssh, , host, ~/myprog} @key{RET} |
| 2918 | @end example | 2706 | @end example |
| 2919 | 2707 | ||
| 2920 | The file name can also be relative to a remote default directory. | 2708 | Relative file names are based on the remote default directory. When |
| 2921 | Given you are in a buffer that belongs to the remote directory | 2709 | @file{myprog.pl} exists in @file{@trampfn{ssh, , host, /home/user}}, |
| 2922 | @trampfn{ssh, , host, /home/user}, you could call | 2710 | valid calls include: |
| 2923 | 2711 | ||
| 2924 | @example | 2712 | @example |
| 2925 | @kbd{M-x perldb @key{RET}} | 2713 | @kbd{M-x perldb @key{RET}} |
| 2926 | @b{Run perldb (like this):} perl -d myprog.pl @key{RET} | 2714 | @b{Run perldb (like this):} perl -d myprog.pl @key{RET} |
| 2927 | @end example | 2715 | @end example |
| 2928 | 2716 | ||
| 2929 | It is not possible to use just the absolute local part of a remote | 2717 | Just the local part of a remote file name, such as @kbd{perl -d |
| 2930 | file name as program to debug, like @kbd{perl -d | 2718 | /home/user/myprog.pl}, is not possible. |
| 2931 | /home/user/myprog.pl}, though. | ||
| 2932 | 2719 | ||
| 2933 | Arguments of the program to be debugged are taken literally. That | 2720 | Arguments of the program to be debugged must be literal, can take |
| 2934 | means, file names as arguments must be given as ordinary relative or | 2721 | relative or absolute paths, but not remote paths. |
| 2935 | absolute file names, without any remote specification. | ||
| 2936 | 2722 | ||
| 2937 | 2723 | ||
| 2938 | @subsection Running remote processes on Windows hosts | 2724 | @subsection Running remote processes on Windows hosts |
| 2939 | @cindex winexe | 2725 | @cindex winexe |
| 2940 | @cindex powershell | 2726 | @cindex powershell |
| 2941 | 2727 | ||
| 2942 | With the help of the @command{winexe} it is possible tu run processes | 2728 | @command{winexe} runs processes on a remote Windows host, and |
| 2943 | on a remote Windows host. @value{tramp} has implemented this for | 2729 | @value{tramp} can use it for @code{process-file} and |
| 2944 | @code{process-file} and @code{start-file-process}. | 2730 | @code{start-file-process}. |
| 2945 | 2731 | ||
| 2946 | The variable @code{tramp-smb-winexe-program} must contain the file | 2732 | @code{tramp-smb-winexe-program} specifies the local @command{winexe} |
| 2947 | name of your local @command{winexe} command. On the remote host, | 2733 | command. Powershell V2.0 on the remote host is required to run |
| 2948 | Powershell V2.0 must be installed; it is used to run the remote | 2734 | processes triggered from @value{tramp}. |
| 2949 | process. | ||
| 2950 | 2735 | ||
| 2951 | In order to open a remote shell on the Windows host via @kbd{M-x | 2736 | @option{explicit-shell-file-name} and @option{explicit-*-args} have to |
| 2952 | shell}, you must set the variables @option{explicit-shell-file-name} | 2737 | be set properly so @kbd{M-x shell} can open a proper remote shell on a |
| 2953 | and @option{explicit-*-args}. If you want, for example, run | 2738 | Windows host. To open @command{cmd}, set it as follows: |
| 2954 | @command{cmd}, you must set: | ||
| 2955 | 2739 | ||
| 2956 | @lisp | 2740 | @lisp |
| 2957 | (setq explicit-shell-file-name "cmd" | 2741 | (setq explicit-shell-file-name "cmd" |
| @@ -2959,7 +2743,7 @@ and @option{explicit-*-args}. If you want, for example, run | |||
| 2959 | @end lisp | 2743 | @end lisp |
| 2960 | 2744 | ||
| 2961 | @noindent | 2745 | @noindent |
| 2962 | In case of running @command{powershell} as remote shell, the settings are | 2746 | To open @command{powershell} as a remote shell, use this: |
| 2963 | 2747 | ||
| 2964 | @lisp | 2748 | @lisp |
| 2965 | (setq explicit-shell-file-name "powershell" | 2749 | (setq explicit-shell-file-name "powershell" |
| @@ -2971,34 +2755,32 @@ In case of running @command{powershell} as remote shell, the settings are | |||
| 2971 | @section Cleanup remote connections | 2755 | @section Cleanup remote connections |
| 2972 | @cindex cleanup | 2756 | @cindex cleanup |
| 2973 | 2757 | ||
| 2974 | Sometimes it is useful to cleanup remote connections. The following | 2758 | @value{tramp} provides several ways to flush remote connections. |
| 2975 | commands support this. | ||
| 2976 | 2759 | ||
| 2977 | @deffn Command tramp-cleanup-connection vec | 2760 | @deffn Command tramp-cleanup-connection vec |
| 2978 | This command flushes all connection related objects. @option{vec} is | 2761 | This command flushes all connection related objects. @option{vec} is |
| 2979 | the internal representation of a remote connection. Called | 2762 | the internal representation of a remote connection. When called |
| 2980 | interactively, the command offers all active remote connections in the | 2763 | interactively, this command lists active remote connections in the |
| 2981 | minibuffer as remote file name prefix like @file{@trampfn{method, | 2764 | minibuffer. Each connection is of the format @file{@trampfn{method, |
| 2982 | user, host, }}. The cleanup includes password cache (@pxref{Password | 2765 | user, host, }}. Flushing remote connections also cleans the password |
| 2983 | handling}), file cache, connection cache (@pxref{Connection caching}), | 2766 | cache (@pxref{Password handling}), file cache, connection cache |
| 2984 | connection buffers. | 2767 | (@pxref{Connection caching}), and connection buffers. |
| 2985 | @end deffn | 2768 | @end deffn |
| 2986 | 2769 | ||
| 2987 | @deffn Command tramp-cleanup-this-connection | 2770 | @deffn Command tramp-cleanup-this-connection |
| 2988 | This command flushes all objects of the current buffer's remote | 2771 | Flushes only the current buffer's remote connection objects, the same |
| 2989 | connection. The same objects are removed as in | 2772 | as in @code{tramp-cleanup-connection}. |
| 2990 | @code{tramp-cleanup-connection}. | ||
| 2991 | @end deffn | 2773 | @end deffn |
| 2992 | 2774 | ||
| 2993 | @deffn Command tramp-cleanup-all-connections | 2775 | @deffn Command tramp-cleanup-all-connections |
| 2994 | This command flushes objects for all active remote connections. The | 2776 | Flushes all active remote connection objects, the same as in |
| 2995 | same objects are removed as in @code{tramp-cleanup-connection}. | 2777 | @code{tramp-cleanup-connection}. |
| 2996 | @end deffn | 2778 | @end deffn |
| 2997 | 2779 | ||
| 2998 | @deffn Command tramp-cleanup-all-buffers | 2780 | @deffn Command tramp-cleanup-all-buffers |
| 2999 | Like in @code{tramp-cleanup-all-connections}, all remote connections | 2781 | Just as for @code{tramp-cleanup-all-connections}, all remote |
| 3000 | are cleaned up. Additionally all buffers, which are related to a | 2782 | connections are cleaned up in addition to killing buffers related to |
| 3001 | remote connection, are killed. | 2783 | that remote connection. |
| 3002 | @end deffn | 2784 | @end deffn |
| 3003 | 2785 | ||
| 3004 | 2786 | ||
| @@ -3006,60 +2788,62 @@ remote connection, are killed. | |||
| 3006 | @chapter Reporting Bugs and Problems | 2788 | @chapter Reporting Bugs and Problems |
| 3007 | @cindex bug reports | 2789 | @cindex bug reports |
| 3008 | 2790 | ||
| 3009 | Bugs and problems with @value{tramp} are actively worked on by the | 2791 | @value{tramp}'s development team is actively engaged in solving bugs |
| 3010 | development team. Feature requests and suggestions are also more than | 2792 | and problems and looks to feature requests and suggestions. |
| 3011 | welcome. | 2793 | |
| 2794 | @value{tramp}'s mailing list is the place for more advice and | ||
| 2795 | information on working with @value{tramp}, solving problems, | ||
| 2796 | discussing, and general discussions about @value{tramp}. | ||
| 3012 | 2797 | ||
| 3013 | The @value{tramp} mailing list is a great place to get information on | 2798 | @value{tramp}'s mailing list is moderated but even non-subscribers can |
| 3014 | working with @value{tramp}, solving problems and general discussion | 2799 | post for moderator approval. Sometimes this approval step may take as |
| 3015 | and advice on topics relating to the package. It is moderated so | 2800 | long as 48 hours due to public holidays. |
| 3016 | non-subscribers can post but messages will be delayed, possibly up to | ||
| 3017 | 48 hours (or longer in case of holidays), until the moderator approves | ||
| 3018 | your message. | ||
| 3019 | 2801 | ||
| 3020 | The mailing list is at @email{tramp-devel@@gnu.org}. Messages sent to | 2802 | @email{tramp-devel@@gnu.org} is the mailing list. Messages sent to |
| 3021 | this address go to all the subscribers. This is @emph{not} the address | 2803 | this address go to all the subscribers. This is @emph{not} the |
| 3022 | to send subscription requests to. | 2804 | address to send subscription requests to. |
| 3023 | 2805 | ||
| 3024 | Subscribing to the list is performed via | 2806 | To subscribe to the mailing list, visit: |
| 3025 | @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, | 2807 | @uref{http://lists.gnu.org/mailman/listinfo/tramp-devel/, the |
| 3026 | the @value{tramp} Mail Subscription Page}. | 2808 | @value{tramp} Mail Subscription Page}. |
| 3027 | 2809 | ||
| 3028 | @ifset emacs | 2810 | @ifset emacs |
| 3029 | @ifset installchapter | 2811 | @ifset installchapter |
| 3030 | Before sending a bug report, you could check whether @value{tramp} | 2812 | Before sending a bug report, run the test suite first @ref{Testing}. |
| 3031 | works at all. Run the test suite on your local host, @ref{Testing}. | ||
| 3032 | @end ifset | 2813 | @end ifset |
| 3033 | @end ifset | 2814 | @end ifset |
| 3034 | 2815 | ||
| 3035 | @findex tramp-bug | 2816 | @findex tramp-bug |
| 3036 | To report a bug in @value{tramp}, you should execute @kbd{M-x | 2817 | Check if the bug or problem is already addressed in @xref{Frequently |
| 3037 | tramp-bug}. This will automatically generate a buffer with the details | ||
| 3038 | of your system and @value{tramp} version. | ||
| 3039 | |||
| 3040 | When submitting a bug report, please try to describe in excruciating | ||
| 3041 | detail the steps required to reproduce the problem, the setup of the | ||
| 3042 | remote host and any special conditions that exist. You should also | ||
| 3043 | check that your problem is not described already in @xref{Frequently | ||
| 3044 | Asked Questions}. | 2818 | Asked Questions}. |
| 3045 | 2819 | ||
| 3046 | If you can identify a minimal test case that reproduces the problem, | 2820 | Run @kbd{M-x tramp-bug} to generate a buffer with details of the |
| 3047 | include that with your bug report. This will make it much easier for | 2821 | system along with the details of the @value{tramp} |
| 3048 | the development team to analyze and correct the problem. | 2822 | installation. Please include these details with the bug report. |
| 2823 | |||
| 2824 | The bug report must describe in as excruciating detail as possible the | ||
| 2825 | steps required to reproduce the problem. These details must include | ||
| 2826 | the setup of the remote host and any special or unique conditions that | ||
| 2827 | exist. | ||
| 2828 | |||
| 2829 | Include a minimal test case that reproduces the problem. This will | ||
| 2830 | help the development team find the best solution and avoid unrelated | ||
| 2831 | detours. | ||
| 3049 | 2832 | ||
| 3050 | Sometimes, there might be also problems due to Tramp caches. Flush | 2833 | To exclude cache-related problems, flush all caches before running the |
| 3051 | all caches before running the test, @ref{Cleanup remote connections}. | 2834 | test, @ref{Cleanup remote connections}. |
| 3052 | 2835 | ||
| 3053 | Before reporting the bug, you should set the verbosity level to 6 | 2836 | When including @value{tramp}'s messages in the bug report, increase |
| 3054 | (@pxref{Traces and Profiles, Traces}) in the @file{~/.emacs} file and | 2837 | the verbosity level to 6 (@pxref{Traces and Profiles, Traces}) in the |
| 3055 | repeat the bug. Then, include the contents of the @file{*tramp/foo*} | 2838 | @file{~/.emacs} file before repeating steps to the bug. Include the |
| 3056 | and @file{*debug tramp/foo*} buffers in your bug report. A verbosity | 2839 | contents of the @file{*tramp/foo*} and @file{*debug tramp/foo*} |
| 3057 | level greater than 6 will produce a very huge debug buffer, which is | 2840 | buffers with the bug report. |
| 3058 | mostly not necessary for the analysis. | ||
| 3059 | 2841 | ||
| 3060 | Please be aware that, with a verbosity level of 6 or greater, the | 2842 | @strong{Note} that a verbosity level greater than 6 is not necessary |
| 2843 | at this stage. Also note that a verbosity level of 6 or greater, the | ||
| 3061 | contents of files and directories will be included in the debug | 2844 | contents of files and directories will be included in the debug |
| 3062 | buffer. Passwords you've typed will never be included there. | 2845 | buffer. Passwords typed in @value{tramp} will never be included |
| 2846 | there. | ||
| 3063 | 2847 | ||
| 3064 | 2848 | ||
| 3065 | @node Frequently Asked Questions | 2849 | @node Frequently Asked Questions |
| @@ -3069,15 +2853,15 @@ buffer. Passwords you've typed will never be included there. | |||
| 3069 | 2853 | ||
| 3070 | @itemize @bullet | 2854 | @itemize @bullet |
| 3071 | @item | 2855 | @item |
| 3072 | Where can I get the latest @value{tramp}? | 2856 | Where is the latest @value{tramp}? |
| 3073 | 2857 | ||
| 3074 | @value{tramp} is available under the URL below. | 2858 | @value{tramp} is available at the GNU URL: |
| 3075 | 2859 | ||
| 3076 | @noindent | 2860 | @noindent |
| 3077 | @uref{ftp://ftp.gnu.org/gnu/tramp/} | 2861 | @uref{ftp://ftp.gnu.org/gnu/tramp/} |
| 3078 | 2862 | ||
| 3079 | @noindent | 2863 | @noindent |
| 3080 | There is also a Savannah project page. | 2864 | @value{tramp}'s GNU project page is located here: |
| 3081 | 2865 | ||
| 3082 | @noindent | 2866 | @noindent |
| 3083 | @uref{http://savannah.gnu.org/projects/tramp/} | 2867 | @uref{http://savannah.gnu.org/projects/tramp/} |
| @@ -3086,38 +2870,39 @@ There is also a Savannah project page. | |||
| 3086 | @item | 2870 | @item |
| 3087 | Which systems does it work on? | 2871 | Which systems does it work on? |
| 3088 | 2872 | ||
| 3089 | The package has been used successfully on Emacs 22, Emacs 23, Emacs | 2873 | The package works successfully on Emacs 22, Emacs 23, Emacs 24, Emacs |
| 3090 | 24, XEmacs 21 (starting with 21.4), and SXEmacs 22. | 2874 | 25, XEmacs 21 (starting with 21.4), and SXEmacs 22. |
| 3091 | 2875 | ||
| 3092 | The package was intended to work on Unix, and it really expects a | 2876 | While Unix and Unix-like systems are the primary remote targets, |
| 3093 | Unix-like system on the remote end (except the @option{smb} method), | 2877 | @value{tramp} has equal success connecting to other platforms, such as |
| 3094 | but some people seemed to have some success getting it to work on MS | 2878 | MS Windows XP/Vista/7. |
| 3095 | Windows XP/Vista/7 @value{emacsname}. | ||
| 3096 | 2879 | ||
| 3097 | 2880 | ||
| 3098 | @item | 2881 | @item |
| 3099 | How could I speed up @value{tramp}? | 2882 | How to speed up @value{tramp}? |
| 3100 | 2883 | ||
| 3101 | In the backstage, @value{tramp} needs a lot of operations on the | 2884 | @value{tramp} does many things in the background, some of which |
| 3102 | remote host. The time for transferring data from and to the remote | 2885 | depends on network speeds, response speeds of remote hosts, and |
| 3103 | host as well as the time needed to perform the operations there count. | 2886 | authentication delays. During these operations, @value{tramp}'s |
| 3104 | In order to speed up @value{tramp}, one could either try to avoid some | 2887 | responsiveness slows down. Some suggestions within the scope of |
| 3105 | of the operations, or one could try to improve their performance. | 2888 | @value{tramp}'s settings include: |
| 3106 | 2889 | ||
| 3107 | Use an external method, like @option{scp}. | 2890 | Use an external method, such as @option{scp}, which are faster than |
| 2891 | internal methods. | ||
| 3108 | 2892 | ||
| 3109 | Use caching. This is already enabled by default. Information about | 2893 | Keep the file @code{tramp-persistency-file-name}, which is where |
| 3110 | the remote host as well as the remote files are cached for reuse. The | 2894 | @value{tramp} caches remote information about hosts and files. Caching |
| 3111 | information about remote hosts is kept in the file specified in | 2895 | is enabled by default. Don't disable it. |
| 3112 | @code{tramp-persistency-file-name}. Keep this file. If you are | ||
| 3113 | confident that files on remote hosts are not changed out of | ||
| 3114 | @value{emacsname}' control, set @code{remote-file-name-inhibit-cache} | ||
| 3115 | to @code{nil}. Set also @code{tramp-completion-reread-directory-timeout} | ||
| 3116 | to @code{nil}, @ref{File name completion}. | ||
| 3117 | 2896 | ||
| 3118 | Disable version control. If you access remote files which are not | 2897 | Set @code{remote-file-name-inhibit-cache} to @code{nil} if remote |
| 3119 | under version control, a lot of check operations can be avoided by | 2898 | files are not independently updated outside @value{tramp}'s control. |
| 3120 | disabling VC@. This can be achieved by | 2899 | That cache cleanup will be necessary if the remote directories or |
| 2900 | files are updated independent of @value{tramp}. | ||
| 2901 | |||
| 2902 | Set @code{tramp-completion-reread-directory-timeout} to @code{nil} to | ||
| 2903 | speed up completions, @ref{File name completion}. | ||
| 2904 | |||
| 2905 | Disable version control to avoid delays: | ||
| 3121 | 2906 | ||
| 3122 | @lisp | 2907 | @lisp |
| 3123 | (setq vc-ignore-dir-regexp | 2908 | (setq vc-ignore-dir-regexp |
| @@ -3126,49 +2911,46 @@ disabling VC@. This can be achieved by | |||
| 3126 | tramp-file-name-regexp)) | 2911 | tramp-file-name-regexp)) |
| 3127 | @end lisp | 2912 | @end lisp |
| 3128 | 2913 | ||
| 3129 | Disable excessive traces. The default trace level of @value{tramp}, | 2914 | Disable excessive traces. Set @code{tramp-verbose} to 3 or lower, |
| 3130 | defined in the variable @code{tramp-verbose}, is 3. You should | 2915 | default being 3. Increase trace levels temporarily when hunting for |
| 3131 | increase this level only temporarily, hunting bugs. | 2916 | bugs. |
| 3132 | |||
| 3133 | 2917 | ||
| 3134 | @item | 2918 | @item |
| 3135 | @value{tramp} does not connect to the remote host | 2919 | @value{tramp} does not connect to the remote host |
| 3136 | 2920 | ||
| 3137 | When @value{tramp} does not connect to the remote host, there are three | 2921 | Three main reasons for why @value{tramp} does not connect to the remote host: |
| 3138 | reasons heading the bug mailing list: | ||
| 3139 | 2922 | ||
| 3140 | @itemize @minus | 2923 | @itemize @minus |
| 3141 | @item | 2924 | @item |
| 3142 | Unknown characters in the prompt | 2925 | Unknown characters in the prompt |
| 3143 | 2926 | ||
| 3144 | @value{tramp} needs to recognize the prompt on the remote host | 2927 | @value{tramp} needs a clean recognizable prompt on the remote host for |
| 3145 | after execution any command. This is not possible when the prompt | 2928 | accurate parsing. Shell prompts that contain escape sequences for |
| 3146 | contains unknown characters like escape sequences for coloring. This | 2929 | coloring cause parsing problems. @ref{Remote shell setup} for |
| 3147 | should be avoided on the remote side. @xref{Remote shell setup}. for | 2930 | customizing prompt detection using regular expressions. |
| 3148 | setting the regular expression detecting the prompt. | ||
| 3149 | 2931 | ||
| 3150 | You can check your settings after an unsuccessful connection by | 2932 | To check if the remote host's prompt is being recognized, use this |
| 3151 | switching to the @value{tramp} connection buffer @file{*tramp/foo*}, | 2933 | test: switch to @value{tramp} connection buffer @file{*tramp/foo*}, |
| 3152 | setting the cursor at the top of the buffer, and applying the expression | 2934 | put the cursor at the top of the buffer, and then apply the following |
| 2935 | expression: | ||
| 3153 | 2936 | ||
| 3154 | @example | 2937 | @example |
| 3155 | @kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))} | 2938 | @kbd{M-: (re-search-forward (concat tramp-shell-prompt-pattern "$"))} |
| 3156 | @end example | 2939 | @end example |
| 3157 | 2940 | ||
| 3158 | If it fails, or the cursor is not moved at the end of the buffer, your | 2941 | If the cursor has not moved to the prompt at the bottom of the buffer, |
| 3159 | prompt is not recognized correctly. | 2942 | then @value{tramp} has failed to recognize the prompt. |
| 3160 | 2943 | ||
| 3161 | A special problem is the zsh shell, which uses left-hand side and | 2944 | When using zsh on remote hosts, disable zsh line editor because zsh |
| 3162 | right-hand side prompts in parallel. Therefore, it is necessary to | 2945 | uses left-hand side and right-hand side prompts in parallel. Add the |
| 3163 | disable the zsh line editor on the remote host. You shall add to | 2946 | following line to @file{~/.zshrc}: |
| 3164 | @file{~/.zshrc} the following command: | ||
| 3165 | 2947 | ||
| 3166 | @example | 2948 | @example |
| 3167 | [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' | 2949 | [ $TERM = "dumb" ] && unsetopt zle && PS1='$ ' |
| 3168 | @end example | 2950 | @end example |
| 3169 | 2951 | ||
| 3170 | Similar fancy prompt settings are known from the fish shell. Here you | 2952 | When using fish shell on remote hosts, disable fancy formatting by |
| 3171 | must add in @file{~/.config/fish/config.fish}: | 2953 | adding the following to @file{~/.config/fish/config.fish}: |
| 3172 | 2954 | ||
| 3173 | @example | 2955 | @example |
| 3174 | function fish_prompt | 2956 | function fish_prompt |
| @@ -3180,35 +2962,30 @@ function fish_prompt | |||
| 3180 | end | 2962 | end |
| 3181 | @end example | 2963 | @end example |
| 3182 | 2964 | ||
| 3183 | Furthermore it has been reported, that @value{tramp} (like sshfs, | 2965 | When using WinSSHD on remote hosts, @value{tramp} do not recognize the |
| 3184 | incidentally) doesn't work with WinSSHD due to strange prompt settings. | 2966 | strange prompt settings. |
| 3185 | 2967 | ||
| 3186 | @item | 2968 | @item |
| 3187 | Echoed characters after login | 2969 | Echoed characters after login |
| 3188 | 2970 | ||
| 3189 | When the remote host opens an echoing shell, there might be control | 2971 | @value{tramp} suppresses echos from remote hosts with the |
| 3190 | characters in the welcome message. @value{tramp} tries to suppress | 2972 | @command{stty -echo} command. But sometimes it is too late to suppress |
| 3191 | such echoes via the @command{stty -echo} command, but sometimes this | 2973 | welcome messages from the remote host containing harmful control |
| 3192 | command is not reached, because the echoed output has confused | 2974 | characters. Using @option{sshx} or @option{scpx} methods can avoid |
| 3193 | @value{tramp} already. In such situations it might be helpful to use | 2975 | this problem because they allocate a pseudo tty. @xref{Inline |
| 3194 | the @option{sshx} or @option{scpx} methods, which allocate a pseudo tty. | 2976 | methods}. |
| 3195 | @xref{Inline methods}. | ||
| 3196 | 2977 | ||
| 3197 | @item | 2978 | @item |
| 3198 | @value{tramp} doesn't transfer strings with more than 500 characters | 2979 | @value{tramp} stops transferring strings longer than 500 characters |
| 3199 | correctly | 2980 | |
| 3200 | 2981 | Set @code{tramp-chunksize} to 500 to get around this problem, which is | |
| 3201 | On some few systems, the implementation of @code{process-send-string} | 2982 | related to faulty implementation of @code{process-send-string} on |
| 3202 | seems to be broken for longer strings. It is reported for HP-UX, | 2983 | HP-UX, FreeBSD and Tru64 Unix systems. Consult the documentation for |
| 3203 | FreeBSD and Tru64 Unix, for example. This case, you should customize | 2984 | @code{tramp-chunksize} to see when this is necessary. |
| 3204 | the variable @code{tramp-chunksize} to 500. For a description how to | 2985 | |
| 3205 | determine whether this is necessary see the documentation of | 2986 | Set @code{file-precious-flag} to @code{t} for files accessed by |
| 3206 | @code{tramp-chunksize}. | 2987 | @value{tramp} so the file contents are checked using checksum by |
| 3207 | 2988 | first saving to a temporary file. | |
| 3208 | Additionally, it will be useful to set @code{file-precious-flag} to | ||
| 3209 | @code{t} for @value{tramp} files. Then the file contents will be | ||
| 3210 | written into a temporary file first, which is checked for correct | ||
| 3211 | checksum. | ||
| 3212 | @ifinfo | 2989 | @ifinfo |
| 3213 | @pxref{Saving Buffers, , , elisp} | 2990 | @pxref{Saving Buffers, , , elisp} |
| 3214 | @end ifinfo | 2991 | @end ifinfo |
| @@ -3224,17 +3001,12 @@ checksum. | |||
| 3224 | 3001 | ||
| 3225 | 3002 | ||
| 3226 | @item | 3003 | @item |
| 3227 | @value{tramp} does not recognize hung @command{ssh} sessions | 3004 | @value{tramp} does not recognize if a @command{ssh} session hangs |
| 3228 | |||
| 3229 | When your network connection is down, @command{ssh} sessions might | ||
| 3230 | hang. @value{tramp} cannot detect it safely, because it still sees a | ||
| 3231 | running @command{ssh} process. Timeouts cannot be used as well, | ||
| 3232 | because it cannot be predicted how long a remote command will last, | ||
| 3233 | for example when copying very large files. | ||
| 3234 | 3005 | ||
| 3235 | Therefore, you must configure the @command{ssh} process to die | 3006 | @command{ssh} sessions on the local host hang when the network is |
| 3236 | in such a case. The following entry in @file{~/.ssh/config} would do | 3007 | down. @value{tramp} cannot safely detect such hangs. The network |
| 3237 | the job: | 3008 | configuration for @command{ssh} can be configured to kill such hangs |
| 3009 | with the following command in the @file{~/.ssh/config}: | ||
| 3238 | 3010 | ||
| 3239 | @example | 3011 | @example |
| 3240 | Host * | 3012 | Host * |
| @@ -3243,25 +3015,17 @@ Host * | |||
| 3243 | 3015 | ||
| 3244 | 3016 | ||
| 3245 | @item | 3017 | @item |
| 3246 | @value{tramp} does not use my @command{ssh} @code{ControlPath} | 3018 | @value{tramp} does not use default @command{ssh} @code{ControlPath} |
| 3247 | 3019 | ||
| 3248 | Your @code{ControlPath} setting will be overwritten by @command{ssh} | 3020 | @value{tramp} overwrites @code{ControlPath} settings when initiating |
| 3249 | sessions initiated by @value{tramp}. This is because a master | 3021 | @command{ssh} sessions. @value{tramp} does this to fend off a stall |
| 3250 | session, initiated outside @value{emacsname}, could be closed, which | 3022 | if a master session opened outside the @value{emacsname} session is no |
| 3251 | would stall all other @command{ssh} sessions for that host inside | 3023 | longer open. That is why @value{tramp} prompts for the password again |
| 3252 | @value{emacsname}. | 3024 | even if there is an @command{ssh} already open. |
| 3253 | |||
| 3254 | Consequently, if you connect to a remote host via @value{tramp}, you | ||
| 3255 | might be prompted for a password again, even if you have established | ||
| 3256 | already an @command{ssh} connection to that host. Further | ||
| 3257 | @value{tramp} connections to that host, for example in order to run a | ||
| 3258 | process on that host, will reuse that initial @command{ssh} | ||
| 3259 | connection. | ||
| 3260 | 3025 | ||
| 3261 | If your @command{ssh} version supports the @code{ControlPersist} | 3026 | Some @command{ssh} versions support a @code{ControlPersist} option, |
| 3262 | option, you could customize the variable | 3027 | which allows to set the @code{ControlPath} provided the variable |
| 3263 | @code{tramp-ssh-controlmaster-options} to use your @code{ControlPath}, | 3028 | @code{tramp-ssh-controlmaster-options} is customized as follows: |
| 3264 | for example: | ||
| 3265 | 3029 | ||
| 3266 | @lisp | 3030 | @lisp |
| 3267 | (setq tramp-ssh-controlmaster-options | 3031 | (setq tramp-ssh-controlmaster-options |
| @@ -3270,11 +3034,12 @@ for example: | |||
| 3270 | "-o ControlMaster=auto -o ControlPersist=yes")) | 3034 | "-o ControlMaster=auto -o ControlPersist=yes")) |
| 3271 | @end lisp | 3035 | @end lisp |
| 3272 | 3036 | ||
| 3273 | Note, that "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and | 3037 | Note how "%r", "%h" and "%p" must be encoded as "%%r", "%%h" and |
| 3274 | "%%p", respectively. | 3038 | "%%p". |
| 3275 | 3039 | ||
| 3276 | These settings can be suppressed, if they are configured properly in | 3040 | If the @file{~/.ssh/config} is configured appropriately for the above |
| 3277 | your @file{~/.ssh/config}: | 3041 | behavior, then any changes to @command{ssh} can be suppressed with |
| 3042 | this @code{nil} setting: | ||
| 3278 | 3043 | ||
| 3279 | @lisp | 3044 | @lisp |
| 3280 | (setq tramp-use-ssh-controlmaster-options nil) | 3045 | (setq tramp-use-ssh-controlmaster-options nil) |
| @@ -3284,44 +3049,40 @@ your @file{~/.ssh/config}: | |||
| 3284 | @item | 3049 | @item |
| 3285 | File name completion does not work with @value{tramp} | 3050 | File name completion does not work with @value{tramp} |
| 3286 | 3051 | ||
| 3287 | When you log in to the remote host, do you see the output of | 3052 | @acronym{ANSI} escape sequences from the remote shell may cause errors |
| 3288 | @command{ls} in color? If so, this may be the cause of your problems. | 3053 | in @value{tramp}'s parsing of remote buffers. |
| 3289 | |||
| 3290 | @command{ls} outputs @acronym{ANSI} escape sequences that your terminal | ||
| 3291 | emulator interprets to set the colors. These escape sequences will | ||
| 3292 | confuse @value{tramp} however. | ||
| 3293 | |||
| 3294 | In your @file{.bashrc}, @file{.profile} or equivalent on the remote | ||
| 3295 | host you probably have an alias configured that adds the option | ||
| 3296 | @option{--color=yes} or @option{--color=auto}. | ||
| 3297 | 3054 | ||
| 3298 | You should remove that alias and ensure that a new login @emph{does not} | 3055 | To test if this is the case, open a remote shell and check if the output |
| 3299 | display the output of @command{ls} in color. If you still cannot use | 3056 | of @command{ls} is in color. |
| 3300 | file name completion, report a bug to the @value{tramp} developers. | ||
| 3301 | 3057 | ||
| 3058 | To disable @acronym{ANSI} escape sequences from the remote hosts, | ||
| 3059 | disable @option{--color=yes} or @option{--color=auto} in the remote | ||
| 3060 | host's @file{.bashrc} or @file{.profile}. Turn this alias on and off | ||
| 3061 | to see if file name completion works. | ||
| 3302 | 3062 | ||
| 3303 | @item | 3063 | @item |
| 3304 | File name completion does not work in large directories | 3064 | File name completion does not work in directories with large number of |
| 3065 | files | ||
| 3305 | 3066 | ||
| 3306 | @value{tramp} uses globbing for some operations. (Globbing means to use the | 3067 | This may be related to globbing, which is the use of shell's ability |
| 3307 | shell to expand wildcards such as @samp{*.c}.) This might create long | 3068 | to expand wild card specifications, such as @samp{*.c}. For |
| 3308 | command lines, especially in directories with many files. Some shells | 3069 | directories with large number of files, globbing might exceed the |
| 3309 | choke on long command lines, or don't cope well with the globbing | 3070 | shell's limit on length of command lines and hang. @value{tramp} uses |
| 3310 | itself. | 3071 | globbing. |
| 3311 | 3072 | ||
| 3312 | If you have a large directory on the remote end, you may wish to execute | 3073 | To test if globbing hangs, open a shell on the remote host and then |
| 3313 | a command like @samp{ls -d * ..?* > /dev/null} and see if it hangs. | 3074 | run @samp{ls -d * ..?* > /dev/null}. |
| 3314 | Note that you must first start the right shell, which might be | 3075 | |
| 3315 | @command{/bin/sh}, @command{ksh} or @command{bash}, depending on which | 3076 | When testing, ensure the remote shell is the same shell |
| 3316 | of those supports tilde expansion. | 3077 | (@command{/bin/sh}, @command{ksh} or @command{bash}), that |
| 3078 | @value{tramp} uses when connecting to that host. | ||
| 3317 | 3079 | ||
| 3318 | 3080 | ||
| 3319 | @item | 3081 | @item |
| 3320 | How can I get notified when @value{tramp} file transfers are complete? | 3082 | How to get notified after @value{tramp} completes file transfers? |
| 3321 | 3083 | ||
| 3322 | The following snippet can be put in your @file{~/.emacs} file. It | 3084 | Make @value{emacsname} beep after reading from or writing to the |
| 3323 | makes @value{emacsname} beep after reading from or writing to the | 3085 | remote host with the following code in @file{~/.emacs} file. |
| 3324 | remote host. | ||
| 3325 | 3086 | ||
| 3326 | @lisp | 3087 | @lisp |
| 3327 | (defadvice tramp-handle-write-region | 3088 | (defadvice tramp-handle-write-region |
| @@ -3346,12 +3107,11 @@ remote host. | |||
| 3346 | 3107 | ||
| 3347 | @ifset emacs | 3108 | @ifset emacs |
| 3348 | @item | 3109 | @item |
| 3349 | I'ld like to get a Visual Warning when working in a sudo:ed context | 3110 | How to get a Visual Warning when working with @samp{root} privileges |
| 3350 | 3111 | ||
| 3351 | When you are working with @samp{root} privileges, it might be useful | 3112 | Get a modeline indication when working with @samp{root} privileges |
| 3352 | to get an indication in the buffer's modeline. The following code, | 3113 | with the following code (tested with @value{emacsname} 22.1) in |
| 3353 | tested with @value{emacsname} 22.1, does the job. You should put it | 3114 | @file{~/.emacs} file: |
| 3354 | into your @file{~/.emacs}: | ||
| 3355 | 3115 | ||
| 3356 | @lisp | 3116 | @lisp |
| 3357 | (defun my-mode-line-function () | 3117 | (defun my-mode-line-function () |
| @@ -3367,10 +3127,10 @@ into your @file{~/.emacs}: | |||
| 3367 | 3127 | ||
| 3368 | @ifset emacs | 3128 | @ifset emacs |
| 3369 | @item | 3129 | @item |
| 3370 | I'ld like to see a host indication in the mode line when I'm remote | 3130 | How to get host indication in the mode line? |
| 3371 | 3131 | ||
| 3372 | The following code has been tested with @value{emacsname} 22.1. You | 3132 | The following code (tested with @value{emacsname} 22.1) in |
| 3373 | should put it into your @file{~/.emacs}: | 3133 | @file{~/.emacs} file shows it: |
| 3374 | 3134 | ||
| 3375 | @lisp | 3135 | @lisp |
| 3376 | (defconst my-mode-line-buffer-identification | 3136 | (defconst my-mode-line-buffer-identification |
| @@ -3398,11 +3158,11 @@ should put it into your @file{~/.emacs}: | |||
| 3398 | my-mode-line-buffer-identification))) | 3158 | my-mode-line-buffer-identification))) |
| 3399 | @end lisp | 3159 | @end lisp |
| 3400 | 3160 | ||
| 3401 | Since @value{emacsname} 23.1, the mode line contains an indication if | 3161 | The mode line in @value{emacsname} 23.1 and later versions now |
| 3402 | @code{default-directory} for the current buffer is on a remote host. | 3162 | contains an indication if @code{default-directory} for the current |
| 3403 | The corresponding tooltip includes the name of that host. If you | 3163 | buffer is on a remote host. Moreover, the corresponding tool-tip |
| 3404 | still want the host name as part of the mode line, you can use the | 3164 | shows the remote host name. The above @code{:eval} clause can also be |
| 3405 | example above, but the @code{:eval} clause can be simplified: | 3165 | simplified to show the host name in the mode line: |
| 3406 | 3166 | ||
| 3407 | @lisp | 3167 | @lisp |
| 3408 | '(:eval | 3168 | '(:eval |
| @@ -3418,12 +3178,11 @@ example above, but the @code{:eval} clause can be simplified: | |||
| 3418 | 3178 | ||
| 3419 | @ifset emacs | 3179 | @ifset emacs |
| 3420 | @item | 3180 | @item |
| 3421 | My remote host does not understand default directory listing options | 3181 | Remote host does not understand default options for directory listing |
| 3422 | 3182 | ||
| 3423 | @value{emacsname} computes the @command{dired} options depending on | 3183 | @value{emacsname} computes the @command{dired} options based on the |
| 3424 | the local host you are working. If your @command{ls} command on the | 3184 | local host but if the remote host cannot understand the same |
| 3425 | remote host does not understand those options, you can change them | 3185 | @command{ls} command, then set them with a hook as follows: |
| 3426 | like this: | ||
| 3427 | 3186 | ||
| 3428 | @lisp | 3187 | @lisp |
| 3429 | (add-hook | 3188 | (add-hook |
| @@ -3436,13 +3195,12 @@ like this: | |||
| 3436 | 3195 | ||
| 3437 | 3196 | ||
| 3438 | @item | 3197 | @item |
| 3439 | There's this @file{~/.sh_history} file on the remote host which keeps | 3198 | Why is @file{~/.sh_history} file on the remote host growing? |
| 3440 | growing and growing. What's that? | ||
| 3441 | 3199 | ||
| 3442 | Sometimes, @value{tramp} starts @command{ksh} on the remote host for | 3200 | Due to @command{ksh} saving tilde expansions triggered by |
| 3443 | tilde expansion. Maybe @command{ksh} saves the history by default. | 3201 | @value{tramp}, the history file is probably growing rapidly. To fix, |
| 3444 | @value{tramp} tries to turn off saving the history, but maybe you have | 3202 | turn off saving history by putting this shell code in the |
| 3445 | to help. For example, you could put this in your @file{.kshrc}: | 3203 | @file{.kshrc} file: |
| 3446 | 3204 | ||
| 3447 | @example | 3205 | @example |
| 3448 | if [ -f $HOME/.sh_history ] ; then | 3206 | if [ -f $HOME/.sh_history ] ; then |
| @@ -3456,23 +3214,24 @@ if [ "$@{HISTSIZE-unset@}" != "unset" ] ; then | |||
| 3456 | fi | 3214 | fi |
| 3457 | @end example | 3215 | @end example |
| 3458 | 3216 | ||
| 3459 | Furthermore, if you use an @option{ssh}-based method, you could add | 3217 | For @option{ssh}-based method, add the following line to your |
| 3460 | the following line to your @file{~/.ssh/environment} file: | 3218 | @file{~/.ssh/environment} file: |
| 3461 | 3219 | ||
| 3462 | @example | 3220 | @example |
| 3463 | HISTFILE=/dev/null | 3221 | HISTFILE=/dev/null |
| 3464 | @end example | 3222 | @end example |
| 3465 | 3223 | ||
| 3466 | 3224 | ||
| 3467 | @item There are longish file names to type. How to shorten this? | 3225 | @item |
| 3226 | How to shorten long file names when typing in @value{tramp}? | ||
| 3468 | 3227 | ||
| 3469 | Let's say you need regularly access to @file{@trampfn{ssh, news, | 3228 | Adapt several of these approaches to reduce typing. If the full name |
| 3470 | news.my.domain, /opt/news/etc}}, which is boring to type again and | 3229 | is @file{@trampfn{ssh, news, news.my.domain, /opt/news/etc}}, then: |
| 3471 | again. The following approaches can be mixed: | ||
| 3472 | 3230 | ||
| 3473 | @enumerate | 3231 | @enumerate |
| 3474 | 3232 | ||
| 3475 | @item Use default values for method and user name: | 3233 | @item |
| 3234 | Use default values for method name and user name: | ||
| 3476 | 3235 | ||
| 3477 | You can define default methods and user names for hosts, | 3236 | You can define default methods and user names for hosts, |
| 3478 | (@pxref{Default Method}, @pxref{Default User}): | 3237 | (@pxref{Default Method}, @pxref{Default User}): |
| @@ -3482,18 +3241,18 @@ You can define default methods and user names for hosts, | |||
| 3482 | tramp-default-user "news") | 3241 | tramp-default-user "news") |
| 3483 | @end lisp | 3242 | @end lisp |
| 3484 | 3243 | ||
| 3485 | The file name left to type would be | 3244 | The reduced typing: @kbd{C-x C-f @trampfn{, , news.my.domain, /opt/news/etc}}. |
| 3486 | @kbd{C-x C-f @trampfn{, , news.my.domain, /opt/news/etc}}. | ||
| 3487 | 3245 | ||
| 3488 | Note that there are some useful settings already. Accessing your | 3246 | @strong{Note} that there are some useful shortcuts already. Accessing |
| 3489 | local host as @samp{root} user, is possible just by @kbd{C-x C-f | 3247 | your local host as @samp{root} user, is possible just by @kbd{C-x C-f |
| 3490 | @trampfn{su, , ,}}. | 3248 | @trampfn{su, , ,}}. |
| 3491 | 3249 | ||
| 3492 | @item Use configuration possibilities of your method: | 3250 | @item |
| 3251 | Use configuration options of the access method: | ||
| 3493 | 3252 | ||
| 3494 | Several connection methods (i.e., the programs used) offer powerful | 3253 | Programs used for access methods already offer powerful configurations |
| 3495 | configuration possibilities (@pxref{Customizing Completion}). In the | 3254 | (@pxref{Customizing Completion}). For @option{ssh}, configure the |
| 3496 | given case, this could be @file{~/.ssh/config}: | 3255 | file @file{~/.ssh/config}: |
| 3497 | 3256 | ||
| 3498 | @example | 3257 | @example |
| 3499 | Host xy | 3258 | Host xy |
| @@ -3501,30 +3260,32 @@ Host xy | |||
| 3501 | User news | 3260 | User news |
| 3502 | @end example | 3261 | @end example |
| 3503 | 3262 | ||
| 3504 | The file name left to type would be @kbd{C-x C-f @trampfn{ssh, , xy, | 3263 | The reduced typing: @kbd{C-x C-f @trampfn{ssh, , xy, /opt/news/etc}}. |
| 3505 | /opt/news/etc}}. Depending on files in your directories, it is even | 3264 | |
| 3506 | possible to complete the host name with @kbd{C-x C-f | 3265 | Depending on the number of files in the directories, host names |
| 3266 | completion can further reduce key strokes: @kbd{C-x C-f | ||
| 3507 | @value{prefix}ssh@value{postfixhop}x @key{TAB}}. | 3267 | @value{prefix}ssh@value{postfixhop}x @key{TAB}}. |
| 3508 | 3268 | ||
| 3509 | @item Use environment variables: | 3269 | @item |
| 3270 | Use environment variables to expand long strings | ||
| 3510 | 3271 | ||
| 3511 | File names typed in the minibuffer can be expanded by environment | 3272 | For long file names, set up environment variables that are expanded in |
| 3512 | variables. You can set them outside @value{emacsname}, or even with | 3273 | the minibuffer. Environment variables are set either outside |
| 3513 | Lisp: | 3274 | @value{emacsname} or inside @value{emacsname} with Lisp: |
| 3514 | 3275 | ||
| 3515 | @lisp | 3276 | @lisp |
| 3516 | (setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}") | 3277 | (setenv "xy" "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}") |
| 3517 | @end lisp | 3278 | @end lisp |
| 3518 | 3279 | ||
| 3519 | Then you need simply to type @kbd{C-x C-f $xy @key{RET}}, and here you | 3280 | The reduced typing: @kbd{C-x C-f $xy @key{RET}}. |
| 3520 | are. The disadvantage is that you cannot edit the file name, because | 3281 | |
| 3282 | @strong{Note} that file name cannot be edited here because the | ||
| 3521 | environment variables are not expanded during editing in the | 3283 | environment variables are not expanded during editing in the |
| 3522 | minibuffer. | 3284 | minibuffer. |
| 3523 | 3285 | ||
| 3524 | @item Define own keys: | 3286 | @item Define own keys: |
| 3525 | 3287 | ||
| 3526 | You can define your own key sequences in @value{emacsname}, which can | 3288 | Redefine another key sequence in @value{emacsname} for @kbd{C-x C-f}: |
| 3527 | be used instead of @kbd{C-x C-f}: | ||
| 3528 | 3289 | ||
| 3529 | @lisp | 3290 | @lisp |
| 3530 | (global-set-key | 3291 | (global-set-key |
| @@ -3537,16 +3298,16 @@ be used instead of @kbd{C-x C-f}: | |||
| 3537 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))) | 3298 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")))) |
| 3538 | @end lisp | 3299 | @end lisp |
| 3539 | 3300 | ||
| 3540 | Simply typing @kbd{C-x C-y} would initialize the minibuffer for | 3301 | Simply typing @kbd{C-x C-y} would prepare minibuffer editing of file |
| 3541 | editing with your beloved file name. | 3302 | name. |
| 3542 | 3303 | ||
| 3543 | See also @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the | 3304 | See @uref{http://www.emacswiki.org/cgi-bin/wiki/TrampMode, the Emacs |
| 3544 | Emacs Wiki} for a more comprehensive example. | 3305 | Wiki} for a more comprehensive example. |
| 3545 | 3306 | ||
| 3546 | @item Define own abbreviation (1): | 3307 | @item |
| 3308 | Define own abbreviation (1): | ||
| 3547 | 3309 | ||
| 3548 | It is possible to define an own abbreviation list for expanding file | 3310 | Abbreviation list expansion can be used to reduce typing long file names: |
| 3549 | names: | ||
| 3550 | 3311 | ||
| 3551 | @lisp | 3312 | @lisp |
| 3552 | (add-to-list | 3313 | (add-to-list |
| @@ -3554,13 +3315,16 @@ names: | |||
| 3554 | '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) | 3315 | '("^/xy" . "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) |
| 3555 | @end lisp | 3316 | @end lisp |
| 3556 | 3317 | ||
| 3557 | This shortens the file opening command to @kbd{C-x C-f /xy | 3318 | The reduced typing: @kbd{C-x C-f /xy @key{RET}}. |
| 3558 | @key{RET}}. The disadvantage is, again, that you cannot edit the file | 3319 | |
| 3559 | name, because the expansion happens after entering the file name only. | 3320 | @strong{Note} that file name cannot be edited here because the |
| 3321 | environment variables are not expanded during editing in the | ||
| 3322 | minibuffer. | ||
| 3560 | 3323 | ||
| 3561 | @item Define own abbreviation (2): | 3324 | @item |
| 3325 | Define own abbreviation (2): | ||
| 3562 | 3326 | ||
| 3563 | The @code{abbrev-mode} gives more flexibility for editing the | 3327 | The @code{abbrev-mode} gives additional flexibility for editing in the |
| 3564 | minibuffer: | 3328 | minibuffer: |
| 3565 | 3329 | ||
| 3566 | @lisp | 3330 | @lisp |
| @@ -3583,18 +3347,18 @@ minibuffer: | |||
| 3583 | (expand-abbrev)) | 3347 | (expand-abbrev)) |
| 3584 | @end lisp | 3348 | @end lisp |
| 3585 | 3349 | ||
| 3586 | After entering @kbd{C-x C-f xy @key{TAB}}, the minibuffer is | 3350 | The reduced typing: @kbd{C-x C-f xy @key{TAB}}. |
| 3587 | expanded, and you can continue editing. | 3351 | |
| 3352 | The minibuffer expands for further editing. | ||
| 3588 | 3353 | ||
| 3589 | @item Use bookmarks: | 3354 | @item Use bookmarks: |
| 3590 | 3355 | ||
| 3591 | Bookmarks can be used to visit Tramp files or directories. | 3356 | Use bookmarks to save Tramp file names. |
| 3592 | @ifinfo | 3357 | @ifinfo |
| 3593 | @pxref{Bookmarks, , , @value{emacsdir}} | 3358 | @pxref{Bookmarks, , , @value{emacsdir}}. |
| 3594 | @end ifinfo | 3359 | @end ifinfo |
| 3595 | 3360 | ||
| 3596 | When you have opened @file{@trampfn{ssh, news, news.my.domain, | 3361 | Upon visiting a location with @value{tramp}, save it as a bookmark with |
| 3597 | /opt/news/etc/}}, you should save the bookmark via | ||
| 3598 | @ifset emacs | 3362 | @ifset emacs |
| 3599 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}. | 3363 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{set}}. |
| 3600 | @end ifset | 3364 | @end ifset |
| @@ -3602,7 +3366,7 @@ When you have opened @file{@trampfn{ssh, news, news.my.domain, | |||
| 3602 | @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}. | 3366 | @kbd{@key{menu-bar} @key{view} @key{bookmarks} @key{set}}. |
| 3603 | @end ifset | 3367 | @end ifset |
| 3604 | 3368 | ||
| 3605 | Later on, you can always navigate to that bookmark via | 3369 | To revisit that bookmark: |
| 3606 | @ifset emacs | 3370 | @ifset emacs |
| 3607 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}. | 3371 | @kbd{@key{menu-bar} @key{edit} @key{bookmarks} @key{jump}}. |
| 3608 | @end ifset | 3372 | @end ifset |
| @@ -3621,15 +3385,15 @@ Later on, you can always navigate to that bookmark via | |||
| 3621 | remembers visited places. | 3385 | remembers visited places. |
| 3622 | @ifinfo | 3386 | @ifinfo |
| 3623 | @ifset emacs | 3387 | @ifset emacs |
| 3624 | @pxref{File Conveniences, , , @value{emacsdir}} | 3388 | @pxref{File Conveniences, , , @value{emacsdir}}. |
| 3625 | @end ifset | 3389 | @end ifset |
| 3626 | @ifset xemacs | 3390 | @ifset xemacs |
| 3627 | @pxref{recent-files, , , edit-utils} | 3391 | @pxref{recent-files, , , edit-utils}. |
| 3628 | @end ifset | 3392 | @end ifset |
| 3629 | @end ifinfo | 3393 | @end ifinfo |
| 3630 | 3394 | ||
| 3631 | You could keep remote file names in the recent list without checking | 3395 | Keep remote file names in the recent list without have to check for |
| 3632 | their readability through a remote access: | 3396 | their accessibility through remote access: |
| 3633 | 3397 | ||
| 3634 | @lisp | 3398 | @lisp |
| 3635 | @ifset emacs | 3399 | @ifset emacs |
| @@ -3646,7 +3410,7 @@ their readability through a remote access: | |||
| 3646 | @end ifset | 3410 | @end ifset |
| 3647 | @end lisp | 3411 | @end lisp |
| 3648 | 3412 | ||
| 3649 | The list of files opened recently is reachable via | 3413 | Reaching recently opened files: |
| 3650 | @ifset emacs | 3414 | @ifset emacs |
| 3651 | @kbd{@key{menu-bar} @key{file} @key{Open Recent}}. | 3415 | @kbd{@key{menu-bar} @key{file} @key{Open Recent}}. |
| 3652 | @end ifset | 3416 | @end ifset |
| @@ -3657,8 +3421,8 @@ The list of files opened recently is reachable via | |||
| 3657 | @ifset emacs | 3421 | @ifset emacs |
| 3658 | @item Use filecache: | 3422 | @item Use filecache: |
| 3659 | 3423 | ||
| 3660 | @file{filecache} remembers visited places. Add the directory into | 3424 | Since @file{filecache} remembers visited places, add the remote |
| 3661 | the cache: | 3425 | directory to the cache: |
| 3662 | 3426 | ||
| 3663 | @lisp | 3427 | @lisp |
| 3664 | (eval-after-load "filecache" | 3428 | (eval-after-load "filecache" |
| @@ -3666,30 +3430,28 @@ the cache: | |||
| 3666 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) | 3430 | "@trampfn{ssh, news, news.my.domain, /opt/news/etc/}")) |
| 3667 | @end lisp | 3431 | @end lisp |
| 3668 | 3432 | ||
| 3669 | Whenever you want to load a file, you can enter @kbd{C-x C-f | 3433 | Then use directory completion in the minibuffer with @kbd{C-x C-f |
| 3670 | C-@key{TAB}} in the minibuffer. The completion is done for the given | 3434 | C-@key{TAB}}. |
| 3671 | directory. | ||
| 3672 | @end ifset | 3435 | @end ifset |
| 3673 | 3436 | ||
| 3674 | @ifset emacs | 3437 | @ifset emacs |
| 3675 | @item Use bbdb: | 3438 | @item Use bbdb: |
| 3676 | 3439 | ||
| 3677 | @file{bbdb} has a built-in feature for @value{ftppackagename} files, | 3440 | @file{bbdb} has a built-in feature for @value{ftppackagename} files, |
| 3678 | which works also for @value{tramp}. | 3441 | which also works for @value{tramp} file names. |
| 3679 | @ifinfo | 3442 | @ifinfo |
| 3680 | @pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb} | 3443 | @pxref{bbdb-ftp, Storing FTP sites in the BBDB, , bbdb}. |
| 3681 | @end ifinfo | 3444 | @end ifinfo |
| 3682 | 3445 | ||
| 3683 | You need to load @file{bbdb}: | 3446 | Load @file{bbdb} in @value{emacs}: |
| 3684 | 3447 | ||
| 3685 | @lisp | 3448 | @lisp |
| 3686 | (require 'bbdb) | 3449 | (require 'bbdb) |
| 3687 | (bbdb-initialize) | 3450 | (bbdb-initialize) |
| 3688 | @end lisp | 3451 | @end lisp |
| 3689 | 3452 | ||
| 3690 | Then you can create a BBDB entry via @kbd{M-x bbdb-create-ftp-site}. | 3453 | Create a BBDB entry with @kbd{M-x bbdb-create-ftp-site}. Then specify |
| 3691 | Because BBDB is not prepared for @value{tramp} syntax, you must | 3454 | a method and user name where needed. Examples: |
| 3692 | specify a method together with the user name when needed. Example: | ||
| 3693 | 3455 | ||
| 3694 | @example | 3456 | @example |
| 3695 | @kbd{M-x bbdb-create-ftp-site @key{RET}} | 3457 | @kbd{M-x bbdb-create-ftp-site @key{RET}} |
| @@ -3700,45 +3462,42 @@ specify a method together with the user name when needed. Example: | |||
| 3700 | @b{Additional Comments:} @key{RET} | 3462 | @b{Additional Comments:} @key{RET} |
| 3701 | @end example | 3463 | @end example |
| 3702 | 3464 | ||
| 3703 | When you have opened your BBDB buffer, you can access such an entry by | 3465 | In BBDB buffer, access an entry by pressing the key @key{F}. |
| 3704 | pressing the key @key{F}. | ||
| 3705 | @end ifset | 3466 | @end ifset |
| 3706 | 3467 | ||
| 3707 | @end enumerate | 3468 | @end enumerate |
| 3708 | 3469 | ||
| 3709 | I would like to thank all @value{tramp} users who have contributed to | 3470 | Thanks to @value{tramp} users for contributing to these recipes. |
| 3710 | the different recipes! | ||
| 3711 | 3471 | ||
| 3472 | @item | ||
| 3473 | Why saved multi-hop file names do not work in a new @value{emacsname} | ||
| 3474 | session? | ||
| 3712 | 3475 | ||
| 3713 | @item I have saved @value{tramp} file names as indicated. But it | 3476 | When saving ad-hoc multi-hop @value{tramp} file names (@pxref{Ad-hoc |
| 3714 | doesn't work in a new @value{emacsname} session! | 3477 | multi-hops}) via bookmarks, recent files, |
| 3715 | |||
| 3716 | If you have saved an ad-hoc multi-hop @value{tramp} file name | ||
| 3717 | (@pxref{Ad-hoc multi-hops}) via bookmarks, recent files, | ||
| 3718 | @ifset emacs | 3478 | @ifset emacs |
| 3719 | filecache, bbdb, | 3479 | filecache, bbdb, |
| 3720 | @end ifset | 3480 | @end ifset |
| 3721 | or another package, you must use the full ad-hoc file name including | 3481 | or another package, use the full ad-hoc file name including all hops, |
| 3722 | all hops, like @file{@trampfn{ssh, bird, | 3482 | like @file{@trampfn{ssh, bird, |
| 3723 | bastion|ssh@value{postfixhop}news.my.domain, /opt/news/etc}}. | 3483 | bastion|ssh@value{postfixhop}news.my.domain, /opt/news/etc}}. |
| 3724 | 3484 | ||
| 3725 | Alternatively, if you save only the abbreviated multi-hop file name | 3485 | Alternatively, when saving abbreviated multi-hop file names |
| 3726 | @file{@trampfn{ssh, news, news.my.domain, /opt/news/etc}}, the custom | 3486 | @file{@trampfn{ssh, news, news.my.domain, /opt/news/etc}}, the custom |
| 3727 | option @code{tramp-save-ad-hoc-proxies} must be set to a to a | 3487 | option @code{tramp-save-ad-hoc-proxies} must be set non-@code{nil} |
| 3728 | non-@code{nil} value. | 3488 | value. |
| 3729 | 3489 | ||
| 3730 | 3490 | ||
| 3731 | @ifset emacs | 3491 | @ifset emacs |
| 3732 | @item | 3492 | @item |
| 3733 | How can I use @value{tramp} to connect to a remote @value{emacsname} | 3493 | How to connect to a remote @value{emacsname} session using @value{tramp}? |
| 3734 | session? | ||
| 3735 | 3494 | ||
| 3736 | You can configure Emacs Client doing this. | 3495 | Configure Emacs Client |
| 3737 | @ifinfo | 3496 | @ifinfo |
| 3738 | @xref{Emacs Server, , , @value{emacsdir}}. | 3497 | (@pxref{Emacs Server, , , @value{emacsdir}}). |
| 3739 | @end ifinfo | 3498 | @end ifinfo |
| 3740 | 3499 | ||
| 3741 | On the remote host, you start the Emacs Server: | 3500 | Then on the remote host, start the Emacs Server: |
| 3742 | 3501 | ||
| 3743 | @lisp | 3502 | @lisp |
| 3744 | (require 'server) | 3503 | (require 'server) |
| @@ -3747,29 +3506,31 @@ On the remote host, you start the Emacs Server: | |||
| 3747 | (server-start) | 3506 | (server-start) |
| 3748 | @end lisp | 3507 | @end lisp |
| 3749 | 3508 | ||
| 3750 | Make sure that the result of @code{(system-name)} can be resolved on | 3509 | If @code{(system-name)} of the remote host cannot be resolved on the |
| 3751 | your local host; otherwise you might use a hard coded IP address. | 3510 | local host, use IP address instead. |
| 3511 | |||
| 3512 | Copy from the remote host the resulting file | ||
| 3513 | @file{~/.emacs.d/server/server} to the local host, to the same | ||
| 3514 | location. | ||
| 3752 | 3515 | ||
| 3753 | The resulting file @file{~/.emacs.d/server/server} must be copied to | 3516 | Then start Emacs Client from the command line: |
| 3754 | your local host, at the same location. You can call then the Emacs | ||
| 3755 | Client from the command line: | ||
| 3756 | 3517 | ||
| 3757 | @example | 3518 | @example |
| 3758 | emacsclient @trampfn{ssh, user, host, /file/to/edit} | 3519 | emacsclient @trampfn{ssh, user, host, /file/to/edit} |
| 3759 | @end example | 3520 | @end example |
| 3760 | 3521 | ||
| 3761 | @code{user} and @code{host} shall be related to your local host. | 3522 | @code{user} and @code{host} refer to the local host. |
| 3762 | 3523 | ||
| 3763 | If you want to use Emacs Client also as editor for other programs, you | 3524 | To make Emacs Client an editor for other programs, use a wrapper |
| 3764 | could write a script @file{emacsclient.sh}: | 3525 | script @file{emacsclient.sh}: |
| 3765 | 3526 | ||
| 3766 | @example | 3527 | @example |
| 3767 | #!/bin/sh | 3528 | #!/bin/sh |
| 3768 | emacsclient @trampfn{ssh, $(whoami), $(hostname --fqdn), $1} | 3529 | emacsclient @trampfn{ssh, $(whoami), $(hostname --fqdn), $1} |
| 3769 | @end example | 3530 | @end example |
| 3770 | 3531 | ||
| 3771 | Then you must set the environment variable @env{EDITOR} pointing to | 3532 | Then change the environment variable @env{EDITOR} to point to the |
| 3772 | that script: | 3533 | wrapper script: |
| 3773 | 3534 | ||
| 3774 | @example | 3535 | @example |
| 3775 | export EDITOR=/path/to/emacsclient.sh | 3536 | export EDITOR=/path/to/emacsclient.sh |
| @@ -3778,18 +3539,18 @@ export EDITOR=/path/to/emacsclient.sh | |||
| 3778 | 3539 | ||
| 3779 | 3540 | ||
| 3780 | @item | 3541 | @item |
| 3781 | There are packages which call @value{tramp} although I haven't entered | 3542 | How to disable other packages from calling @value{tramp}? |
| 3782 | a remote file name ever. I dislike it, how could I disable it? | ||
| 3783 | 3543 | ||
| 3784 | In general, @value{tramp} functions are used only when | 3544 | There are packages that call @value{tramp} without the user ever |
| 3785 | you apply remote file name syntax. However, some packages enable | 3545 | entering a remote file name. Even without applying a remote file |
| 3786 | @value{tramp} on their own. | 3546 | syntax, some packages enable @value{tramp} on their own. How can users |
| 3547 | disable such features. | ||
| 3787 | 3548 | ||
| 3788 | @itemize @minus | 3549 | @itemize @minus |
| 3789 | @item | 3550 | @item |
| 3790 | @file{ido.el} | 3551 | @file{ido.el} |
| 3791 | 3552 | ||
| 3792 | You could disable @value{tramp} file name completion: | 3553 | Disable @value{tramp} file name completion: |
| 3793 | 3554 | ||
| 3794 | @lisp | 3555 | @lisp |
| 3795 | (custom-set-variables | 3556 | (custom-set-variables |
| @@ -3799,7 +3560,7 @@ You could disable @value{tramp} file name completion: | |||
| 3799 | @item | 3560 | @item |
| 3800 | @file{rlogin.el} | 3561 | @file{rlogin.el} |
| 3801 | 3562 | ||
| 3802 | You could disable remote directory tracking mode: | 3563 | Disable remote directory tracking mode: |
| 3803 | 3564 | ||
| 3804 | @lisp | 3565 | @lisp |
| 3805 | (rlogin-directory-tracking-mode -1) | 3566 | (rlogin-directory-tracking-mode -1) |
| @@ -3808,15 +3569,13 @@ You could disable remote directory tracking mode: | |||
| 3808 | 3569 | ||
| 3809 | 3570 | ||
| 3810 | @item | 3571 | @item |
| 3811 | How can I disable @value{tramp} at all? | 3572 | How to disable @value{tramp}? |
| 3812 | |||
| 3813 | Shame on you, why did you read until now? | ||
| 3814 | 3573 | ||
| 3815 | @itemize @minus | 3574 | @itemize @minus |
| 3816 | @ifset emacs | 3575 | @ifset emacs |
| 3817 | @item | 3576 | @item |
| 3818 | If you just want to have @value{ftppackagename} as default remote | 3577 | To keep @value{ftppackagename} as default the remote files access |
| 3819 | files access package, you should apply the following code: | 3578 | package, set this in @file{.emacs}: |
| 3820 | 3579 | ||
| 3821 | @lisp | 3580 | @lisp |
| 3822 | (setq tramp-default-method "ftp") | 3581 | (setq tramp-default-method "ftp") |
| @@ -3824,24 +3583,23 @@ files access package, you should apply the following code: | |||
| 3824 | @end ifset | 3583 | @end ifset |
| 3825 | 3584 | ||
| 3826 | @item | 3585 | @item |
| 3827 | In order to disable | 3586 | To disable both |
| 3828 | @ifset emacs | 3587 | @ifset emacs |
| 3829 | @value{tramp} (and @value{ftppackagename}), | 3588 | @value{tramp} (and @value{ftppackagename}), |
| 3830 | @end ifset | 3589 | @end ifset |
| 3831 | @ifset xemacs | 3590 | @ifset xemacs |
| 3832 | @value{tramp}, | 3591 | @value{tramp}, |
| 3833 | @end ifset | 3592 | @end ifset |
| 3834 | you must set @code{tramp-mode} to @code{nil}: | 3593 | set @code{tramp-mode} to @code{nil} in @file{.emacs}. |
| 3835 | 3594 | ||
| 3836 | @lisp | 3595 | @lisp |
| 3837 | (setq tramp-mode nil) | 3596 | (setq tramp-mode nil) |
| 3838 | @end lisp | 3597 | @end lisp |
| 3839 | 3598 | ||
| 3840 | @item | 3599 | @item |
| 3841 | Unloading @value{tramp} can be achieved by applying @kbd{M-x | 3600 | To unload @value{tramp}, type @kbd{M-x tramp-unload-tramp}. |
| 3842 | tramp-unload-tramp}. | ||
| 3843 | @ifset emacs | 3601 | @ifset emacs |
| 3844 | This resets also the @value{ftppackagename} plugins. | 3602 | Unloading @value{tramp} resets @value{ftppackagename} plugins also. |
| 3845 | @end ifset | 3603 | @end ifset |
| 3846 | @end itemize | 3604 | @end itemize |
| 3847 | @end itemize | 3605 | @end itemize |
| @@ -3852,48 +3610,44 @@ This resets also the @value{ftppackagename} plugins. | |||
| 3852 | @chapter How file names, directories and localnames are mangled and managed. | 3610 | @chapter How file names, directories and localnames are mangled and managed. |
| 3853 | 3611 | ||
| 3854 | @menu | 3612 | @menu |
| 3855 | * Localname deconstruction:: Breaking a localname into its components. | 3613 | * Localname deconstruction:: Splitting a localname into its component parts. |
| 3856 | @ifset emacs | 3614 | @ifset emacs |
| 3857 | * External packages:: Integration with external Lisp packages. | 3615 | * External packages:: Integrating with external Lisp packages. |
| 3858 | @end ifset | 3616 | @end ifset |
| 3859 | @end menu | 3617 | @end menu |
| 3860 | 3618 | ||
| 3861 | 3619 | ||
| 3862 | @node Localname deconstruction | 3620 | @node Localname deconstruction |
| 3863 | @section Breaking a localname into its components | 3621 | @section Splitting a localname into its component parts |
| 3864 | |||
| 3865 | @value{tramp} file names are somewhat different, obviously, to ordinary file | ||
| 3866 | names. As such, the lisp functions @code{file-name-directory} and | ||
| 3867 | @code{file-name-nondirectory} are overridden within the @value{tramp} | ||
| 3868 | package. | ||
| 3869 | 3622 | ||
| 3870 | Their replacements are reasonably simplistic in their approach. They | 3623 | @value{tramp} package redefines lisp functions |
| 3871 | dissect the file name, call the original handler on the localname and | 3624 | @code{file-name-directory} and @code{file-name-nondirectory} to |
| 3872 | then rebuild the @value{tramp} file name with the result. | 3625 | accommodate the unique file naming syntax that @value{tramp} requires. |
| 3873 | 3626 | ||
| 3874 | This allows the platform specific hacks in the original handlers to take | 3627 | The replacements dissect the file name, use the original handler for |
| 3875 | effect while preserving the @value{tramp} file name information. | 3628 | the localname, take that result, and then re-build the @value{tramp} |
| 3629 | file name. By relying on the original handlers for localnames, | ||
| 3630 | @value{tramp} benefits from platform specific hacks to the original | ||
| 3631 | handlers. | ||
| 3876 | 3632 | ||
| 3877 | 3633 | ||
| 3878 | @ifset emacs | 3634 | @ifset emacs |
| 3879 | @node External packages | 3635 | @node External packages |
| 3880 | @section Integration with external Lisp packages | 3636 | @section Integrating with external Lisp packages |
| 3881 | @subsection File name completion. | 3637 | @subsection File name completion. |
| 3882 | 3638 | ||
| 3883 | While reading file names in the minibuffer, @value{tramp} must decide | 3639 | For name completions in the minibuffer, @value{tramp} depends on the |
| 3884 | whether it completes possible incomplete file names, or not. Imagine | 3640 | last input character to decide whether to look for method name |
| 3885 | there is the following situation: You have typed @kbd{C-x C-f | 3641 | completion or host name completion. For example, @kbd{C-x C-f |
| 3886 | @value{prefix}ssh@value{postfixhop} @key{TAB}}. @value{tramp} cannot | 3642 | @value{prefix}ssh@value{postfixhop} @key{TAB}} is not entirely clear |
| 3887 | know, whether @option{ssh} is a method or a host name. It checks | 3643 | if @option{ssh} is a method or a host name. But if the last input |
| 3888 | therefore the last input character you have typed. If this is | 3644 | character was either @key{TAB}, @key{SPACE} or @kbd{?}, then |
| 3889 | @key{TAB}, @key{SPACE} or @kbd{?}, @value{tramp} assumes that you are | 3645 | @value{tramp} favors file name completion over host name completion. |
| 3890 | still in file name completion, and it does not connect to the possible | 3646 | |
| 3891 | remote host @option{ssh}. | 3647 | What about external packages using other characters to trigger file |
| 3892 | 3648 | name completions? They must somehow signal this to @value{tramp}. Use | |
| 3893 | External packages, which use other characters for completing file names | 3649 | the variable @code{non-essential} temporarily and bind it to |
| 3894 | in the minibuffer, must signal this to @value{tramp}. For this case, | 3650 | non-@code{nil} value. |
| 3895 | the variable @code{non-essential} can be bound temporarily to | ||
| 3896 | a non-@code{nil} value. | ||
| 3897 | 3651 | ||
| 3898 | @lisp | 3652 | @lisp |
| 3899 | (let ((non-essential t)) | 3653 | (let ((non-essential t)) |
| @@ -3903,27 +3657,27 @@ a non-@code{nil} value. | |||
| 3903 | 3657 | ||
| 3904 | @subsection File attributes cache. | 3658 | @subsection File attributes cache. |
| 3905 | 3659 | ||
| 3906 | When @value{tramp} runs remote processes, files on the remote host | 3660 | Keeping a local cache of remote file attributes in sync with the |
| 3907 | could change their attributes. Consequently, @value{tramp} must flush | 3661 | remote host is a time-consuming operation. Flushing and re-querying |
| 3908 | its complete cache keeping attributes for all files of the remote host | 3662 | these attributes can tax @value{tramp} to a grinding halt on busy |
| 3909 | it has seen so far. | 3663 | remote servers. |
| 3910 | 3664 | ||
| 3911 | This is a performance degradation, because the lost file attributes | 3665 | To get around these types of slow-downs in @value{tramp}'s |
| 3912 | must be recomputed when needed again. In cases where the caller of | 3666 | responsiveness, set the @code{process-file-side-effects} to @code{nil} |
| 3913 | @code{process-file} knows that there are no file attribute changes, it | 3667 | to stop @value{tramp} from flushing the cache. This is helpful in |
| 3914 | should let-bind the variable @code{process-file-side-effects} to | 3668 | situations where callers to @code{process-file} know there are no file |
| 3915 | @code{nil}. Then @value{tramp} won't flush the file attributes cache. | 3669 | attribute changes. The let-bind form to accomplish this: |
| 3916 | 3670 | ||
| 3917 | @lisp | 3671 | @lisp |
| 3918 | (let (process-file-side-effects) | 3672 | (let (process-file-side-effects) |
| 3919 | @dots{}) | 3673 | @dots{}) |
| 3920 | @end lisp | 3674 | @end lisp |
| 3921 | 3675 | ||
| 3922 | For asynchronous processes, @value{tramp} flushes the file attributes | 3676 | For asynchronous processes, @value{tramp} uses a process sentinel to |
| 3923 | cache via a process sentinel. If the caller of | 3677 | flush file attributes cache. When callers to @code{start-file-process} |
| 3924 | @code{start-file-process} knows that there are no file attribute | 3678 | know beforehand no file attribute changes are expected, then the |
| 3925 | changes, it should set the process sentinel to the default. In cases | 3679 | process sentinel should be set to the default state. In cases where |
| 3926 | where the caller defines its own process sentinel, @value{tramp}'s process | 3680 | the caller defines its own process sentinel, @value{tramp}'s process |
| 3927 | sentinel is overwritten. The caller can still flush the file | 3681 | sentinel is overwritten. The caller can still flush the file |
| 3928 | attributes cache in its process sentinel with this code: | 3682 | attributes cache in its process sentinel with this code: |
| 3929 | 3683 | ||
| @@ -3932,21 +3686,18 @@ attributes cache in its process sentinel with this code: | |||
| 3932 | (dired-uncache remote-directory)) | 3686 | (dired-uncache remote-directory)) |
| 3933 | @end lisp | 3687 | @end lisp |
| 3934 | 3688 | ||
| 3935 | @code{remote-directory} shall be the root directory, where file | 3689 | Since @value{tramp} traverses subdirectories starting with the |
| 3936 | attribute changes can happen during the process lifetime. | 3690 | root-directory, it is most likely sufficient to make the |
| 3937 | @value{tramp} traverses all subdirectories, starting at this | 3691 | @code{default-directory} of the process buffer as the root directory. |
| 3938 | directory. Often, it is sufficient to use @code{default-directory} of | ||
| 3939 | the process buffer as root directory. | ||
| 3940 | @end ifset | 3692 | @end ifset |
| 3941 | 3693 | ||
| 3942 | 3694 | ||
| 3943 | @node Traces and Profiles | 3695 | @node Traces and Profiles |
| 3944 | @chapter How to Customize Traces | 3696 | @chapter How to Customize Traces |
| 3945 | 3697 | ||
| 3946 | All @value{tramp} messages are raised with a verbosity level. The | 3698 | @value{tramp} messages are raised with verbosity levels ranging from 0 |
| 3947 | verbosity level can be any number between 0 and 10. Only messages with | 3699 | to 10. @value{tramp} does not display all messages; only those with a |
| 3948 | a verbosity level less than or equal to @code{tramp-verbose} are | 3700 | verbosity level less than or equal to @code{tramp-verbose}. |
| 3949 | displayed. | ||
| 3950 | 3701 | ||
| 3951 | The verbosity levels are | 3702 | The verbosity levels are |
| 3952 | 3703 | ||
| @@ -3962,11 +3713,10 @@ The verbosity levels are | |||
| 3962 | @*@indent @w{ 9} test commands | 3713 | @*@indent @w{ 9} test commands |
| 3963 | @*@indent @w{10} traces (huge) | 3714 | @*@indent @w{10} traces (huge) |
| 3964 | 3715 | ||
| 3965 | When @code{tramp-verbose} is greater than or equal to 4, the messages | 3716 | With @code{tramp-verbose} greater than or equal to 4, messages are |
| 3966 | are also written into a @value{tramp} debug buffer. This debug buffer | 3717 | also written to a @value{tramp} debug buffer. Such debug buffers are |
| 3967 | is useful for analyzing problems; sending a @value{tramp} bug report | 3718 | essential to bug and problem analyses. For @value{tramp} bug reports, |
| 3968 | should be done with @code{tramp-verbose} set to a verbosity level of at | 3719 | set the @code{tramp-verbose} level to 6 (@pxref{Bug Reports}). |
| 3969 | least 6 (@pxref{Bug Reports}). | ||
| 3970 | 3720 | ||
| 3971 | The debug buffer is in | 3721 | The debug buffer is in |
| 3972 | @ifinfo | 3722 | @ifinfo |
| @@ -3975,25 +3725,23 @@ The debug buffer is in | |||
| 3975 | @ifnotinfo | 3725 | @ifnotinfo |
| 3976 | Outline Mode. | 3726 | Outline Mode. |
| 3977 | @end ifnotinfo | 3727 | @end ifnotinfo |
| 3978 | That means, you can change the level of messages to be viewed. If you | 3728 | In this buffer, messages can be filtered by their level. To see |
| 3979 | want, for example, see only messages up to verbosity level 5, you must | 3729 | messages up to verbosity level 5, enter @kbd{C-u 6 C-c C-q}. |
| 3980 | enter @kbd{C-u 6 C-c C-q}. | ||
| 3981 | @ifinfo | 3730 | @ifinfo |
| 3982 | Other keys for navigating are described in | 3731 | Other navigation keys are described in |
| 3983 | @ref{Outline Visibility, , , @value{emacsdir}}. | 3732 | @ref{Outline Visibility, , , @value{emacsdir}}. |
| 3984 | @end ifinfo | 3733 | @end ifinfo |
| 3985 | 3734 | ||
| 3986 | @value{tramp} errors are handled internally in order to raise the | 3735 | @value{tramp} handles errors internally. But to get a Lisp backtrace, |
| 3987 | verbosity level 1 messages. When you want to get a Lisp backtrace in | 3736 | both the error and the signal have to be set as follows: |
| 3988 | case of an error, you need to set both | ||
| 3989 | 3737 | ||
| 3990 | @lisp | 3738 | @lisp |
| 3991 | (setq debug-on-error t | 3739 | (setq debug-on-error t |
| 3992 | debug-on-signal t) | 3740 | debug-on-signal t) |
| 3993 | @end lisp | 3741 | @end lisp |
| 3994 | 3742 | ||
| 3995 | Sometimes, it might be even necessary to step through @value{tramp} | 3743 | To enable stepping through @value{tramp} function call traces, they |
| 3996 | function call traces. Such traces are enabled by the following code: | 3744 | have to be specifically enabled as shown in this code: |
| 3997 | 3745 | ||
| 3998 | @lisp | 3746 | @lisp |
| 3999 | (require 'trace) | 3747 | (require 'trace) |
| @@ -4003,11 +3751,10 @@ function call traces. Such traces are enabled by the following code: | |||
| 4003 | (untrace-function 'tramp-gw-basic-authentication) | 3751 | (untrace-function 'tramp-gw-basic-authentication) |
| 4004 | @end lisp | 3752 | @end lisp |
| 4005 | 3753 | ||
| 4006 | The function call traces are inserted in the buffer | 3754 | The buffer @file{*trace-output*} contains the output from the function |
| 4007 | @file{*trace-output*}. @code{tramp-read-passwd} and | 3755 | call traces. Disable @code{tramp-read-passwd} and |
| 4008 | @code{tramp-gw-basic-authentication} shall be disabled when the | 3756 | @code{tramp-gw-basic-authentication} to stop password strings from |
| 4009 | function call traces are added to @value{tramp}, because both | 3757 | being written to @file{*trace-output*}. |
| 4010 | functions return password strings, which should not be distributed. | ||
| 4011 | 3758 | ||
| 4012 | 3759 | ||
| 4013 | @node Issues | 3760 | @node Issues |
| @@ -4016,52 +3763,49 @@ functions return password strings, which should not be distributed. | |||
| 4016 | @itemize @bullet | 3763 | @itemize @bullet |
| 4017 | @item The uuencode method does not always work. | 3764 | @item The uuencode method does not always work. |
| 4018 | 3765 | ||
| 4019 | Due to the design of @value{tramp}, the encoding and decoding programs | 3766 | @command{uudecode} on some systems cannot write to stdout, but |
| 4020 | need to read from stdin and write to stdout. On some systems, | 3767 | @value{tramp} depends on encoding and decoding programs to be able to |
| 4021 | @command{uudecode -o -} will read stdin and write the decoded file to | 3768 | read from stdin and write to stdout. |
| 4022 | stdout, on other systems @command{uudecode -p} does the same thing. | ||
| 4023 | But some systems have uudecode implementations which cannot do this at | ||
| 4024 | all---it is not possible to call these uudecode implementations with | ||
| 4025 | suitable parameters so that they write to stdout. | ||
| 4026 | 3769 | ||
| 4027 | Of course, this could be circumvented: the @code{begin foo 644} line | 3770 | We can find ways to circumvent @command{uudecode}'s ability to write |
| 4028 | could be rewritten to put in some temporary file name, then | 3771 | to stdout, such as writing to a temporary file and then piping that to |
| 4029 | @command{uudecode} could be called, then the temp file could be | 3772 | stdout. |
| 4030 | printed and deleted. | ||
| 4031 | 3773 | ||
| 4032 | But I have decided that this is too fragile to reliably work, so on some | 3774 | But I have decided not to implement workarounds as they are too |
| 4033 | systems you'll have to do without the uuencode methods. | 3775 | fragile to work reliably. Some on systems, @value{tramp} will not have |
| 3776 | uuencode method. | ||
| 4034 | 3777 | ||
| 4035 | @item The @value{tramp} file name syntax differs between Emacs and XEmacs. | 3778 | @item The @value{tramp} file name syntax differs between Emacs and XEmacs. |
| 4036 | 3779 | ||
| 4037 | The Emacs maintainers wish to use a unified file name syntax for | 3780 | The Emacs maintainers wish to use a unified file name syntax for |
| 4038 | Ange-FTP and @value{tramp} so that users don't have to learn a new | 3781 | Ange-FTP and @value{tramp} so that users don't have to learn yet |
| 4039 | syntax. It is sufficient to learn some extensions to the old syntax. | 3782 | another syntax though it is okay to learn new extensions. |
| 4040 | 3783 | ||
| 4041 | For the XEmacs maintainers, the problems caused from using a unified | 3784 | For the XEmacs maintainers, the disruption from a unified file name |
| 4042 | file name syntax are greater than the gains. The XEmacs package system | 3785 | syntax are not worth the gains. Firstly, the XEmacs package system |
| 4043 | uses EFS for downloading new packages. So, obviously, EFS has to be | 3786 | relies on EFS for downloading new packages and therefore is already |
| 4044 | installed from the start. If the file names were unified, @value{tramp} | 3787 | installed. On the other hand, @value{tramp} is not installed by |
| 4045 | would have to be installed from the start, too. | 3788 | default in XEmacs. Unifying will require @value{tramp} installed from |
| 3789 | the start. | ||
| 4046 | 3790 | ||
| 4047 | @ifset xemacs | 3791 | @ifset xemacs |
| 4048 | @strong{Note:} If you'd like to use a similar syntax like | 3792 | @strong{Note:} To make the syntax similar to @value{ftppackagename}, |
| 4049 | @value{ftppackagename}, you need the following settings in your init | 3793 | make this change to the init file: |
| 4050 | file: | ||
| 4051 | 3794 | ||
| 4052 | @lisp | 3795 | @lisp |
| 4053 | (setq tramp-unified-filenames t) | 3796 | (setq tramp-unified-filenames t) |
| 4054 | (require 'tramp) | 3797 | (require 'tramp) |
| 4055 | @end lisp | 3798 | @end lisp |
| 4056 | 3799 | ||
| 4057 | The autoload of the @value{emacsname} @value{tramp} package must be | 3800 | To disable auto loading @value{emacsname} @value{tramp} package, set |
| 4058 | disabled. This can be achieved by setting file permissions @code{000} | 3801 | file permissions of |
| 4059 | to the files @file{@dots{}/xemacs-packages/lisp/tramp/auto-autoloads.el*}. | 3802 | @file{@dots{}/xemacs-packages/lisp/tramp/auto-autoloads.el*} to |
| 3803 | @code{000}. | ||
| 4060 | 3804 | ||
| 4061 | In case of unified file names, all @value{emacsname} download sites are | 3805 | When using unified file names, @value{emacsname} download sites are |
| 4062 | added to @code{tramp-default-method-alist} with default method | 3806 | added to @code{tramp-default-method-alist} with default method of |
| 4063 | @option{ftp} @xref{Default Method}. These settings shouldn't be | 3807 | @option{ftp} @xref{Default Method} for proper working of the |
| 4064 | touched for proper working of the @value{emacsname} package system. | 3808 | @value{emacsname} package system. |
| 4065 | 3809 | ||
| 4066 | The syntax for unified file names is described in the @value{tramp} manual | 3810 | The syntax for unified file names is described in the @value{tramp} manual |
| 4067 | for @value{emacsothername}. | 3811 | for @value{emacsothername}. |
diff --git a/doc/misc/trampver.texi b/doc/misc/trampver.texi index dccf3175386..436679613a1 100644 --- a/doc/misc/trampver.texi +++ b/doc/misc/trampver.texi | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | @c In the Tramp GIT, the version number is auto-frobbed from | 8 | @c In the Tramp GIT, the version number is auto-frobbed from |
| 9 | @c configure.ac, so you should edit that file and run | 9 | @c configure.ac, so you should edit that file and run |
| 10 | @c "autoconf && ./configure" to change the version number. | 10 | @c "autoconf && ./configure" to change the version number. |
| 11 | @set trampver 2.2.13-pre | 11 | @set trampver 2.2.13.25.1 |
| 12 | 12 | ||
| 13 | @c Other flags from configuration | 13 | @c Other flags from configuration |
| 14 | @set instprefix /usr/local | 14 | @set instprefix /usr/local |
diff --git a/doc/misc/url.texi b/doc/misc/url.texi index 95fe5eabc33..121c28eb8f8 100644 --- a/doc/misc/url.texi +++ b/doc/misc/url.texi | |||
| @@ -373,9 +373,10 @@ for specific schemes. | |||
| 373 | * rlogin/telnet/tn3270:: Remote host connectivity. | 373 | * rlogin/telnet/tn3270:: Remote host connectivity. |
| 374 | * irc:: Internet Relay Chat. | 374 | * irc:: Internet Relay Chat. |
| 375 | * data:: Embedded data URLs. | 375 | * data:: Embedded data URLs. |
| 376 | * nfs:: Networked File System | 376 | * nfs:: Networked File System. |
| 377 | * ldap:: Lightweight Directory Access Protocol | 377 | * ldap:: Lightweight Directory Access Protocol. |
| 378 | * man:: Unix man pages. | 378 | * man:: Unix man pages. |
| 379 | * Tramp:: Schemes supported via Tramp. | ||
| 379 | @end menu | 380 | @end menu |
| 380 | 381 | ||
| 381 | @node http/https | 382 | @node http/https |
| @@ -549,8 +550,8 @@ file://@var{user}:@var{password}@@@var{host}:@var{port}/@var{file} | |||
| 549 | @noindent | 550 | @noindent |
| 550 | If the URL specifies a local file, it is retrieved by reading the file | 551 | If the URL specifies a local file, it is retrieved by reading the file |
| 551 | contents in the usual way. If it specifies a remote file, it is | 552 | contents in the usual way. If it specifies a remote file, it is |
| 552 | retrieved using the Ange-FTP package. @xref{Remote Files,,, emacs, | 553 | retrieved using either the Tramp or the Ange-FTP package. |
| 553 | The GNU Emacs Manual}. | 554 | @xref{Remote Files,,, emacs, The GNU Emacs Manual}. |
| 554 | 555 | ||
| 555 | When retrieving a compressed file, it is automatically uncompressed | 556 | When retrieving a compressed file, it is automatically uncompressed |
| 556 | if it has the file suffix @file{.z}, @file{.gz}, @file{.Z}, | 557 | if it has the file suffix @file{.z}, @file{.gz}, @file{.Z}, |
| @@ -682,7 +683,8 @@ telnet://@var{user}:@var{password}@@@var{host}:@var{port} | |||
| 682 | @end example | 683 | @end example |
| 683 | 684 | ||
| 684 | @noindent | 685 | @noindent |
| 685 | but the @var{password} component is ignored. | 686 | but the @var{password} component is ignored. By default, the |
| 687 | @code{telnet} scheme is handled via Tramp (@pxref{Tramp}). | ||
| 686 | 688 | ||
| 687 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, | 689 | To handle rlogin, telnet and tn3270 URLs, a @code{rlogin}, |
| 688 | @code{telnet} or @code{tn3270} (the program names and arguments are | 690 | @code{telnet} or @code{tn3270} (the program names and arguments are |
| @@ -798,6 +800,38 @@ The @code{man} scheme is a non-standard one. Such URLs have the form | |||
| 798 | and are retrieved by passing @var{page-spec} to the Lisp function | 800 | and are retrieved by passing @var{page-spec} to the Lisp function |
| 799 | @code{man}. | 801 | @code{man}. |
| 800 | 802 | ||
| 803 | @node Tramp | ||
| 804 | @section URL Types Supported via Tramp | ||
| 805 | |||
| 806 | @vindex url-tramp-protocols | ||
| 807 | Some additional URL types are supported by passing them to Tramp | ||
| 808 | (@pxref{Top, The Tramp Manual,, tramp, The Tramp Manual}). These | ||
| 809 | protocols are listed in the @code{url-tramp-protocols} variable, which | ||
| 810 | you can customize. The default value includes the following | ||
| 811 | protocols: | ||
| 812 | |||
| 813 | @table @code | ||
| 814 | @item ftp | ||
| 815 | The file transfer protocol. @xref{file/ftp}. | ||
| 816 | |||
| 817 | @item ssh | ||
| 818 | @cindex ssh | ||
| 819 | The secure shell protocol. @xref{Inline Methods,,, tramp, The Tramp | ||
| 820 | Manual}. | ||
| 821 | |||
| 822 | @item scp | ||
| 823 | @cindex scp | ||
| 824 | The secure file copy protocol. @xref{External Methods,,, tramp, The | ||
| 825 | Tramp Manual}. | ||
| 826 | |||
| 827 | @item rsync | ||
| 828 | @cindex rsync | ||
| 829 | The remote sync protocol. | ||
| 830 | |||
| 831 | @item telnet | ||
| 832 | The telnet protocol. | ||
| 833 | @end table | ||
| 834 | |||
| 801 | @node General Facilities | 835 | @node General Facilities |
| 802 | @chapter General Facilities | 836 | @chapter General Facilities |
| 803 | 837 | ||
| @@ -1296,6 +1330,14 @@ Connect directly. | |||
| 1296 | @end table | 1330 | @end table |
| 1297 | @end defopt | 1331 | @end defopt |
| 1298 | 1332 | ||
| 1333 | @defopt url-user-agent | ||
| 1334 | The User Agent string used for sending HTTP/HTTPS requests. The value | ||
| 1335 | should be a string or a function of no arguments that returns a | ||
| 1336 | string. The default value is @w{@samp{User-Agent: @var{package-name} | ||
| 1337 | URL/Emacs}}, where @var{package-name} is the value of | ||
| 1338 | @code{url-package-name} and its version, if they are non-@code{nil}. | ||
| 1339 | @end defopt | ||
| 1340 | |||
| 1299 | @node GNU Free Documentation License | 1341 | @node GNU Free Documentation License |
| 1300 | @appendix GNU Free Documentation License | 1342 | @appendix GNU Free Documentation License |
| 1301 | @include doclicense.texi | 1343 | @include doclicense.texi |