aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-10-26 22:49:12 +0000
committerRichard M. Stallman <[email protected]>2002-10-26 22:49:12 +0000
commita11e28000a4dcdbff747b8b7a04f4560d765b805 (patch)
tree05f25275ce209ae938581ba00bec0ded1d2877bf
parent90a29c8337092fd667f254405064734214b83c00 (diff)
(makefile-cleanup-continuations): Default for variable is nil.
(makefile-warn-continuations): New function. (makefile-mode): Put it on write-file-functions.
-rw-r--r--lisp/progmodes/make-mode.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index ad635c0c3e..1a53455f53 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -192,7 +192,7 @@ Otherwise filenames are omitted."
:type 'boolean
:group 'makefile)
-(defcustom makefile-cleanup-continuations t
+(defcustom makefile-cleanup-continuations nil
"*If non-nil, automatically clean up continuation lines when saving.
A line is cleaned up by removing all whitespace following a trailing
backslash. This is done silently.
@@ -568,6 +568,8 @@ Makefile mode can be configured by modifying the following variables:
(add-hook 'write-file-functions
'makefile-warn-suspicious-lines nil t)
(add-hook 'write-file-functions
+ 'makefile-warn-continuations nil t)
+ (add-hook 'write-file-functions
'makefile-cleanup-continuations nil t)
(make-local-variable 'makefile-target-table)
(make-local-variable 'makefile-macro-table)
@@ -1384,9 +1386,17 @@ and generates the overview, one line per target name."
(goto-char (point-min))
(if (re-search-forward "^\\(\t+$\\| +\t\\)" nil t)
(not (y-or-n-p
- (format "Suspicious line %d. Save anyway "
+ (format "Suspicious line %d. Save anyway? "
+ (count-lines (point-min) (point)))))))))
+
+(defun makefile-warn-continuations ()
+ (if (eq major-mode 'makefile-mode)
+ (save-excursion
+ (goto-char (point-min))
+ (if (re-search-forward "\\\\[ \t]+$")
+ (not (y-or-n-p
+ (format "Suspicious continuation in line %d. Save anyway? "
(count-lines (point-min) (point)))))))))
-
;;; ------------------------------------------------------------