From unknown Fri Jun 20 07:25:04 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#31028 <31028@debbugs.gnu.org> To: bug#31028 <31028@debbugs.gnu.org> Subject: Status: 27.0.50; Saving shell buffers to a file makes the desktop file unreadable Reply-To: bug#31028 <31028@debbugs.gnu.org> Date: Fri, 20 Jun 2025 14:25:04 +0000 retitle 31028 27.0.50; Saving shell buffers to a file makes the desktop fil= e unreadable reassign 31028 emacs submitter 31028 Juri Linkov severity 31028 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Apr 02 15:56:03 2018 Received: (at submit) by debbugs.gnu.org; 2 Apr 2018 19:56:03 +0000 Received: from localhost ([127.0.0.1]:35431 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35Yh-0003n1-9Y for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:56:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43017) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f35Yf-0003mM-9E for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:56:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f35YY-000634-U0 for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:55:56 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:45817) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f35YY-00062r-QR for submit@debbugs.gnu.org; Mon, 02 Apr 2018 15:55:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f35YX-00015r-L5 for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 15:55:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f35YU-0005y9-HP for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 15:55:53 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39113 helo=homiemail-a11.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1f35YU-0005wi-AK for bug-gnu-emacs@gnu.org; Mon, 02 Apr 2018 15:55:50 -0400 Received: from homiemail-a11.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTP id F1BBF314C069 for ; Mon, 2 Apr 2018 12:55:47 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a11.g.dreamhost.com (Postfix) with ESMTPSA id 52285314C066 for ; Mon, 2 Apr 2018 12:55:47 -0700 (PDT) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 27.0.50; Saving shell buffers to a file makes the desktop file unreadable Organization: LINKOV.NET Date: Mon, 02 Apr 2018 22:48:38 +0300 Message-ID: <87in99jvg9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain 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: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=desktop-shell-mode.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))) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 04 16:44:28 2018 Received: (at 31028-done) by debbugs.gnu.org; 4 Apr 2018 20:44:28 +0000 Received: from localhost ([127.0.0.1]:38673 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3pGe-0002j9-HL for submit@debbugs.gnu.org; Wed, 04 Apr 2018 16:44:28 -0400 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:37294 helo=homiemail-a19.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1f3pGc-0002j1-SR for 31028-done@debbugs.gnu.org; Wed, 04 Apr 2018 16:44:27 -0400 Received: from homiemail-a19.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTP id E870660406B for <31028-done@debbugs.gnu.org>; Wed, 4 Apr 2018 13:44:25 -0700 (PDT) Received: from localhost.linkov.net (m91-129-105-236.cust.tele2.ee [91.129.105.236]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a19.g.dreamhost.com (Postfix) with ESMTPSA id 476CB604069 for <31028-done@debbugs.gnu.org>; Wed, 4 Apr 2018 13:44:25 -0700 (PDT) From: Juri Linkov To: 31028-done@debbugs.gnu.org Subject: Re: bug#31028: 27.0.50; Saving shell buffers to a file makes the desktop file unreadable Organization: LINKOV.NET References: <87in99jvg9.fsf@mail.linkov.net> Date: Wed, 04 Apr 2018 23:44:07 +0300 In-Reply-To: <87in99jvg9.fsf@mail.linkov.net> (Juri Linkov's message of "Mon, 02 Apr 2018 22:48:38 +0300") Message-ID: <87woxmbt2g.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 31028-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > 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. From unknown Fri Jun 20 07:25:04 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 03 May 2018 11:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator