[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master c2fdd50: Fix resolving symlinks in Eshell history f
From: |
Eli Zaretskii |
Subject: |
[Emacs-diffs] master c2fdd50: Fix resolving symlinks in Eshell history file names |
Date: |
Sun, 9 Dec 2018 02:47:10 -0500 (EST) |
branch: master
commit c2fdd50c3cb0b03d2414370c58c1aa2a6ec3311d
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>
Fix resolving symlinks in Eshell history file names
* lisp/eshell/em-dirs.el (eshell-write-last-dir-ring):
* lisp/eshell/em-hist.el (eshell-write-history): Don't call
file-truename with argument of nil. (Bug#33477)
* test/lisp/eshell/eshell-tests.el (with-temp-eshell): Remove
HISTFILE from the environment, to make sure the Eshell history
file is nil.
---
lisp/eshell/em-dirs.el | 2 +-
lisp/eshell/em-hist.el | 2 +-
test/lisp/eshell/eshell-tests.el | 3 +++
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/lisp/eshell/em-dirs.el b/lisp/eshell/em-dirs.el
index c16a5ac..8533828 100644
--- a/lisp/eshell/em-dirs.el
+++ b/lisp/eshell/em-dirs.el
@@ -553,7 +553,7 @@ in the minibuffer:
(defun eshell-write-last-dir-ring ()
"Write the buffer's `eshell-last-dir-ring' to a history file."
(let* ((file eshell-last-dir-ring-file-name)
- (resolved-file (file-truename file)))
+ (resolved-file (if (stringp file) (file-truename file))))
(cond
((or (null file)
(equal file "")
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index f866dfd..1b240c0 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -467,7 +467,7 @@ Useful within process sentinels.
See also `eshell-read-history'."
(let* ((file (or filename eshell-history-file-name))
- (resolved-file (file-truename file)))
+ (resolved-file (if (stringp file) (file-truename file))))
(cond
((or (null file)
(equal file "")
diff --git a/test/lisp/eshell/eshell-tests.el b/test/lisp/eshell/eshell-tests.el
index b6dbd09..cefbeef 100644
--- a/test/lisp/eshell/eshell-tests.el
+++ b/test/lisp/eshell/eshell-tests.el
@@ -31,6 +31,9 @@
(defmacro with-temp-eshell (&rest body)
"Evaluate BODY in a temporary Eshell buffer."
`(let* ((eshell-directory-name (make-temp-file "eshell" t))
+ ;; We want no history file, so prevent Eshell from falling
+ ;; back on $HISTFILE.
+ (_ (setenv "HISTFILE"))
(eshell-history-file-name nil)
(eshell-buffer (eshell t)))
(unwind-protect
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master c2fdd50: Fix resolving symlinks in Eshell history file names,
Eli Zaretskii <=