view lisp/abbrevlist.el @ 2323:626d9ac52bc9

(YACC): flag added to c_ext. (c_ext): no more a synonim for c_ext&C_PLPL because of YACC. (find_entries): consistently use streq when reasonable. (find_entries): a .y file is a yacc file. (get_C_stab): c_ext becomes c_ext&C_PLPL. (C_entries): logical cplpl means c_ext&C_PLPL. (C_entries): logical yacc_rules means we are after the first %%. (C_entries): added logic for yacc files. (C_entries): ':' case moved to the second switch. (C_entries): do not examine token if structdef==scolonseen. (consider_token): structtag set to null string for enum. (GET_COOKIE): and related macros removed. (logical): is now int, no more a char. (reg): define deleted. (isgood, _gd, notgd): deleted. (gotone): deleted. (TOKEN): member linestart removed. (linepos, prev_linepos, lb1): deleted. (main): call initbuffer on lbs array instead of lb1. (init): removed the initialisation of the logical _gd array; (find_entries): a .sa suffix means assembler file. (C_create_stab): "auto", "void", "extern", "static" are st_C_typespec. All C state machines rewritten. (C_entries): complete rewrite. (condider_token): complete rewrite. (getline): deleted. (C_entries): Added the quotednl logical variable. Used for parsing of #define's spanning multiple lines. (C_entries): Save the definedef status even when a newline is met inside a string.
author Richard M. Stallman <rms@gnu.org>
date Mon, 22 Mar 1993 23:13:10 +0000
parents 2c7997f249eb
children 83f275dcd93a
line wrap: on
line source

;;; abbrevlist.el --- list one abbrev table alphabetically ordered.

;; Copyright (C) 1986, 1992 Free Software Foundation, Inc.
;; Suggested by a previous version by Gildea.

;; Maintainer: FSF
;; Keywords: abbrev

;; This file is part of GNU Emacs.

;; GNU Emacs is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation; either version 2, or (at your option)
;; any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs; see the file COPYING.  If not, write to
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

;;; Code:

(defun list-one-abbrev-table (abbrev-table output-buffer)
  "Display alphabetical listing of ABBREV-TABLE in buffer OUTPUT-BUFFER."
  (with-output-to-temp-buffer output-buffer
    (save-excursion
      (let ((abbrev-list nil) (first-column 0))
	(set-buffer standard-output)
	(mapatoms 
	  (function (lambda (abbrev)
		      (setq abbrev-list (cons abbrev abbrev-list))))
	  abbrev-table)
	(setq abbrev-list (sort abbrev-list 'string-lessp))
	(while abbrev-list
	  (if (> (+ first-column 40) (frame-width))
	      (progn
		(insert "\n")
		(setq first-column 0)))
	  (indent-to first-column)
	  (insert (symbol-name (car abbrev-list)))
	  (indent-to (+ first-column 8))
	  (insert (symbol-value (car abbrev-list)))
	  (setq first-column (+ first-column 40))
	  (setq abbrev-list (cdr abbrev-list)))))))

(provide 'abbrevlist)

;;; abbrevlist.el ends here