From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: RE: Patch: enhanced mark navigation commands Date: Wed, 5 Mar 2008 23:18:49 -0800 Message-ID: <003b01c87f5a$53517290$0600a8c0@us.oracle.com> References: <55f7df060803042112w380b5170qe964002c6c06ab01@mail.gmail.com><200803050641.m256fnvm009784@sallyv1.ics.uci.edu><87y78woewc.fsf@jurta.org> <200803060147.m261ljNU022154@sallyv1.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204788061 30572 80.91.229.12 (6 Mar 2008 07:21:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 6 Mar 2008 07:21:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: "'Dan Nicolaescu'" , "'Juri Linkov'" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 06 08:21:28 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 1JXAPv-0004tk-QG for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 08:21:28 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXAPO-0000Ng-4z for ged-emacs-devel@m.gmane.org; Thu, 06 Mar 2008 02:20:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JXAPI-0000Lt-Oo for emacs-devel@gnu.org; Thu, 06 Mar 2008 02:20:48 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JXAPG-0000Ki-Dr for emacs-devel@gnu.org; Thu, 06 Mar 2008 02:20:47 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JXAPG-0000Kf-81 for emacs-devel@gnu.org; Thu, 06 Mar 2008 02:20:46 -0500 Original-Received: from agminet01.oracle.com ([141.146.126.228]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JXAPF-0004Bh-Py for emacs-devel@gnu.org; Thu, 06 Mar 2008 02:20:46 -0500 Original-Received: from rgmgw2.us.oracle.com (rgmgw2.us.oracle.com [138.1.186.111]) by agminet01.oracle.com (Switch-3.2.4/Switch-3.1.7) with ESMTP id m267KZPr002674; Thu, 6 Mar 2008 01:20:35 -0600 Original-Received: from acsmt350.oracle.com (acsmt350.oracle.com [141.146.40.150]) by rgmgw2.us.oracle.com (Switch-3.2.4/Switch-3.2.4) with ESMTP id m263bWeR028468; Thu, 6 Mar 2008 00:20:34 -0700 Original-Received: from inet-141-146-46-1.oracle.com by acsmt350.oracle.com with ESMTP id 3601794131204787928; Wed, 05 Mar 2008 23:18:48 -0800 Original-Received: from dradamslap1 (/141.144.72.2) by bhmail.oracle.com (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 05 Mar 2008 23:18:48 -0800 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <200803060147.m261ljNU022154@sallyv1.ics.uci.edu> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 Thread-Index: Ach/LIXKK1TcQJSgR2OtiYm6PGBvdgAI+UaQ X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:91471 Archived-At: FWIW, in Icicles you can navigate among the markers in a buffer or among global markers, in any order. While doing that, you can complete against the text on each marker's line (or ""): each completion candidate is an alist entry (line-text . marker). More typically, however, you cycle among the markers or click them in *Completions* with the mouse. You can cycle in either direction, and you need not visit each marker in sequence (direct access or skip some). You can sort the candidate marker list in various ways - by default, the candidates are in marker order (i.e. buffer position). If unsorted, they are in chronological order, i.e., mark-ring insertion order. Hit a key to change the sort order - you can have any number of orders. You can filter the set of candidate markers by matching (or complement-matching) your minibuffer input against each marker's line. When you visit a marker, its line is highlighted temporarily. It is a bit like a dynamic `occur' command (change your input on the fly and it changes the matching candidates), but an `occur' where the lines are only those with markers and each marker has a line (candidate). This all falls out for free by using the general function (command) `icicle-map' to define the navigating commands (`icicle-goto-marker' and `icicle-goto-global-marker'). Those definitions are trivial. `icicle-map' applies a function to alist-entry completion candidates that are chosen interactively, e.g. by cycling. In the case of the marker-navigator commands, the function applied by `icicle-map' just goes to the chosen marker candidate and highlights its line: (defun goto-and-highlight (cand) (pop-to-buffer (marker-buffer (cdr cand))) (goto-char (cdr cand)) (setq mark-active nil) (let ((hl-line-flash-show-period 60)) (hl-line-flash))) (point-marker))))) ; Return marker at point, for message. The complete definition of `icicle-go-to-marker is this (plus some bindings for sort functions and an error message if no markers): (defun icicle-goto-marker () "Go to a marker in this buffer." (interactive) (icicle-map (mapcar #'icicle-marker+text (icicle-markers mark-ring)) #'goto-and-highlight))) Function `icicle-marker+text' just creates an alist entry (completion candidate) using the text of a marker's line as car and the marker as cdr. Function `icicle-markers' just filters the `mark-ring' for live buffers, excluding the minibuffer. You can use `icicle-map' to define a command to traverse any alist, doing anything you want to the entries. The user picks the entries to act on, in the ways mentioned above (filter, sort, cycle, complete, choose directly). The user can act on candidates repeatedly and in any order. `icicle-map' and commands such as `icicle-goto-marker' that you define using it are multi-commands. It is that that lets a user choose multiple completion candidates (e.g. cycle among them) in a single command invocation.