Browse Source

Agenda: Control how links are presented in added text.

Patch by Christopher Suckling.
Carsten Dominik 16 years ago
parent
commit
029fc74688
2 changed files with 22 additions and 0 deletions
  1. 5 0
      lisp/ChangeLog
  2. 17 0
      lisp/org-agenda.el

+ 5 - 0
lisp/ChangeLog

@@ -1,5 +1,10 @@
 2009-03-08  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-03-08  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
+	* org-agenda.el (org-agenda-add-entry-text-descriptive-links): New
+	option.
+	(org-agenda-add-entry-text): Honor
+	`org-agenda-add-entry-text-descriptive-links'.
+
 	* org-export-latex.el (org-export-latex-preprocess): Make all
 	* org-export-latex.el (org-export-latex-preprocess): Make all
 	external preprocess functions use a PARAMETER arg.
 	external preprocess functions use a PARAMETER arg.
 
 

+ 17 - 0
lisp/org-agenda.el

@@ -126,6 +126,14 @@ that is listed in the agenda view."
   :group 'org-agenda
   :group 'org-agenda
   :type 'integer)
   :type 'integer)
 
 
+(defcustom org-agenda-add-entry-text-descriptive-links t
+  "Non-nil means, export org-links as descriptive links in agenda added text.
+This variable applies to the text added to the agenda when
+`org-agenda-add-entry-text-maxlines' is larger than 0.
+When this variable nil, the URL will (also) be shown."
+  :group 'org-agenda
+  :type 'boolean)
+
 (defcustom org-agenda-export-html-style ""
 (defcustom org-agenda-export-html-style ""
   "The style specification for exported HTML Agenda files.
   "The style specification for exported HTML Agenda files.
 If this variable contains a string, it will replace the default <style>
 If this variable contains a string, it will replace the default <style>
@@ -2132,6 +2140,15 @@ Drawers will be excluded, also the line with scheduling/deadline info."
 					      ".*\n?"))
 					      ".*\n?"))
 		    (with-temp-buffer
 		    (with-temp-buffer
 		      (insert txt)
 		      (insert txt)
+		      (when org-agenda-add-entry-text-descriptive-links
+			(goto-char (point-min))
+			(while (org-activate-bracket-links (point-max))
+			  (add-text-properties (match-beginning 0) (match-end 0)
+					       '(face org-link))))
+		      (goto-char (point-min))
+		      (while (re-search-forward org-bracket-link-regexp (point-max) t)
+			(set-text-properties (match-beginning 0) (match-end 0)
+					     nil))
 		      (goto-char (point-min))
 		      (goto-char (point-min))
 		      (while (re-search-forward drawer-re nil t)
 		      (while (re-search-forward drawer-re nil t)
 			(delete-region
 			(delete-region