summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2016-05-05 11:05:49 +0000
committerAlan Mackenzie <acm@muc.de>2016-05-05 11:05:49 +0000
commit25f455815bfaa868dc470d445413df9a7a546c46 (patch)
treeb0c56ba886eda0dfe5b0e200d59051dafd644488 /lisp/emacs-lisp
parent6aad36ace9953b9672b13be68416d205532d5e59 (diff)
downloademacs-25f455815bfaa868dc470d445413df9a7a546c46.tar.gz
emacs-25f455815bfaa868dc470d445413df9a7a546c46.tar.bz2
emacs-25f455815bfaa868dc470d445413df9a7a546c46.zip
Call hack-local-variables from major modes rather than from file visiting
This prevents file/directory local variables from being lost when the major mode is set or changed. This fixes bug #15577 and bug #23407. * lisp/files.el (normal-mode): Call `hack-local-variables' when the major mode function hasn't already done so. (hack-local-variables): Rename parameter `mode-only' to `handle-mode', make its previous non-nil setting be t, and introduce the following action for a non-nil non-t value: apply all settings apart from `mode'. * lisp/subr.el (run-mode-hooks): call `hack-local-variables' for buffers which are visiting files. * doc/emacs/custom.texi (File Variables): Note that setting a major mode also sets file variables. (Directory Variables): Note that `mode', `eval', and `unibyte' can be set as dir local variables, but `coding' can't. * doc/lispref/modes.texi (Major Mode Conventions): Say that `run-mode-hooks' also calls `hack-local-variables'. (Auto Major Mode): Say that `find-file' no longer runs `hack-local-variables', as from 25.2. Remove vagueness from `normal-mode' and `set-auto-mode' by saying that the mode IS SET, not merely "selected" or "chosen". (Mode Hooks): Document change to `run-mode-hooks'. * doc/lispref/variables.texi (File Local Variables): Document change to `hack-local-variables'.
Diffstat (limited to 'lisp/emacs-lisp')
0 files changed, 0 insertions, 0 deletions