aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2018-03-23 11:01:31 -0400
committerStefan Monnier2018-03-23 11:01:31 -0400
commit6695c1be51bd8a1e208ae02505b2a6fa64c85e68 (patch)
tree5b98a40ea7c74b7e9c24d1187c9ed6f332e5b2f2 /doc
parent8e5ab342aac11ccc54fdcdc9593e989b562f7ae7 (diff)
parentb8ebf5fb64dbf261315bfdb281a8b0a119e7cc2b (diff)
downloademacs-6695c1be51bd8a1e208ae02505b2a6fa64c85e68.tar.gz
emacs-6695c1be51bd8a1e208ae02505b2a6fa64c85e68.zip
Merge from origin/emacs-26
b8ebf5fb64 * src/lisp.h (struct Lisp_Buffer_Local_Value): Update comm... 8c92a37cb4 * doc/emacs/trouble.texi: Fix location of `emacs-version' ... 10b1f2fdd5 Explain more about (defvar foo) form (Bug#18059) 68c2f336b1 * doc/lispref/buffers.texi (Buffer List): Fix grammar. 7e720c6851 * doc/lispref/anti.texi (Antinews): Fix grammar. a6a821d29b * lisp/org/ob-lisp.el (org-babel-lisp-eval-fn): Tweak type.
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/trouble.texi2
-rw-r--r--doc/lispref/anti.texi7
-rw-r--r--doc/lispref/buffers.texi2
-rw-r--r--doc/lispref/compile.texi3
-rw-r--r--doc/lispref/variables.texi39
5 files changed, 44 insertions, 9 deletions
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index c0dc3d472e3..fc9a64d375e 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -594,7 +594,6 @@ with the manual, one of them must be wrong; that is a bug.
594@cindex bug reporting 594@cindex bug reporting
595@cindex report an Emacs bug, how to 595@cindex report an Emacs bug, how to
596 596
597@findex emacs-version
598 When you decide that there is a bug, it is important to report it 597 When you decide that there is a bug, it is important to report it
599and to report it in a way which is useful. What is most useful is an 598and to report it in a way which is useful. What is most useful is an
600exact description of what commands you type, starting with the shell 599exact description of what commands you type, starting with the shell
@@ -717,6 +716,7 @@ should include all these things:
717The version number of Emacs. Without this, we won't know whether there is any 716The version number of Emacs. Without this, we won't know whether there is any
718point in looking for the bug in the current version of GNU Emacs. 717point in looking for the bug in the current version of GNU Emacs.
719 718
719@findex emacs-version
720@kbd{M-x report-emacs-bug} includes this information automatically, 720@kbd{M-x report-emacs-bug} includes this information automatically,
721but if you are not using that command for your report you can get the 721but if you are not using that command for your report you can get the
722version number by typing @kbd{M-x emacs-version @key{RET}}. If that 722version number by typing @kbd{M-x emacs-version @key{RET}}. If that
diff --git a/doc/lispref/anti.texi b/doc/lispref/anti.texi
index ef28415d591..556203b69f0 100644
--- a/doc/lispref/anti.texi
+++ b/doc/lispref/anti.texi
@@ -164,9 +164,10 @@ come, and learning to use yet another API is a burden.
164 164
165@item 165@item
166The function @code{read-multiple-choice} is also gone, in recognition 166The function @code{read-multiple-choice} is also gone, in recognition
167of the fact that nothing makes Emacs Lisp hacker rejoice more than the 167of the fact that nothing makes Emacs Lisp hackers rejoice more than
168need to sit down and write yet another interactive question-and-answer 168the need to sit down and write yet another interactive
169function, and make it optimal for each specific case. 169question-and-answer function, and make it optimal for each specific
170case.
170 171
171@item 172@item
172The function @code{add-variable-watcher} and the corresponding 173The function @code{add-variable-watcher} and the corresponding
diff --git a/doc/lispref/buffers.texi b/doc/lispref/buffers.texi
index a72e1eb69fc..cfd2fb7715b 100644
--- a/doc/lispref/buffers.texi
+++ b/doc/lispref/buffers.texi
@@ -891,7 +891,7 @@ This function operates on each frame's @code{buffer-list} parameter as
891well as the fundamental buffer list; therefore, the buffer that you bury 891well as the fundamental buffer list; therefore, the buffer that you bury
892will come last in the value of @code{(buffer-list @var{frame})} and in 892will come last in the value of @code{(buffer-list @var{frame})} and in
893the value of @code{(buffer-list)}. In addition, it also puts the buffer 893the value of @code{(buffer-list)}. In addition, it also puts the buffer
894at the end of the list of buffer of the selected window (@pxref{Window 894at the end of the list of buffers of the selected window (@pxref{Window
895History}) provided it is shown in that window. 895History}) provided it is shown in that window.
896 896
897If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the 897If @var{buffer-or-name} is @code{nil} or omitted, this means to bury the
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 0e39866d349..e665b84f9b8 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -500,7 +500,8 @@ You can tell the compiler that a function is defined using
500@item 500@item
501Likewise, you can tell the compiler that a variable is defined using 501Likewise, you can tell the compiler that a variable is defined using
502@code{defvar} with no initial value. (Note that this marks the 502@code{defvar} with no initial value. (Note that this marks the
503variable as special, i.e.@: dynamically bound.) @xref{Defining 503variable as special, i.e.@: dynamically bound, but only within the
504current lexical scope, or file if at top-level.) @xref{Defining
504Variables}. 505Variables}.
505@end itemize 506@end itemize
506 507
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index b80bc88a585..4d04335d83a 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -443,9 +443,13 @@ dynamically bound value; @pxref{Void Variables}), then @var{value} is
443evaluated and @var{symbol} is set to the result. But if @var{symbol} 443evaluated and @var{symbol} is set to the result. But if @var{symbol}
444is not void, @var{value} is not evaluated, and @var{symbol}'s value is 444is not void, @var{value} is not evaluated, and @var{symbol}'s value is
445left unchanged. If @var{value} is omitted, the value of @var{symbol} 445left unchanged. If @var{value} is omitted, the value of @var{symbol}
446is not changed in any case. Using @code{defvar} with no value is one 446is not changed in any case.
447method of suppressing byte compilation warnings, see @ref{Compiler 447
448Errors}. 448Note that specifying a value, even @code{nil}, marks the variable as
449special permanently. Whereas if @var{value} is omitted then the
450variable is only marked special locally (i.e.@: within the current
451lexical scope, or file if at the top-level). This can be useful for
452suppressing byte compilation warnings, see @ref{Compiler Errors}.
449 453
450If @var{symbol} has a buffer-local binding in the current buffer, 454If @var{symbol} has a buffer-local binding in the current buffer,
451@code{defvar} acts on the default value, which is buffer-independent, 455@code{defvar} acts on the default value, which is buffer-independent,
@@ -489,6 +493,9 @@ it a documentation string:
489 493
490The @code{defvar} form returns @var{symbol}, but it is normally used 494The @code{defvar} form returns @var{symbol}, but it is normally used
491at top level in a file where its value does not matter. 495at top level in a file where its value does not matter.
496
497For a more elaborate example of using @code{defvar} without a value,
498see @ref{Local defvar example}.
492@end defspec 499@end defspec
493 500
494@cindex constant variables 501@cindex constant variables
@@ -1165,6 +1172,32 @@ variables}. Every variable that has been defined with @code{defvar},
1165(@pxref{Defining Variables}). All other variables are subject to 1172(@pxref{Defining Variables}). All other variables are subject to
1166lexical binding. 1173lexical binding.
1167 1174
1175@anchor{Local defvar example}
1176Using @code{defvar} without a value, it is possible to bind a variable
1177dynamically just in one file, or in just one part of a file while
1178still binding it lexically elsewhere. For example:
1179
1180@example
1181@group
1182(let (_)
1183 (defvar x) ; @r{Let-bindings of @code{x} will be dynamic within this let.}
1184 (let ((x -99)) ; @r{This is a dynamic binding of @code{x}.}
1185 (defun get-dynamic-x ()
1186 x)))
1187
1188(let ((x 'lexical)) ; @r{This is a lexical binding of @code{x}.}
1189 (defun get-lexical-x ()
1190 x))
1191
1192(let (_)
1193 (defvar x)
1194 (let ((x 'dynamic))
1195 (list (get-lexical-x)
1196 (get-dynamic-x))))
1197 @result{} (lexical dynamic)
1198@end group
1199@end example
1200
1168@defun special-variable-p symbol 1201@defun special-variable-p symbol
1169This function returns non-@code{nil} if @var{symbol} is a special 1202This function returns non-@code{nil} if @var{symbol} is a special
1170variable (i.e., it has a @code{defvar}, @code{defcustom}, or 1203variable (i.e., it has a @code{defvar}, @code{defcustom}, or