aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2000-03-23 02:39:58 +0000
committerStefan Monnier2000-03-23 02:39:58 +0000
commit68049bfad7e77372e824e91832864cabc1111df0 (patch)
tree1ac15cd17383cbf72ce36af7b0d87ffbaeff7761
parentff4df011b908a175a702eedf12e07805cf08c5f5 (diff)
downloademacs-68049bfad7e77372e824e91832864cabc1111df0.tar.gz
emacs-68049bfad7e77372e824e91832864cabc1111df0.zip
(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.
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/progmodes/make-mode.el22
2 files changed, 14 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 99209b23efe..77b0671a899 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12000-03-22 Stefan Monnier <monnier@cs.yale.edu>
2
3 * progmodes/make-mode.el (makefile-warn-suspicious-lines): clean
4 up the code and the regexp and make sure the cursor is temporarily
5 moved to the suspicious line while querying the user.
6
12000-03-22 Jason Rumney <jasonr@gnu.org> 72000-03-22 Jason Rumney <jasonr@gnu.org>
2 8
3 * w32-fns.el (w32-charset-info-alist): Initialize. 9 * w32-fns.el (w32-charset-info-alist): Initialize.
diff --git a/lisp/progmodes/make-mode.el b/lisp/progmodes/make-mode.el
index c4265252b9a..b2d50413fb4 100644
--- a/lisp/progmodes/make-mode.el
+++ b/lisp/progmodes/make-mode.el
@@ -1344,20 +1344,14 @@ and generates the overview, one line per target name."
1344;;; ------------------------------------------------------------ 1344;;; ------------------------------------------------------------
1345 1345
1346(defun makefile-warn-suspicious-lines () 1346(defun makefile-warn-suspicious-lines ()
1347 (let ((dont-save nil)) 1347 ;; Returning non-nil cancels the save operation
1348 (if (eq major-mode 'makefile-mode) 1348 (if (eq major-mode 'makefile-mode)
1349 (let ((suspicious 1349 (save-excursion
1350 (save-excursion 1350 (goto-char (point-min))
1351 (goto-char (point-min)) 1351 (if (re-search-forward "^\\(\t+$\\| +\t\\)" nil t)
1352 (re-search-forward 1352 (not (y-or-n-p
1353 "\\(^[\t]+$\\)\\|\\(^[ ]+[\t]\\)" (point-max) t)))) 1353 (format "Suspicious line %d. Save anyway "
1354 (if suspicious 1354 (count-lines (point-min) (point)))))))))
1355 (let ((line-nr (count-lines (point-min) suspicious)))
1356 (setq dont-save
1357 (not (y-or-n-p
1358 (format "Suspicious line %d. Save anyway "
1359 line-nr))))))))
1360 dont-save))
1361 1355
1362 1356
1363 1357