diff options
| author | Chong Yidong | 2012-02-07 14:34:52 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-02-07 14:34:52 +0800 |
| commit | 0992bd9c06b90c8f316187467bcc005cbe51050e (patch) | |
| tree | 8dc76890f747f5aaccd2e2754fad74616c7d18bf | |
| parent | 75ded89ba50f0b1758fe5c70701e0ae422b0c497 (diff) | |
| download | emacs-0992bd9c06b90c8f316187467bcc005cbe51050e.tar.gz emacs-0992bd9c06b90c8f316187467bcc005cbe51050e.zip | |
Fix and doc-fix for `buffer-local-variables'.
* src/buffer.c (Fbuffer_local_variables)
(buffer_lisp_local_variables): Handle unbound vars correctly;
don't let Qunbound leak into Lisp.
* doc/lispref/variables.texi (Creating Buffer-Local): Minor clarification
to buffer-local-variables doc.
Fixes: debbugs:10715
| -rw-r--r-- | admin/notes/bugtracker | 11 | ||||
| -rw-r--r-- | doc/lispref/ChangeLog | 5 | ||||
| -rw-r--r-- | doc/lispref/variables.texi | 11 | ||||
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/buffer.c | 14 |
5 files changed, 38 insertions, 9 deletions
diff --git a/admin/notes/bugtracker b/admin/notes/bugtracker index dd1ea46ceb2..3c24212ea10 100644 --- a/admin/notes/bugtracker +++ b/admin/notes/bugtracker | |||
| @@ -640,3 +640,14 @@ I think you also have to add them to 'tags' and 'tags_single_letter' | |||
| 640 | in /usr/share/perl5/Debbugs/Config.pm. | 640 | in /usr/share/perl5/Debbugs/Config.pm. |
| 641 | And update /var/www/Developer.html with a description of what the tag means. | 641 | And update /var/www/Developer.html with a description of what the tag means. |
| 642 | And the "valid tags" list in /var/www/index.html. | 642 | And the "valid tags" list in /var/www/index.html. |
| 643 | |||
| 644 | ** Backups | ||
| 645 | |||
| 646 | The FSF sysadmins handle multi-generational backups of the filesystem | ||
| 647 | on debbugs.gnu.org. But if you really want to have your own backup of | ||
| 648 | the bug database, you can use rsync (this requires login access to | ||
| 649 | debbugs.gnu.org): | ||
| 650 | |||
| 651 | rsync -azvv -e ssh USER@debbugs.gnu.org:/var/lib/debbugs/ DEST | ||
| 652 | |||
| 653 | Note that this occupies well over 1G of disk space. | ||
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index 1a7c71232c6..04d1234be06 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-02-07 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * variables.texi (Creating Buffer-Local): Minor clarification | ||
| 4 | to buffer-local-variables doc (Bug#10715). | ||
| 5 | |||
| 1 | 2012-02-07 Glenn Morris <rgm@gnu.org> | 6 | 2012-02-07 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * display.texi (ImageMagick Images): General update. | 8 | * display.texi (ImageMagick Images): General update. |
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi index bdb16cd10a8..ab3a4edc0ac 100644 --- a/doc/lispref/variables.texi +++ b/doc/lispref/variables.texi | |||
| @@ -1317,11 +1317,12 @@ value (@pxref{Default Value}) of @var{variable} instead. | |||
| 1317 | 1317 | ||
| 1318 | @defun buffer-local-variables &optional buffer | 1318 | @defun buffer-local-variables &optional buffer |
| 1319 | This function returns a list describing the buffer-local variables in | 1319 | This function returns a list describing the buffer-local variables in |
| 1320 | buffer @var{buffer}. (If @var{buffer} is omitted, the current buffer is | 1320 | buffer @var{buffer}. (If @var{buffer} is omitted, the current buffer |
| 1321 | used.) It returns an association list (@pxref{Association Lists}) in | 1321 | is used.) Normally, each list element has the form |
| 1322 | which each element contains one buffer-local variable and its value. | 1322 | @w{@code{(@var{sym} . @var{val})}}, where @var{sym} is a buffer-local |
| 1323 | However, when a variable's buffer-local binding in @var{buffer} is void, | 1323 | variable (a symbol) and @var{val} is its buffer-local value. But when |
| 1324 | then the variable appears directly in the resulting list. | 1324 | a variable's buffer-local binding in @var{buffer} is void, its list |
| 1325 | element is just @var{sym}. | ||
| 1325 | 1326 | ||
| 1326 | @example | 1327 | @example |
| 1327 | @group | 1328 | @group |
diff --git a/src/ChangeLog b/src/ChangeLog index 5e4d995d857..71af862cdac 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2012-02-07 Chong Yidong <cyd@gnu.org> | ||
| 2 | |||
| 3 | * buffer.c (Fbuffer_local_variables) | ||
| 4 | (buffer_lisp_local_variables): Handle unbound vars correctly; | ||
| 5 | don't let Qunbound leak into Lisp. | ||
| 6 | |||
| 1 | 2012-02-07 Glenn Morris <rgm@gnu.org> | 7 | 2012-02-07 Glenn Morris <rgm@gnu.org> |
| 2 | 8 | ||
| 3 | * image.c (Fimagemagick_types): Doc fix. | 9 | * image.c (Fimagemagick_types): Doc fix. |
diff --git a/src/buffer.c b/src/buffer.c index 01418956c8d..a6f61a1936a 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -1022,7 +1022,10 @@ buffer_lisp_local_variables (struct buffer *buf) | |||
| 1022 | if (buf != current_buffer) | 1022 | if (buf != current_buffer) |
| 1023 | val = XCDR (elt); | 1023 | val = XCDR (elt); |
| 1024 | 1024 | ||
| 1025 | result = Fcons (Fcons (XCAR (elt), val), result); | 1025 | result = Fcons (EQ (val, Qunbound) |
| 1026 | ? XCAR (elt) | ||
| 1027 | : Fcons (XCAR (elt), val), | ||
| 1028 | result); | ||
| 1026 | } | 1029 | } |
| 1027 | 1030 | ||
| 1028 | return result; | 1031 | return result; |
| @@ -1064,9 +1067,12 @@ No argument or nil as argument means use current buffer as BUFFER. */) | |||
| 1064 | idx = PER_BUFFER_IDX (offset); | 1067 | idx = PER_BUFFER_IDX (offset); |
| 1065 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) | 1068 | if ((idx == -1 || PER_BUFFER_VALUE_P (buf, idx)) |
| 1066 | && SYMBOLP (PER_BUFFER_SYMBOL (offset))) | 1069 | && SYMBOLP (PER_BUFFER_SYMBOL (offset))) |
| 1067 | result = Fcons (Fcons (PER_BUFFER_SYMBOL (offset), | 1070 | { |
| 1068 | PER_BUFFER_VALUE (buf, offset)), | 1071 | Lisp_Object sym = PER_BUFFER_SYMBOL (offset); |
| 1069 | result); | 1072 | Lisp_Object val = PER_BUFFER_VALUE (buf, offset); |
| 1073 | result = Fcons (EQ (val, Qunbound) ? sym : Fcons (sym, val), | ||
| 1074 | result); | ||
| 1075 | } | ||
| 1070 | } | 1076 | } |
| 1071 | } | 1077 | } |
| 1072 | 1078 | ||