annotate lisp/utils/abbrevlist.el @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents ac2d302a0011
children
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
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
23 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
24 ;; 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26 ;;; Synched up with: FSF 19.34.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 (defun list-one-abbrev-table (abbrev-table output-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 (with-output-to-temp-buffer output-buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 (let ((abbrev-list nil) (first-column 0))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 (set-buffer standard-output)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 (mapatoms
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 (function (lambda (abbrev)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 (setq abbrev-list (cons abbrev abbrev-list))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 abbrev-table)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 (setq abbrev-list (sort abbrev-list 'string-lessp))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 (while abbrev-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 (if (> (+ first-column 40) (frame-width))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 (insert "\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 (setq first-column 0)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 (indent-to first-column)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 (insert (symbol-name (car abbrev-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 (indent-to (+ first-column 8))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 (insert (symbol-value (car abbrev-list)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 (setq first-column (+ first-column 40))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 (setq abbrev-list (cdr abbrev-list)))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (provide 'abbrevlist)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;;; abbrevlist.el ends here