From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Emacs navigation mode Date: Mon, 2 Apr 2012 16:59:18 -0700 Message-ID: <53257D223EF948C2A8C83ADBDB4CE62D@us.oracle.com> References: <33545005.post@talk.nabble.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1333411177 26609 80.91.229.3 (2 Apr 2012 23:59:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Apr 2012 23:59:37 +0000 (UTC) To: "'Earendil'" , Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 03 01:59:36 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SEr9r-0002aw-Qu for geh-help-gnu-emacs@m.gmane.org; Tue, 03 Apr 2012 01:59:36 +0200 Original-Received: from localhost ([::1]:58366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEr9r-0004Sy-Ad for geh-help-gnu-emacs@m.gmane.org; Mon, 02 Apr 2012 19:59:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:52593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEr9l-0004St-GY for Help-gnu-emacs@gnu.org; Mon, 02 Apr 2012 19:59:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SEr9j-0007kU-CG for Help-gnu-emacs@gnu.org; Mon, 02 Apr 2012 19:59:29 -0400 Original-Received: from acsinet15.oracle.com ([141.146.126.227]:30131) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SEr9j-0007kP-5a for Help-gnu-emacs@gnu.org; Mon, 02 Apr 2012 19:59:27 -0400 Original-Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by acsinet15.oracle.com (Sentrion-MTA-4.2.2/Sentrion-MTA-4.2.2) with ESMTP id q32NxMK4005237 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 2 Apr 2012 23:59:23 GMT Original-Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id q32NxLxT020512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 2 Apr 2012 23:59:21 GMT Original-Received: from abhmt105.oracle.com (abhmt105.oracle.com [141.146.116.57]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id q32NxLx5002758; Mon, 2 Apr 2012 18:59:21 -0500 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 02 Apr 2012 16:59:20 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <33545005.post@talk.nabble.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 thread-index: Ac0RA1MT3JNTStvQTmWDAV0VSKITCQABspow X-Source-IP: ucsinet22.oracle.com [156.151.31.94] X-CT-RefId: str=0001.0A090201.4F7A3D5B.0043,ss=1,re=0.000,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Received-From: 141.146.126.227 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:84273 Archived-At: > automatically remembers positions in buffers you were > watching long enough and lets you easily jump between them > (in linear style, not Emacs-undo-style). I guess you mean that if Emacs is idle for a given amount of time then the position of the cursor (or perhaps its current line) is automatically remembered on a list, and you can navigate to positions on the list. 1. Without the automatic remembering part there are a number of possibilities, including bookmarking and setting markers. IOW, some explicit user action sets a bookmark or sets a marker. See the Emacs Wiki for different possibilities: http://emacswiki.org/emacs/BookMarks http://emacswiki.org/emacs/MarkCommand 2. For the automatic-remembering part, you can put the bookmark-setting action on an idle timer. IOW, have Emacs automatically set a bookmark or a marker whenever Emacs is idle for a given delay. For bookmarks, if you use Bookmark+ then you can use persistent or temporary bookmarks, including with automatic naming if you like (with the position in the name). You can have them show up visually (be highlighted) or not. You can cycle among any set of bookmarks. See below for an example. With Bookmark+ you can easily navigate among bookmarks: cycling, direct access, access using completion. With Icicles you can do the same with Emacs markers (local or global). With both libraries, navigating among bookmarks is even easier. http://emacswiki.org/emacs/MarkCommands#IciclesGoToMarker (navigate/cycle among markers) http://www.emacswiki.org/cgi-bin/wiki/BookmarkPlus#toc47 (bookmark navigation lists & cycling) A quick example thrown together to show one way of doing automatic idle bookmarking with Bookmark+ (http://emacswiki.org/emacs/BookmarkPlus): 1. (Optional) To make autonamed bookmarks always be temporary (not saved), customize option `bmkp-autotemp-bookmark-predicates' to include `bmkp-autonamed-bookmark-p'. To test, you can just do this: (setq bmkp-autotemp-bookmark-predicates '(bmkp-autonamed-bookmark-p)) 2. (Optional) To highlight autonamed bookmarks when they are set, customize option `bmkp-auto-light-when-set' to `autonamed-bookmark'. To test, you can just do this: (setq bmkp-auto-light-when-set 'autonamed-bookmark) 3. Define the number of idle seconds before setting a bookmark: (defcustom auto-idle-bookmark-mode-delay 30 "Secs before automatically setting a bookmark." :type 'integer :group 'bookmark-plus) 4. Define an idle timer: (defvar auto-idle-bookmark-mode-timer (progn (when (timerp 'auto-idle-bookmark-mode-timer) (cancel-timer auto-idle-bookmark-mode-timer)) (prog1 (run-with-idle-timer auto-idle-bookmark-mode-delay t #'bmkp-set-autonamed-bookmark-at-line) (when (timerp 'auto-idle-bookmark-mode-timer) (cancel-timer auto-idle-bookmark-mode-timer)))) "Timer for `auto-idle-bookmark-mode'.") 5. Define a command to turn automatic bookmarking on/off: (define-minor-mode auto-idle-bookmark-mode "Toggle automatic setting of a bookmark when Emacs is idle" :init-value nil :global t :lighter " BMK" (cancel-timer auto-idle-bookmark-mode-timer) (when auto-idle-bookmark-mode (setq auto-idle-bookmark-mode-timer (run-with-idle-timer auto-idle-bookmark-mode-delay t #'bmkp-set-autonamed-bookmark-at-line)))) 6. Turn it on: `M-x auto-idle-bookmark-mode'. 7. To cycle among the bookmarks in the current buffer, use `C-x p down' (`down' `down'...), or `up'. If you have Icicles, you can navigate more flexibly, combining direct access with cycling and completion. 8. The function used in #5 to set a bookmark is `bmkp-set-autonamed-bookmark-at-line'. It sets it at the beginning of the current line. If you instead want to bookmark at point, so you can have more than one such bookmark on the same line, then use `bmkp-set-autonamed-bookmark' (no `-at-line'). 9. Because of #1, all of the bookmarks created this way are temporary: not saved to your bookmarks file. You can also delete them all at anytime using `M-x bmkp-delete-all-temporary-bookmarks'. You can also delete any of them individually by putting the cursor on its line (or its position, if you don't use (`-at-line') and hitting `C-x p RET' - this key creates/deletes an autonamed bookmark at point. 10. If you do not want to highlight the bookmarks, don't do #2. If you want to unhighlight them at any time, use `C-x p u' (all in the buffer) or `C-x p C-u' (the bookmark on the same line as cursor). See also `C-x p U'. HTH.