Function: idlwave-list-abbrevs
idlwave-list-abbrevs is an interactive and byte-compiled function
defined in idlwave.el.gz.
Signature
(idlwave-list-abbrevs ARG)
Documentation
Show the code abbreviations define in IDLWAVE mode.
This lists all abbrevs where the replacement text differs from the input text. These are the ones the users want to learn to speed up their writing.
The function does *not* list abbrevs which replace a word with itself
to call a hook. These hooks are used to change the case of words or
to blink the matching begin, and the user does not need to know them.
With arg, list all abbrevs with the corresponding hook.
This function was written since list-abbrevs looks terrible for IDLWAVE mode.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/progmodes/idlwave.el.gz
(defun idlwave-list-abbrevs (arg)
"Show the code abbreviations define in IDLWAVE mode.
This lists all abbrevs where the replacement text differs from the input text.
These are the ones the users want to learn to speed up their writing.
The function does *not* list abbrevs which replace a word with itself
to call a hook. These hooks are used to change the case of words or
to blink the matching `begin', and the user does not need to know them.
With arg, list all abbrevs with the corresponding hook.
This function was written since `list-abbrevs' looks terrible for IDLWAVE mode."
(interactive "P")
(let ((table idlwave-mode-abbrev-table)
abbrevs
str rpl func fmt (len-str 0) (len-rpl 0))
(mapatoms
(lambda (sym)
(if (symbol-value sym)
(progn
(setq str (symbol-name sym)
rpl (symbol-value sym)
func (symbol-function sym))
(if arg
(setq func (prin1-to-string func))
(if (and (listp func) (stringp (nth 2 func)))
(setq rpl (concat "EVAL: " (nth 2 func))
func "")
(setq func "")))
(if (or arg (not (string= rpl str)))
(progn
(setq len-str (max len-str (length str)))
(setq len-rpl (max len-rpl (length rpl)))
(setq abbrevs (cons (list str rpl func) abbrevs)))))))
table)
;; sort the list
(setq abbrevs (sort abbrevs (lambda (a b) (string< (car a) (car b)))))
;; Make the format
(setq fmt (format "%%-%ds %%-%ds %%s\n" len-str len-rpl))
(with-output-to-temp-buffer "*Help*"
(if arg
(progn
(princ "Abbreviations and Actions in IDLWAVE-Mode\n")
(princ "=========================================\n\n")
(princ (format fmt "KEY" "REPLACE" "HOOK"))
(princ (format fmt "---" "-------" "----")))
(princ "Code Abbreviations and Templates in IDLWAVE-Mode\n")
(princ "================================================\n\n")
(princ (format fmt "KEY" "ACTION" ""))
(princ (format fmt "---" "------" "")))
(dolist (list abbrevs)
(setq str (car list)
rpl (nth 1 list)
func (nth 2 list))
(princ (format fmt str rpl func)))))
;; Make sure each abbreviation uses only one display line
(with-current-buffer "*Help*"
(setq truncate-lines t)))