/[emacs]/emacs/lisp/progmodes/fortran.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/fortran.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.99 by gm, Thu Dec 12 01:06:05 2002 UTC revision 1.100 by monnier, Wed Feb 12 15:23:21 2003 UTC
# Line 664  with no args, if that value is non-nil." Line 664  with no args, if that value is non-nil."
664         ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)")         ;; (concat "\\(\\)\\(![ \t]*\\|" fortran-comment-line-start-skip "\\)")
665         "\\(\\)\\(?:^[CcDd*]\\|!\\)\\(?:\\([^ \t\n]\\)\\2+\\)?[ \t]*")         "\\(\\)\\(?:^[CcDd*]\\|!\\)\\(?:\\([^ \t\n]\\)\\2+\\)?[ \t]*")
666    (set (make-local-variable 'comment-padding) "$$$")    (set (make-local-variable 'comment-padding) "$$$")
667    (make-local-variable 'comment-start)    (set (make-local-variable 'comment-start) fortran-comment-line-start)
668    (setq comment-start fortran-comment-line-start)    ;; The syntax tables don't understand the column-0 comment-markers.
669      (set (make-local-variable 'comment-use-syntax) nil)
670    (make-local-variable 'require-final-newline)    (make-local-variable 'require-final-newline)
671    (setq require-final-newline t)    (setq require-final-newline t)
672    (make-local-variable 'abbrev-all-caps)    (make-local-variable 'abbrev-all-caps)
# Line 1753  file before the end or the first `fortra Line 1754  file before the end or the first `fortra
1754    "Fill surrounding comment block as paragraphs, else fill statement.    "Fill surrounding comment block as paragraphs, else fill statement.
1755  Intended as the value of `fill-paragraph-function'."  Intended as the value of `fill-paragraph-function'."
1756    (interactive "P")    (interactive "P")
1757    (save-excursion    (or (fill-comment-paragraph justify)
1758      (beginning-of-line)        (fortran-fill-statement)
1759      (if (not (looking-at fortran-comment-line-start-skip))        t))
         (fortran-fill-statement)  
         ;; We're in a comment block.  Find the start and end of a  
         ;; paragraph, delimited either by non-comment lines or empty  
         ;; comments.  (Get positions as markers, since the  
         ;; `indent-region' below can shift the block's end).  
         (let* ((non-empty-comment  
                 (concat fortran-comment-line-start-skip "[^ \t\n]"))  
                (start (save-excursion  
                         ;; Find (start of) first line.  
                         (while (and (zerop (forward-line -1))  
                                     (looking-at non-empty-comment)))  
                         (or (looking-at non-empty-comment)  
                             (forward-line)) ; overshot  
                         (point-marker)))  
                (end (save-excursion  
                       ;; Find start of first line past region to fill.  
                       (while (progn  
                                (forward-line)  
                                (looking-at non-empty-comment)))  
                       (point-marker))))  
           ;; Indent the block, find the string comprising the effective  
           ;; comment start skip and use that as a fill-prefix for  
           ;; filling the region.  
           (indent-region start end nil)  
           (let ((paragraph-ignore-fill-prefix nil)  
                 (fill-prefix (progn  
                                (beginning-of-line)  
                                (looking-at fortran-comment-line-start-skip)  
                                (match-string 0))))  
             (let (fill-paragraph-function)  
               (fill-region start end justify))) ; with normal `fill-paragraph'  
           (set-marker start nil)  
           (set-marker end nil))))  
   t)  
1760    
1761  (defun fortran-fill-statement ()  (defun fortran-fill-statement ()
1762    "Fill a fortran statement up to `fill-column'."    "Fill a fortran statement up to `fill-column'."

Legend:
Removed from v.1.99  
changed lines
  Added in v.1.100

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26