emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/f90.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/f90.el,v
Date: Thu, 24 Apr 2008 15:06:28 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/04/24 15:06:28

Index: progmodes/f90.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/f90.el,v
retrieving revision 1.109
retrieving revision 1.110
diff -u -b -r1.109 -r1.110
--- progmodes/f90.el    10 Apr 2008 14:10:39 -0000      1.109
+++ progmodes/f90.el    24 Apr 2008 15:06:27 -0000      1.110
@@ -623,10 +623,13 @@
   (let ((table (make-syntax-table)))
     (modify-syntax-entry ?\! "<"  table) ; begin comment
     (modify-syntax-entry ?\n ">"  table) ; end comment
+    ;; FIXME: This goes against the convention: it should be "_".
     (modify-syntax-entry ?_  "w"  table) ; underscore in names
     (modify-syntax-entry ?\' "\"" table) ; string quote
     (modify-syntax-entry ?\" "\"" table) ; string quote
-    (modify-syntax-entry ?\` "w"  table) ; for abbrevs
+    ;; FIXME: We used to set ` to word syntax for the benefit of abbrevs, but
+    ;; we do not need it any more.  Not sure if it should be "_" or "." now.
+    (modify-syntax-entry ?\` "_"  table)
     (modify-syntax-entry ?\r " "  table) ; return is whitespace
     (modify-syntax-entry ?+  "."  table) ; punctuation
     (modify-syntax-entry ?-  "."  table)
@@ -866,7 +869,7 @@
 (defun f90-imenu-type-matcher ()
   "Search backward for the start of a derived type.
 Set subexpression 1 in the match-data to the name of the type."
-  (let (found l)
+  (let (found)
     (while (and (re-search-backward "^[ \t0-9]*type[ \t]*" nil t)
                 (not (setq found
                            (save-excursion
@@ -881,7 +884,8 @@
 (defvar f90-imenu-generic-expression
   (let ((good-char "[^!\"\&\n \t]") (not-e "[^e!\n\"\& \t]")
         (not-n "[^n!\n\"\& \t]") (not-d "[^d!\n\"\& \t]")
-        (not-ib "[^i(!\n\"\& \t]") (not-s "[^s!\n\"\& \t]"))
+        ;; (not-ib "[^i(!\n\"\& \t]") (not-s "[^s!\n\"\& \t]")
+        )
     (list
      '(nil "^[ \t0-9]*program[ \t]+\\(\\sw+\\)" 1)
      '("Modules" "^[ \t0-9]*module[ \t]+\\(\\sw+\\)[ \t]*\\(!\\|$\\)" 1)
@@ -922,20 +926,8 @@
 
 
 ;; Abbrevs have generally two letters, except standard types `c, `i, `r, `t.
-(defvar f90-mode-abbrev-table
-  (progn
-    (define-abbrev-table 'f90-mode-abbrev-table nil)
-    f90-mode-abbrev-table)
-  "Abbrev table for F90 mode.")
-
-;; Not in defvar because user abbrevs may be restored before this file loads.
-(mapc
- (lambda (e)
-   (condition-case nil
-       (define-abbrev f90-mode-abbrev-table (car e) (cdr e) nil :count 0
-         :system t)
-     (wrong-number-of-arguments         ; Emacs 22
-      (define-abbrev f90-mode-abbrev-table (car e) (cdr e) nil 0 t))))
+(define-abbrev-table 'f90-mode-abbrev-table
+  (mapcar (lambda (e) (list (car e) (cdr e) nil :system t))
  '(("`al"  . "allocate"     )
    ("`ab"  . "allocatable"  )
    ("`ai"  . "abstract interface")
@@ -996,7 +988,9 @@
    ("`vo"  . "volatile"     )
    ("`wh"  . "where"        )
    ("`wr"  . "write"        )))
-
+  "Abbrev table for F90 mode."
+  ;; Accept ` as the first char of an abbrev.  Also allow _ in abbrevs.
+  :regexp "\\(?:[^[:word:]_`]\\|^\\)\\(`?[[:word:]_]+\\)[^[:word:]_]*")
 
 ;;;###autoload
 (defun f90-mode ()
@@ -2102,8 +2096,7 @@
 
 (defun f90-prepare-abbrev-list-buffer ()
   "Create a buffer listing the F90 mode abbreviations."
-  (save-excursion
-    (set-buffer (get-buffer-create "*Abbrevs*"))
+  (with-current-buffer (get-buffer-create "*Abbrevs*")
     (erase-buffer)
     (insert-abbrev-table-description 'f90-mode-abbrev-table t)
     (goto-char (point-min))
@@ -2172,7 +2165,7 @@
               (funcall change-word -1)
               (or (string= saveword (buffer-substring back-point ref-point))
                   (setq modified t))))
-        (or modified (set-buffer-modified-p nil))))))
+        (or modified (restore-buffer-modified-p nil))))))
 
 
 (defun f90-current-defun ()




reply via email to

[Prev in Thread] Current Thread [Next in Thread]