Re: [PATCH 1/2] emacs: maildir fcc make insert more flexible
David Edmondsonwrites: > On Monday, 2017-08-28 at 12:27:03 +0100, Mark Walters wrote: > The fcc-header should be of the form \"folder +tag1 -tag2\" where >>> >>> I realise that this patch set didn't add this string, but it is mildly >>> ridiculous. There's no reason that we couldn't use a list, where a >>> leading “+” or “-” indicates a tag and anything else is a folder. >>> >>> Even two variables (one for folder and another for tags) would be an >>> improvement >> >> The reason for this choice is that, when writing the postpone code, I >> wanted to keep within the message mode compose world, which has the fcc >> header as a string. > > You could add whatever headers you like. > >> I think I would also only like to be queried once when inserting. Or are >> you suggesting that the user types in a lisp list? > > If we prompt for it then we could do multiple prompts - we already have > a completion-capable reader for tags. > There was in fact a request for this feature in id:87shgtgiux.fsf@len. OTOH, it seems like a lot of this discussion talks about enhancing or re-factoring the existing draft/fcc handling. Would it be possible to seperate that out, even if it means a list of pre-requisite changes before this feature is added? d ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 1/2] emacs: maildir fcc make insert more flexible
On Monday, 2017-08-28 at 12:27:03 +0100, Mark Walters wrote: >>> The fcc-header should be of the form \"folder +tag1 -tag2\" where >> >> I realise that this patch set didn't add this string, but it is mildly >> ridiculous. There's no reason that we couldn't use a list, where a >> leading “+” or “-” indicates a tag and anything else is a folder. >> >> Even two variables (one for folder and another for tags) would be an >> improvement > > The reason for this choice is that, when writing the postpone code, I > wanted to keep within the message mode compose world, which has the fcc > header as a string. You could add whatever headers you like. > I think I would also only like to be queried once when inserting. Or are > you suggesting that the user types in a lisp list? If we prompt for it then we could do multiple prompts - we already have a completion-capable reader for tags. dme. -- I'm catching up with myself! ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 1/2] emacs: maildir fcc make insert more flexible
Hi Thanks for the review. On Mon, 28 Aug 2017, David Edmondsonwrote: > On Monday, 2017-08-28 at 08:32:21 +0100, Mark Walters wrote: > >> This changeset makes the function >> notmuch-maildir-fcc-with-notmuch-insert slightly more flexible by >> allowing some of the prompts to be controlled by the caller. >> --- >> emacs/notmuch-maildir-fcc.el | 16 ++-- >> 1 file changed, 10 insertions(+), 6 deletions(-) >> >> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el >> index 1551e8b..acff24d 100644 >> --- a/emacs/notmuch-maildir-fcc.el >> +++ b/emacs/notmuch-maildir-fcc.el >> @@ -227,7 +227,7 @@ should be a list of tag changes to apply to the inserted >> message." >> (apply 'notmuch-call-notmuch-process >> :stdin-string (buffer-string) "insert" args))) >> >> -(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create) >> +(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create >> header-name) > > Given that this is not FCC specific, perhaps rename it? Yes that might make sense. > >>"Store message with notmuch insert. >> >> The fcc-header should be of the form \"folder +tag1 -tag2\" where > > I realise that this patch set didn't add this string, but it is mildly > ridiculous. There's no reason that we couldn't use a list, where a > leading “+” or “-” indicates a tag and anything else is a folder. > > Even two variables (one for folder and another for tags) would be an > improvement The reason for this choice is that, when writing the postpone code, I wanted to keep within the message mode compose world, which has the fcc header as a string. I think I would also only like to be queried once when inserting. Or are you suggesting that the user types in a lisp list? Best wishes Mark ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
Re: [PATCH 1/2] emacs: maildir fcc make insert more flexible
On Monday, 2017-08-28 at 08:32:21 +0100, Mark Walters wrote: > This changeset makes the function > notmuch-maildir-fcc-with-notmuch-insert slightly more flexible by > allowing some of the prompts to be controlled by the caller. > --- > emacs/notmuch-maildir-fcc.el | 16 ++-- > 1 file changed, 10 insertions(+), 6 deletions(-) > > diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el > index 1551e8b..acff24d 100644 > --- a/emacs/notmuch-maildir-fcc.el > +++ b/emacs/notmuch-maildir-fcc.el > @@ -227,7 +227,7 @@ should be a list of tag changes to apply to the inserted > message." > (apply 'notmuch-call-notmuch-process > :stdin-string (buffer-string) "insert" args))) > > -(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create) > +(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create > header-name) Given that this is not FCC specific, perhaps rename it? >"Store message with notmuch insert. > > The fcc-header should be of the form \"folder +tag1 -tag2\" where I realise that this patch set didn't add this string, but it is mildly ridiculous. There's no reason that we couldn't use a list, where a leading “+” or “-” indicates a tag and anything else is a folder. Even two variables (one for folder and another for tags) would be an improvement > @@ -239,7 +239,8 @@ quoting each space with an immediately preceding backslash > or surrounding the entire folder name in double quotes. > > If CREATE is non-nil then create the folder if necessary." > - (let* ((args (split-string-and-unquote fcc-header)) > + (let* ((header-name (or header-name "Fcc header")) > + (args (split-string-and-unquote fcc-header)) >(folder (car args)) >(tags (cdr args))) > (condition-case nil > @@ -250,14 +251,17 @@ If CREATE is non-nil then create the folder if > necessary." >;; how to deal with it. >(error > (let ((response (notmuch-read-char-choice > - "Insert failed: (r)etry, (c)reate folder, (i)gnore, or > (e)dit the header? " > + (concat > + "Insert failed: (r)etry, (c)reate folder, (i)gnore, or > (e)dit the " > + header-name "? ") > '(?r ?c ?i ?e >(case response > -(?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header)) > -(?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't)) > +(?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header nil > header-name)) > +(?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't > header-name)) > (?i 't) > (?e (notmuch-maildir-fcc-with-notmuch-insert > - (read-from-minibuffer "Fcc header: " fcc-header) > + (read-from-minibuffer (concat header-name ": ") fcc-header) > + nil header-name > > > ; > -- > 2.1.4 > > ___ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch dme. -- Walk without rhythm and it won't attract the worm. ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/2] emacs: maildir fcc make insert more flexible
This changeset makes the function notmuch-maildir-fcc-with-notmuch-insert slightly more flexible by allowing some of the prompts to be controlled by the caller. --- emacs/notmuch-maildir-fcc.el | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 1551e8b..acff24d 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -227,7 +227,7 @@ should be a list of tag changes to apply to the inserted message." (apply 'notmuch-call-notmuch-process :stdin-string (buffer-string) "insert" args))) -(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create) +(defun notmuch-maildir-fcc-with-notmuch-insert (fcc-header create header-name) "Store message with notmuch insert. The fcc-header should be of the form \"folder +tag1 -tag2\" where @@ -239,7 +239,8 @@ quoting each space with an immediately preceding backslash or surrounding the entire folder name in double quotes. If CREATE is non-nil then create the folder if necessary." - (let* ((args (split-string-and-unquote fcc-header)) + (let* ((header-name (or header-name "Fcc header")) +(args (split-string-and-unquote fcc-header)) (folder (car args)) (tags (cdr args))) (condition-case nil @@ -250,14 +251,17 @@ If CREATE is non-nil then create the folder if necessary." ;; how to deal with it. (error (let ((response (notmuch-read-char-choice - "Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the header? " + (concat +"Insert failed: (r)etry, (c)reate folder, (i)gnore, or (e)dit the " +header-name "? ") '(?r ?c ?i ?e (case response - (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header)) - (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't)) + (?r (notmuch-maildir-fcc-with-notmuch-insert fcc-header nil header-name)) + (?c (notmuch-maildir-fcc-with-notmuch-insert fcc-header 't header-name)) (?i 't) (?e (notmuch-maildir-fcc-with-notmuch-insert - (read-from-minibuffer "Fcc header: " fcc-header) + (read-from-minibuffer (concat header-name ": ") fcc-header) + nil header-name ; -- 2.1.4 ___ notmuch mailing list notmuch@notmuchmail.org https://notmuchmail.org/mailman/listinfo/notmuch