Function: register-preview-1

register-preview-1 is a byte-compiled function defined in register.el.gz.

Signature

(register-preview-1 BUFFER &optional SHOW-EMPTY TYPES)

Documentation

Pop up a window showing the preview of registers in BUFFER.

This is the preview function used with the register-read-with-preview-fancy function. If SHOW-EMPTY is non-nil, show the preview window even if no registers. Optional argument TYPES (a list) specifies the types of register to show; if it is nil, show all the registers. See register-type for suitable types. Format of each entry is controlled by the variable register-preview-function.

Source Code

;; Defined in /usr/src/emacs/lisp/register.el.gz
(defun register-preview-1 (buffer &optional show-empty types)
  "Pop up a window showing the preview of registers in BUFFER.

This is the preview function used with the `register-read-with-preview-fancy'
function.
If SHOW-EMPTY is non-nil, show the preview window even if no registers.
Optional argument TYPES (a list) specifies the types of register to show;
if it is nil, show all the registers.  See `register-type' for suitable types.
Format of each entry is controlled by the variable `register-preview-function'."
  (unless register-preview-function
    (setq register-preview-function (register--preview-function
                                     register--read-with-preview-function)))
  (let ((registers (register-of-type-alist (or types '(all)))))
    (when (or show-empty (consp registers))
      (with-current-buffer-window
        buffer
        register-preview-display-buffer-alist
        nil
        (with-current-buffer standard-output
          (setq cursor-in-non-selected-windows nil)
          (mapc (lambda (elem)
                  (when (get-register (car elem))
                    (insert (funcall register-preview-function elem))))
                registers))))))