]> git.eshelyaron.com Git - emacs.git/commitdiff
Make `shell-mode' more robust
authorMichael Albinus <michael.albinus@gmx.de>
Fri, 28 Jun 2024 09:28:33 +0000 (11:28 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sun, 30 Jun 2024 21:01:57 +0000 (23:01 +0200)
* lisp/shell.el (shell-mode): Ensure that
`comint-input-ring-file-name' is non-nil when calling `file-truename'.

(cherry picked from commit c4ad54812acaf8f156962047eaaaf75b0c0ecf96)

lisp/shell.el

index d6f1b443ed43ec00997971320ac5496d02d2568b..89ec893a3081ca55642d2a008f6cf4335d1dec56 100644 (file)
@@ -764,9 +764,10 @@ command."
              (setq-local comint-input-ring-size hsize))
         (setq comint-input-ring-file-name
               (concat remote hfile)))
-      (if (or (equal comint-input-ring-file-name "")
-             (equal (file-truename comint-input-ring-file-name)
-                    (file-truename null-device)))
+      (if (and comint-input-ring-file-name
+               (or (equal comint-input-ring-file-name "")
+                  (equal (file-truename comint-input-ring-file-name)
+                         (file-truename null-device))))
          (setq comint-input-ring-file-name nil))
       ;; Arrange to write out the input ring on exit, if the shell doesn't
       ;; do this itself.