annotate lisp/utils/abbrevlist.el @ 0:376386a54a3c r19-14

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