all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Exclude spaces and maybe tags from SUMMARY in iCalendar export
@ 2010-05-18 11:43 Tassilo Horn
  2010-05-18 12:46 ` Carsten Dominik
  0 siblings, 1 reply; 2+ messages in thread
From: Tassilo Horn @ 2010-05-18 11:43 UTC (permalink / raw
  To: emacs-orgmode

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: Exclude spaces and maybe tags from SUMMARY in iCalendar export
  2010-05-18 11:43 Exclude spaces and maybe tags from SUMMARY in iCalendar export Tassilo Horn
@ 2010-05-18 12:46 ` Carsten Dominik
  0 siblings, 0 replies; 2+ messages in thread
From: Carsten Dominik @ 2010-05-18 12:46 UTC (permalink / raw
  To: Tassilo Horn; +Cc: emacs-orgmode

Applied, thanks.

- Carsten

On May 18, 2010, at 1:43 PM, Tassilo Horn wrote:

> 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
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

- Carsten

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-18 15:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-18 11:43 Exclude spaces and maybe tags from SUMMARY in iCalendar export Tassilo Horn
2010-05-18 12:46 ` Carsten Dominik

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.