diff options
| author | Dave Love | 1999-06-01 15:54:31 +0000 |
|---|---|---|
| committer | Dave Love | 1999-06-01 15:54:31 +0000 |
| commit | e04196d361f47583ccd4a28b2bac80562feff447 (patch) | |
| tree | 977c8ce4959b3950ae22ab495b79fe192ee6db19 | |
| parent | becd59439f2195710e7a62f4b13e54291aab1ff3 (diff) | |
| download | emacs-e04196d361f47583ccd4a28b2bac80562feff447.tar.gz emacs-e04196d361f47583ccd4a28b2bac80562feff447.zip | |
Add :link to defgroup.
(fortran-blink-matching-if): Match ELSE statements too.
(fortran-fill-statement, fortran-fill): Bind auto-fill-function so
that filling is always done.
| -rw-r--r-- | lisp/progmodes/fortran.el | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/lisp/progmodes/fortran.el b/lisp/progmodes/fortran.el index af6aee0f64b..453cb250c71 100644 --- a/lisp/progmodes/fortran.el +++ b/lisp/progmodes/fortran.el | |||
| @@ -58,6 +58,7 @@ | |||
| 58 | 58 | ||
| 59 | (defgroup fortran nil | 59 | (defgroup fortran nil |
| 60 | "Fortran mode for Emacs" | 60 | "Fortran mode for Emacs" |
| 61 | :link '(custom-manual "(emacs)Fortran") | ||
| 61 | :group 'languages) | 62 | :group 'languages) |
| 62 | 63 | ||
| 63 | (defgroup fortran-indent nil | 64 | (defgroup fortran-indent nil |
| @@ -1059,7 +1060,7 @@ Doesn't push a mark." | |||
| 1059 | message) | 1060 | message) |
| 1060 | (if (save-excursion (beginning-of-line) | 1061 | (if (save-excursion (beginning-of-line) |
| 1061 | (skip-chars-forward " \t0-9") | 1062 | (skip-chars-forward " \t0-9") |
| 1062 | (looking-at "end[ \t]*if\\b")) | 1063 | (looking-at "e\\(nd[ \t]*if\\|lse\\([ \t]*if\\)?\\)\\b")) |
| 1063 | (progn | 1064 | (progn |
| 1064 | (if (not (setq matching-if (fortran-beginning-if))) | 1065 | (if (not (setq matching-if (fortran-beginning-if))) |
| 1065 | (setq message "No matching if.") | 1066 | (setq message "No matching if.") |
| @@ -1694,7 +1695,8 @@ automatically breaks the line at a previous space." | |||
| 1694 | 1695 | ||
| 1695 | (defun fortran-fill () | 1696 | (defun fortran-fill () |
| 1696 | (interactive) | 1697 | (interactive) |
| 1697 | (let* ((opoint (point)) | 1698 | (let* ((auto-fill-function #'fortran-do-auto-fill) |
| 1699 | (opoint (point)) | ||
| 1698 | (bol (save-excursion (beginning-of-line) (point))) | 1700 | (bol (save-excursion (beginning-of-line) (point))) |
| 1699 | (eol (save-excursion (end-of-line) (point))) | 1701 | (eol (save-excursion (end-of-line) (point))) |
| 1700 | (bos (min eol (+ bol (fortran-current-line-indentation)))) | 1702 | (bos (min eol (+ bol (fortran-current-line-indentation)))) |
| @@ -1867,25 +1869,26 @@ Intended as the value of `fill-paragraph-function'." | |||
| 1867 | (defun fortran-fill-statement () | 1869 | (defun fortran-fill-statement () |
| 1868 | "Fill a fortran statement up to `fill-column'." | 1870 | "Fill a fortran statement up to `fill-column'." |
| 1869 | (interactive) | 1871 | (interactive) |
| 1870 | (if (not (save-excursion | 1872 | (let ((auto-fill-function #'fortran-do-auto-fill)) |
| 1871 | (beginning-of-line) | 1873 | (if (not (save-excursion |
| 1872 | (or (looking-at "[ \t]*$") | 1874 | (beginning-of-line) |
| 1873 | (looking-at comment-line-start-skip) | 1875 | (or (looking-at "[ \t]*$") |
| 1874 | (and comment-start-skip | 1876 | (looking-at comment-line-start-skip) |
| 1875 | (looking-at (concat "[ \t]*" comment-start-skip)))))) | 1877 | (and comment-start-skip |
| 1876 | (save-excursion | 1878 | (looking-at (concat "[ \t]*" comment-start-skip)))))) |
| 1877 | ;; Find beginning of statement. | 1879 | (save-excursion |
| 1878 | (fortran-next-statement) | 1880 | ;; Find beginning of statement. |
| 1879 | (fortran-previous-statement) | 1881 | (fortran-next-statement) |
| 1880 | ;; Re-indent initially. | 1882 | (fortran-previous-statement) |
| 1881 | (fortran-indent-line) | 1883 | ;; Re-indent initially. |
| 1882 | ;; Replace newline plus continuation field plus indentation with | 1884 | (fortran-indent-line) |
| 1883 | ;; single space. | 1885 | ;; Replace newline plus continuation field plus indentation with |
| 1884 | (while (progn | 1886 | ;; single space. |
| 1885 | (forward-line) | 1887 | (while (progn |
| 1886 | (fortran-remove-continuation))) | 1888 | (forward-line) |
| 1887 | (fortran-previous-statement))) | 1889 | (fortran-remove-continuation))) |
| 1888 | (fortran-indent-line)) | 1890 | (fortran-previous-statement))) |
| 1891 | (fortran-indent-line))) | ||
| 1889 | 1892 | ||
| 1890 | (provide 'fortran) | 1893 | (provide 'fortran) |
| 1891 | 1894 | ||