aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-04-26 02:33:47 +0000
committerGlenn Morris2008-04-26 02:33:47 +0000
commit17cb3e0e8a8c070ad09fe7d71e091377c313769e (patch)
treedfb3a2d11e05707b2664b79de8030aa6b51828ed
parent64f00939e0cea6c99ae93e0e5d9b4b4013125db9 (diff)
downloademacs-17cb3e0e8a8c070ad09fe7d71e091377c313769e.tar.gz
emacs-17cb3e0e8a8c070ad09fe7d71e091377c313769e.zip
(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.
-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 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'.")
560 560
561(defvar fortran-mode-syntax-table 561(defvar fortran-mode-syntax-table
562 (let ((table (make-syntax-table))) 562 (let ((table (make-syntax-table)))
563 ;; We might like `;' to be punctuation (g77 multi-statement 563 ;; Was a word-constituent (for abbrevs), now punctuation (g77
564 ;; lines), but that screws abbrevs. 564 ;; multi-statement lines).
565 (modify-syntax-entry ?\; "w" table) 565 (modify-syntax-entry ?\; "." table)
566 (modify-syntax-entry ?\r " " table) 566 (modify-syntax-entry ?\r " " table)
567 (modify-syntax-entry ?+ "." table) 567 (modify-syntax-entry ?+ "." table)
568 (modify-syntax-entry ?- "." table) 568 (modify-syntax-entry ?- "." table)
@@ -670,78 +670,69 @@ Used in the Fortran entry in `hs-special-modes-alist'.")
670 "Keymap used in Fortran mode.") 670 "Keymap used in Fortran mode.")
671 671
672 672
673(defvar fortran-mode-abbrev-table 673(define-abbrev-table 'fortran-mode-abbrev-table
674 (progn 674 (mapcar (lambda (e) (list (car e) (cdr e) nil :system t))
675 (define-abbrev-table 'fortran-mode-abbrev-table nil) 675 '((";au" . "automatic" )
676 fortran-mode-abbrev-table) 676 (";b" . "byte" )
677 "Abbrev table for Fortran mode.") 677 (";bd" . "block data" )
678 678 (";ch" . "character" )
679;; Not in defvar because user abbrevs may be restored before this file loads. 679 (";cl" . "close" )
680(mapc 680 (";c" . "continue" )
681 (lambda (e) 681 (";cm" . "common" )
682 (condition-case nil 682 (";cx" . "complex" )
683 (define-abbrev fortran-mode-abbrev-table (car e) (cdr e) nil :count 0 683 (";df" . "define" )
684 :system t) 684 (";di" . "dimension" )
685 (wrong-number-of-arguments ; Emacs 22 685 (";do" . "double" )
686 (define-abbrev fortran-mode-abbrev-table (car e) (cdr e) nil 0 t)))) 686 (";dc" . "double complex" )
687 '((";au" . "automatic" ) 687 (";dp" . "double precision" )
688 (";b" . "byte" ) 688 (";dw" . "do while" )
689 (";bd" . "block data" ) 689 (";e" . "else" )
690 (";ch" . "character" ) 690 (";ed" . "enddo" )
691 (";cl" . "close" ) 691 (";el" . "elseif" )
692 (";c" . "continue" ) 692 (";en" . "endif" )
693 (";cm" . "common" ) 693 (";eq" . "equivalence" )
694 (";cx" . "complex" ) 694 (";ew" . "endwhere" )
695 (";df" . "define" ) 695 (";ex" . "external" )
696 (";di" . "dimension" ) 696 (";ey" . "entry" )
697 (";do" . "double" ) 697 (";f" . "format" )
698 (";dc" . "double complex" ) 698 (";fa" . ".false." )
699 (";dp" . "double precision" ) 699 (";fu" . "function" )
700 (";dw" . "do while" ) 700 (";g" . "goto" )
701 (";e" . "else" ) 701 (";im" . "implicit" )
702 (";ed" . "enddo" ) 702 (";ib" . "implicit byte" )
703 (";el" . "elseif" ) 703 (";ic" . "implicit complex" )
704 (";en" . "endif" ) 704 (";ich" . "implicit character")
705 (";eq" . "equivalence" ) 705 (";ii" . "implicit integer" )
706 (";ew" . "endwhere" ) 706 (";il" . "implicit logical" )
707 (";ex" . "external" ) 707 (";ir" . "implicit real" )
708 (";ey" . "entry" ) 708 (";inc" . "include" )
709 (";f" . "format" ) 709 (";in" . "integer" )
710 (";fa" . ".false." ) 710 (";intr" . "intrinsic" )
711 (";fu" . "function" ) 711 (";l" . "logical" )
712 (";g" . "goto" ) 712 (";n" . "namelist" )
713 (";im" . "implicit" ) 713 (";o" . "open" ) ; was ;op
714 (";ib" . "implicit byte" ) 714 (";pa" . "parameter" )
715 (";ic" . "implicit complex" ) 715 (";pr" . "program" )
716 (";ich" . "implicit character") 716 (";ps" . "pause" )
717 (";ii" . "implicit integer" ) 717 (";p" . "print" )
718 (";il" . "implicit logical" ) 718 (";rc" . "record" )
719 (";ir" . "implicit real" ) 719 (";re" . "real" )
720 (";inc" . "include" ) 720 (";r" . "read" )
721 (";in" . "integer" ) 721 (";rt" . "return" )
722 (";intr" . "intrinsic" ) 722 (";rw" . "rewind" )
723 (";l" . "logical" ) 723 (";s" . "stop" )
724 (";n" . "namelist" ) 724 (";sa" . "save" )
725 (";o" . "open" ) ; was ;op 725 (";st" . "structure" )
726 (";pa" . "parameter" ) 726 (";sc" . "static" )
727 (";pr" . "program" ) 727 (";su" . "subroutine" )
728 (";ps" . "pause" ) 728 (";tr" . ".true." )
729 (";p" . "print" ) 729 (";ty" . "type" )
730 (";rc" . "record" ) 730 (";vo" . "volatile" )
731 (";re" . "real" ) 731 (";w" . "write" )
732 (";r" . "read" ) 732 (";wh" . "where" )))
733 (";rt" . "return" ) 733 "Abbrev table for Fortran mode."
734 (";rw" . "rewind" ) 734 ;; Accept ; as the first char of an abbrev. Also allow _ in abbrevs.
735 (";s" . "stop" ) 735 :regexp "\\(?:[^[:word:]_;]\\|^\\)\\(;?[[:word:]_]+\\)[^[:word:]_]*")
736 (";sa" . "save" )
737 (";st" . "structure" )
738 (";sc" . "static" )
739 (";su" . "subroutine" )
740 (";tr" . ".true." )
741 (";ty" . "type" )
742 (";vo" . "volatile" )
743 (";w" . "write" )
744 (";wh" . "where" )))
745 736
746 737
747;;;###autoload 738;;;###autoload