(defun line-move-1 (arg &optional noerror _to-end)
;; Don't run any point-motion hooks, and disregard intangibility,
;; for intermediate positions.
- (let ((inhibit-point-motion-hooks t)
+ (let ((outer-ipmh inhibit-point-motion-hooks)
+ (inhibit-point-motion-hooks t)
(opoint (point))
(orig-arg arg))
(if (consp temporary-goal-column)
;; point-left-hooks.
(let* ((npoint (prog1 (line-end-position)
(goto-char opoint)))
- (inhibit-point-motion-hooks nil))
+ (inhibit-point-motion-hooks outer-ipmh))
(goto-char npoint)))
((< arg 0)
;; If we did not move up as far as desired,
;; at least go to beginning of line.
(let* ((npoint (prog1 (line-beginning-position)
(goto-char opoint)))
- (inhibit-point-motion-hooks nil))
+ (inhibit-point-motion-hooks outer-ipmh))
(goto-char npoint)))
(t
(line-move-finish (or goal-column temporary-goal-column)
- opoint (> orig-arg 0)))))))
+ opoint (> orig-arg 0) (not outer-ipmh)))))))
-(defun line-move-finish (column opoint forward)
+(defun line-move-finish (column opoint forward &optional not-ipmh)
(let ((repeat t))
(while repeat
;; Set REPEAT to t to repeat the whole thing.
;; unnecessarily. Note that we move *forward* past intangible
;; text when the initial and final points are the same.
(goto-char new)
- (let ((inhibit-point-motion-hooks nil))
+ (let ((inhibit-point-motion-hooks (not not-ipmh)))
(goto-char new)
;; If intangibility moves us to a different (later) place
;; Now move to the updated destination, processing fields
;; as well as intangibility.
(goto-char opoint)
- (let ((inhibit-point-motion-hooks nil))
+ (let ((inhibit-point-motion-hooks (not not-ipmh)))
(goto-char
;; Ignore field boundaries if the initial and final
;; positions have the same `field' property, even if the