;; the end of the line when it fails to go to the next line.
(goto-char old-point)
(next-history-element arg)
+ ;; Reset `temporary-goal-column' because a correct value is not
+ ;; calculated when `next-line' above fails by bumping against
+ ;; the bottom of the minibuffer (bug#22544).
+ (setq temporary-goal-column 0)
;; Restore the original goal column on the last line
;; of possibly multi-line input.
(goto-char (point-max))
;; the beginning of the line when it fails to go to the previous line.
(goto-char old-point)
(previous-history-element arg)
+ ;; Reset `temporary-goal-column' because a correct value is not
+ ;; calculated when `previous-line' above fails by bumping against
+ ;; the top of the minibuffer (bug#22544).
+ (setq temporary-goal-column 0)
;; Restore the original goal column on the first line
;; of possibly multi-line input.
(goto-char (minibuffer-prompt-end))
(if (= (line-number-at-pos) 1)
(move-to-column (+ old-column (1- (minibuffer-prompt-end))))
(move-to-column old-column))
- (goto-char (line-end-position)))))))
+ ;; Put the cursor at the end of the visual line instead of the
+ ;; logical line, so the next `previous-line-or-history-element'
+ ;; would move to the previous history element, not to a possible upper
+ ;; visual line from the end of logical line in `line-move-visual' mode.
+ (end-of-visual-line)
+ ;; Since `end-of-visual-line' puts the cursor at the beginning
+ ;; of the next visual line, move it one char back to the end
+ ;; of the first visual line (bug#22544).
+ (unless (eolp) (backward-char 1)))))))
(defun next-complete-history-element (n)
"Get next history element which completes the minibuffer before the point.
(defun process-menu-delete-process ()
"Kill process at point in a `list-processes' buffer."
(interactive)
- (delete-process (tabulated-list-get-id))
- (revert-buffer))
+ (let ((pos (point)))
+ (delete-process (tabulated-list-get-id))
+ (revert-buffer)
+ (goto-char (min pos (point-max)))
+ (if (eobp)
+ (forward-line -1)
+ (beginning-of-line))))
(defun list-processes--refresh ()
"Recompute the list of processes for the Process List buffer.
(defun backward-word (&optional arg)
"Move backward until encountering the beginning of a word.
With argument ARG, do this that many times.
-If ARG is omitted or nil, move point backward one word."
+If ARG is omitted or nil, move point backward one word.
+
+The word boundaries are normally determined by the buffer's syntax
+table, but `find-word-boundary-function-table', such as set up
+by `subword-mode', can change that. If a Lisp program needs to
+move by words determined strictly by the syntax table, it should
+use `backward-word-strictly' instead."
(interactive "^p")
(forward-word (- (or arg 1))))