diff options
| author | Stefan Monnier | 2025-04-20 10:10:17 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2025-04-20 10:10:17 -0400 |
| commit | 2f2fbae88280a460d2750ee685351475145e9d55 (patch) | |
| tree | 856647cae47b510c905757ee5becb8d9be9f4e73 | |
| parent | 6fb2a4691f4d53473c0a326d3a6c23df9008b6e8 (diff) | |
| download | emacs-2f2fbae88280a460d2750ee685351475145e9d55.tar.gz emacs-2f2fbae88280a460d2750ee685351475145e9d55.zip | |
(savehist-minibuffer-hook): Exclude uninterned history vars
* lisp/savehist.el (savehist--reload): Don't bother merging the value
of vars that were not changed.
(savehist-minibuffer-hook): Exclude uninterned history vars.
| -rw-r--r-- | lisp/savehist.el | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lisp/savehist.el b/lisp/savehist.el index 34226b3bd81..2cd591bc04f 100644 --- a/lisp/savehist.el +++ b/lisp/savehist.el | |||
| @@ -243,7 +243,8 @@ Be careful to do it while preserving the current history data." | |||
| 243 | ;; For each histvar that we knew about, make sure all the entries that | 243 | ;; For each histvar that we knew about, make sure all the entries that |
| 244 | ;; were there before are still here now and in the same order. | 244 | ;; were there before are still here now and in the same order. |
| 245 | (with-demoted-errors "%S" ;Maybe some var is not a list or something. | 245 | (with-demoted-errors "%S" ;Maybe some var is not a list or something. |
| 246 | (set s (savehist--merge v (symbol-value s)))))))) | 246 | (unless (equal v (symbol-value s)) |
| 247 | (set s (savehist--merge v (symbol-value s))))))))) | ||
| 247 | 248 | ||
| 248 | (defun savehist--file-modtime () | 249 | (defun savehist--file-modtime () |
| 249 | (or (file-attribute-modification-time (file-attributes savehist-file)) | 250 | (or (file-attribute-modification-time (file-attributes savehist-file)) |
| @@ -443,7 +444,12 @@ Does nothing if Savehist mode is off." | |||
| 443 | ;; (which `read-password' does), | 444 | ;; (which `read-password' does), |
| 444 | ;; `minibuffer-history-variable' is bound to t to mean | 445 | ;; `minibuffer-history-variable' is bound to t to mean |
| 445 | ;; "no history is being recorded". | 446 | ;; "no history is being recorded". |
| 446 | (memq minibuffer-history-variable savehist-ignored-variables)) | 447 | (memq minibuffer-history-variable savehist-ignored-variables) |
| 448 | ;; Filter out uninterned history vars since we can't | ||
| 449 | ;; reliably write+read them back in anyway (and presumably | ||
| 450 | ;; they are not intended to survive sessions). | ||
| 451 | (not (eq (intern-soft minibuffer-history-variable) | ||
| 452 | minibuffer-history-variable))) | ||
| 447 | (add-to-list 'savehist-minibuffer-history-variables | 453 | (add-to-list 'savehist-minibuffer-history-variables |
| 448 | minibuffer-history-variable))) | 454 | minibuffer-history-variable))) |
| 449 | 455 | ||