Gnus development mailing list
 help / color / mirror / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eric S Fraga <e.fraga@ucl.ac.uk>
Cc: ding@gnus.org
Subject: Re: gnus-icalendar export to org does not include time stamp if no description
Date: Sun, 14 Apr 2019 13:21:31 +0200	[thread overview]
Message-ID: <m2bm18de84.fsf@gmail.com> (raw)
In-Reply-To: <87k1fwq2bb.fsf@ucl.ac.uk> (Eric S. Fraga's message of "Sun, 14 Apr 2019 12:00:24 +0100")

>>>>> On Sun, 14 Apr 2019 12:00:24 +0100, Eric S Fraga <e.fraga@ucl.ac.uk> said:

    Eric> Hello, I don't know whether to post this here, in the org
    Eric> mailing list, or an emacs group...

    Eric> I use gnus-icalendar-event-export to create org entries from
    Eric> calendar invites.  For some reason, the time stamp
    Eric> associated with the entry is only exported if the invite has
    Eric> a description field (line 483 of gnus-icalendar.el in git
    Eric> version of Emacs).  As the description field is optional,
    Eric> some invites do not get exported properly.  This seems wrong
    Eric> to me.

    Eric> I could try fixing this myself but I'm not proficient with
    Eric> elisp...

Totally untested, as I donʼt use gnus-icalendar at all.

diff --git a/lisp/gnus/gnus-icalendar.el b/lisp/gnus/gnus-icalendar.el
index 28020a1fd0..64cc3f92a9 100644
--- a/lisp/gnus/gnus-icalendar.el
+++ b/lisp/gnus/gnus-icalendar.el
@@ -480,14 +480,14 @@ gnus-icalendar--format-participant-list
                 (org-entry-put (point) (car prop) (cdr prop)))
               props))
 
-      (when description
-        (save-restriction
-          (narrow-to-region (point) (point))
-          (insert (gnus-icalendar-event:org-timestamp event)
-                  "\n\n"
-                  description)
-          (indent-region (point-min) (point-max) 2)
-          (fill-region (point-min) (point-max))))
+      (save-restriction
+        (narrow-to-region (point) (point))
+        (insert (gnus-icalendar-event:org-timestamp event)
+                "\n\n")
+        (when description
+          (insert description))
+        (indent-region (point-min) (point-max) 2)
+        (fill-region (point-min) (point-max)))
 
       (buffer-string))))
 



  reply	other threads:[~2019-04-14 11:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-14 11:00 Eric S Fraga
2019-04-14 11:21 ` Robert Pluim [this message]
2019-04-14 11:41   ` Eric S Fraga
2019-04-14 12:03     ` Robert Pluim
2019-04-14 12:11       ` Eric S Fraga
2019-04-14 11:58   ` Eric S Fraga
2019-06-22 11:16     ` Lars Ingebrigtsen

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

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

  git send-email \
    --in-reply-to=m2bm18de84.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=ding@gnus.org \
    --cc=e.fraga@ucl.ac.uk \
    /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.
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 NNTP newsgroup(s).