emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Open single link immediately
@ 2009-08-28 17:23 Bernt Hansen
  2009-08-30  8:09 ` Carsten Dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2009-08-28 17:23 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Open single link immediately
  2009-08-28 17:23 [PATCH] Open single link immediately Bernt Hansen
@ 2009-08-30  8:09 ` Carsten Dominik
  2009-08-30 14:27   ` Tim O'Callaghan
  0 siblings, 1 reply; 3+ messages in thread
From: Carsten Dominik @ 2009-08-30  8:09 UTC (permalink / raw)
  To: Bernt Hansen; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Open single link immediately
  2009-08-30  8:09 ` Carsten Dominik
@ 2009-08-30 14:27   ` Tim O'Callaghan
  0 siblings, 0 replies; 3+ messages in thread
From: Tim O'Callaghan @ 2009-08-30 14:27 UTC (permalink / raw)
  To: org-mode

FWIW it should be back up on monday.

http://article.gmane.org/gmane.comp.version-control.git/85019

Tim.

2009/8/30 Carsten Dominik <carsten.dominik@gmail.com>:
> 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
>
>
>
> _______________________________________________
> 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-08-30 14:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-28 17:23 [PATCH] Open single link immediately Bernt Hansen
2009-08-30  8:09 ` Carsten Dominik
2009-08-30 14:27   ` Tim O'Callaghan

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).