mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-12-04 08:47:11 +00:00
(line-move): Fix previous change: if we get an error,
move to where the error happened, don't go back to starting point.
This commit is contained in:
parent
f32cdadd92
commit
2596511d21
@ -1606,11 +1606,13 @@ Outline mode sets this.")
|
||||
;; This is the guts of next-line and previous-line.
|
||||
;; Arg says how many lines to move.
|
||||
(defun line-move (arg)
|
||||
(let (new)
|
||||
;; Don't run any point-motion hooks, and disregard intangibility,
|
||||
;; for intermediate positions.
|
||||
(let ((inhibit-point-motion-hooks t))
|
||||
(save-excursion
|
||||
(let ((inhibit-point-motion-hooks t)
|
||||
(opoint (point))
|
||||
new)
|
||||
(unwind-protect
|
||||
(progn
|
||||
(if (not (or (eq last-command 'next-line)
|
||||
(eq last-command 'previous-line)))
|
||||
(setq temporary-goal-column
|
||||
@ -1669,12 +1671,16 @@ Outline mode sets this.")
|
||||
(goto-char (previous-single-property-change (point) 'invisible))
|
||||
(goto-char (previous-overlay-change (point)))))
|
||||
(setq arg (1+ arg))))
|
||||
(move-to-column (or goal-column temporary-goal-column))
|
||||
(setq new (point))))
|
||||
;; Run any point-motion hooks, deal with intangible text, etc.,
|
||||
;; once and for all, for the entire motion we did.
|
||||
(goto-char new)
|
||||
nil))
|
||||
(move-to-column (or goal-column temporary-goal-column)))
|
||||
;; Remember where we moved to, go back home,
|
||||
;; then do the motion over again
|
||||
;; in just one step, with intangibility and point-motion hooks
|
||||
;; enabled this time.
|
||||
(setq new (point))
|
||||
(goto-char opoint)
|
||||
(setq inhibit-point-motion-hooks nil)
|
||||
(goto-char new)))
|
||||
nil)
|
||||
|
||||
;;; Many people have said they rarely use this feature, and often type
|
||||
;;; it by accident. Maybe it shouldn't even be on a key.
|
||||
|
Loading…
Reference in New Issue
Block a user