Function: strokes-list-strokes

strokes-list-strokes is an autoloaded, interactive and byte-compiled function defined in strokes.el.gz.

Signature

(strokes-list-strokes &optional CHRONOLOGICAL STROKES-MAP)

Documentation

Pop up a buffer containing an alphabetical listing of strokes in STROKES-MAP.

With CHRONOLOGICAL prefix arg (C-u (universal-argument)) list strokes chronologically by command name. If STROKES-MAP is not given, strokes-global-map will be used instead.

Probably introduced at or before Emacs version 21.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/strokes.el.gz
;;;###autoload
(defun strokes-list-strokes (&optional chronological strokes-map)
  "Pop up a buffer containing an alphabetical listing of strokes in STROKES-MAP.
With CHRONOLOGICAL prefix arg (\\[universal-argument]) list strokes chronologically
by command name.
If STROKES-MAP is not given, `strokes-global-map' will be used instead."
  (interactive "P")
  (setq strokes-map (or strokes-map
			strokes-global-map
			(progn
			  (strokes-load-user-strokes)
			  strokes-global-map)))
  (if (not chronological)
      ;; then alphabetize the strokes based on command names...
      (setq strokes-map (sort (copy-sequence strokes-map)
			      (function strokes-alphabetic-lessp))))
  (let ((config (current-window-configuration)))
    (set-buffer (get-buffer-create "*Strokes List*"))
    (setq buffer-read-only nil)
    (erase-buffer)
    (insert
     "Command                                     Stroke\n"
     "-------                                     ------")
    (cl-loop
     for def in strokes-map do
     (let ((stroke (car def))
           (command-name (if (symbolp (cdr def))
                             (symbol-name (cdr def))
                           (prin1-to-string (cdr def)))))
       (strokes-xpm-for-stroke stroke " *strokes-xpm*")
       (newline 2)
       (insert-char ?\s 45)
       (beginning-of-line)
       (insert command-name)
       (beginning-of-line)
       (forward-char 45)
       (insert-image
        (create-image (with-current-buffer " *strokes-xpm*"
                        (buffer-string))
                      'xpm t
                      :color-symbols
                      `(("foreground"
                         . ,(frame-parameter nil 'foreground-color))))))
     finally do (unless (eobp)
                  (kill-region (1+ (point)) (point-max))))
    (view-buffer "*Strokes List*" nil)
    (setq-local view-mode-map
                (let ((map (copy-keymap view-mode-map)))
                  (define-key map "q" `(lambda ()
                                         (interactive)
                                         (View-quit)
                                         (set-window-configuration ,config)))
                  map))
    (goto-char (point-min))))