From ffaeb09ca6ef9b3d97c8b378c1e5c2b2723dae6f Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Sun, 15 Oct 2017 16:41:17 -0400 Subject: [PATCH] Ignore string properties when saving eshell history (Bug#28700) * lisp/eshell/em-hist.el (eshell-write-history): Remove properties before inserting history strings. (eshell-read-history): Remove obsolete comment. --- lisp/eshell/em-hist.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 1ab3c60b2c..8084c12653 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el @@ -444,7 +444,6 @@ eshell-read-history (ignore-dups eshell-hist-ignoredups)) (with-temp-buffer (insert-file-contents file) - ;; Save restriction in case file is already visited... ;; Watch for those date stamps in history files! (goto-char (point-max)) (while (and (< count size) @@ -488,7 +487,9 @@ eshell-write-history (while (> index 0) (setq index (1- index)) (let ((start (point))) - (insert (ring-ref ring index) ?\n) + ;; Remove properties before inserting, to avoid trouble + ;; with read-only strings (Bug#28700). + (insert (substring-no-properties (ring-ref ring index)) ?\n) (subst-char-in-region start (1- (point)) ?\n ?\177))) (eshell-with-private-file-modes (write-region (point-min) (point-max) file append -- 2.11.0