annotate lisp/abbrevlist.el @ 486:80cdb2387043

Initial revision
author Jim Blandy <jimb@redhat.com>
date Mon, 13 Jan 1992 22:04:23 +0000
parents b062439c29cd
children 4cd7543be581
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
170
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
1 ;; List one abbrev table alphabetically ordered.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
2 ;; Copyright (C) 1986 Free Software Foundation, Inc.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
3 ;; Suggested by a previous version by Gildea.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
4
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
5 ;; This file is part of GNU Emacs.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
6
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; it under the terms of the GNU General Public License as published by
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9 ;; the Free Software Foundation; either version 1, or (at your option)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
10 ;; any later version.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
11
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
12 ;; GNU Emacs is distributed in the hope that it will be useful,
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
15 ;; GNU General Public License for more details.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
16
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
17 ;; You should have received a copy of the GNU General Public License
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
18 ;; along with GNU Emacs; see the file COPYING. If not, write to
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
19 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
20
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
21
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
22 (provide 'abbrevlist)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
24 (defun list-one-abbrev-table (abbrev-table output-buffer)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25 "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER."
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 (with-output-to-temp-buffer output-buffer
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 (save-excursion
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 (let ((abbrev-list nil) (first-column 0))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 (set-buffer standard-output)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 (mapatoms
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 (function (lambda (abbrev)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 (setq abbrev-list (cons abbrev abbrev-list))))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 abbrev-table)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 (setq abbrev-list (sort abbrev-list 'string-lessp))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 (while abbrev-list
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36 (if (> (+ first-column 40) (screen-width))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
37 (progn
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
38 (insert "\n")
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
39 (setq first-column 0)))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
40 (indent-to first-column)
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 (insert (symbol-name (car abbrev-list)))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (indent-to (+ first-column 8))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43 (insert (symbol-value (car abbrev-list)))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (setq first-column (+ first-column 40))
b062439c29cd Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (setq abbrev-list (cdr abbrev-list)))))))