Commit 2e17e05e authored by Glenn Morris's avatar Glenn Morris
Browse files

(Setting up a customization file): Grammar fix.

Customize is no longer "new".
(Displaying the current line or column): Line-number mode is on by
default.  Don't mention `column' package.  Mention linum.el.
(Turning on abbrevs by default): Explain how to do it for buffers,
modes, and everywhere.
(Associating modes with files): Use add-to-list.  Don't mention Emacs 19.
(Highlighting a region): On by default since 23.1.
(Replacing highlighted text): Update doc quote.
(Working with unprintable characters): Don't mention search-quote-char.
(Using an already running Emacs process): Gnuclient is probably not an
enhancement these days.
(Indenting switch statements): Remove mention of pre-Emacs 20.
(Horizontal scrolling): Abbreviate Emacs 20 description.
(Replacing text across multiple files): Fix name of dired command.
(Disabling backups): Use require not load.
parent ad4c1f62
2009-06-13 Glenn Morris <rgm@gnu.org>
* faq.texi (Setting up a customization file): Grammar fix.
Customize is no longer "new".
(Displaying the current line or column): Line-number mode is on by
default. Don't mention `column' package. Mention linum.el.
(Turning on abbrevs by default): Explain how to do it for buffers,
modes, and everywhere.
(Associating modes with files): Use add-to-list. Don't mention Emacs
19.
(Highlighting a region): On by default since 23.1.
(Replacing highlighted text): Update doc quote.
(Working with unprintable characters): Don't mention search-quote-char.
(Using an already running Emacs process): Gnuclient is probably not an
enhancement these days.
(Indenting switch statements): Remove mention of pre-Emacs 20.
(Horizontal scrolling): Abbreviate Emacs 20 description.
(Replacing text across multiple files): Fix name of dired command.
(Disabling backups): Use require not load.
2009-06-13 Bill Wohler <wohler@newt.com> 2009-06-13 Bill Wohler <wohler@newt.com>
Release MH-E manual version 8.2. Release MH-E manual version 8.2.
......
...@@ -935,8 +935,8 @@ C-f} (@kbd{M-x view-emacs-FAQ}). ...@@ -935,8 +935,8 @@ C-f} (@kbd{M-x view-emacs-FAQ}).
@chapter Status of Emacs @chapter Status of Emacs
@cindex Status of Emacs @cindex Status of Emacs
This chapter gives you basic information about Emacs, including its This chapter gives you basic information about Emacs, including the
latest version status. status of its latest version.
@menu @menu
* Origin of the term Emacs:: * Origin of the term Emacs::
...@@ -1199,16 +1199,15 @@ full list. ...@@ -1199,16 +1199,15 @@ full list.
@inforef{Init File, Init File, emacs}. @inforef{Init File, Init File, emacs}.
In general, new Emacs users should not have @file{.emacs} files, because In general, new Emacs users should not be provided with @file{.emacs}
it causes confusing non-standard behavior. Then they send questions to files, because this can cause confusing non-standard behavior. Then
@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as they send questions to @email{help-gnu-emacs@@gnu.org} asking why Emacs
documented. isn't behaving as documented.
Beginning with version 20.1, Emacs includes the new Customize facility Emacs includes the Customize facility (@pxref{Using Customize}). This
(@pxref{Using Customize}). This allows users who are unfamiliar with allows users who are unfamiliar with Emacs Lisp to modify their
Emacs Lisp to modify their @file{.emacs} files in a relatively @file{.emacs} files in a relatively straightforward way, using menus
straightforward way, using menus rather than Lisp code. Most packages rather than Lisp code.
support Customize as of this writing.
While Customize might indeed make it easier to configure Emacs, While Customize might indeed make it easier to configure Emacs,
consider taking a bit of time to learn Emacs Lisp and modifying your consider taking a bit of time to learn Emacs Lisp and modifying your
...@@ -1289,18 +1288,10 @@ variables which you are trying to set or use. ...@@ -1289,18 +1288,10 @@ variables which you are trying to set or use.
@cindex Column, displaying the current @cindex Column, displaying the current
@cindex @code{mode-line-format} @cindex @code{mode-line-format}
To have Emacs automatically display the current line number of the point By default, Emacs displays the current line number of the point in the
in the mode line, do @kbd{M-x line-number-mode}. You can also put the mode line. You can toggle this feature off or on with the command
form @kbd{M-x line-number-mode}, or by setting the variable
@code{line-number-mode}. Note that Emacs will not display the line
@lisp
(setq line-number-mode t)
@end lisp
@noindent
in your @file{.emacs} file to achieve this whenever you start Emacs.
(Line number display is on by default, unless your site-specific
initialization disables it.) Note that Emacs will not display the line
number if the buffer's size in bytes is larger than the value of the number if the buffer's size in bytes is larger than the value of the
variable @code{line-number-display-limit}. variable @code{line-number-display-limit}.
...@@ -1312,7 +1303,7 @@ You can similarly display the current column with ...@@ -1312,7 +1303,7 @@ You can similarly display the current column with
@end lisp @end lisp
@noindent @noindent
in your @file{.emacs} file. in your @file{.emacs} file. This feature is off by default.
The @code{"%c"} format specifier in the variable @code{mode-line-format} The @code{"%c"} format specifier in the variable @code{mode-line-format}
will insert the current column's value into the mode line. See the will insert the current column's value into the mode line. See the
...@@ -1320,17 +1311,12 @@ documentation for @code{mode-line-format} (using @kbd{C-h v ...@@ -1320,17 +1311,12 @@ documentation for @code{mode-line-format} (using @kbd{C-h v
mode-line-format @key{RET}}) for more information on how to set and use mode-line-format @key{RET}}) for more information on how to set and use
this variable. this variable.
Users of all Emacs versions can display the current column using the
@samp{column} package written by @email{abraham@@dina.kvl.dk, Per
Abrahamsen}. @xref{Packages that do not come with Emacs}, for
instructions on how to get it.
@cindex Set number capability in @code{vi} emulators @cindex Set number capability in @code{vi} emulators
None of the @code{vi} emulation modes provide the ``set number'' The @samp{linum} package (distributed with Emacs since version 23.1)
capability of @code{vi} (as far as we know). The @samp{setnu} package displays line numbers in the left margin, like the ``set number''
written by @email{kyle@@wonderworks.com, Kyle Jones} provides this capability of @code{vi}. The packages @samp{setnu} and
feature. So too does @samp{wb-line-number}, written by @samp{wb-line-number} (not distributed with Emacs) also implement this
@email{naoki.y.nakamura@@nifty.com, Naoki Nakamura}. feature.
@node Displaying the current file name in the titlebar @node Displaying the current file name in the titlebar
@section How can I modify the titlebar to contain the current file name? @section How can I modify the titlebar to contain the current file name?
...@@ -1366,20 +1352,29 @@ in your @file{.emacs}: ...@@ -1366,20 +1352,29 @@ in your @file{.emacs}:
@section How do I turn on abbrevs by default just in mode @var{mymode}? @section How do I turn on abbrevs by default just in mode @var{mymode}?
@cindex Abbrevs, turning on by default @cindex Abbrevs, turning on by default
Put this in your @file{.emacs} file: Abbrev mode expands abbreviations as you type them. To turn it on in a
specific buffer, use @kbd{M-x abbrev-mode}. To turn it on in every
buffer by default, put this in your @file{.emacs} file:
@lisp @lisp
(condition-case () (setq-default abbrev-mode t)
(quietly-read-abbrev-file) @end lisp
(file-error nil))
@noindent To turn it on in a specific mode, use:
@lisp
(add-hook '@var{mymode}-mode-hook (add-hook '@var{mymode}-mode-hook
(lambda () (lambda ()
(setq abbrev-mode t))) (setq abbrev-mode t)))
@end lisp @end lisp
Starting with Emacs 22, the standard abbrevs file is read automatically @noindent If your Emacs version is older then 22.1, you will also need to use:
at startup, so the first of these two forms becomes unnecessary.
@lisp
(condition-case ()
(quietly-read-abbrev-file)
(file-error nil))
@end lisp
@node Associating modes with files @node Associating modes with files
@section How do I make Emacs use a certain major mode for certain files? @section How do I make Emacs use a certain major mode for certain files?
...@@ -1392,10 +1387,10 @@ If you want to use a certain mode @var{foo} for all files whose names end ...@@ -1392,10 +1387,10 @@ If you want to use a certain mode @var{foo} for all files whose names end
with the extension @file{.@var{bar}}, this will do it for you: with the extension @file{.@var{bar}}, this will do it for you:
@lisp @lisp
(setq auto-mode-alist (cons '("\\.@var{bar}\\'" . @var{foo}-mode) auto-mode-alist)) (add-to-list 'auto-mode-alist '("\\.@var{bar}\\'" . @var{foo}-mode))
@end lisp @end lisp
Otherwise put this somewhere in the first line of any file you want to Alternatively, put this somewhere in the first line of any file you want to
edit in the mode @var{foo} (in the second line, if the first line begins edit in the mode @var{foo} (in the second line, if the first line begins
with @samp{#!}): with @samp{#!}):
...@@ -1404,11 +1399,11 @@ with @samp{#!}): ...@@ -1404,11 +1399,11 @@ with @samp{#!}):
@end example @end example
@cindex Major mode for shell scripts @cindex Major mode for shell scripts
Beginning with Emacs 19, the variable @code{interpreter-mode-alist} The variable @code{interpreter-mode-alist} specifies which mode to use
specifies which mode to use when loading a shell script. (Emacs when loading an interpreted script (e.g. shell, python, etc.). Emacs
determines which interpreter you're using by examining the first line of determines which interpreter you're using by examining the first line of
the script.) Use @kbd{C-h v} (or @kbd{M-x describe-variable}) the script. Use @kbd{C-h v} (or @kbd{M-x describe-variable}) on
on @code{interpreter-mode-alist} to learn more. @code{interpreter-mode-alist} to learn more.
@node Highlighting a region @node Highlighting a region
@section How can I highlight a region of text in Emacs? @section How can I highlight a region of text in Emacs?
...@@ -1421,11 +1416,11 @@ You can cause the region to be highlighted when the mark is active by ...@@ -1421,11 +1416,11 @@ You can cause the region to be highlighted when the mark is active by
including including
@lisp @lisp
(transient-mark-mode t) (transient-mark-mode 1)
@end lisp @end lisp
@noindent @noindent
in your @file{.emacs} file. in your @file{.emacs} file. Since Emacs 23.1, this feature is on by default.
@node Replacing highlighted text @node Replacing highlighted text
@section How can I replace highlighted text with what I type? @section How can I replace highlighted text with what I type?
...@@ -1445,8 +1440,10 @@ According to the documentation string for @code{delete-selection-mode} ...@@ -1445,8 +1440,10 @@ According to the documentation string for @code{delete-selection-mode}
delete-selection-mode @key{RET}}): delete-selection-mode @key{RET}}):
@quotation @quotation
When ON, typed text replaces the selection if the selection is active. When Delete Selection mode is enabled, Transient Mark mode is also
When OFF, typed text is just inserted at point. enabled and typed text replaces the selection if the selection is
active. Otherwise, typed text is just inserted at point regardless of
any selection.
@end quotation @end quotation
This mode also allows you to delete (not kill) the highlighted region by This mode also allows you to delete (not kill) the highlighted region by
...@@ -1459,8 +1456,9 @@ pressing @key{DEL}. ...@@ -1459,8 +1456,9 @@ pressing @key{DEL}.
@cindex Searching without case sensitivity @cindex Searching without case sensitivity
@cindex Ignoring case in searches @cindex Ignoring case in searches
For searching, the value of the variable @code{case-fold-search} @c FIXME
determines whether they are case sensitive: The value of the variable @code{case-fold-search} determines whether
searches are case sensitive:
@lisp @lisp
(setq case-fold-search nil) ; make searches case sensitive (setq case-fold-search nil) ; make searches case sensitive
...@@ -1494,8 +1492,7 @@ mode's hook. For example: ...@@ -1494,8 +1492,7 @@ mode's hook. For example:
@cindex Regexps and unprintable characters @cindex Regexps and unprintable characters
To search for a single character that appears in the buffer as, for 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 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}.
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 Searching for @strong{all} unprintable characters is best done with a
regular expression (@dfn{regexp}) search. The easiest regexp to use for regular expression (@dfn{regexp}) search. The easiest regexp to use for
the unprintable chars is the complement of the regexp for the printable the unprintable chars is the complement of the regexp for the printable
...@@ -1668,7 +1665,7 @@ requested by @code{emacsclient}, Emacs will switch to it; otherwise ...@@ -1668,7 +1665,7 @@ requested by @code{emacsclient}, Emacs will switch to it; otherwise
@code{emacsclient} will exit, signaling the calling program to continue. @code{emacsclient} will exit, signaling the calling program to continue.
@cindex @code{gnuserv} @cindex @code{gnuserv}
There is an enhanced version of @samp{emacsclient} called There is an alternative version of @samp{emacsclient} called
@samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman} @samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman}
(@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses (@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses
Internet domain sockets, so it can work across most network connections. Internet domain sockets, so it can work across most network connections.
...@@ -1711,20 +1708,12 @@ f() ...@@ -1711,20 +1708,12 @@ f()
@} @}
@end example @end example
The solution at first appears to be: set @code{c-indent-level} to 4 and @noindent To achieve this, add the following line to your @file{.emacs}:
@code{c-label-offset} to -2. However, this will give you an indentation
spacing of four instead of two.
The @emph{real} solution is to use @code{cc-mode} (the default mode for
C programming in Emacs 20 and later) and add the following line to your
@file{.emacs}:
@lisp @lisp
(c-set-offset 'case-label '+) (c-set-offset 'case-label '+)
@end lisp @end lisp
There appears to be no way to do this with the old @code{c-mode}.
@node Customizing C and C++ indentation @node Customizing C and C++ indentation
@section How to customize indentation in C, C@t{++}, and Java buffers? @section How to customize indentation in C, C@t{++}, and Java buffers?
@cindex Indentation, how to customize @cindex Indentation, how to customize
...@@ -1824,33 +1813,7 @@ Note that this is overridden by the variable ...@@ -1824,33 +1813,7 @@ Note that this is overridden by the variable
@code{truncate-partial-width-windows} if that variable is non-nil @code{truncate-partial-width-windows} if that variable is non-nil
and the current buffer is not full-frame width. and the current buffer is not full-frame width.
In Emacs 20, use the @code{hscroll-mode}. Here is some information from In Emacs 20, use @code{hscroll-mode}.
the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}:
Automatically scroll horizontally when the point moves off the
left or right edge of the window.
@itemize @minus
@item
Type @kbd{M-x hscroll-mode} to enable it in the current buffer.
@item
Type @kbd{M-x hscroll-global-mode} to enable it in every buffer.
@item
@code{turn-on-hscroll} is useful in mode hooks as in:
@lisp
(add-hook 'text-mode-hook 'turn-on-hscroll)
@end lisp
@item
@code{hscroll-margin} controls how close the cursor can get to the
edge of the window.
@item
@code{hscroll-step-percent} controls how far to jump once we decide to do so.
@end itemize
@node Overwrite mode @node Overwrite mode
@section How do I make Emacs ``typeover'' or ``overwrite'' instead of inserting? @section How do I make Emacs ``typeover'' or ``overwrite'' instead of inserting?
...@@ -2204,9 +2167,9 @@ is actually typical for regexp syntax.) ...@@ -2204,9 +2167,9 @@ is actually typical for regexp syntax.)
@cindex Files, replacing strings across multiple @cindex Files, replacing strings across multiple
@cindex Recursive search/replace operations @cindex Recursive search/replace operations
As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x d}) supports the
d}) supports the command @code{dired-do-query-replace} (@kbd{Q}), which command @code{dired-do-query-replace-regexp} (@kbd{Q}), which allows
allows users to replace regular expressions in multiple files. users to replace regular expressions in multiple files.
You can use this command to perform search/replace operations on You can use this command to perform search/replace operations on
multiple files by following the following steps: multiple files by following the following steps:
...@@ -2257,7 +2220,7 @@ load @code{dired-x} by adding the following to your @file{.emacs} file: ...@@ -2257,7 +2220,7 @@ load @code{dired-x} by adding the following to your @file{.emacs} file:
@lisp @lisp
(add-hook 'dired-load-hook (add-hook 'dired-load-hook
(lambda () (lambda ()
(load "dired-x"))) (require 'dired-x)))
@end lisp @end lisp
With @code{dired-x} loaded, @kbd{M-o} toggles omitting in each dired buffer. With @code{dired-x} loaded, @kbd{M-o} toggles omitting in each dired buffer.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment