diff options
author | Karoly Lorentey <karoly@lorentey.hu> | 2007-04-22 11:42:03 +0000 |
---|---|---|
committer | Karoly Lorentey <karoly@lorentey.hu> | 2007-04-22 11:42:03 +0000 |
commit | 81088e260b086fe28f36964f32b6338210ec6fd8 (patch) | |
tree | 53d5af73ca0c971fe6925944d4d059caab5337a2 /lisp/files.el | |
parent | fa1b1007cac59bafd16df7bd501ef2591dd77d62 (diff) | |
parent | a6f0e674ebf44b1d37732b64070b804673481d28 (diff) | |
download | emacs-81088e260b086fe28f36964f32b6338210ec6fd8.tar.gz |
Merged from emacs@sv.gnu.org
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-650
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-651
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-652
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-653
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-654
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-655
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-656
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-657
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-658
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-659
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-203
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-204
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-205
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-599
Diffstat (limited to 'lisp/files.el')
-rw-r--r-- | lisp/files.el | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/lisp/files.el b/lisp/files.el index 3b089c06d92..22c817993f9 100644 --- a/lisp/files.el +++ b/lisp/files.el @@ -2285,14 +2285,12 @@ only set the major mode, if that would change it." If optional arg KEEP-MODE-IF-SAME is non-nil, MODE is chased of any aliases and compared to current major mode. If they are the same, do nothing and return nil." - (when keep-mode-if-same - (while (symbolp (symbol-function mode)) - (setq mode (symbol-function mode))) - (if (eq mode major-mode) - (setq mode nil))) - (when mode - (funcall mode) - mode)) + (unless (and keep-mode-if-same + (eq (indirect-function mode) + (indirect-function major-mode))) + (when mode + (funcall mode) + mode))) (defun set-auto-mode-1 () "Find the -*- spec in the buffer. @@ -2788,7 +2786,8 @@ It is dangerous if either of these conditions are met: ;; During bootstrapping, edebug-basic-spec might not be ;; defined yet. (and (fboundp 'edebug-basic-spec) - (edebug-basic-spec val)))))) + (hack-one-local-variable-quotep val) + (edebug-basic-spec (nth 1 val))))))) ;; Allow expressions that the user requested. (member exp safe-local-eval-forms) ;; Certain functions can be allowed with safe arguments @@ -2811,9 +2810,15 @@ It is dangerous if either of these conditions are met: ok))))))) (defun hack-one-local-variable (var val) - "Set local variable VAR with value VAL." + "Set local variable VAR with value VAL. +If VAR is `mode', call `VAL-mode' as a function unless it's +already the major mode." (cond ((eq var 'mode) - (funcall (intern (concat (downcase (symbol-name val)) "-mode")))) + (let ((mode (intern (concat (downcase (symbol-name val)) + "-mode")))) + (unless (eq (indirect-function mode) + (indirect-function major-mode)) + (funcall mode)))) ((eq var 'eval) (save-excursion (eval val))) (t |