changeset 12772:f4b2913b7f58

(fortran-auto-fill-mode, fortran-do-auto-fill, fortran-fill): Invoke auto filling only when past fill-column.
author Richard M. Stallman <rms@gnu.org>
date Sat, 05 Aug 1995 01:02:10 +0000
parents 6f07c79d9a05
children 3fb29deb1b1b
files lisp/progmodes/fortran.el
diffstat 1 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/fortran.el	Sat Aug 05 00:57:17 1995 +0000
+++ b/lisp/progmodes/fortran.el	Sat Aug 05 01:02:10 1995 +0000
@@ -4,7 +4,7 @@
 
 ;; Author: Michael D. Prange <prange@erl.mit.edu>
 ;; Maintainer: bug-fortran-mode@erl.mit.edu
-;; Version 1.30.5.1 (Sept 16, 1994)
+;; Version 1.30.6 (July 27, 1995)
 ;; Keywords: languages
 
 ;; This file is part of GNU Emacs.
@@ -46,7 +46,7 @@
 
 ;;; Bugs to bug-fortran-mode@erl.mit.edu
 
-(defconst fortran-mode-version "version 1.30.5.1")
+(defconst fortran-mode-version "version 1.30.6")
 
 ;;; Code:
 
@@ -160,7 +160,7 @@
  style.")
 
 (defvar fortran-break-before-delimiters t
-  "*Non-nil causes `fortran-do-auto-fill' to break lines before delimiters.")
+  "*Non-nil causes `fortran-fill' to break lines before delimiters.")
 
 (if fortran-mode-syntax-table
     ()
@@ -442,7 +442,7 @@
     Non-nil causes line number digits to be moved to the correct column 
     as typed.  (default t)
  fortran-break-before-delimiters
-    Non-nil causes `fortran-do-auto-fill' breaks lines before delimiters.
+    Non-nil causes `fortran-fill' breaks lines before delimiters.
     (default t)
  fortran-startup-message
     Set to nil to inhibit message first time Fortran mode is used.
@@ -1034,7 +1034,7 @@
 	     (> (save-excursion (end-of-line) (current-column)) fill-column))
 	(save-excursion
 	  (end-of-line)
-	  (fortran-do-auto-fill)))
+	  (fortran-fill)))
     (if fortran-blink-matching-if
 	(progn
 	  (fortran-blink-matching-if)
@@ -1408,11 +1408,15 @@
 	       (if (if (null arg)
 		       (not auto-fill-function)
 		     (> (prefix-numeric-value arg) 0))
-		   'fortran-indent-line
+		   'fortran-do-auto-fill
 		 nil))
     (force-mode-line-update)))
 
 (defun fortran-do-auto-fill ()
+  (if (> (current-column) fill-column)
+      (fortran-indent-line)))
+
+(defun fortran-fill ()
   (interactive)
   (let* ((opoint (point))
 	 (bol (save-excursion (beginning-of-line) (point)))
@@ -1510,7 +1514,7 @@
 	  (end-of-line)
 	  (delete-region (point) (match-end 0))
 	  (delete-horizontal-space)
-	  (fortran-do-auto-fill))
+	  (fortran-fill))
       (fortran-split-line))
     (if comment-string
 	(save-excursion