aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/fortran.el
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2008-04-26 02:33:47 +0000
committerGlenn Morris <[email protected]>2008-04-26 02:33:47 +0000
commit17cb3e0e8a8c070ad09fe7d71e091377c313769e (patch)
treedfb3a2d11e05707b2664b79de8030aa6b51828ed /lisp/progmodes/fortran.el
parent64f00939e0cea6c99ae93e0e5d9b4b4013125db9 (diff)
(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.
Diffstat (limited to 'lisp/progmodes/fortran.el')
-rw-r--r--lisp/progmodes/fortran.el141
1 files changed, 66 insertions, 75 deletions
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el
index fdd8ff75a2..1eda1255a0 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