diff options
| author | Lars Ingebrigtsen | 2019-10-11 08:27:50 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2019-10-11 08:27:50 +0200 |
| commit | df713b9344e978eff4f0a6aff506932fcdb1a39c (patch) | |
| tree | cfdfca95826646ff493764177fcd00c84361fcb3 /doc | |
| parent | 88f0c5662d7ace5e1dd770f8f0cc489d02a5876b (diff) | |
| download | emacs-df713b9344e978eff4f0a6aff506932fcdb1a39c.tar.gz emacs-df713b9344e978eff4f0a6aff506932fcdb1a39c.zip | |
Ensure that setq-local take an even number of symbol/value pairs
* doc/lispref/variables.texi (Creating Buffer-Local): Document the
new syntax for setq-local.
* lisp/subr.el (setq-local): Ensure that there's an even number of
variable/value pairs, and expand the doc string by taking some
text from `setq'.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/variables.texi | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index 89dac4f7a4d..76bda7874e3 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1430,11 +1430,17 @@ needed if you use the @var{local} argument to @code{add-hook} or | |||
| 1430 | @code{remove-hook}. | 1430 | @code{remove-hook}. |
| 1431 | @end deffn | 1431 | @end deffn |
| 1432 | 1432 | ||
| 1433 | @defmac setq-local variable value | 1433 | @defmac setq-local &rest pairs |
| 1434 | This macro creates a buffer-local binding in the current buffer for | 1434 | @var{pairs} is a list of variable and value pairs. This macro creates |
| 1435 | @var{variable}, and gives it the buffer-local value @var{value}. It | 1435 | a buffer-local binding in the current buffer for each of the |
| 1436 | is equivalent to calling @code{make-local-variable} followed by | 1436 | variables, and gives them a buffer-local value. It is equivalent to |
| 1437 | @code{setq}. @var{variable} should be an unquoted symbol. | 1437 | calling @code{make-local-variable} followed by @code{setq} for each of |
| 1438 | the variables. The variables should be unquoted symbols. | ||
| 1439 | |||
| 1440 | @lisp | ||
| 1441 | (setq-local var1 "value1" | ||
| 1442 | var2 "value2") | ||
| 1443 | @end lisp | ||
| 1438 | @end defmac | 1444 | @end defmac |
| 1439 | 1445 | ||
| 1440 | @deffn Command make-variable-buffer-local variable | 1446 | @deffn Command make-variable-buffer-local variable |