Refactor doom*strip-text-properties-from-undo-history

:around -> :before advice
This commit is contained in:
Henrik Lissner 2018-08-07 03:27:24 +02:00
parent c45e563453
commit 37e80c4878
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -231,13 +231,12 @@ savehist file."
(advice-add #'undo-tree-make-history-save-file-name :filter-return (advice-add #'undo-tree-make-history-save-file-name :filter-return
#'doom*undo-tree-make-history-save-file-name) #'doom*undo-tree-make-history-save-file-name)
(defun doom*strip-text-properties-from-undo-history (orig-fn &rest args) (defun doom*strip-text-properties-from-undo-history (&rest args)
(dolist (item buffer-undo-list) (dolist (item buffer-undo-list)
(and (consp item) (and (consp item)
(stringp (car item)) (stringp (car item))
(setcar item (substring-no-properties (car item))))) (setcar item (substring-no-properties (car item))))))
(apply orig-fn args)) (advice-add 'undo-list-transfer-to-tree :before #'doom*strip-text-properties-from-undo-history)
(advice-add 'undo-list-transfer-to-tree :around #'doom*strip-text-properties-from-undo-history)
(defun doom*compress-undo-tree-history (orig-fn &rest args) (defun doom*compress-undo-tree-history (orig-fn &rest args)
(cl-letf* ((jka-compr-verbose nil) (cl-letf* ((jka-compr-verbose nil)