Gnus development mailing list
 help / color / mirror / Atom feed
From: Jan Tatarik <jan.tatarik@gmail.com>
To: ding@gnus.org
Subject: Re: gnus-icalendar - RSVP handling
Date: Mon, 02 Dec 2013 22:19:11 +0100	[thread overview]
Message-ID: <87r49vx86o.fsf@nb-jtatarik2.xing.hh> (raw)
In-Reply-To: <87txerqmg7.fsf@topper.koldfront.dk> ("Adam \=\?utf-8\?Q\?Sj\?\= \=\?utf-8\?Q\?\=C3\=B8gren\=22's\?\= message of "Mon, 02 Dec 2013 16:52:56 +0100")

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

On Mon, Dec 02 2013, Adam Sjøgren wrote:

> Jan Tatarik <jan.tatarik@gmail.com> writes:

>> Does this work for you?

> Setting gnus-icalendar-additional-identities works as expected!

> One catch is that if I change it, I seem to have to restart Emacs for
> the changes to be taken into account. Just changing the value of
> gnus-icalendar-additional-identities isn't sufficient. Shouldn't it be?

How about this?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dynamic_identities.patch --]
[-- Type: text/x-diff, Size: 1971 bytes --]

diff --git a/lisp/gnus-icalendar.el b/lisp/gnus-icalendar.el
index 5f152921b663850918be8bfcb3a76f5e69bc1d6d..1abcb6e27e4b40f504de1544f8ff2b1320648e82 100644
--- a/lisp/gnus-icalendar.el
+++ b/lisp/gnus-icalendar.el
@@ -677,7 +677,10 @@ only makes sense to define names or email addresses."
 (make-variable-buffer-local
  (defvar gnus-icalendar-handle nil))
 
-(defvar gnus-icalendar-identities
+(defun gnus-icalendar-identities ()
+  "Return list of regexp-quoted names and email addresses belonging to the user.
+
+These will be used to retrieve the RSVP information from ical events."
   (apply #'append
          (mapcar (lambda (x) (if (listp x) x (list x)))
                  (list user-full-name (regexp-quote user-mail-address)
@@ -766,7 +769,7 @@ only makes sense to define names or email addresses."
          (event (caddr data))
          (reply (gnus-icalendar-with-decoded-handle handle
                   (gnus-icalendar-event-reply-from-buffer
-                   (current-buffer) status gnus-icalendar-identities))))
+                   (current-buffer) status (gnus-icalendar-identities)))))
 
     (when reply
       (gmm-labels ((fold-icalendar-buffer ()
@@ -838,7 +841,7 @@ only makes sense to define names or email addresses."
 
 
 (defun gnus-icalendar-mm-inline (handle)
-  (let ((event (gnus-icalendar-event-from-handle handle gnus-icalendar-identities)))
+  (let ((event (gnus-icalendar-event-from-handle handle (gnus-icalendar-identities))))
 
     (setq gnus-icalendar-reply-status nil)
 
@@ -867,7 +870,7 @@ only makes sense to define names or email addresses."
 (defun gnus-icalendar-save-part (handle)
   (let (event)
     (when (and (equal (car (mm-handle-type handle)) "text/calendar")
-               (setq event (gnus-icalendar-event-from-handle handle gnus-icalendar-identities)))
+               (setq event (gnus-icalendar-event-from-handle handle (gnus-icalendar-identities))))
 
       (gnus-icalendar-event:sync-to-org event))))
 

  reply	other threads:[~2013-12-02 21:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-19 11:15 Adam Sjøgren
2013-11-19 13:15 ` Jan Tatarik
2013-11-19 21:33   ` Adam Sjøgren
2013-11-19 23:00     ` Jan Tatarik
2013-11-21 22:43       ` Adam Sjøgren
2013-12-02 15:52       ` Adam Sjøgren
2013-12-02 21:19         ` Jan Tatarik [this message]
2013-12-18 21:11           ` Adam Sjøgren

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=87r49vx86o.fsf@nb-jtatarik2.xing.hh \
    --to=jan.tatarik@gmail.com \
    --cc=ding@gnus.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.
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).