]> git.eshelyaron.com Git - emacs.git/commitdiff
Give permanent-local property to per-buffer variables without defaults.
authorChong Yidong <cyd@gnu.org>
Fri, 13 Jul 2012 14:25:59 +0000 (22:25 +0800)
committerChong Yidong <cyd@gnu.org>
Fri, 13 Jul 2012 14:25:59 +0000 (22:25 +0800)
* 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
doc/emacs/ChangeLog
doc/emacs/custom.texi
lisp/ChangeLog
lisp/bindings.el
lisp/help-fns.el

index fc2b7fe073a53e8f118bd57097b609956e9d6a7e..c4e431257dbf14a4bd25d2018fc4a8f1d565136a 100644 (file)
@@ -1,5 +1,7 @@
 2012-07-13  Chong Yidong  <cyd@gnu.org>
 
+       * custom.texi (Examining): Update C-h v message.
+
        * buffers.texi (Misc Buffer): Document view-read-only.
 
 2012-07-07  Chong Yidong  <cyd@gnu.org>
index f352898a4d4963baa46361505b7da45033deaf28..2da70227c29cd2ac3d155151784e39d043994a0a 100644 (file)
@@ -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'.
 
index d6ce409dc9cf46a3d2217875b1db4ba279494753..d0f28f2a63d2781d31f4f3bae559105e88cec56d 100644 (file)
@@ -1,3 +1,11 @@
+2012-07-13  Chong Yidong  <cyd@gnu.org>
+
+       * 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  <cyd@gnu.org>
 
        * files.el (toggle-read-only): Doc fix and code cleanup.  New arg
index e0bea34cd0a22ccef522bdd6188dbd66917c5b96..97450f788aa224f6bde0c89d47d3453c0a81b3c9 100644 (file)
@@ -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)
index 387b65fe243c2745c03abfd2a0f89a524c5be68b..2e56da0bcaa67223ada809e815e580bd36675ae7 100644 (file)
@@ -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)