From f564644bb24e635429f9fc8990882d3291f69387 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 16 Mar 2008 17:45:11 +0000 Subject: [PATCH] (goto-line): Leave mark at previous position. Doc fix. --- lisp/ChangeLog | 16 ++++++++++++++++ lisp/simple.el | 12 ++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1c4070fc14b..8fdbf297e1e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,19 @@ +2008-03-16 Juri Linkov + + * isearch.el (isearch-edit-string): Use search-ring-yank-pointer + and regexp-search-ring-yank-pointer for the HISTPOS argument of + read-from-minibuffer to provide the correct initial minibuffer + history position in isearch-edit-string when it is called from + isearch-ring-adjust. + + * menu-bar.el (kill-this-buffer): Use menu-bar-non-minibuffer-window-p + to check if the current buffer is the minibuffer, and in this case + call abort-recursive-edit to kill the minibuffer. Doc fix. + (kill-this-buffer-enabled-p): Allow this function to return non-nil + when the current buffer is the minibuffer. + + * simple.el (goto-line): Leave mark at previous position. Doc fix. + 2008-03-16 Tassilo Horn * doc-view.el (doc-view-doc->txt, doc-view-convert-current-doc): diff --git a/lisp/simple.el b/lisp/simple.el index c140e719d58..d7cea7d3194 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -819,10 +819,11 @@ that uses or sets the mark." (defun goto-line (arg &optional buffer) "Goto line ARG, counting from line 1 at beginning of buffer. -Normally, move point in the current buffer. -With just \\[universal-argument] as argument, move point in the most recently -displayed other buffer, and switch to it. When called from Lisp code, -the optional argument BUFFER specifies a buffer to switch to. +Normally, move point in the current buffer, and leave mark at previous +position. With just \\[universal-argument] as argument, move point +in the most recently displayed other buffer, and switch to it. +When called from Lisp code, the optional argument BUFFER specifies +a buffer to switch to. If there's a number in the buffer at point, it is the default for ARG." (interactive @@ -859,6 +860,9 @@ If there's a number in the buffer at point, it is the default for ARG." (let ((window (get-buffer-window buffer))) (if window (select-window window) (switch-to-buffer-other-window buffer)))) + ;; Leave mark at previous position + (or (and transient-mark-mode mark-active) + (push-mark)) ;; Move to the specified line number in that buffer. (save-restriction (widen) -- 2.39.2