changeset 50532:4737239e4dad

(desktop-buffer-file): Restore major-mode if it is different from the normal mode.
author Juanma Barranquero <lekktu@gmail.com>
date Thu, 10 Apr 2003 16:26:12 +0000
parents 42265835091c
children 52ea574e2233
files lisp/desktop.el
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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