emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[debbugs-tracker] bug#31028: closed (27.0.50; Saving shell buffers to a


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#31028: closed (27.0.50; Saving shell buffers to a file makes the desktop file unreadable)
Date: Wed, 04 Apr 2018 20:45:02 +0000

Your message dated Wed, 04 Apr 2018 23:44:07 +0300
with message-id <address@hidden>
and subject line Re: bug#31028: 27.0.50; Saving shell buffers to a file makes 
the desktop file unreadable
has caused the debbugs.gnu.org bug report #31028,
regarding 27.0.50; Saving shell buffers to a file makes the desktop file 
unreadable
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
31028: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=31028
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 27.0.50; Saving shell buffers to a file makes the desktop file unreadable Date: Mon, 02 Apr 2018 22:48:38 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
1. M-x shell RET
2. C-d (send EOF to exit shell)
3. C-x C-s (save to a file)
4. M-x desktop-save-in-desktop-dir RET
5. Restart Emacs

Loading the desktop file fails because the file buffer is saved with shell-mode,
but on reading shell-mode fails while trying to eval

  (process-command (get-buffer-process (current-buffer)))

where get-buffer-process returns nil that is unacceptable as an arg
to process-command.

Possible solutions:

1. Skip and don't save buffers with shell-mode
   by adding it to the default value of desktop-modes-not-to-save

2. Still save but properly handle shell buffers on reading, i.e. fix shell-mode
   to check for nil values such as in this patch:

diff --git a/lisp/shell.el b/lisp/shell.el
index 5c228a5..d4a0556 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -568,8 +568,10 @@ shell-mode
   (setq list-buffers-directory (expand-file-name default-directory))
   ;; shell-dependent assignments.
   (when (ring-empty-p comint-input-ring)
-    (let ((shell (file-name-nondirectory (car
-                  (process-command (get-buffer-process (current-buffer))))))
+    (let ((shell (if (get-buffer-process (current-buffer))
+                     (file-name-nondirectory
+                      (car (process-command (get-buffer-process 
(current-buffer)))))
+                   ""))
          (hsize (getenv "HISTSIZE")))
       (and (stringp hsize)
           (integerp (setq hsize (string-to-number hsize)))

--- End Message ---
--- Begin Message --- Subject: Re: bug#31028: 27.0.50; Saving shell buffers to a file makes the desktop file unreadable Date: Wed, 04 Apr 2018 23:44:07 +0300 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)
> 2. Still save but properly handle shell buffers on reading, i.e. fix 
> shell-mode
>    to check for nil values such as in this patch:

This solution installed to master.


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]