Commit 68049bfa authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(makefile-warn-suspicious-lines): clean

up the code and the regexp and make sure the cursor is temporarily
moved to the suspicious line while querying the user.
parent ff4df011
2000-03-22 Stefan Monnier <monnier@cs.yale.edu>
* progmodes/make-mode.el (makefile-warn-suspicious-lines): clean
up the code and the regexp and make sure the cursor is temporarily
moved to the suspicious line while querying the user.
2000-03-22 Jason Rumney <jasonr@gnu.org>
* w32-fns.el (w32-charset-info-alist): Initialize.
......
......@@ -1344,20 +1344,14 @@ and generates the overview, one line per target name."
;;; ------------------------------------------------------------
(defun makefile-warn-suspicious-lines ()
(let ((dont-save nil))
(if (eq major-mode 'makefile-mode)
(let ((suspicious
(save-excursion
(goto-char (point-min))
(re-search-forward
"\\(^[\t]+$\\)\\|\\(^[ ]+[\t]\\)" (point-max) t))))
(if suspicious
(let ((line-nr (count-lines (point-min) suspicious)))
(setq dont-save
(not (y-or-n-p
(format "Suspicious line %d. Save anyway "
line-nr))))))))
dont-save))
;; Returning non-nil cancels the save operation
(if (eq major-mode 'makefile-mode)
(save-excursion
(goto-char (point-min))
(if (re-search-forward "^\\(\t+$\\| +\t\\)" nil t)
(not (y-or-n-p
(format "Suspicious line %d. Save anyway "
(count-lines (point-min) (point)))))))))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment