Browse Source

Fix bug when creating a link from the agenda

Carsten Dominik 15 years ago
parent
commit
a70cf873c3
2 changed files with 5 additions and 3 deletions
  1. 2 0
      lisp/ChangeLog
  2. 3 3
      lisp/org.el

+ 2 - 0
lisp/ChangeLog

@@ -2,6 +2,8 @@
 
 	* org.el (org-on-heading-p, org-at-heading-p): Make sure these are
 	always with `invisible-ok'.
+	(org-store-link): No error when there is nothing to link to in the
+	agenda.
 
 	* org-list.el (org-update-checkbox-count): Insert changed cookie
 	before the old, to avoid problems with invisibility at the end of

+ 3 - 3
lisp/org.el

@@ -7205,9 +7205,9 @@ For file links, arg negates `org-context-in-file-links'."
       ;; We are in the agenda, link to referenced location
       (let ((m (or (get-text-property (point) 'org-hd-marker)
 		   (get-text-property (point) 'org-marker))))
-	(unless m (error "Don't know what location to link to"))
-	(org-with-point-at m
-	  (call-interactively 'org-store-link))))
+	(when m
+	  (org-with-point-at m
+	    (call-interactively 'org-store-link)))))
 
      ((eq major-mode 'calendar-mode)
       (let ((cd (calendar-cursor-to-date)))