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