From 3621314ac2d0c9f06c0681350dcdf7f260fd3c38 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Tue, 16 Mar 2021 20:54:56 +0100 Subject: [PATCH 1/4] =?UTF-8?q?mu4e/icalendar:=20fix=20free=20variable=20?= =?UTF-8?q?=E2=80=98original-msg=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mu4e/mu4e-icalendar.el | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mu4e/mu4e-icalendar.el b/mu4e/mu4e-icalendar.el index 93da0faa..8813df61 100644 --- a/mu4e/mu4e-icalendar.el +++ b/mu4e/mu4e-icalendar.el @@ -172,13 +172,10 @@ response in icalendar format." ;; also trash the message (thus must be appended to hooks). (add-hook 'message-sent-hook - #'mu4e~icalendar-setup-sent-hook-fn + (defun mu4e~icalendar-trash-hook() + (setq mu4e-sent-func (mu4e~icalendar-trash-message original-msg))) t t)))) -(defun mu4e~icalendar-setup-sent-hook-fn () - (setq mu4e-sent-func - (mu4e~icalendar-trash-message original-msg))) - (defun mu4e~icalendar-insert-diary (event reply-status filename) "Insert a diary entry for the EVENT in file named FILENAME. REPLY-STATUS is the status of the reply. The possible values are From 339a17852b99fca1e4058e3b54c98439729082b7 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Tue, 16 Mar 2021 21:21:00 +0100 Subject: [PATCH 2/4] mu4e/icalendar: Restore the deletion of the citation --- mu4e/mu4e-icalendar.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mu4e/mu4e-icalendar.el b/mu4e/mu4e-icalendar.el index 8813df61..4faaea2e 100644 --- a/mu4e/mu4e-icalendar.el +++ b/mu4e/mu4e-icalendar.el @@ -147,8 +147,8 @@ See `gnus-icalendar-event-reply-from-buffer' for the possible STATUS values. BUFFER-NAME is the name of the buffer holding the response in icalendar format." (let ((message-signature nil)) - (let ((_mu4e-compose-cite-function #'mu4e~icalendar-delete-citation) - (_mu4e-sent-messages-behavior 'delete) + (let ((mu4e-compose-cite-function #'mu4e~icalendar-delete-citation) + (mu4e-sent-messages-behavior 'delete) (mu4e-compose-reply-recipients 'sender)) (mu4e~compose-handler 'reply original-msg)) ;; Make sure the recipient is the organizer From 2d67b665067ee908edb6c553f295cfe44a0cb2b8 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Tue, 16 Mar 2021 21:24:59 +0100 Subject: [PATCH 3/4] mu4e/icalendar: Avoid unused lexical variable gnus-icalendar-find-if MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This syncs the definition of mu4e-icalendar-reply with the one of gnus-icalendar-reply and, in turn, avoids the compiler warning “Unused lexical variable `gnus-icalendar-find-if'”. --- mu4e/mu4e-icalendar.el | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-icalendar.el b/mu4e/mu4e-icalendar.el index 4faaea2e..5bac2872 100644 --- a/mu4e/mu4e-icalendar.el +++ b/mu4e/mu4e-icalendar.el @@ -85,9 +85,8 @@ (gnus-icalendar-additional-identities (mu4e-personal-addresses 'no-regexp)) (reply (gnus-icalendar-with-decoded-handle handle - (let ((gnus-icalendar-find-if (lambda(_pred _seq) nil))) - (gnus-icalendar-event-reply-from-buffer - (current-buffer) status (gnus-icalendar-identities))))) + (gnus-icalendar-event-reply-from-buffer + (current-buffer) status (gnus-icalendar-identities)))) (msg (mu4e-message-at-point 'noerror)) (charset (cdr (assoc 'charset (mm-handle-type handle))))) (when reply From 1c9e1f4be10e0948043f5ada76dd3f63ca4d1b83 Mon Sep 17 00:00:00 2001 From: Christophe Troestler Date: Wed, 17 Mar 2021 00:34:04 +0100 Subject: [PATCH 4/4] mu4e/icalendar: Use a closure to trash the original message This work around the fact that `defun' has an undefined return value. --- mu4e/mu4e-icalendar.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-icalendar.el b/mu4e/mu4e-icalendar.el index 5bac2872..2f2b60a9 100644 --- a/mu4e/mu4e-icalendar.el +++ b/mu4e/mu4e-icalendar.el @@ -140,6 +140,10 @@ (or (mu4e-view-headers-next) (kill-buffer-and-window)))))) +(defun mu4e~icalendar-trash-message-hook (original-msg) + (lambda () (setq mu4e-sent-func + (mu4e~icalendar-trash-message original-msg)))) + (defun mu4e-icalendar-reply-ical (original-msg event status buffer-name) "Reply to ORIGINAL-MSG containing invitation EVENT with STATUS. See `gnus-icalendar-event-reply-from-buffer' for the possible @@ -171,9 +175,8 @@ response in icalendar format." ;; also trash the message (thus must be appended to hooks). (add-hook 'message-sent-hook - (defun mu4e~icalendar-trash-hook() - (setq mu4e-sent-func (mu4e~icalendar-trash-message original-msg))) - t t)))) + (mu4e~icalendar-trash-message-hook original-msg) + 90 t)))) (defun mu4e~icalendar-insert-diary (event reply-status filename) "Insert a diary entry for the EVENT in file named FILENAME.