# HG changeset patch # User Richard M. Stallman # Date 1035672552 0 # Node ID 1117d26eaae0760037f717a3e4b4d3cc54ad51a6 # Parent 566c232970782c820ff66224ea2129f095d07cf2 (makefile-cleanup-continuations): Default for variable is nil. (makefile-warn-continuations): New function. (makefile-mode): Put it on write-file-functions. diff -r 566c23297078 -r 1117d26eaae0 lisp/progmodes/make-mode.el --- a/lisp/progmodes/make-mode.el Sat Oct 26 22:43:02 2002 +0000 +++ b/lisp/progmodes/make-mode.el Sat Oct 26 22:49:12 2002 +0000 @@ -192,7 +192,7 @@ :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 @@ (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 @@ (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))))))))) ;;; ------------------------------------------------------------