diff options
| author | Glenn Morris | 2011-05-21 18:18:49 -0700 |
|---|---|---|
| committer | Glenn Morris | 2011-05-21 18:18:49 -0700 |
| commit | 162d78a17e0da16bdcb0c2d5633f8fdaf323f407 (patch) | |
| tree | 8f07a433257f4f0a74ea87a14a32898d7f5404ef | |
| parent | 80614e570147005ed87f1f676c7d4926930eba6e (diff) | |
| download | emacs-162d78a17e0da16bdcb0c2d5633f8fdaf323f407.tar.gz emacs-162d78a17e0da16bdcb0c2d5633f8fdaf323f407.zip | |
Further tweak previous files.el change.
* lisp/files.el (hack-local-variables): In the MODE-ONLY case, try to
ignore minor modes.
| -rw-r--r-- | lisp/files.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/files.el b/lisp/files.el index 1d560ace065..24a0e0a5b62 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3147,7 +3147,9 @@ DIR-NAME is the name of the associated directory. Otherwise it is nil." | |||
| 3147 | (defun hack-local-variables (&optional mode-only) | 3147 | (defun hack-local-variables (&optional mode-only) |
| 3148 | "Parse and put into effect this buffer's local variables spec. | 3148 | "Parse and put into effect this buffer's local variables spec. |
| 3149 | If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" | 3149 | If MODE-ONLY is non-nil, all we do is check whether a \"mode:\" |
| 3150 | is specified, and return the corresponding mode symbol, or nil." | 3150 | is specified, and return the corresponding mode symbol, or nil. |
| 3151 | In this case, we try to ignore minor-modes, and only return a | ||
| 3152 | major-mode." | ||
| 3151 | (let ((enable-local-variables | 3153 | (let ((enable-local-variables |
| 3152 | (and local-enable-local-variables enable-local-variables)) | 3154 | (and local-enable-local-variables enable-local-variables)) |
| 3153 | result) | 3155 | result) |
| @@ -3226,17 +3228,20 @@ is specified, and return the corresponding mode symbol, or nil." | |||
| 3226 | (let* ((str (buffer-substring beg (point))) | 3228 | (let* ((str (buffer-substring beg (point))) |
| 3227 | (var (let ((read-circle nil)) | 3229 | (var (let ((read-circle nil)) |
| 3228 | (read str))) | 3230 | (read str))) |
| 3229 | val) | 3231 | val val2) |
| 3230 | ;; Read the variable value. | 3232 | ;; Read the variable value. |
| 3231 | (skip-chars-forward "^:") | 3233 | (skip-chars-forward "^:") |
| 3232 | (forward-char 1) | 3234 | (forward-char 1) |
| 3233 | (let ((read-circle nil)) | 3235 | (let ((read-circle nil)) |
| 3234 | (setq val (read (current-buffer)))) | 3236 | (setq val (read (current-buffer)))) |
| 3235 | (if mode-only | 3237 | (if mode-only |
| 3236 | (if (eq var 'mode) | 3238 | (and (eq var 'mode) |
| 3237 | (setq result | 3239 | ;; Specifying minor-modes via mode: is |
| 3238 | (intern (concat (symbol-name val) | 3240 | ;; deprecated, but try to reject them anyway. |
| 3239 | "-mode")))) | 3241 | (not (string-match |
| 3242 | "-minor\\'" | ||
| 3243 | (setq val2 (symbol-name val)))) | ||
| 3244 | (setq result (intern (concat val2 "-mode")))) | ||
| 3240 | (unless (eq var 'coding) | 3245 | (unless (eq var 'coding) |
| 3241 | (condition-case nil | 3246 | (condition-case nil |
| 3242 | (push (cons (if (eq var 'eval) | 3247 | (push (cons (if (eq var 'eval) |