Function: tutorial--detailed-help

tutorial--detailed-help is a byte-compiled function defined in tutorial.el.gz.

Signature

(tutorial--detailed-help BUTTON)

Documentation

Give detailed help about changed keys.

Source Code

;; Defined in /usr/src/emacs/lisp/tutorial.el.gz
(defun tutorial--detailed-help (button)
  "Give detailed help about changed keys."
  (help-setup-xref (list #'tutorial--detailed-help button)
                   (called-interactively-p 'interactive))
  (with-help-window (help-buffer)
    (let* ((tutorial-buffer  (button-get button 'tutorial-buffer))
           (explain-key-desc (button-get button 'explain-key-desc))
           (changed-keys (with-current-buffer tutorial-buffer
                           (save-excursion
                             (goto-char (point-min))
                             (tutorial--find-changed-keys
			      tutorial--default-keys)))))
      (when changed-keys
        (insert
         "The following key bindings used in the tutorial have been changed
from the Emacs default:\n\n" )
        (let ((frm "   %-14s %-27s %-16s\n"))
          (insert (format frm
			  "Standard Key" "Command" "In Your Emacs")))
        (dolist (tk changed-keys)
          (let* ((def-fun     (nth 1 tk))
                 (key         (nth 0 tk))
                 (def-fun-txt (nth 2 tk))
                 (where       (nth 3 tk))
                 (remark      (nth 4 tk))
                 (key-txt (key-description key))
                 (key-fun (with-current-buffer tutorial-buffer (key-binding key))))
            (unless (eq def-fun key-fun)
              ;; Insert key binding description:
              (when (string= key-txt explain-key-desc)
                (put-text-property 0 (length key-txt)
				   'face 'tutorial-warning-face key-txt))
              (insert "   " key-txt " ")
	      (indent-to 18)
              ;; Insert a link describing the old binding:
              (insert-button def-fun-txt
                             'value def-fun
                             'action
                             (lambda (button) (interactive)
                               (describe-function
                                (button-get button 'value)))
                             'follow-link t)
	      (indent-to 45)
              (when (listp where)
                (setq where "list"))
              ;; Tell where the old binding is now:
              (insert (format " %-16s "
                              (if (string= "" where)
                                  (format "M-x %s" def-fun-txt)
                                where)))
              ;; Insert a link with more information, for example
              ;; current binding and keymap or information about
              ;; cua-mode replacements:
              (insert-button (car remark)
                             'action
                             (lambda (b) (interactive)
                               (let ((value (button-get b 'value)))
                                 (tutorial--describe-nonstandard-key value)))
                             'value (cdr remark)
                             'follow-link t)
              (insert "\n")))))

      (insert "
It is OK to change key bindings, but changed bindings do not
correspond to what the tutorial says.\n\n")
      (help-print-return-message))))