changeset 52996:c9843219861e

(desktop-locals-to-save): Add buffer-file-coding-system. (desktop-buffer-file): Use saved buffer-file-coding-system for file reading. Set auto-insert to nil to prevent automatic insertion into restored empty files.
author Lars Hansen <larsh@soem.dk>
date Wed, 05 Nov 2003 13:28:17 +0000
parents 79178080aec6
children 8fe47ef85f89
files lisp/desktop.el
diffstat 1 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/desktop.el	Wed Nov 05 05:11:41 2003 +0000
+++ b/lisp/desktop.el	Wed Nov 05 13:28:17 2003 +0000
@@ -227,7 +227,8 @@
   fill-column
   overwrite-mode
   change-log-default-name
-  line-number-mode)
+  line-number-mode
+  buffer-file-coding-system)
   "List of local variables to save for each buffer.
 The variables are saved only when they really are local."
   :type '(repeat symbol)
@@ -872,7 +873,12 @@
 		   (y-or-n-p (format
 			      "File \"%s\" no longer exists. Re-create? "
 			      desktop-buffer-file-name))))
-	  (let ((buf (find-file-noselect desktop-buffer-file-name)))
+	  (let* ((auto-insert nil) ; Disable auto insertion
+		 (coding-system-for-read
+		  (or coding-system-for-read
+		      (cdr (assq 'buffer-file-coding-system
+				 desktop-buffer-locals))))
+		 (buf (find-file-noselect desktop-buffer-file-name)))
 	    (condition-case nil
 		(switch-to-buffer buf)
 	      (error (pop-to-buffer buf)))