diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-12-12 01:00:35 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-12-12 01:00:35 -0500 |
commit | e58ba090575203746b2b36b1a0e2ac0b1435441f (patch) | |
tree | f0fd9009fe3166d876c28afebea7b9069a8c3cf8 /lisp | |
parent | 9c7b4e3ba6133d61e5de6649808daa3c14de41ec (diff) | |
download | emacs.d-e58ba090575203746b2b36b1a0e2ac0b1435441f.tar.gz |
occur: Don't insert nil values in regexp-history
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-editing.el | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el index 19c20db..2dac01d 100644 --- a/lisp/init-editing.el +++ b/lisp/init-editing.el @@ -144,12 +144,11 @@ touches." (defun km/occur () "Call `occur' with active region or symbol at point." (interactive) - (push (if (use-region-p) - (buffer-substring-no-properties - (region-beginning) - (region-end)) - (thing-at-point 'symbol)) - regexp-history) + (--when-let (if (use-region-p) + (buffer-substring-no-properties + (region-beginning) (region-end)) + (thing-at-point 'symbol)) + (push it regexp-history)) (call-interactively 'occur)) (global-set-key (kbd "C-x \\") 'align-regexp) |