Function: describe-bindings

describe-bindings is an interactive and byte-compiled function defined in help.el.gz.

Signature

(describe-bindings &optional PREFIX BUFFER)

Documentation

Display a buffer showing a list of all defined keys, and their definitions.

The keys are displayed in order of precedence.

The optional argument PREFIX, if non-nil, should be a key sequence; then we display only bindings that start with that prefix. The optional argument BUFFER specifies which buffer's bindings to display (default, the current buffer). BUFFER can be a buffer or a buffer name.

View in manual

Probably introduced at or before Emacs version 17.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/help.el.gz
(defun describe-bindings (&optional prefix buffer)
  "Display a buffer showing a list of all defined keys, and their definitions.
The keys are displayed in order of precedence.

The optional argument PREFIX, if non-nil, should be a key sequence;
then we display only bindings that start with that prefix.
The optional argument BUFFER specifies which buffer's bindings
to display (default, the current buffer).  BUFFER can be a buffer
or a buffer name."
  (interactive)
  (let ((help-buffer-under-preparation t))
    (or buffer (setq buffer (current-buffer)))
    (help-setup-xref (list #'describe-bindings prefix buffer)
		     (called-interactively-p 'interactive))
    (with-help-window (help-buffer)
      (with-current-buffer (help-buffer)
	(describe-buffer-bindings buffer prefix)

	(when describe-bindings-outline
          (setq-local outline-regexp ".*:$")
          (setq-local outline-level (lambda () 1))
          (setq-local outline-minor-mode-cycle t
                      outline-minor-mode-highlight t
                      outline-minor-mode-use-buttons 'insert
                      ;; Hide the longest body.
                      outline-default-state 1
                      outline-default-rules describe-bindings-outline-rules)
          (outline-minor-mode 1)
          (save-excursion
            (goto-char (point-min))
            (let ((inhibit-read-only t))
              ;; Hide ^Ls.
              (while (search-forward "\n\f\n" nil t)
		(put-text-property (1+ (match-beginning 0)) (1- (match-end 0))
                                   'invisible t)))))))))