Browse Source

Respect link abbreviations when offering a list of links

John Wiegley writes:

> I have the following data in my Org-mode file:
>
>  #+LINK: cegbug https://portal/bugzilla/show_bug.cgi?id=
>
>  ** TODO [[cegbug:351][#351]] Bizcard: Fix Maven build setup
>     - State "TODO"       from "STARTED"    [2010-03-01 Mon 14:42]
>
> Now, in the Agenda and in the Org-mode buffer, everything looks fine.
> I can also use C-c C-o if my cursor is within the #<NUMBER> text.
>
> However, if I'm in the Agenda and I hit C-c C-o, it says 'No match'
> after about a second. Is there any reason I can't open these links
> from the Agenda view?
Carsten Dominik 15 years ago
parent
commit
ac7ee0427c
2 changed files with 9 additions and 0 deletions
  1. 5 0
      lisp/ChangeLog
  2. 4 0
      lisp/org.el

+ 5 - 0
lisp/ChangeLog

@@ -1,3 +1,8 @@
+2010-03-08  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-open-at-point): Get link abbreviations from
+	reference buffer.
+
 2010-03-07  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-table.el (org-table-convert-refs-to-rc): Do not read arctan2

+ 4 - 0
lisp/org.el

@@ -8389,6 +8389,10 @@ Org-mode syntax."
 	(org-mode)
 	(insert s)
 	(goto-char (point-min))
+	(when reference-buffer
+	  (setq org-link-abbrev-alist-local
+		(with-current-buffer reference-buffer
+		  org-link-abbrev-alist-local)))
 	(org-open-at-point arg reference-buffer)))))
 
 (defun org-open-at-point (&optional in-emacs reference-buffer)