[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-26 b4f67eb: Improve discoverability of 'defvar' for
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] emacs-26 b4f67eb: Improve discoverability of 'defvar' for suppressing warnings |
Date: |
Fri, 24 Nov 2017 09:38:44 -0500 (EST) |
branch: emacs-26
commit b4f67ebb92b3d753e601e333f64b871a602b3979
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Improve discoverability of 'defvar' for suppressing warnings
* doc/lispref/compile.texi (Compiler Errors): Add index entries.
* doc/lispref/variables.texi (Defining Variables): Mention that
defvar with no value is used for suppressing compiler warnings.
(Bug#29400)
---
doc/lispref/compile.texi | 10 ++++++++--
doc/lispref/variables.texi | 4 +++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/doc/lispref/compile.texi b/doc/lispref/compile.texi
index 201d9fc..57ff060 100644
--- a/doc/lispref/compile.texi
+++ b/doc/lispref/compile.texi
@@ -434,6 +434,7 @@ to what @code{eval-when-compile} does.
@node Compiler Errors
@section Compiler Errors
@cindex compiler errors
address@hidden byte-compiler errors
Error and warning messages from byte compilation are printed in a
buffer named @file{*Compile-Log*}. These messages include file names
@@ -450,6 +451,10 @@ compiled, and point shows how far the byte compiler was
able to read;
the cause of the error might be nearby. @xref{Syntax Errors}, for
some tips for locating syntax errors.
address@hidden byte-compiler warnings
address@hidden free variable, byte-compiler warning
address@hidden reference to free variable, compilation warning
address@hidden function not known to be defined, compilation warning
A common type of warning issued by the byte compiler is for
functions and variables that were used but not defined. Such warnings
report the line number for the end of the file, not the locations
@@ -490,12 +495,13 @@ The reference to @var{variable} must be in the
@var{then-form} of the
@item
You can tell the compiler that a function is defined using
address@hidden @xref{Declaring Functions}.
address@hidden @xref{Declaring Functions}.
@item
Likewise, you can tell the compiler that a variable is defined using
@code{defvar} with no initial value. (Note that this marks the
-variable as special.) @xref{Defining Variables}.
+variable as special, i.e.@: dynamically bound.) @xref{Defining
+Variables}.
@end itemize
You can also suppress any and all compiler warnings within a certain
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 52d1f3b..99bbfc9 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -435,7 +435,9 @@ dynamically bound value; @pxref{Void Variables}), then
@var{value} is
evaluated and @var{symbol} is set to the result. But if @var{symbol}
is not void, @var{value} is not evaluated, and @var{symbol}'s value is
left unchanged. If @var{value} is omitted, the value of @var{symbol}
-is not changed in any case.
+is not changed in any case. Using @code{defvar} with no value is one
+method of suppressing byte compilation warnings, see @ref{Compiler
+Errors}.
If @var{symbol} has a buffer-local binding in the current buffer,
@code{defvar} acts on the default value, which is buffer-independent,
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-26 b4f67eb: Improve discoverability of 'defvar' for suppressing warnings,
Eli Zaretskii <=