unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/1] emacs: make editing a message as new include FCC
  2018-10-22 14:41 [PATCH 0/1] Make emacs add FCC when editing a message as new Léo Gaspard
@ 2018-10-22 14:41 ` Léo Gaspard
  0 siblings, 0 replies; 4+ messages in thread
From: Léo Gaspard @ 2018-10-22 14:41 UTC (permalink / raw)
  To: notmuch; +Cc: Léo Gaspard

---
 emacs/notmuch-draft.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index fb7f4f55..e22e0d16 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -2,6 +2,7 @@
 ;;
 ;; Copyright © Mark Walters
 ;; Copyright © David Bremner
+;; Copyright © Leo Gaspard
 ;;
 ;; This file is part of Notmuch.
 ;;
@@ -20,6 +21,7 @@
 ;;
 ;; Authors: Mark Walters <markwalters1009@gmail.com>
 ;;	    David Bremner <david@tethera.net>
+;;	    Leo Gaspard <leo@gaspard.io>
 
 ;;; Code:
 
@@ -225,7 +227,7 @@ applied to newly inserted messages)."
 			      "--exclude=false" id))
 	 (draft (equal tags (notmuch-update-tags tags notmuch-draft-tags))))
     (when (or draft
-	      (yes-or-no-p "Message does not appear to be a draft: really resume? "))
+	      (yes-or-no-p "Message does not appear to be a draft: edit as new? "))
       (switch-to-buffer (get-buffer-create (concat "*notmuch-draft-" id "*")))
       (setq buffer-read-only nil)
       (erase-buffer)
@@ -244,6 +246,7 @@ applied to newly inserted messages)."
 	  (message-remove-header "Message-ID"))
 	(when (member 'Date message-deletable-headers)
 	  (message-remove-header "Date"))
+	(unless draft (notmuch-fcc-header-setup))
 	;; The X-Notmuch-Emacs-Draft header is a more reliable
 	;; indication of whether the message really is a draft.
 	(setq draft (> (message-remove-header "X-Notmuch-Emacs-Draft") 0)))
-- 
2.18.1

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

* [PATCH 0/1] Make emacs add FCC when editing a message as new
@ 2018-10-22 14:44 notmuchmail.org
  2018-10-22 14:44 ` [PATCH 1/1] emacs: make editing a message as new include FCC notmuchmail.org
  0 siblings, 1 reply; 4+ messages in thread
From: notmuchmail.org @ 2018-10-22 14:44 UTC (permalink / raw)
  To: notmuch; +Cc: Léo Gaspard

From: Léo Gaspard <leo@gaspard.io>

Hello,

This patch changes the meaning of `e` for non-drafts to make it behave
similarly to new messages, which here means add the `FCC` header.

Disclaimer: it's the second non-trivial elisp expression I've ever
written, the first one currently being on the wiki [1], and which I'd be
happy if you checked I didn't do complete nonsense.

Thank you for your work on notmuch! I've been using it only for a few
days but it's being really great.
Leo

[1] https://notmuchmail.org/emacstips/#index24h2


Léo Gaspard (1):
  emacs: make editing a message as new include FCC

 emacs/notmuch-draft.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.18.1

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

* [PATCH 1/1] emacs: make editing a message as new include FCC
  2018-10-22 14:44 [PATCH 0/1] Make emacs add FCC when editing a message as new notmuchmail.org
@ 2018-10-22 14:44 ` notmuchmail.org
  2019-03-31 17:53   ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: notmuchmail.org @ 2018-10-22 14:44 UTC (permalink / raw)
  To: notmuch; +Cc: Léo Gaspard

From: Léo Gaspard <leo@gaspard.io>

---
 emacs/notmuch-draft.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-draft.el b/emacs/notmuch-draft.el
index fb7f4f55..e22e0d16 100644
--- a/emacs/notmuch-draft.el
+++ b/emacs/notmuch-draft.el
@@ -2,6 +2,7 @@
 ;;
 ;; Copyright © Mark Walters
 ;; Copyright © David Bremner
+;; Copyright © Leo Gaspard
 ;;
 ;; This file is part of Notmuch.
 ;;
@@ -20,6 +21,7 @@
 ;;
 ;; Authors: Mark Walters <markwalters1009@gmail.com>
 ;;	    David Bremner <david@tethera.net>
+;;	    Leo Gaspard <leo@gaspard.io>
 
 ;;; Code:
 
@@ -225,7 +227,7 @@ applied to newly inserted messages)."
 			      "--exclude=false" id))
 	 (draft (equal tags (notmuch-update-tags tags notmuch-draft-tags))))
     (when (or draft
-	      (yes-or-no-p "Message does not appear to be a draft: really resume? "))
+	      (yes-or-no-p "Message does not appear to be a draft: edit as new? "))
       (switch-to-buffer (get-buffer-create (concat "*notmuch-draft-" id "*")))
       (setq buffer-read-only nil)
       (erase-buffer)
@@ -244,6 +246,7 @@ applied to newly inserted messages)."
 	  (message-remove-header "Message-ID"))
 	(when (member 'Date message-deletable-headers)
 	  (message-remove-header "Date"))
+	(unless draft (notmuch-fcc-header-setup))
 	;; The X-Notmuch-Emacs-Draft header is a more reliable
 	;; indication of whether the message really is a draft.
 	(setq draft (> (message-remove-header "X-Notmuch-Emacs-Draft") 0)))
-- 
2.18.1

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

* Re: [PATCH 1/1] emacs: make editing a message as new include FCC
  2018-10-22 14:44 ` [PATCH 1/1] emacs: make editing a message as new include FCC notmuchmail.org
@ 2019-03-31 17:53   ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2019-03-31 17:53 UTC (permalink / raw)
  To: notmuchmail.org, notmuch; +Cc: Léo Gaspard

notmuchmail.org@leo.gaspard.io writes:

> From: Léo Gaspard <leo@gaspard.io>
>

pushed, with some of the cover text copied into the commit message.

d

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

end of thread, other threads:[~2019-03-31 17:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-22 14:44 [PATCH 0/1] Make emacs add FCC when editing a message as new notmuchmail.org
2018-10-22 14:44 ` [PATCH 1/1] emacs: make editing a message as new include FCC notmuchmail.org
2019-03-31 17:53   ` David Bremner
  -- strict thread matches above, loose matches on Subject: below --
2018-10-22 14:41 [PATCH 0/1] Make emacs add FCC when editing a message as new Léo Gaspard
2018-10-22 14:41 ` [PATCH 1/1] emacs: make editing a message as new include FCC Léo Gaspard

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).