Fix infinite loop in vc-dir-mark-unmark
* lisp/vc/vc-dir.el (vc-dir-mark-unmark): Prevent from getting stuck on the same line in an infinite loop. (Bug#24017)
This commit is contained in:
parent
5f17472574
commit
9685774e38
1 changed files with 6 additions and 2 deletions
|
@ -554,11 +554,15 @@ If a prefix argument is given, move by that many lines."
|
|||
|
||||
(defun vc-dir-mark-unmark (mark-unmark-function)
|
||||
(if (use-region-p)
|
||||
(let (;; (firstl (line-number-at-pos (region-beginning)))
|
||||
(let ((processed-line nil)
|
||||
(lastl (line-number-at-pos (region-end))))
|
||||
(save-excursion
|
||||
(goto-char (region-beginning))
|
||||
(while (<= (line-number-at-pos) lastl)
|
||||
(while (and (<= (line-number-at-pos) lastl)
|
||||
;; We make sure to not get stuck processing the
|
||||
;; same line in an infinite loop.
|
||||
(not (eq processed-line (line-number-at-pos))))
|
||||
(setq processed-line (line-number-at-pos))
|
||||
(condition-case nil
|
||||
(funcall mark-unmark-function)
|
||||
;; `vc-dir-mark-file' signals an error if we try marking
|
||||
|
|
Loading…
Add table
Reference in a new issue