aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2010-04-14 19:05:36 -0700
committerGlenn Morris2010-04-14 19:05:36 -0700
commit4d4e95223174bc3d8e816515e1ccca8bc67a75a1 (patch)
tree5905e31066773538b47a0a9e0813eda2d08a6e3d
parent5854c2677e0a197d8adedfdf3d558b35f874beb7 (diff)
downloademacs-4d4e95223174bc3d8e816515e1ccca8bc67a75a1.tar.gz
emacs-4d4e95223174bc3d8e816515e1ccca8bc67a75a1.zip
Document new commands for manipulating local variable lists.
* custom.texi (Specifying File Variables, Directory Variables): Document new commands for manipulating local variable lists.
-rw-r--r--doc/emacs/ChangeLog5
-rw-r--r--doc/emacs/custom.texi41
-rw-r--r--etc/NEWS6
3 files changed, 46 insertions, 6 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b4cb1c5b052..938fe1572ac 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,8 @@
12010-04-15 Glenn Morris <rgm@gnu.org>
2
3 * custom.texi (Specifying File Variables, Directory Variables):
4 Document new commands for manipulating local variable lists.
5
12010-04-09 Glenn Morris <rgm@gnu.org> 62010-04-09 Glenn Morris <rgm@gnu.org>
2 7
3 * trouble.texi (Contributing): Add cindex entry. 8 * trouble.texi (Contributing): Add cindex entry.
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index f0faec4d40c..a8bba419c25 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -1,6 +1,7 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001, 2@c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 2000, 2001,
3@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. 3@c 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
4@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 5@c See file emacs.texi for copying conditions.
5@node Customization, Quitting, Amusements, Top 6@node Customization, Quitting, Amusements, Top
6@chapter Customization 7@chapter Customization
@@ -1086,11 +1087,22 @@ You can specify any number of variable/value pairs in this way, each
1086pair with a colon and semicolon as shown above. The special 1087pair with a colon and semicolon as shown above. The special
1087variable/value pair @code{mode: @var{modename};}, if present, 1088variable/value pair @code{mode: @var{modename};}, if present,
1088specifies a major or minor mode; if you use this to specify a major 1089specifies a major or minor mode; if you use this to specify a major
1089mode, it should come first in the line. The @var{value}s are are used 1090mode, it should come first in the line. The @var{value}s are used
1090literally, and not evaluated. 1091literally, and not evaluated.
1091 1092
1092 Here is an example that specifies Lisp mode and sets two variables 1093@findex add-file-local-variable-prop-line
1093with numeric values: 1094@findex delete-file-local-variable-prop-line
1095@findex copy-dir-locals-to-file-locals-prop-line
1096 You can use the command @code{add-file-local-variable-prop-line}
1097instead of adding entries by hand. It prompts for a variable
1098and value, and adds them to the first line in the appropriate way.
1099The command @code{delete-file-local-variable-prop-line} deletes a
1100variable from the line. The command
1101@code{copy-dir-locals-to-file-locals-prop-line} copies directory-local
1102variables (@pxref{Directory Variables}) to the first line.
1103
1104 Here is an example first line that specifies Lisp mode and sets two
1105variables with numeric values:
1094 1106
1095@smallexample 1107@smallexample
1096;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*- 1108;; -*- mode: Lisp; fill-column: 75; comment-column: 50; -*-
@@ -1144,6 +1156,17 @@ won't confuse other programs that the file is intended for. The
1144example above is for the C programming language, where comment lines 1156example above is for the C programming language, where comment lines
1145start with @samp{/*} and end with @samp{*/}. 1157start with @samp{/*} and end with @samp{*/}.
1146 1158
1159@findex add-file-local-variable
1160@findex delete-file-local-variable
1161@findex copy-dir-locals-to-file-locals
1162 You can construct the local variables list yourself, or use the
1163command @code{add-file-local-variable}. This prompts for a variable
1164and value, and adds them to the list. If necessary, it also adds the
1165start and end markers. The command @code{delete-file-local-variable}
1166deletes a variable from the list. The command
1167@code{copy-dir-locals-to-file-locals} copies directory-local variables
1168(@pxref{Directory Variables}) to the list.
1169
1147 As with the @samp{-*-} line, the variables in a local variables list 1170 As with the @samp{-*-} line, the variables in a local variables list
1148are used literally, and are not evaluated first. If you want to split 1171are used literally, and are not evaluated first. If you want to split
1149a long string across multiple lines of the file, you can use 1172a 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
1323subdirectory of the directory where you put the @file{.dir-locals.el} 1346subdirectory of the directory where you put the @file{.dir-locals.el}
1324file. 1347file.
1325 1348
1349@findex add-dir-local-variable
1350@findex delete-dir-local-variable
1351@findex copy-file-locals-to-dir-locals
1352 You can edit the @file{.dir-locals.el} file by hand, or use the
1353command @code{add-dir-local-variable}. This prompts for a mode (or
1354subdirectory), variable and value, and adds an entry to the file.
1355The command @code{delete-dir-local-variable} deletes an entry. The
1356command @code{copy-file-locals-to-dir-locals} copies file local
1357variables (@pxref{File Variables}) to the @file{.dir-locals.el} file.
1358
1326@findex dir-locals-set-class-variables 1359@findex dir-locals-set-class-variables
1327@findex dir-locals-set-directory-class 1360@findex dir-locals-set-directory-class
1328 Another method of specifying directory-local variables is to explicitly 1361 Another method of specifying directory-local variables is to explicitly
diff --git a/etc/NEWS b/etc/NEWS
index 0d6bfbf52aa..101967fdd35 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -95,12 +95,14 @@ with `set-process-query-on-exit-flag'.
95unconditionally. The previous behavior, toggling the mode, was 95unconditionally. The previous behavior, toggling the mode, was
96neither reliable nor generally desirable. 96neither reliable nor generally desirable.
97 97
98*** New commands for adding and removing file-local variables: 98+++
99*** There are new commands for adding and removing file-local variables:
99`add-file-local-variable', `delete-file-local-variable', 100`add-file-local-variable', `delete-file-local-variable',
100`add-file-local-variable-prop-line', and 101`add-file-local-variable-prop-line', and
101`delete-file-local-variable-prop-line'. 102`delete-file-local-variable-prop-line'.
102 103
103*** New commands for adding and removing directory-local variables, 104+++
105*** There are new commands for adding and removing directory-local variables,
104and copying them to and from file-local variable lists: 106and copying them to and from file-local variable lists:
105`add-dir-local-variable', `delete-dir-local-variable', 107`add-dir-local-variable', `delete-dir-local-variable',
106`copy-dir-locals-to-file-locals', 108`copy-dir-locals-to-file-locals',