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/fortran.el


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/fortran.el
Date: Sun, 12 May 2002 09:31:32 -0400

Index: emacs/lisp/progmodes/fortran.el
diff -c emacs/lisp/progmodes/fortran.el:1.92 
emacs/lisp/progmodes/fortran.el:1.93
*** emacs/lisp/progmodes/fortran.el:1.92        Wed May  1 11:31:31 2002
--- emacs/lisp/progmodes/fortran.el     Sun May 12 09:31:31 2002
***************
*** 139,144 ****
--- 139,151 ----
    :type 'regexp
    :group 'fortran-comment)
  
+ (defcustom fortran-preprocessor-re
+   "^[ \t]*#.*"
+   "*Regexp to match the whole of a preprocessor line."
+   :version "21.3"
+   :type 'regexp
+   :group 'fortran-indent)
+ 
  (defcustom fortran-minimum-statement-indent-fixed 6
    "*Minimum statement indentation for fixed format continuation style."
    :type 'integer
***************
*** 368,374 ****
            '("^\t\\([1-9]\\)" 1 font-lock-string-face))
         (list
          ;; cpp stuff (ugh)
!         '("^# *[a-z]+" . font-lock-keyword-face))
           ;; The list `fortran-font-lock-keywords-2' less that for types
           ;; (see above).
           (cdr (nthcdr (length fortran-font-lock-keywords-1)
--- 375,382 ----
            '("^\t\\([1-9]\\)" 1 font-lock-string-face))
         (list
          ;; cpp stuff (ugh)
! ;;;     '("^# *[a-z]+" . font-lock-keyword-face))
!           `(,fortran-preprocessor-re (0 font-lock-keyword-face t)))
           ;; The list `fortran-font-lock-keywords-2' less that for types
           ;; (see above).
           (cdr (nthcdr (length fortran-font-lock-keywords-1)
***************
*** 970,989 ****
  
  (defun fortran-previous-statement ()
    "Move point to beginning of the previous Fortran statement.
! Returns `first-statement' if that statement is the first
! non-comment Fortran statement in the file, and nil otherwise."
    (interactive)
    (let (not-first-statement continue-test)
      (beginning-of-line)
      (setq continue-test
          (and
           (not (looking-at fortran-comment-line-start-skip))
           (or (looking-at
                (concat "[ \t]*"
                        (regexp-quote fortran-continuation-string)))
               (looking-at " \\{5\\}[^ 0\n]\\|\t[1-9]"))))
      (while (and (setq not-first-statement (= (forward-line -1) 0))
                (or (looking-at fortran-comment-line-start-skip)
                    (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]")
                    (looking-at (concat "[ \t]*" comment-start-skip)))))
      (cond ((and continue-test
--- 978,1000 ----
  
  (defun fortran-previous-statement ()
    "Move point to beginning of the previous Fortran statement.
! Returns 'first-statement if that statement is the first
! non-comment Fortran statement in the file, and nil otherwise.
! Preprocessor lines are treated as comments."
    (interactive)
    (let (not-first-statement continue-test)
      (beginning-of-line)
      (setq continue-test
          (and
           (not (looking-at fortran-comment-line-start-skip))
+            (not (looking-at fortran-preprocessor-re))
           (or (looking-at
                (concat "[ \t]*"
                        (regexp-quote fortran-continuation-string)))
               (looking-at " \\{5\\}[^ 0\n]\\|\t[1-9]"))))
      (while (and (setq not-first-statement (= (forward-line -1) 0))
                (or (looking-at fortran-comment-line-start-skip)
+                     (looking-at fortran-preprocessor-re)
                    (looking-at "[ \t]*$\\| \\{5\\}[^ 0\n]\\|\t[1-9]")
                    (looking-at (concat "[ \t]*" comment-start-skip)))))
      (cond ((and continue-test
***************
*** 996,1003 ****
  
  (defun fortran-next-statement ()
    "Move point to beginning of the next Fortran statement.
! Returns `last-statement' if that statement is the last
! non-comment Fortran statement in the file, and nil otherwise."
    (interactive)
    (let (not-last-statement)
      (beginning-of-line)
--- 1007,1015 ----
  
  (defun fortran-next-statement ()
    "Move point to beginning of the next Fortran statement.
! Returns 'last-statement if that statement is the last
! non-comment Fortran statement in the file, and nil otherwise.
! Preprocessor lines are treated as comments."
    (interactive)
    (let (not-last-statement)
      (beginning-of-line)
***************
*** 1005,1010 ****
--- 1017,1023 ----
                      (and (= (forward-line 1) 0)
                           (not (eobp))))
                (or (looking-at fortran-comment-line-start-skip)
+                     (looking-at fortran-preprocessor-re)
                    (looking-at "[ \t]*$\\|     [^ 0\n]\\|\t[1-9]")
                    (looking-at (concat "[ \t]*" comment-start-skip)))))
      (if (not not-last-statement)
***************
*** 1356,1362 ****
                                      fortran-continuation-string)))
                 (looking-at " \\{5\\}[^ 0\n]\\|\t[1-9]"))
             (setq icol (+ icol fortran-continuation-indent)))
!           ((looking-at "[ \t]*#")     ; Check for cpp directive.
             (setq fortran-minimum-statement-indent 0 icol 0))
            (first-statement)
            ((and fortran-check-all-num-for-matching-do
--- 1369,1375 ----
                                      fortran-continuation-string)))
                 (looking-at " \\{5\\}[^ 0\n]\\|\t[1-9]"))
             (setq icol (+ icol fortran-continuation-indent)))
!           ((looking-at fortran-preprocessor-re) ; Check for cpp directive.
             (setq fortran-minimum-statement-indent 0 icol 0))
            (first-statement)
            ((and fortran-check-all-num-for-matching-do



reply via email to

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