diff options
author | Bastien Guerry <bzg@altern.org> | 2013-01-16 18:36:33 +0100 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-01-16 18:36:33 +0100 |
commit | 1d8ba5a9cdae08d272ed77b4ecc49e451eb93829 (patch) | |
tree | 6055c280cbc6a73c7c2574cc4f97ffb15fa62114 | |
parent | be0d87ddb779987d2ee6b09c409595b1dc996330 (diff) | |
parent | bd779fad624af01dbcb35b381dee10452dc945b1 (diff) | |
download | org-mode-1d8ba5a9cdae08d272ed77b4ecc49e451eb93829.tar.gz |
Merge branch 'maint'
-rw-r--r-- | lisp/org-agenda.el | 46 |
1 files changed, 24 insertions, 22 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 82b039b..f48ff6f 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -8109,32 +8109,34 @@ It also looks at the text of the entry itself." (let* ((marker (or (org-get-at-bol 'org-hd-marker) (org-get-at-bol 'org-marker))) (buffer (and marker (marker-buffer marker))) - (prefix (buffer-substring - (point-at-bol) (point-at-eol))) + (prefix (buffer-substring (point-at-bol) (point-at-eol))) (lkall (org-offer-links-in-entry buffer marker arg prefix)) - (lk (car lkall)) + (lk0 (car lkall)) + (lk (if (stringp lk0) (list lk0) lk0)) (lkend (cdr lkall)) trg) (cond - ((and buffer (stringp lk)) - (with-current-buffer buffer - (setq trg (and (string-match org-bracket-link-regexp lk) - (match-string 1 lk))) - (if (or (not trg) (string-match org-any-link-re trg)) - (save-excursion - (save-restriction - (widen) - (goto-char marker) - (when (search-forward lk nil lkend) - (goto-char (match-beginning 0)) - (org-open-at-point)))) - ;; This is an internal link, widen the buffer - (switch-to-buffer-other-window buffer) - (widen) - (goto-char marker) - (when (search-forward lk nil lkend) - (goto-char (match-beginning 0)) - (org-open-at-point))))) + ((and buffer lk) + (mapcar (lambda(l) + (with-current-buffer buffer + (setq trg (and (string-match org-bracket-link-regexp l) + (match-string 1 l))) + (if (or (not trg) (string-match org-any-link-re trg)) + (save-excursion + (save-restriction + (widen) + (goto-char marker) + (when (search-forward l nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point)))) + ;; This is an internal link, widen the buffer + (switch-to-buffer-other-window buffer) + (widen) + (goto-char marker) + (when (search-forward l nil lkend) + (goto-char (match-beginning 0)) + (org-open-at-point))))) + lk)) ((or (org-in-regexp (concat "\\(" org-bracket-link-regexp "\\)")) (save-excursion (beginning-of-line 1) |