# HG changeset patch # User Richard M. Stallman # Date 1019514946 0 # Node ID 56b4ca0725c1fd7d4c90b74ed8a1e7ad2f3b8913 # Parent 52388a234829e18fcc07e03a97c549a21cabf2d8 (line-move-finish): Find beg and end of line before calling line-move-to-column. Do consider intangible when finding the end. Take more care in analyzing the results of intangibility after line-move-to-column. diff -r 52388a234829 -r 56b4ca0725c1 lisp/simple.el --- a/lisp/simple.el Mon Apr 22 22:35:45 2002 +0000 +++ b/lisp/simple.el Mon Apr 22 22:35:46 2002 +0000 @@ -2638,12 +2638,17 @@ ;; Set REPEAT to t to repeat the whole thing. (setq repeat nil) - ;; Move to the desired column. - (line-move-to-column column) - - (let ((new (point)) + (let (new (line-beg (save-excursion (beginning-of-line) (point))) - (line-end (save-excursion (end-of-line) (point)))) + (line-end + ;; Compute the end of the line + ;; ignoring effectively intangible newlines. + (let ((inhibit-point-motion-hooks nil)) + (save-excursion (end-of-line) (point))))) + + ;; Move to the desired column. + (line-move-to-column column) + (setq new (point)) ;; Process intangibility within a line. ;; Move to the chosen destination position from above, @@ -2656,7 +2661,15 @@ ;; If intangibility moves us to a different (later) place ;; in the same line, use that as the destination. (if (<= (point) line-end) - (setq new (point)))) + (setq new (point)) + ;; If that position is "too late", + ;; try the previous allowable position. + ;; See if it is ok. + (backward-char) + (if (<= (point) line-end) + (setq new (point)) + ;; As a last resort, use the end of the line. + (setq new line-end)))) ;; Now move to the updated destination, processing fields ;; as well as intangibility. @@ -2666,7 +2679,7 @@ (constrain-to-field new opoint nil t 'inhibit-line-move-field-capture))) - ;; If intangibility processing moved us to a different line, + ;; If all this moved us to a different line, ;; retry everything within that new line. (when (or (< (point) line-beg) (> (point) line-end)) ;; Repeat the intangibility and field processing.