]> git.eshelyaron.com Git - emacs.git/commitdiff
Make register-preview ignore empty registers
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 20 Sep 2019 22:19:11 +0000 (00:19 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 20 Sep 2019 22:19:11 +0000 (00:19 +0200)
* lisp/register.el (register-preview): Ignore elements that are
empty (bug#37155).

lisp/register.el

index 775e1a2cc9251505cbcf90bc2c024f75df502eb0..b4d9d0d01c7ddc903b9e9ad4f40ed5af1de864ad 100644 (file)
@@ -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.