Commit f564644b authored by Juri Linkov's avatar Juri Linkov
Browse files

(goto-line): Leave mark at previous position. Doc fix.

parent a86b330f
2008-03-16 Juri Linkov <juri@jurta.org>
* 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 <tassilo@member.fsf.org> 2008-03-16 Tassilo Horn <tassilo@member.fsf.org>
   
* doc-view.el (doc-view-doc->txt, doc-view-convert-current-doc): * doc-view.el (doc-view-doc->txt, doc-view-convert-current-doc):
......
...@@ -819,10 +819,11 @@ that uses or sets the mark." ...@@ -819,10 +819,11 @@ that uses or sets the mark."
(defun goto-line (arg &optional buffer) (defun goto-line (arg &optional buffer)
"Goto line ARG, counting from line 1 at beginning of buffer. "Goto line ARG, counting from line 1 at beginning of buffer.
Normally, move point in the current buffer. Normally, move point in the current buffer, and leave mark at previous
With just \\[universal-argument] as argument, move point in the most recently position. With just \\[universal-argument] as argument, move point
displayed other buffer, and switch to it. When called from Lisp code, in the most recently displayed other buffer, and switch to it.
the optional argument BUFFER specifies a buffer to switch to. 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." If there's a number in the buffer at point, it is the default for ARG."
(interactive (interactive
...@@ -859,6 +860,9 @@ If there's a number in the buffer at point, it is the default for ARG." ...@@ -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))) (let ((window (get-buffer-window buffer)))
(if window (select-window window) (if window (select-window window)
(switch-to-buffer-other-window buffer)))) (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. ;; Move to the specified line number in that buffer.
(save-restriction (save-restriction
(widen) (widen)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment