aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2002-04-22 22:35:46 +0000
committerRichard M. Stallman <[email protected]>2002-04-22 22:35:46 +0000
commit1f980920393ec6f8cba0b5c060a14a41cb6ae33d (patch)
tree4247b74ba7274ee33928ab4afc971f2dd1d25c10
parent477feba7985e30a1d54be7ac61ec26f683a31448 (diff)
(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.
-rw-r--r--lisp/simple.el27
1 files changed, 20 insertions, 7 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index eae8ad74b0..1b5e866645 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2638,12 +2638,17 @@ Outline mode sets this."
;; 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 @@ Outline mode sets this."
;; 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 @@ Outline mode sets this."
(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.