emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Christopher Suckling <suckling.list@googlemail.com>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Subject: [PATCH] org-agenda-add-entry-text
Date: Sun, 8 Mar 2009 15:28:24 +0000	[thread overview]
Message-ID: <D479C3FB-DC1F-44F1-916E-33D3BA77AC7E@gmail.com> (raw)

There seems to be an inconsistency in how org-agenda-add-entry-text  
handles links. Sometimes they are exported as descriptive links and  
sometimes as a [[URL][descriptive]] pair.

The following patch adds a new variable, org-agenda-add-entry-text- 
descriptive-links, that controls which of the above formats to use  
when exporting the agenda.

Best wishes,

Christopher

-----

	Modified lisp/org-agenda.el
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 9b34d01..be2faab 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -126,6 +126,12 @@ that is listed in the agenda view."
    :group 'org-agenda
    :type 'integer)

+(defcustom org-agenda-add-entry-text-descriptive-links t
+  "Non-nil means, export org-links as descriptive links (obfuscating  
the
+URL) when adding entry text to an agenda export."
+  :group 'org-agenda
+  :type 'boolean)
+
  (defcustom org-agenda-export-html-style ""
    "The style specification for exported HTML Agenda files.
  If this variable contains a string, it will replace the default  
<style>
@@ -2132,6 +2138,15 @@ Drawers will be excluded, also the line with  
scheduling/deadline info."
  					      ".*\n?"))
  		    (with-temp-buffer
  		      (insert txt)
+		      (if org-agenda-add-entry-text-descriptive-links
+			  (progn (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))
  		      (while (re-search-forward drawer-re nil t)
  			(delete-region

  

             reply	other threads:[~2009-03-08 15:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-08 15:28 Christopher Suckling [this message]
2009-03-08 15:53 ` [PATCH] org-agenda-add-entry-text Carsten Dominik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D479C3FB-DC1F-44F1-916E-33D3BA77AC7E@gmail.com \
    --to=suckling.list@googlemail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).