diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-05-18 14:45:56 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-05-18 14:45:56 +0200 |
commit | abe03d140ba0aac986e022cac50c821321b7bd5f (patch) | |
tree | fe49aed2e564a5bb117c2460b6e3e55355b49c10 | |
parent | 7bb31a512ed4945a656a63258695136eef09778f (diff) | |
download | org-mode-abe03d140ba0aac986e022cac50c821321b7bd5f.tar.gz |
Clean up space in headlines when exporting to iCalendar
Tassilo Horn writes:
> 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.
-rw-r--r-- | 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) |