Mercurial > emacs
changeset 48815:4d051ad4475f
(fortran-mode-abbrev-table): Handle `define-abbrev' with either 5
or 6 arguments.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 12 Dec 2002 01:06:05 +0000 |
parents | 6aba24953065 |
children | 8a9619f2076e |
files | lisp/progmodes/fortran.el |
diffstat | 1 files changed, 70 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/fortran.el Thu Dec 12 00:52:05 2002 +0000 +++ b/lisp/progmodes/fortran.el Thu Dec 12 01:06:05 2002 +0000 @@ -486,67 +486,76 @@ "Keymap used in Fortran mode.") (defvar fortran-mode-abbrev-table - (let ((ac abbrevs-changed)) - (define-abbrev-table 'fortran-mode-abbrev-table ()) - (define-abbrev fortran-mode-abbrev-table ";au" "automatic" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";b" "byte" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";bd" "block data" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ch" "character" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";cl" "close" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";c" "continue" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";cm" "common" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";cx" "complex" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";df" "define" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";di" "dimension" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";do" "double" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";dc" "double complex" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";dp" "double precision" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";dw" "do while" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";e" "else" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ed" "enddo" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";el" "elseif" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";en" "endif" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";eq" "equivalence" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ew" "endwhere" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ex" "external" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ey" "entry" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";f" "format" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";fa" ".false." nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";fu" "function" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";g" "goto" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";im" "implicit" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ib" "implicit byte" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ic" "implicit complex" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ich" "implicit character" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ii" "implicit integer" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";il" "implicit logical" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ir" "implicit real" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";inc" "include" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";in" "integer" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";intr" "intrinsic" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";l" "logical" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";n" "namelist" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";o" "open" nil 0 t) ; was ;op - (define-abbrev fortran-mode-abbrev-table ";pa" "parameter" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";pr" "program" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ps" "pause" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";p" "print" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";rc" "record" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";re" "real" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";r" "read" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";rt" "return" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";rw" "rewind" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";s" "stop" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";sa" "save" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";st" "structure" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";sc" "static" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";su" "subroutine" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";tr" ".true." nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";ty" "type" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";vo" "volatile" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";w" "write" nil 0 t) - (define-abbrev fortran-mode-abbrev-table ";wh" "where" nil 0 t) - (setq abbrevs-changed ac) + (let (abbrevs-changed) + (define-abbrev-table 'fortran-mode-abbrev-table nil) + ;; Use the 6th arg (SYSTEM-FLAG) of define-abbrev if possible. + ;; Only use `apply' to quieten the byte-compiler. + (mapcar + (function (lambda (element) + (condition-case nil + (apply 'define-abbrev fortran-mode-abbrev-table + (append element '(nil 0 t))) + (wrong-number-of-arguments + (apply 'define-abbrev fortran-mode-abbrev-table + (append element '(nil 0))))))) + '((";au" "automatic" ) + (";b" "byte" ) + (";bd" "block data" ) + (";ch" "character" ) + (";cl" "close" ) + (";c" "continue" ) + (";cm" "common" ) + (";cx" "complex" ) + (";df" "define" ) + (";di" "dimension" ) + (";do" "double" ) + (";dc" "double complex" ) + (";dp" "double precision" ) + (";dw" "do while" ) + (";e" "else" ) + (";ed" "enddo" ) + (";el" "elseif" ) + (";en" "endif" ) + (";eq" "equivalence" ) + (";ew" "endwhere" ) + (";ex" "external" ) + (";ey" "entry" ) + (";f" "format" ) + (";fa" ".false." ) + (";fu" "function" ) + (";g" "goto" ) + (";im" "implicit" ) + (";ib" "implicit byte" ) + (";ic" "implicit complex" ) + (";ich" "implicit character") + (";ii" "implicit integer" ) + (";il" "implicit logical" ) + (";ir" "implicit real" ) + (";inc" "include" ) + (";in" "integer" ) + (";intr" "intrinsic" ) + (";l" "logical" ) + (";n" "namelist" ) + (";o" "open" ) ; was ;op + (";pa" "parameter" ) + (";pr" "program" ) + (";ps" "pause" ) + (";p" "print" ) + (";rc" "record" ) + (";re" "real" ) + (";r" "read" ) + (";rt" "return" ) + (";rw" "rewind" ) + (";s" "stop" ) + (";sa" "save" ) + (";st" "structure" ) + (";sc" "static" ) + (";su" "subroutine" ) + (";tr" ".true." ) + (";ty" "type" ) + (";vo" "volatile" ) + (";w" "write" ) + (";wh" "where" ))) fortran-mode-abbrev-table)) (eval-when-compile ; silence compiler