From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.devel Subject: Re: Patch: enhanced mark navigation commands Date: Sun, 09 Mar 2008 23:55:05 +0200 Organization: JURTA Message-ID: <8763vv7lju.fsf@jurta.org> References: <55f7df060803042112w380b5170qe964002c6c06ab01@mail.gmail.com> <200803050641.m256fnvm009784@sallyv1.ics.uci.edu> <87y78woewc.fsf@jurta.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205100966 17132 80.91.229.12 (9 Mar 2008 22:16:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Mar 2008 22:16:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Mar 09 23:16:34 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JYToY-0000kv-HH for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 23:16:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYTo0-0002cm-Bo for ged-emacs-devel@m.gmane.org; Sun, 09 Mar 2008 18:15:44 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JYTnL-0002BF-FZ for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:15:03 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JYTnJ-00029C-JS for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:15:02 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JYTnJ-00028w-B5 for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:15:01 -0400 Original-Received: from relay03.kiev.sovam.com ([62.64.120.201]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JYTnJ-0008Fm-84 for emacs-devel@gnu.org; Sun, 09 Mar 2008 18:15:01 -0400 Original-Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.67) (envelope-from ) id 1JYTn8-000GcX-Hl for emacs-devel@gnu.org; Mon, 10 Mar 2008 00:14:58 +0200 In-Reply-To: <87y78woewc.fsf@jurta.org> (Juri Linkov's message of "Thu, 06 Mar 2008 02:57:23 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (x86_64-unknown-linux-gnu) X-Scanner-Signature: 8d26fb09d298f8c1cb325fc86345eca8 X-DrWeb-checked: yes X-SpamTest-Envelope-From: juri@jurta.org X-SpamTest-Group-ID: 00000000 X-SpamTest-Header: Not Detected X-SpamTest-Info: Profiles 2374 [Mar 9 2008] X-SpamTest-Info: helo_type=3 X-SpamTest-Info: {HEADERS: header Content-Type found without required header Content-Transfer-Encoding} X-SpamTest-Method: none X-SpamTest-Rate: 11 X-SpamTest-Status: Not detected X-SpamTest-Status-Extended: not_detected X-SpamTest-Version: SMTP-Filter Version 3.0.0 [0255], KAS30/Release X-detected-kernel: by monty-python.gnu.org: FreeBSD 6.x (1) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:91930 Archived-At: > BTW, in Emacs `goto-line' doesn't push the mark to the mark ring. > I think it should since often it is used to for long distance > navigation. The following patch fixes this: Index: lisp/simple.el =================================================================== RCS file: /sources/emacs/emacs/lisp/simple.el,v retrieving revision 1.904 diff -c -r1.904 simple.el *** lisp/simple.el 3 Mar 2008 02:16:00 -0000 1.904 --- lisp/simple.el 9 Mar 2008 21:54:38 -0000 *************** *** 820,829 **** (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. If there's a number in the buffer at point, it is the default for ARG." (interactive --- 820,830 ---- (defun goto-line (arg &optional buffer) "Goto line ARG, counting from line 1 at beginning of buffer. ! 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 *************** *** 860,865 **** --- 861,869 ---- (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) -- Juri Linkov http://www.jurta.org/emacs/