summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-09-21 00:19:11 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-09-21 00:19:11 +0200
commit80b53a3b8dcc28d18ac9a7adacf377ebe6d23ffe (patch)
tree8ec4c8adac1cb78ece182842aeac7d076fba731e
parent7c3ef77ccbc144a269b2a45ec855647290c8e0d0 (diff)
downloademacs-80b53a3b8dcc28d18ac9a7adacf377ebe6d23ffe.tar.gz
Make register-preview ignore empty registers
* lisp/register.el (register-preview): Ignore elements that are empty (bug#37155).
-rw-r--r--lisp/register.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/register.el b/lisp/register.el
index 775e1a2cc92..b4d9d0d01c7 100644
--- a/lisp/register.el
+++ b/lisp/register.el
@@ -139,7 +139,10 @@ Format of each entry is controlled by the variable `register-preview-function'."
nil
(with-current-buffer standard-output
(setq cursor-in-non-selected-windows nil)
- (insert (mapconcat register-preview-function register-alist ""))))))
+ (mapc (lambda (elem)
+ (when (get-register (car elem))
+ (insert (funcall register-preview-function elem))))
+ register-alist)))))
(defun register-read-with-preview (prompt)
"Read and return a register name, possibly showing existing registers.