emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-orgmode@gnu.org
Subject: Exclude spaces and maybe tags from SUMMARY in iCalendar export
Date: Tue, 18 May 2010 13:43:24 +0200	[thread overview]
Message-ID: <87mxvxo2oz.fsf@thinkpad.tsdh.de> (raw)

Hi all,

I've just discovered the iCalendar export and use that to have a
visually appealing read-only agenda in KOrganizer.  Basically, the
export seems perfect except for one thing.

When I have an org entry like

* Test                                           :some:tags:here:

the corresponding VEVENT will have the whole org heading including the
spaces and the tag string as SUMMARY (unless the entry has a SUMMARY
property).  Having the tags there might be ok (although by default they
are also set as CATEGORY), but the spaces between the heading title and
the tags should be compacted.

Appended is patch that does that when not `is-body'.

Bye,
Tassilo

---
 lisp/org-icalendar.el |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/org-icalendar.el b/lisp/org-icalendar.el
index 9acd2f4..66da256 100644
--- a/lisp/org-icalendar.el
+++ b/lisp/org-icalendar.el
@@ -516,11 +516,12 @@ whitespace, newlines, drawers, and timestamps, and cut it down to MAXLENGTH
 characters."
   (if (not s)
       nil
-    (when is-body
+    (if is-body
       (let ((re (concat "\\(" org-drawer-regexp "\\)[^\000]*?:END:.*\n?"))
 	    (re2 (concat "^[ \t]*" org-keyword-time-regexp ".*\n?")))
 	(while (string-match re s) (setq s (replace-match "" t t s)))
-	(while (string-match re2 s) (setq s (replace-match "" t t s)))))
+	(while (string-match re2 s) (setq s (replace-match "" t t s))))
+      (setq s (replace-regexp-in-string "[[:space:]]+" " " s)))
     (let ((start 0))
       (while (string-match "\\([,;]\\)" s start)
 	(setq start (+ (match-beginning 0) 2)
-- 
1.7.1

             reply	other threads:[~2010-05-18 11:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-18 11:43 Tassilo Horn [this message]
2010-05-18 12:46 ` Exclude spaces and maybe tags from SUMMARY in iCalendar export 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=87mxvxo2oz.fsf@thinkpad.tsdh.de \
    --to=tassilo@member.fsf.org \
    --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).