From 9f261d3c1d29f48ca2f8f96e4809bccbe3c81e89 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Thu, 23 Feb 2006 23:16:12 +0000 Subject: [PATCH] (Common requests): Move `Turning on auto-fill by default' after `Wrapping words automatically'. Move `Working with unprintable characters' before `Searching for/replacing newlines'. Move `Replacing highlighted text' after `Highlighting a region'. Merge `Repeating commands' and `Repeating a command as many times as possible' into the former. (Packages that do not come with Emacs): Add refs to Gmane and etc/MORE.STUFF. --- man/ChangeLog | 11 +++ man/faq.texi | 269 +++++++++++++++++++++++--------------------------- 2 files changed, 136 insertions(+), 144 deletions(-) diff --git a/man/ChangeLog b/man/ChangeLog index 6b12f4390da..e2d948aef35 100644 --- a/man/ChangeLog +++ b/man/ChangeLog @@ -1,3 +1,14 @@ +2006-02-23 Juri Linkov + + * faq.texi (Common requests): Move `Turning on auto-fill by + default' after `Wrapping words automatically'. Move `Working with + unprintable characters' before `Searching for/replacing newlines'. + Move `Replacing highlighted text' after `Highlighting a region'. + Merge `Repeating commands' and `Repeating a command as many times + as possible' into the former. + (Packages that do not come with Emacs): Add refs to Gmane and + etc/MORE.STUFF. + 2006-02-23 Juri Linkov * faq.texi (Newsgroup archives): Update URLs of GNU mail archives. diff --git a/man/faq.texi b/man/faq.texi index 9dc6772d7e1..0c4838d9019 100644 --- a/man/faq.texi +++ b/man/faq.texi @@ -1185,14 +1185,15 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual * Displaying the current line or column:: * Displaying the current file name in the titlebar:: * Turning on abbrevs by default:: -* Turning on auto-fill by default:: * Associating modes with files:: -* Working with unprintable characters:: * Highlighting a region:: +* Replacing highlighted text:: * Controlling case sensitivity:: +* Working with unprintable characters:: * Searching for/replacing newlines:: * Yanking text in isearch:: * Wrapping words automatically:: +* Turning on auto-fill by default:: * Spell-checkers:: * Checking TeX and *roff documents:: * Changing load-path:: @@ -1213,7 +1214,6 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual * Changing the length of a Tab:: * Inserting text at the beginning of each line:: * Underlining paragraphs:: -* Repeating a command as many times as possible:: * Forcing the cursor to remain in the same column:: * Forcing Emacs to iconify itself:: * Using regular expressions:: @@ -1226,7 +1226,6 @@ In addition, Emacs 22 now includes the Emacs Lisp Reference Manual * Deleting menus and menu options:: * Turning on syntax highlighting:: * Scrolling only one line:: -* Replacing highlighted text:: * Editing MS-DOS files:: * Filling paragraphs with a single space:: * Escape sequences in shell output:: @@ -1404,7 +1403,7 @@ in your @file{.emacs}: (setq frame-title-format "%b") @end lisp -@node Turning on abbrevs by default, Turning on auto-fill by default, Displaying the current file name in the titlebar, Common requests +@node Turning on abbrevs by default, Associating modes with files, Displaying the current file name in the titlebar, Common requests @section How do I turn on abbrevs by default just in mode @var{mymode}? @cindex Abbrevs, turning on by default @@ -1423,30 +1422,7 @@ Put this in your @file{.emacs} file: Starting with Emacs 22, the standard abbrevs file is read automatically at startup, so the first of these two forms becomes unnecessary. -@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests -@section How do I turn on @code{auto-fill-mode} by default? -@cindex @code{auto-fill-mode}, activating automatically -@cindex Filling automatically -@cindex Automatic entry to @code{auto-fill-mode} - -To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x -auto-fill-mode}. - -To turn it on for every buffer in a certain mode, you must use the hook -for that mode. For example, to turn on @code{auto-fill} mode for all -text buffers, including the following in your @file{.emacs} file: - -@lisp -(add-hook 'text-mode-hook 'turn-on-auto-fill) -@end lisp - -If you want @code{auto-fill} mode on in all major modes, do this: - -@lisp -(setq-default auto-fill-function 'do-auto-fill) -@end lisp - -@node Associating modes with files, Working with unprintable characters, Turning on auto-fill by default, Common requests +@node Associating modes with files, Highlighting a region, Turning on abbrevs by default, Common requests @section How do I make Emacs use a certain major mode for certain files? @cindex Associating modes with files @cindex File extensions and modes @@ -1476,63 +1452,7 @@ the script.) This feature only applies when the file name doesn't indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x describe-variable}) on @code{interpreter-mode-alist} to learn more. -@node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests -@section How do I search for, delete, or replace unprintable (eight-bit or control) characters? -@cindex Unprintable characters, working with -@cindex Working with unprintable characters -@cindex Control characters, working with -@cindex Eight-bit characters, working with -@cindex Searching for unprintable characters -@cindex Regexps and unprintable characters - -To search for a single character that appears in the buffer as, for -example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes -the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).) -Searching for @strong{all} unprintable characters is best done with a -regular expression (@dfn{regexp}) search. The easiest regexp to use for -the unprintable chars is the complement of the regexp for the printable -chars. - -@itemize @bullet - -@item -Regexp for the printable chars: @samp{[\t\n\r\f -~]} - -@item -Regexp for the unprintable chars: @samp{[^\t\n\r\f -~]} - -@end itemize - -To type these special characters in an interactive argument to -@code{isearch-forward-regexp} or @code{re-search-forward}, you need to -use @kbd{C-q}. (@samp{\t}, @samp{\n}, @samp{\r}, and @samp{\f} stand -respectively for @key{TAB}, @key{LFD}, @key{RET}, and @kbd{C-l}.) So, -to search for unprintable characters using @code{re-search-forward}: - -@kbd{M-x re-search-forward @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET}} - -Using @code{isearch-forward-regexp}: - -@kbd{C-M-s [^ @key{TAB} @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~]} - -To delete all unprintable characters, simply use replace-regexp: - -@kbd{M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} @key{RET}} - -Replacing is similar to the above. To replace all unprintable -characters with a colon, use: - -M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET} - -@itemize @bullet - -@item -You don't need to quote @key{TAB} with either isearch or typing -something in the minibuffer. - -@end itemize - -@node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests +@node Highlighting a region, Replacing highlighted text, Associating modes with files, Common requests @section How can I highlight a region of text in Emacs? @cindex Highlighting text @cindex Text, highlighting @@ -1549,7 +1469,32 @@ including @noindent in your @file{.emacs} file. -@node Controlling case sensitivity, Searching for/replacing newlines, Highlighting a region, Common requests +@node Replacing highlighted text, Controlling case sensitivity, Highlighting a region, Common requests +@section How can I replace highlighted text with what I type? +@cindex @code{delete-selection-mode} +@cindex Replacing highlighted text +@cindex Highlighting and replacing text + +Use @code{delete-selection-mode}, which you can start automatically by +placing the following Lisp form in your @file{.emacs} file: + +@lisp +(delete-selection-mode 1) +@end lisp + +According to the documentation string for @code{delete-selection-mode} +(which you can read using @kbd{M-x describe-function @key{RET} +delete-selection-mode @key{RET}}): + +@quotation +When ON, typed text replaces the selection if the selection is active. +When OFF, typed text is just inserted at point. +@end quotation + +This mode also allows you to delete (not kill) the highlighted region by +pressing @key{DEL}. + +@node Controlling case sensitivity, Working with unprintable characters, Replacing highlighted text, Common requests @section How do I control Emacs's case-sensitivity when searching/replacing? @cindex @code{case-fold-search} @cindex Case sensitivity of searches @@ -1581,7 +1526,55 @@ mode's hook. For example: (setq case-fold-search nil))) @end lisp -@node Searching for/replacing newlines, Yanking text in isearch, Controlling case sensitivity, Common requests +@node Working with unprintable characters, Searching for/replacing newlines, Controlling case sensitivity, Common requests +@section How do I search for, delete, or replace unprintable (eight-bit or control) characters? +@cindex Unprintable characters, working with +@cindex Working with unprintable characters +@cindex Control characters, working with +@cindex Eight-bit characters, working with +@cindex Searching for unprintable characters +@cindex Regexps and unprintable characters + +To search for a single character that appears in the buffer as, for +example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes +the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).) +Searching for @strong{all} unprintable characters is best done with a +regular expression (@dfn{regexp}) search. The easiest regexp to use for +the unprintable chars is the complement of the regexp for the printable +chars. + +@itemize @bullet + +@item +Regexp for the printable chars: @samp{[\t\n\r\f -~]} + +@item +Regexp for the unprintable chars: @samp{[^\t\n\r\f -~]} + +@end itemize + +To type these special characters in an interactive argument to +@code{isearch-forward-regexp} or @code{re-search-forward}, you need to +use @kbd{C-q}. (@samp{\t}, @samp{\n}, @samp{\r}, and @samp{\f} stand +respectively for @key{TAB}, @key{LFD}, @key{RET}, and @kbd{C-l}.) So, +to search for unprintable characters using @code{re-search-forward}: + +@kbd{M-x re-search-forward @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET}} + +Using @code{isearch-forward-regexp}: + +@kbd{C-M-s [^ @key{TAB} @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~]} + +To delete all unprintable characters, simply use replace-regexp: + +@kbd{M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} @key{RET}} + +Replacing is similar to the above. To replace all unprintable +characters with a colon, use: + +M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET} + +@node Searching for/replacing newlines, Yanking text in isearch, Working with unprintable characters, Common requests @section How do I input a newline character in isearch or query-replace? @cindex Searching for newlines @cindex Replacing newlines @@ -1597,7 +1590,7 @@ Special Input for Incremental Search, emacs}. Use @kbd{M-y}. @inforef{Isearch Yank, Isearch Yanking, emacs}. -@node Wrapping words automatically, Spell-checkers, Yanking text in isearch, Common requests +@node Wrapping words automatically, Turning on auto-fill by default, Yanking text in isearch, Common requests @section How do I make Emacs wrap words for me? @cindex Wrapping word automatically @cindex Wrapping lines @@ -1611,7 +1604,30 @@ The default maximum line width is 70, determined by the variable @code{fill-column}. To learn how to turn this on automatically, see @ref{Turning on auto-fill by default}. -@node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests +@node Turning on auto-fill by default, Spell-checkers, Wrapping words automatically, Common requests +@section How do I turn on @code{auto-fill-mode} by default? +@cindex @code{auto-fill-mode}, activating automatically +@cindex Filling automatically +@cindex Automatic entry to @code{auto-fill-mode} + +To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x +auto-fill-mode}. + +To turn it on for every buffer in a certain mode, you must use the hook +for that mode. For example, to turn on @code{auto-fill} mode for all +text buffers, including the following in your @file{.emacs} file: + +@lisp +(add-hook 'text-mode-hook 'turn-on-auto-fill) +@end lisp + +If you want @code{auto-fill} mode on in all major modes, do this: + +@lisp +(setq-default auto-fill-function 'do-auto-fill) +@end lisp + +@node Spell-checkers, Checking TeX and *roff documents, Turning on auto-fill by default, Common requests @section Where can I get a better spelling checker for Emacs? @cindex Checking spelling @cindex Spelling, checking text documents @@ -2055,14 +2071,11 @@ parenthesis, it simply inserts a % like normal. to investigate @file{cpp.el}, which is distributed with Emacs. @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests -@section Is there an equivalent to the @code{.} (dot) command of vi? -@cindex Repeating commands as with @code{vi} -@cindex Command, repeat last +@section How do I repeat a command as many times as possible? +@cindex Repeating commands many times +@cindex Commands, repeating many times @cindex @code{.}, equivalent to @code{vi} command -(@code{.} is the redo command in @code{vi}. It redoes the last -insertion/deletion.) - As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x z}) that repeats the last command. If you preface it with a prefix argument, the prefix arg is applied to the command. @@ -2074,12 +2087,14 @@ type @kbd{M-p} and @kbd{M-n} (and also up-arrow and down-arrow, if your keyboard has these keys) to scan through all the different complex commands you've typed. -To repeat a set of commands, use keyboard macros. (@inforef{Keyboard -Macros, Keyboard Macros, emacs}.) +To repeat a set of commands, use keyboard macros. Use @kbd{C-x (} and +@kbd{C-x )} to make a keyboard macro that invokes the command and then +type @kbd{C-x e}. (@inforef{Keyboard Macros, Keyboard Macros, emacs}.) -If you're really desperate for the @code{.} command, use VIPER, a -@code{vi} emulation mode which comes with Emacs, and which appears to -support it. (@xref{VIPER}.) +If you're really desperate for the @code{.} command in @code{vi} that +redoes the last insertion/deletion, use VIPER, a @code{vi} emulation +mode which comes with Emacs, and which appears to support it. +(@xref{VIPER}.) @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests @section What are the valid X resource settings (i.e., stuff in .Xdefaults)? @@ -2180,27 +2195,14 @@ buffers, you can even use @kbd{M-;} to cite yanked messages (@kbd{M-;} runs the function @code{comment-region}, it is a general-purpose mechanism to comment regions) (@pxref{Changing the included text prefix}). -@node Underlining paragraphs, Repeating a command as many times as possible, Inserting text at the beginning of each line, Common requests +@node Underlining paragraphs, Forcing the cursor to remain in the same column, Inserting text at the beginning of each line, Common requests @section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph? @cindex Underlining a region of text @cindex @code{underline-region} Mark the region and then type @kbd{M-x underline-region @key{RET}}. -@node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests -@section How do I repeat a command as many times as possible? -@cindex Repeating commands many times -@cindex Commands, repeating many times - -Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes -the command and then type @kbd{M-0 C-x e}. - -Any messages your command prints in the echo area will be suppressed. - -If you need to repeat a command a small number of times, you can use -@kbd{C-x z} (@pxref{Repeating commands}) or @kbd{C-x e}. - -@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests +@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Underlining paragraphs, Common requests @section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short? @cindex @code{picture-mode} @cindex Remaining in the same column, regardless of contents @@ -2561,7 +2563,7 @@ PostScript printer, or a PostScript interpreter such as Ghostscript; consult the documentation of the variables @code{ps-printer-name}, @code{ps-lpr-command}, and @code{ps-lpr-switches} for more details. -@node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests +@node Scrolling only one line, Editing MS-DOS files, Turning on syntax highlighting, Common requests @section How can I force Emacs to scroll only one line when I move past the bottom of the screen? @cindex Scrolling only one line @cindex Reducing the increment when scrolling @@ -2577,32 +2579,7 @@ Alternatively, use the following Lisp form in your @file{.emacs}: (setq scroll-conservatively most-positive-fixnum) @end lisp -@node Replacing highlighted text, Editing MS-DOS files, Scrolling only one line, Common requests -@section How can I replace highlighted text with what I type? -@cindex @code{delete-selection-mode} -@cindex Replacing highlighted text -@cindex Highlighting and replacing text - -Use @code{delete-selection-mode}, which you can start automatically by -placing the following Lisp form in your @file{.emacs} file: - -@lisp -(delete-selection-mode 1) -@end lisp - -According to the documentation string for @code{delete-selection-mode} -(which you can read using @kbd{M-x describe-function @key{RET} -delete-selection-mode @key{RET}}): - -@quotation -When ON, typed text replaces the selection if the selection is active. -When OFF, typed text is just inserted at point. -@end quotation - -This mode also allows you to delete (not kill) the highlighted region by -pressing @key{DEL}. - -@node Editing MS-DOS files, Filling paragraphs with a single space, Replacing highlighted text, Common requests +@node Editing MS-DOS files, Filling paragraphs with a single space, Scrolling only one line, Common requests @section How can I edit MS-DOS files using Emacs? @cindex Editing MS-DOS files @cindex MS-DOS files, editing @@ -3502,7 +3479,8 @@ the @file{ell} package}. Many authors post their packages to the @uref{news:gnu.emacs.sources, Emacs sources newsgroup}. You can search the archives of this -group with @uref{http://groups.google.com, Google}, for example. +group with @uref{http://groups.google.com/group/gnu.emacs.sources, Google}, +or @uref{http://dir.gmane.org/gmane.emacs.sources, Gmane}, for example. Several packages are stored in @uref{http://emacswiki.org/elisp/, the Lisp area of the Emacs Wiki}. @@ -3513,6 +3491,9 @@ although you can still access the old files at @uref{ftp://ftp.cis.ohio-state.edu/pub/emacs-lisp/WWW/index.html} +Read the file @file{etc/MORE.STUFF} for more information about +external packages. + @node Current GNU distributions, Difference between Emacs and XEmacs, Packages that do not come with Emacs, Finding Emacs and related packages @section Where can I get other up-to-date GNU stuff? @cindex Current GNU distributions -- 2.39.2