: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.
(kill-all-local-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)
(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)))))))))
-
\f
;;; ------------------------------------------------------------