mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-09 05:01:02 -08:00
Document new commands for manipulating local variable lists.
* custom.texi (Specifying File Variables, Directory Variables): Document new commands for manipulating local variable lists.
This commit is contained in:
parent
5854c2677e
commit
4d4e952231
3 changed files with 46 additions and 6 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2010-04-15 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* custom.texi (Specifying File Variables, Directory Variables):
|
||||
Document new commands for manipulating local variable lists.
|
||||
|
||||
2010-04-09 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* trouble.texi (Contributing): Add cindex entry.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
@c This is part of the Emacs manual.
|
||||
@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
|
||||
@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
|
||||
@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
|
||||
@c Free Software Foundation, Inc.
|
||||
@c See file emacs.texi for copying conditions.
|
||||
@node Customization, Quitting, Amusements, Top
|
||||
@chapter Customization
|
||||
|
|
@ -1086,11 +1087,22 @@ You can specify any number of variable/value pairs in this way, each
|
|||
pair with a colon and semicolon as shown above. The special
|
||||
variable/value pair @code{mode: @var{modename};}, if present,
|
||||
specifies a major or minor mode; if you use this to specify a major
|
||||
mode, it should come first in the line. The @var{value}s are are used
|
||||
mode, it should come first in the line. The @var{value}s are used
|
||||
literally, and not evaluated.
|
||||
|
||||
Here is an example that specifies Lisp mode and sets two variables
|
||||
with numeric values:
|
||||
@findex add-file-local-variable-prop-line
|
||||
@findex delete-file-local-variable-prop-line
|
||||
@findex copy-dir-locals-to-file-locals-prop-line
|
||||
You can use the command @code{add-file-local-variable-prop-line}
|
||||
instead of adding entries by hand. It prompts for a variable
|
||||
and value, and adds them to the first line in the appropriate way.
|
||||
The command @code{delete-file-local-variable-prop-line} deletes a
|
||||
variable from the line. The command
|
||||
@code{copy-dir-locals-to-file-locals-prop-line} copies directory-local
|
||||
variables (@pxref{Directory Variables}) to the first line.
|
||||
|
||||
Here is an example first line that specifies Lisp mode and sets two
|
||||
variables with numeric values:
|
||||
|
||||
@smallexample
|
||||
;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*-
|
||||
|
|
@ -1144,6 +1156,17 @@ won't confuse other programs that the file is intended for. The
|
|||
example above is for the C programming language, where comment lines
|
||||
start with @samp{/*} and end with @samp{*/}.
|
||||
|
||||
@findex add-file-local-variable
|
||||
@findex delete-file-local-variable
|
||||
@findex copy-dir-locals-to-file-locals
|
||||
You can construct the local variables list yourself, or use the
|
||||
command @code{add-file-local-variable}. This prompts for a variable
|
||||
and value, and adds them to the list. If necessary, it also adds the
|
||||
start and end markers. The command @code{delete-file-local-variable}
|
||||
deletes a variable from the list. The command
|
||||
@code{copy-dir-locals-to-file-locals} copies directory-local variables
|
||||
(@pxref{Directory Variables}) to the list.
|
||||
|
||||
As with the @samp{-*-} line, the variables in a local variables list
|
||||
are used literally, and are not evaluated first. If you want to split
|
||||
a long string across multiple lines of the file, you can use
|
||||
|
|
@ -1323,6 +1346,16 @@ style for any C or Java source file. Finally, it specifies a different
|
|||
subdirectory of the directory where you put the @file{.dir-locals.el}
|
||||
file.
|
||||
|
||||
@findex add-dir-local-variable
|
||||
@findex delete-dir-local-variable
|
||||
@findex copy-file-locals-to-dir-locals
|
||||
You can edit the @file{.dir-locals.el} file by hand, or use the
|
||||
command @code{add-dir-local-variable}. This prompts for a mode (or
|
||||
subdirectory), variable and value, and adds an entry to the file.
|
||||
The command @code{delete-dir-local-variable} deletes an entry. The
|
||||
command @code{copy-file-locals-to-dir-locals} copies file local
|
||||
variables (@pxref{File Variables}) to the @file{.dir-locals.el} file.
|
||||
|
||||
@findex dir-locals-set-class-variables
|
||||
@findex dir-locals-set-directory-class
|
||||
Another method of specifying directory-local variables is to explicitly
|
||||
|
|
|
|||
6
etc/NEWS
6
etc/NEWS
|
|
@ -95,12 +95,14 @@ with `set-process-query-on-exit-flag'.
|
|||
unconditionally. The previous behavior, toggling the mode, was
|
||||
neither reliable nor generally desirable.
|
||||
|
||||
*** New commands for adding and removing file-local variables:
|
||||
+++
|
||||
*** There are new commands for adding and removing file-local variables:
|
||||
`add-file-local-variable', `delete-file-local-variable',
|
||||
`add-file-local-variable-prop-line', and
|
||||
`delete-file-local-variable-prop-line'.
|
||||
|
||||
*** New commands for adding and removing directory-local variables,
|
||||
+++
|
||||
*** There are new commands for adding and removing directory-local variables,
|
||||
and copying them to and from file-local variable lists:
|
||||
`add-dir-local-variable', `delete-dir-local-variable',
|
||||
`copy-dir-locals-to-file-locals',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue