]> git.eshelyaron.com Git - emacs.git/commitdiff
Drop 'local-enable-local-variables'.
authorEshel Yaron <me@eshelyaron.com>
Sat, 5 Apr 2025 09:54:06 +0000 (11:54 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 5 Apr 2025 09:54:06 +0000 (11:54 +0200)
lisp/arc-mode.el
lisp/files.el
lisp/mail/rmail.el
lisp/so-long.el
lisp/tar-mode.el

index 32743edd6b3d741e1ee62f6d86af6a0d3f7c1b26..a2b4725e2422be6d2bf67fece74d8634c546f19c 100644 (file)
@@ -737,7 +737,6 @@ archive.
 
         (setq-local truncate-lines t)
        (setq-local require-final-newline nil)
-       (setq-local local-enable-local-variables nil)
 
        ;; Prevent loss of data when saving the file.
        (setq-local file-precious-flag t)
index b3826e6525dcc3c9f79250387e08fbaaf073441c..6423413357e1d68ac1a70043e9ee7ed42d81f8a0 100644 (file)
@@ -757,38 +757,6 @@ See also `trusted-content'."
                    (setq trusted t)))
                trusted)))))))
 
-;; This is an odd variable IMO.
-;; You might wonder why it is needed, when we could just do:
-;; (setq-local enable-local-variables nil)
-;; These two are not precisely the same.
-;; Setting this variable does not cause -*- mode settings to be
-;; ignored, whereas setting enable-local-variables does.
-;; Only three places in Emacs use this variable: tar and arc modes,
-;; and rmail.  The first two don't need it.  They already use
-;; inhibit-local-variables-regexps, which is probably enough, and
-;; could also just set enable-local-variables locally to nil.
-;; Them setting it has the side-effect that dir-locals cannot apply to
-;; eg tar files (?).  FIXME Is this appropriate?
-;; AFAICS, rmail is the only thing that needs this, and the only
-;; reason it uses it is for BABYL files (which are obsolete).
-;; These contain "-*- rmail -*-" in the first line, which rmail wants
-;; to respect, so that find-file on a BABYL file will switch to
-;; rmail-mode automatically (this is nice, but hardly essential,
-;; since most people are used to explicitly running a command to
-;; access their mail; M-x gnus etc).  Rmail files may happen to
-;; contain Local Variables sections in messages, which Rmail wants to
-;; ignore.  So AFAICS the only reason this variable exists is for a
-;; minor convenience feature for handling of an obsolete Rmail file format.
-(defvar local-enable-local-variables t
-  "Like `enable-local-variables', except for major mode in a -*- line.
-The meaningful values are nil and non-nil.  The default is non-nil.
-It should be set in a buffer-local fashion.
-
-Setting this to nil has the same effect as setting `enable-local-variables'
-to nil, except that it does not ignore any mode: setting in a -*- line.
-Unless this difference matters to you, you should set `enable-local-variables'
-instead of this variable.")
-
 (defcustom enable-local-eval nil
   "Control processing of the \"variable\" `eval' in a file's local variables.
 The value can be t, nil or something else.
@@ -3013,8 +2981,6 @@ Uses the visited file name, the -*- line, and the local variables spec.
 This function is called automatically from `find-file'.  In that case,
 we may set up the file-specified mode and local variables,
 depending on the value of `enable-local-variables'.
-In addition, if `local-enable-local-variables' is nil, we do
-not set local variables (though we do notice a mode specified with -*-.)
 
 `enable-local-variables' is ignored if you run `normal-mode' interactively,
 or from Lisp without specifying the optional argument FIND-FILE;
@@ -3613,8 +3579,7 @@ It also obeys `major-mode-remap-alist' and `major-mode-remap-defaults'.
 
 If `enable-local-variables' is nil, or if the file name matches
 `inhibit-local-variables-regexps', this function does not check
-for any mode: tag anywhere in the file.  If `local-enable-local-variables'
-is nil, then the only mode: tag that can be relevant is a -*- one.
+for any mode: tag anywhere in the file.
 
 If the optional argument KEEP-MODE-IF-SAME is non-nil, then we
 set the major mode only if that would change it.  In other words
@@ -3629,7 +3594,6 @@ we don't actually set it to the same mode the buffer already has."
     (save-excursion
       (goto-char (point-min))
       (skip-chars-forward " \t\n")
-      ;; Note by design local-enable-local-variables does not matter here.
       (and enable-local-variables
           try-locals
           (setq end (set-auto-mode-1))
@@ -3816,8 +3780,7 @@ Call with point at the place to start searching from.
 If one is found, set point to the beginning and return the position
 of the end.  Otherwise, return nil; may change point.
 The variable `inhibit-local-variables-regexps' can cause a -*- spec to
-be ignored; but `enable-local-variables' and `local-enable-local-variables'
-have no effect."
+be ignored; but `enable-local-variables' has no effect."
   (let (beg end)
     (and
      ;; Don't look for -*- if this file name matches any
@@ -4258,12 +4221,11 @@ would be applicable to files in `default-directory'.
 Uses `hack-local-variables-apply' and `hack-dir-local-variables'
 to apply the variables.
 
-If `enable-local-variables' or `local-enable-local-variables' is
-nil, or INHIBIT-LOCALS is non-nil, this function disregards all
-normal local variables.  If `inhibit-local-variables-regexps'
-applies to the file in question, the file is not scanned for
-local variables, but directory-local variables may still be
-applied.
+If `enable-local-variables' is nil, or if INHIBIT-LOCALS is non-nil,
+this function disregards all normal local variables.  If
+`inhibit-local-variables-regexps' applies to the file in question, the
+file is not scanned for local variables, but directory-local variables
+may still be applied.
 
 Variables present in `permanently-enabled-local-variables' will
 still be evaluated, even if local variables are otherwise
@@ -4281,9 +4243,7 @@ all the specified local variables, but ignores any settings of \"mode:\"."
   ;; variable sections, but there is no reason dir-locals cannot apply
   ;; to them.  The real meaning of inhibit-local-variables-p is "do
   ;; not scan this file for local variables".
-  (let ((enable-local-variables
-        (and (not inhibit-locals)
-              local-enable-local-variables enable-local-variables)))
+  (let ((enable-local-variables (not inhibit-locals)))
     (if (eq handle-mode t)
         ;; We're looking just for the major mode setting.
         (and enable-local-variables
index 41b0813707f982293a6c08c389311ba020b0a9af..4ab1e78d74a3e39051d98d266df6c0734259d26b 100644 (file)
@@ -1481,8 +1481,6 @@ If so restore the actual mbox message collection."
 (defun rmail-variables ()
   ;; Turn off undo.  We turn it back on in rmail-edit.
   (setq buffer-undo-list t)
-  ;; Don't let a local variables list in a message cause confusion.
-  (setq-local local-enable-local-variables nil)
   ;; Don't turn off auto-saving based on the size of the buffer
   ;; because that code does not understand buffer-swapping.
   (setq-local auto-save-include-big-deletions t)
index 6f6e2ec796392f40a9180e1b6c3d4c4bff744d51..4b04dc7100e3c23b120f092b2fe5c82e99063651 100644 (file)
@@ -1630,7 +1630,6 @@ function defined by `so-long-file-local-mode-function'."
     (save-excursion
       (goto-char (point-min))
       (skip-chars-forward " \t\n")
-      ;; Note by design local-enable-local-variables does not matter here.
       (and enable-local-variables
            try-locals
            (setq end (set-auto-mode-1))
index 6a138455f8faa831fdb63603844fc6dd5e663185..85cd80634442365a2ed30e61a77242411d9e3130 100644 (file)
@@ -843,7 +843,6 @@ See also: variables `tar-update-datestamp' and `tar-anal-blocksize'.
        (setq buffer-read-only nil))    ; undo what `special-mode' did
   (make-local-variable 'tar-parse-info)
   (setq-local require-final-newline nil) ; binary data, dude...
-  (setq-local local-enable-local-variables nil)
   (setq-local next-line-add-newlines nil)
   (setq-local tar-file-name-coding-system
               (or file-name-coding-system