|
|
1.1 root 1: ;; List one abbrev table alphabetically ordered.
2: ;; Copyright (C) 1986 Free Software Foundation, Inc.
3: ;; Suggested by a previous version by Gildea.
4:
5: ;; This file is part of GNU Emacs.
6:
7: ;; GNU Emacs is distributed in the hope that it will be useful,
8: ;; but WITHOUT ANY WARRANTY. No author or distributor
9: ;; accepts responsibility to anyone for the consequences of using it
10: ;; or for whether it serves any particular purpose or works at all,
11: ;; unless he says so in writing. Refer to the GNU Emacs General Public
12: ;; License for full details.
13:
14: ;; Everyone is granted permission to copy, modify and redistribute
15: ;; GNU Emacs, but only under the conditions described in the
16: ;; GNU Emacs General Public License. A copy of this license is
17: ;; supposed to have been given to you along with GNU Emacs so you
18: ;; can know your rights and responsibilities. It should be in a
19: ;; file named COPYING. Among other things, the copyright notice
20: ;; and this notice must be preserved on all copies.
21:
22:
23: (provide 'abbrevlist)
24:
25: (defun list-one-abbrev-table (abbrev-table output-buffer)
26: "Display alphabetical listing of ABBREV-TABLE in buffer BUFFER."
27: (with-output-to-temp-buffer output-buffer
28: (save-excursion
29: (let ((abbrev-list nil) (first-column 0))
30: (set-buffer standard-output)
31: (mapatoms
32: (function (lambda (abbrev)
33: (setq abbrev-list (cons abbrev abbrev-list))))
34: abbrev-table)
35: (setq abbrev-list (sort abbrev-list 'string-lessp))
36: (while abbrev-list
37: (if (> (+ first-column 40) (screen-width))
38: (progn
39: (insert "\n")
40: (setq first-column 0)))
41: (indent-to first-column)
42: (insert (symbol-name (car abbrev-list)))
43: (indent-to (+ first-column 8))
44: (insert (symbol-value (car abbrev-list)))
45: (setq first-column (+ first-column 40))
46: (setq abbrev-list (cdr abbrev-list)))))))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.