aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2016-02-10 02:31:40 +0200
committerJuri Linkov2016-02-10 02:31:40 +0200
commitee909aa2bb3c30eb3b842426088a32a4504a0d0d (patch)
treec610cc162bc5acbf57b0d390d9dee8349c32ff58
parent0a289d38b5b6aed734040314621b3f84200140df (diff)
downloademacs-ee909aa2bb3c30eb3b842426088a32a4504a0d0d.tar.gz
emacs-ee909aa2bb3c30eb3b842426088a32a4504a0d0d.zip
* lisp/simple.el (next-line-or-history-element): Reset temporary-goal-column.
(previous-line-or-history-element): Reset temporary-goal-column. Use end-of-visual-line instead of line-end-position. (Bug#22544)
-rw-r--r--lisp/simple.el18
1 files changed, 17 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index cfdea742084..e39c864fc04 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2041,6 +2041,10 @@ next element of the minibuffer history in the minibuffer."
2041 ;; the end of the line when it fails to go to the next line. 2041 ;; the end of the line when it fails to go to the next line.
2042 (goto-char old-point) 2042 (goto-char old-point)
2043 (next-history-element arg) 2043 (next-history-element arg)
2044 ;; Reset `temporary-goal-column' because a correct value is not
2045 ;; calculated when `next-line' above fails by bumping against
2046 ;; the bottom of the minibuffer (bug#22544).
2047 (setq temporary-goal-column 0)
2044 ;; Restore the original goal column on the last line 2048 ;; Restore the original goal column on the last line
2045 ;; of possibly multi-line input. 2049 ;; of possibly multi-line input.
2046 (goto-char (point-max)) 2050 (goto-char (point-max))
@@ -2071,6 +2075,10 @@ previous element of the minibuffer history in the minibuffer."
2071 ;; the beginning of the line when it fails to go to the previous line. 2075 ;; the beginning of the line when it fails to go to the previous line.
2072 (goto-char old-point) 2076 (goto-char old-point)
2073 (previous-history-element arg) 2077 (previous-history-element arg)
2078 ;; Reset `temporary-goal-column' because a correct value is not
2079 ;; calculated when `previous-line' above fails by bumping against
2080 ;; the top of the minibuffer (bug#22544).
2081 (setq temporary-goal-column 0)
2074 ;; Restore the original goal column on the first line 2082 ;; Restore the original goal column on the first line
2075 ;; of possibly multi-line input. 2083 ;; of possibly multi-line input.
2076 (goto-char (minibuffer-prompt-end)) 2084 (goto-char (minibuffer-prompt-end))
@@ -2078,7 +2086,15 @@ previous element of the minibuffer history in the minibuffer."
2078 (if (= (line-number-at-pos) 1) 2086 (if (= (line-number-at-pos) 1)
2079 (move-to-column (+ old-column (1- (minibuffer-prompt-end)))) 2087 (move-to-column (+ old-column (1- (minibuffer-prompt-end))))
2080 (move-to-column old-column)) 2088 (move-to-column old-column))
2081 (goto-char (line-end-position))))))) 2089 ;; Put the cursor at the end of the visual line instead of the
2090 ;; logical line, so the next `previous-line-or-history-element'
2091 ;; would move to the previous history element, not to a possible upper
2092 ;; visual line from the end of logical line in `line-move-visual' mode.
2093 (end-of-visual-line)
2094 ;; Since `end-of-visual-line' puts the cursor at the beginning
2095 ;; of the next visual line, move it one char back to the end
2096 ;; of the first visual line (bug#22544).
2097 (unless (eolp) (backward-char 1)))))))
2082 2098
2083(defun next-complete-history-element (n) 2099(defun next-complete-history-element (n)
2084 "Get next history element which completes the minibuffer before the point. 2100 "Get next history element which completes the minibuffer before the point.