# HG changeset patch # User Juanma Barranquero # Date 1049991972 0 # Node ID 4737239e4dad2a2f941b6fc6ba10e9987ddac253 # Parent 42265835091ce7689f8e95ec9906add6dfad490c (desktop-buffer-file): Restore major-mode if it is different from the normal mode. diff -r 42265835091c -r 4737239e4dad lisp/desktop.el --- a/lisp/desktop.el Thu Apr 10 12:02:31 2003 +0000 +++ b/lisp/desktop.el Thu Apr 10 16:26:12 2003 +0000 @@ -832,7 +832,8 @@ '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 @@ (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 @@ (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