From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Open single link immediately Date: Sun, 30 Aug 2009 10:09:39 +0200 Message-ID: <9906B72A-15D5-4795-BE2F-0BFD799582D1@gmail.com> References: <1251480180-9815-1-git-send-email-bernt@norang.ca> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MhfTw-00019T-QB for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 04:09:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MhfTr-00013w-B6 for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 04:09:48 -0400 Received: from [199.232.76.173] (port=58206 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MhfTq-00013e-Uv for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 04:09:43 -0400 Received: from mail-ew0-f211.google.com ([209.85.219.211]:53979) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MhfTp-0008OV-G5 for emacs-orgmode@gnu.org; Sun, 30 Aug 2009 04:09:42 -0400 Received: by ewy7 with SMTP id 7so3108236ewy.31 for ; Sun, 30 Aug 2009 01:09:40 -0700 (PDT) In-Reply-To: <1251480180-9815-1-git-send-email-bernt@norang.ca> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bernt Hansen Cc: emacs-orgmode@gnu.org This will be in the next push, when our repository is online again. Thanks! - Carsten On Aug 28, 2009, at 7:23 PM, Bernt Hansen wrote: > C-c C-o on a headline or in the agenda displays a menu of links to > choose from. If there is only a single link then go there directly > skipping the menu. > --- > This patch is available at git://git.norang.ca/org-mode.git for- > carsten > > lisp/org.el | 31 ++++++++++++++++--------------- > 1 files changed, 16 insertions(+), 15 deletions(-) > > diff --git a/lisp/org.el b/lisp/org.el > index a5181ab..f3d8976 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -8073,21 +8073,22 @@ needed for the interpretation of abbreviated > links." > (push (match-string 0) links)) > (setq links (reverse links)) > (unless links (error "No links")) > - > - (unless (and (integerp nth) (>= (length links) nth)) > - (save-excursion > - (save-window-excursion > - (delete-other-windows) > - (with-output-to-temp-buffer "*Select Link*" > - (princ "Select link\n\n") > - (mapc (lambda (l) (princ (format "[%d] %s\n" (incf cnt) l))) > - links)) > - (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) > - (message "Select link to open:") > - (setq c (read-char-exclusive)) > - (and (get-buffer "*Select Link*") (kill-buffer "*Select > Link*")))) > - (setq nth (- c ?0))) > - > + (if (eq 1 (length links)) > + (setq c 1) > + (unless (and (integerp nth) (>= (length links) nth)) > + (save-excursion > + (save-window-excursion > + (delete-other-windows) > + (with-output-to-temp-buffer "*Select Link*" > + (princ "Select link\n\n") > + (mapc (lambda (l) (princ (format "[%d] %s\n" (incf cnt) l))) > + links)) > + (org-fit-window-to-buffer (get-buffer-window "*Select Link*")) > + (message "Select link to open:") > + (setq c (read-char-exclusive)) > + (and (get-buffer "*Select Link*") (kill-buffer "*Select > Link*")))))) > + (setq nth (- c ?0)) > + > (unless (and (integerp nth) (>= (length links) nth)) > (error "Invalid link selection")) > (setq link (nth (1- nth) links) > -- > 1.6.4.1.331.gda1d56 > > > > _______________________________________________ > Emacs-orgmode mailing list > Remember: use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode