comparison lisp/progmodes/make-mode.el @ 104541:f54e4dfe90e2

(makefile-browser-toggle): Use forward-line rather than goto-line. (makefile-browser-insert-selection): Use goto-char rather than goto-line.
author Glenn Morris <rgm@gnu.org>
date Sat, 22 Aug 2009 19:20:27 +0000
parents a9dc0e7c3f2b
children afa0e028ba97
comparison
equal deleted inserted replaced
104540:fc0ed6b4a2b2 104541:f54e4dfe90e2
1484 "Toggle the selection state of the browser item at the cursor position." 1484 "Toggle the selection state of the browser item at the cursor position."
1485 (interactive) 1485 (interactive)
1486 (let ((this-line (count-lines (point-min) (point)))) 1486 (let ((this-line (count-lines (point-min) (point))))
1487 (setq this-line (max 1 this-line)) 1487 (setq this-line (max 1 this-line))
1488 (makefile-browser-toggle-state-for-line this-line) 1488 (makefile-browser-toggle-state-for-line this-line)
1489 (goto-line this-line) 1489 (goto-char (point-min))
1490 (forward-line (1- this-line))
1490 (let ((inhibit-read-only t)) 1491 (let ((inhibit-read-only t))
1491 (beginning-of-line) 1492 (beginning-of-line) ; redundant?
1492 (if (makefile-browser-on-macro-line-p) 1493 (if (makefile-browser-on-macro-line-p)
1493 (let ((macro-name (makefile-browser-this-line-macro-name))) 1494 (let ((macro-name (makefile-browser-this-line-macro-name)))
1494 (delete-region (point) (progn (end-of-line) (point))) 1495 (delete-region (point) (progn (end-of-line) (point)))
1495 (insert 1496 (insert
1496 (makefile-browser-format-macro-line 1497 (makefile-browser-format-macro-line
1526 (defun makefile-browser-insert-selection () 1527 (defun makefile-browser-insert-selection ()
1527 "Insert all selected targets and/or macros in the makefile buffer. 1528 "Insert all selected targets and/or macros in the makefile buffer.
1528 Insertion takes place at point." 1529 Insertion takes place at point."
1529 (interactive) 1530 (interactive)
1530 (save-excursion 1531 (save-excursion
1531 (goto-line 1) 1532 (goto-char (point-min))
1532 (let ((current-line 1)) 1533 (let ((current-line 1))
1533 (while (not (eobp)) 1534 (while (not (eobp))
1534 (if (makefile-browser-get-state-for-line current-line) 1535 (if (makefile-browser-get-state-for-line current-line)
1535 (makefile-browser-send-this-line-item)) 1536 (makefile-browser-send-this-line-item))
1536 (forward-line 1) 1537 (forward-line 1)