From bcceabe70968416fb4540e32c68bfbda76820f9b Mon Sep 17 00:00:00 2001 From: Jambunathan K Date: Sun, 22 Aug 2010 23:36:52 +0530 Subject: [PATCH 1/2] org-store-link: Return link when invoked from within agenda buffer. * org.el (org-store-link): Return link when invoked non-interactively from an agenda buffer. TINYCHANGE --- lisp/org.el | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index 366c8dd..5db7aab 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -8218,7 +8218,7 @@ For file links, arg negates `org-context-in-file-links'." (org-load-modules-maybe) (setq org-store-link-plist nil) ; reset (let ((outline-regexp (org-get-limited-outline-regexp)) - link cpltxt desc description search txt custom-id) + link cpltxt desc description search txt custom-id agenda-link) (cond ((run-hook-with-args-until-success 'org-store-link-functions) @@ -8250,9 +8250,10 @@ For file links, arg negates `org-context-in-file-links'." (get-text-property (point) 'org-marker)))) (when m (org-with-point-at m - (if (interactive-p) - (call-interactively 'org-store-link) - (org-store-link nil)))))) + (setq agenda-link + (if (interactive-p) + (call-interactively 'org-store-link) + (org-store-link nil))))))) ((eq major-mode 'calendar-mode) (let ((cd (calendar-cursor-to-date))) @@ -8389,7 +8390,7 @@ For file links, arg negates `org-context-in-file-links'." "::#" custom-id)) (setq org-stored-links (cons (list link desc) org-stored-links)))) - (and link (org-make-link-string link desc))))) + (or agenda-link (and link (org-make-link-string link desc)))))) (defun org-store-link-props (&rest plist) "Store link properties, extract names and addresses." -- 1.7.0.4