diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2003-04-10 16:26:12 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2003-04-10 16:26:12 +0000 |
commit | 84b538ecf878ffa02dc9bb01c799ac49efea48d8 (patch) | |
tree | 9a494ab257ec3ecc2be63326c9ae4126c8866fed /lisp/desktop.el | |
parent | a288d979732cdfc4dd2a57965a0b5dc4de048662 (diff) | |
download | emacs-84b538ecf878ffa02dc9bb01c799ac49efea48d8.tar.gz |
(desktop-buffer-file): Restore major-mode if it is different from the normal
mode.
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r-- | lisp/desktop.el | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el index 197680470ee..7f2b6f1312e 100644 --- a/lisp/desktop.el +++ b/lisp/desktop.el @@ -832,7 +832,8 @@ This function always sets `desktop-enable' to t." 'ignored))) ;; ---------------------------------------------------------------------------- -(defun desktop-buffer-file () "Load a file." +(defun desktop-buffer-file () + "Load a file." (if desktop-buffer-file-name (if (or (file-exists-p desktop-buffer-file-name) (and desktop-missing-file-warning @@ -843,6 +844,9 @@ This function always sets `desktop-enable' to t." (condition-case nil (switch-to-buffer buf) (error (pop-to-buffer buf))) + (and (not (eq major-mode desktop-buffer-major-mode)) + (functionp desktop-buffer-major-mode) + (funcall desktop-buffer-major-mode)) buf) 'ignored))) @@ -940,7 +944,7 @@ This function always sets `desktop-enable' to t." (cons 'case-fold-search cfs) (cons 'case-replace cr) (cons 'overwrite-mode (car mim))))) - + ;; ---------------------------------------------------------------------------- ;; When `desktop-enable' is non-nil and "--no-desktop" is not specified on the ;; command line, we do the rest of what it takes to use desktop, but do it |