changeset 23463:ac51d834b81e

1998-10-14 Dave Love <fx@gnu.org> * progmodes/fortran.el (fortran-mode-map): Change "Join Continuation Line" to "Join Line". (font-lock-keywords-1): Add "cycle", "exit". 1998-10-14 Emilio Lopes <Emilio.Lopes@Physik.TU-Muenchen.DE> * progmodes/fortran.el (fortran-join-line): Use `delete-indentation' instead of issuing an error message if not on a continuation line. Provide for joining several lines using prefix arg.
author Dave Love <fx@gnu.org>
date Wed, 14 Oct 1998 18:09:05 +0000
parents aaad8461ff34
children 7fb0a3c74e1d
files lisp/progmodes/fortran.el
diffstat 1 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/fortran.el	Wed Oct 14 15:17:11 1998 +0000
+++ b/lisp/progmodes/fortran.el	Wed Oct 14 18:09:05 1998 +0000
@@ -279,7 +279,7 @@
          (regexp-opt '("continue" "format" "end" "enddo" "if" "then"
                        "else" "endif" "elseif" "while" "inquire" "stop"
                        "return" "include" "open" "close" "read" "write"
-                       "format" "print" "select" "case"))))
+                       "format" "print" "select" "case" "cycle" "exit"))))
       (fortran-logicals
        (eval-when-compile
          (regexp-opt '("and" "or" "not" "lt" "le" "eq" "ge" "gt" "ne"
@@ -455,7 +455,7 @@
        ["Momentary 72-column window" fortran-window-create-momentarily t]
        "----"
        ["Break Line at Point" fortran-split-line t]
-       ["Join Continuation Line" fortran-join-line t]
+       ["Join Line" fortran-join-line t]
        ["Fill Statement/Comment" fill-paragraph  t]
        "----"
        ["Add imenu menu"
@@ -829,13 +829,21 @@
 	     (delete-indentation)
 	     t)))
 
-(defun fortran-join-line ()
-  "Join a continuation line to the previous one and re-indent."
-  (interactive)
+(defun fortran-join-line (arg)
+  "Join current line to the previous one and re-indent.
+With a prefix argument, repeat this operation that many times.
+If the prefix argument ARG is negative, join the next -ARG lines.
+Continuation lines are correctly handled."
+  (interactive "*p")
   (save-excursion
-    (beginning-of-line)
-    (if (not (fortran-remove-continuation))
-	(error "Not a continuation line"))
+    (when (> 0 arg)
+      (setq arg (- arg))
+      (forward-line arg))
+    (while (not (zerop arg))
+      (beginning-of-line)
+      (or (fortran-remove-continuation)
+          (delete-indentation))
+      (setq arg (1- arg)))
     (fortran-indent-line)))
 
 (defun fortran-numerical-continuation-char ()