From: Chong Yidong Date: Fri, 13 Jul 2012 14:25:59 +0000 (+0800) Subject: Give permanent-local property to per-buffer variables without defaults. X-Git-Tag: emacs-24.2.90~1199^2~14 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dea31bd311229e7fa662e9b4b55f4c3683b7fe7b;p=emacs.git Give permanent-local property to per-buffer variables without defaults. * doc/emacs/custom.texi (Examining): Update C-h v message. * lisp/bindings.el: Assign a non-nil permanent-local property to per-buffer variables which lack a default value. * lisp/help-fns.el (describe-variable): In the "automatically becomes local" notice, take note of permanent-local variables. Fixes: debbugs:11930 --- diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index fc2b7fe073a..c4e431257db 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog @@ -1,5 +1,7 @@ 2012-07-13 Chong Yidong + * custom.texi (Examining): Update C-h v message. + * buffers.texi (Misc Buffer): Document view-read-only. 2012-07-07 Chong Yidong diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi index f352898a4d4..2da70227c29 100644 --- a/doc/emacs/custom.texi +++ b/doc/emacs/custom.texi @@ -766,7 +766,7 @@ displays something like this: fill-column is a variable defined in `C source code'. fill-column's value is 70 -Automatically becomes buffer-local when set in any fashion. +Automatically becomes buffer-local when set. This variable is safe as a file local variable if its value satisfies the predicate `integerp'. diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d6ce409dc9c..d0f28f2a63d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2012-07-13 Chong Yidong + + * bindings.el: Assign a non-nil permanent-local property to + per-buffer variables which lack a default value (Bug#11930). + + * help-fns.el (describe-variable): In the "automatically becomes + local" notice, take note of permanent-local variables. + 2012-07-13 Chong Yidong * files.el (toggle-read-only): Doc fix and code cleanup. New arg diff --git a/lisp/bindings.el b/lisp/bindings.el index e0bea34cd0a..97450f788aa 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el @@ -650,9 +650,22 @@ okay. See `mode-line-format'.") user-error ;; That's the main one! )) - (make-variable-buffer-local 'indent-tabs-mode) +;; These per-buffer variables are never reset by +;; `kill-all-local-variables', because they have no default value. +;; For consistency, we give them the `permanent-local' property, even +;; though `kill-all-local-variables' does not actually consult it. + +(mapcar (lambda (sym) (put sym 'permanent-local t)) + '(buffer-file-name default-directory buffer-backed-up + buffer-saved-size buffer-auto-save-file-name + buffer-read-only buffer-undo-list mark-active + point-before-scroll buffer-file-truename + buffer-file-format buffer-auto-save-file-format + buffer-display-count buffer-display-time + enable-multibyte-characters)) + ;; We have base64, md5 and sha1 functions built in now. (provide 'base64) (provide 'md5) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 387b65fe243..2e56da0bcaa 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -852,7 +852,10 @@ it is displayed along with the global value." (with-temp-buffer (local-variable-if-set-p variable)))) (setq extra-line t) - (princ " Automatically becomes buffer-local when set in any fashion.\n")) + (princ " Automatically becomes ") + (if (get variable 'permanent-local) + (princ "permanently ")) + (princ "buffer-local when set.\n")) ;; Mention if it's an alias (unless (eq alias variable)