瀏覽代碼

New function `org-occur-link-in-agenda-files'.

This function create a link and search for it in agenda files.
Note that it does not store the link in `org-stored-links'.
Bastien Guerry 15 年之前
父節點
當前提交
03fffc1864
共有 2 個文件被更改,包括 12 次插入0 次删除
  1. 2 0
      lisp/ChangeLog
  2. 10 0
      lisp/org.el

+ 2 - 0
lisp/ChangeLog

@@ -1,5 +1,7 @@
 2009-07-26  Bastien Guerry  <bzg@altern.org>
 
+	* org.el (org-occur-link-in-agenda-files): New function.
+
 	* org-timer.el (org-timer-last-timer): New variable.
 
 	* org-agenda.el (org-agenda-mode-map): New key for

+ 10 - 0
lisp/org.el

@@ -15601,6 +15601,16 @@ really on, so that the block visually is on the match."
 	    (goto-char pos)
 	    (org-reveal)))))))
 
+(defun org-occur-link-in-agenda-files ()
+  "Create a link and search for it in the agendas.
+The link is not stored in `org-stored-links', it is just created
+for the search purpose."
+  (interactive)
+  (let ((link (condition-case nil
+		  (org-store-link nil)
+		(error "Unable to create a link from here"))))
+    (org-occur-in-agenda-files (regexp-quote link))))
+
 (defun org-uniquify (list)
   "Remove duplicate elements from LIST."
   (let (res)