diff options
| author | Noam Postavsky | 2017-10-15 16:41:17 -0400 |
|---|---|---|
| committer | Noam Postavsky | 2017-10-21 15:19:14 -0400 |
| commit | 9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed (patch) | |
| tree | d67e58b6f2682acfd271dd89bd01cc5d39b4cdeb /lisp | |
| parent | 0f286ca85a259575b67dba520ff72e59cc011426 (diff) | |
| download | emacs-9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed.tar.gz emacs-9e4265ef91bd659a5fac49fbe7dc34b91f89d4ed.zip | |
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.
* test/lisp/eshell/em-hist-tests.el (eshell-write-readonly-history):
New test.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/eshell/em-hist.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el index 1ab3c60b2c7..8084c126530 100644 --- a/lisp/eshell/em-hist.el +++ b/lisp/eshell/em-hist.el | |||
| @@ -444,7 +444,6 @@ line, with the most recent command last. See also | |||
| 444 | (ignore-dups eshell-hist-ignoredups)) | 444 | (ignore-dups eshell-hist-ignoredups)) |
| 445 | (with-temp-buffer | 445 | (with-temp-buffer |
| 446 | (insert-file-contents file) | 446 | (insert-file-contents file) |
| 447 | ;; Save restriction in case file is already visited... | ||
| 448 | ;; Watch for those date stamps in history files! | 447 | ;; Watch for those date stamps in history files! |
| 449 | (goto-char (point-max)) | 448 | (goto-char (point-max)) |
| 450 | (while (and (< count size) | 449 | (while (and (< count size) |
| @@ -488,7 +487,9 @@ See also `eshell-read-history'." | |||
| 488 | (while (> index 0) | 487 | (while (> index 0) |
| 489 | (setq index (1- index)) | 488 | (setq index (1- index)) |
| 490 | (let ((start (point))) | 489 | (let ((start (point))) |
| 491 | (insert (ring-ref ring index) ?\n) | 490 | ;; Remove properties before inserting, to avoid trouble |
| 491 | ;; with read-only strings (Bug#28700). | ||
| 492 | (insert (substring-no-properties (ring-ref ring index)) ?\n) | ||
| 492 | (subst-char-in-region start (1- (point)) ?\n ?\177))) | 493 | (subst-char-in-region start (1- (point)) ?\n ?\177))) |
| 493 | (eshell-with-private-file-modes | 494 | (eshell-with-private-file-modes |
| 494 | (write-region (point-min) (point-max) file append | 495 | (write-region (point-min) (point-max) file append |