From 6ae5d634f35e2367035c53e0913669f73cbd9542 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Wed, 18 May 2016 02:14:08 -0400 Subject: [PATCH] savehist: refactor text-properties cleanup --- core/core-editor.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/core-editor.el b/core/core-editor.el index ca0cbf3ba..76a143fe9 100644 --- a/core/core-editor.el +++ b/core/core-editor.el @@ -49,17 +49,16 @@ '(kill-ring search-ring regexp-search-ring)) (savehist-mode 1) -;; text properties severely bloat the history so delete them (courtesy of PythonNut) +;; Remove text property cruft from history (defun unpropertize-savehist () (mapc (lambda (list) - (with-demoted-errors - (when (boundp list) - (set list (mapcar #'substring-no-properties (eval list)))))) + (when (boundp list) + (set list (mapcar 'substring-no-properties (eval list))))) '(kill-ring minibuffer-history helm-grep-history helm-ff-history file-name-history read-expression-history extended-command-history evil-ex-history))) -(add-hook 'kill-emacs-hook #'unpropertize-savehist) -(add-hook 'savehist-save-hook #'unpropertize-savehist) +(add-hook 'kill-emacs-hook 'unpropertize-savehist) +(add-hook 'savehist-save-hook 'unpropertize-savehist) ;; Keep track of recently opened files (require 'recentf)