From 17cb3e0e8a8c070ad09fe7d71e091377c313769e Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 26 Apr 2008 02:33:47 +0000 Subject: [PATCH] (fortran-mode-syntax-table): Change `;' to punctuation now it's not needed for abbrevs. (fortran-mode-abbrev-table): Remove defvar, make use of new define-abbrev-table :regexp feature. --- lisp/progmodes/fortran.el | 141 ++++++++++++++++++++++------------------------ 1 file changed, 66 insertions(+), 75 deletions(-) diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index fdd8ff75a27..1eda1255a01 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el @@ -560,9 +560,9 @@ Used in the Fortran entry in `hs-special-modes-alist'.") (defvar fortran-mode-syntax-table (let ((table (make-syntax-table))) - ;; We might like `;' to be punctuation (g77 multi-statement - ;; lines), but that screws abbrevs. - (modify-syntax-entry ?\; "w" table) + ;; Was a word-constituent (for abbrevs), now punctuation (g77 + ;; multi-statement lines). + (modify-syntax-entry ?\; "." table) (modify-syntax-entry ?\r " " table) (modify-syntax-entry ?+ "." table) (modify-syntax-entry ?- "." table) @@ -670,78 +670,69 @@ Used in the Fortran entry in `hs-special-modes-alist'.") "Keymap used in Fortran mode.") -(defvar fortran-mode-abbrev-table - (progn - (define-abbrev-table 'fortran-mode-abbrev-table nil) - fortran-mode-abbrev-table) - "Abbrev table for Fortran mode.") - -;; Not in defvar because user abbrevs may be restored before this file loads. -(mapc - (lambda (e) - (condition-case nil - (define-abbrev fortran-mode-abbrev-table (car e) (cdr e) nil :count 0 - :system t) - (wrong-number-of-arguments ; Emacs 22 - (define-abbrev fortran-mode-abbrev-table (car e) (cdr e) nil 0 t)))) - '((";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" ))) +(define-abbrev-table 'fortran-mode-abbrev-table + (mapcar (lambda (e) (list (car e) (cdr e) nil :system t)) + '((";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" ))) + "Abbrev table for Fortran mode." + ;; Accept ; as the first char of an abbrev. Also allow _ in abbrevs. + :regexp "\\(?:[^[:word:]_;]\\|^\\)\\(;?[[:word:]_]+\\)[^[:word:]_]*") ;;;###autoload -- 2.11.4.GIT