]> code.delx.au - gnu-emacs/commitdiff
(desktop-locals-to-save): Add buffer-file-coding-system.
authorLars Hansen <larsh@soem.dk>
Wed, 5 Nov 2003 13:28:48 +0000 (13:28 +0000)
committerLars Hansen <larsh@soem.dk>
Wed, 5 Nov 2003 13:28:48 +0000 (13:28 +0000)
(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.

lisp/ChangeLog
lisp/desktop.el

index 534798f1686f783ea252224cdc89acd3de306fa3..1023634b470f879239df3f971bf1228945aed75a 100644 (file)
@@ -1,3 +1,10 @@
+2003-11-05  Juri Linkov  <juri@jurta.org>
+
+       * desktop.el (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.
+
 2003-11-04  Luc Teirlinck  <teirllm@auburn.edu>
 
        * files.el (risky-local-variable-p): Make second argument optional.
index 73fef5c44b7def0badb11e7b82bcb24d2fb933f8..0cff5e5a21f0436d9a7238d5e7f02620ad3bdf50 100644 (file)
@@ -227,7 +227,8 @@ This variable is maintained for backward compatibility only.  Use
   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 @@ directory DIRNAME."
                   (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)))