unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] Expand docstrings about fcc using notmuch-insert
@ 2016-10-11  4:52 Keith Amidon
  2016-10-13 22:40 ` Keith Amidon
  2016-10-14  6:58 ` Mark Walters
  0 siblings, 2 replies; 9+ messages in thread
From: Keith Amidon @ 2016-10-11  4:52 UTC (permalink / raw)
  To: notmuch

This commit expands docstrings for notmuch-fcc-dirs and
notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
are processed and make the ability to configure sent folders containing
whitespace more discoverable.
---
 emacs/notmuch-maildir-fcc.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 95e5650..cfe1931 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -54,7 +54,10 @@ If `notmuch-maildir-use-notmuch-insert' is set (the default) then
 the header should be of the form \"folder +tag1 -tag2\" where
 folder is the folder (relative to the notmuch mailstore) to store
 the message in, and tag1 and tag2 are tag changes to apply to the
-stored message.
+stored message.  This string is split using `split-string-and-unquote',
+so a folder name containing whitespace can be specified by
+quoting the whitespace with an immediately preceeding backslash
+or surrounding the entire folder name in double quotes.
 
 If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
 header should be the directory where the message should be
@@ -230,8 +233,12 @@ should be a list of tag changes to apply to the inserted message."
 The fcc-header should be of the form \"folder +tag1 -tag2\" where
 folder is the folder (relative to the notmuch mailstore) to store
 the message in, and tag1 and tag2 are tag changes to apply to the
-stored message. If CREATE is non-nil then create the folder if
-necessary."
+stored message. This string is split using `split-string-and-unquote',
+so a folder name containing whitespace can be specified by quoting
+the whitespace with an immediately preceeding 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))
 	 (folder (car args))
 	 (tags (cdr args)))
-- 
2.10.0

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-11  4:52 [PATCH] Expand docstrings about fcc using notmuch-insert Keith Amidon
@ 2016-10-13 22:40 ` Keith Amidon
  2016-10-14  1:30   ` David Bremner
  2016-10-14  6:58 ` Mark Walters
  1 sibling, 1 reply; 9+ messages in thread
From: Keith Amidon @ 2016-10-13 22:40 UTC (permalink / raw)
  To: notmuch

Did my attempt to submit via git send-email the documentation patch
quoted below somehow not get forwarded by the list server?  I never got
a copy forwarded by the list but just assumed that it was suppressing
copies to the authors.  Having observed that folks here are usually
very good about reviewing patch submissions quickly and not having
gotten any feedback, I'm wondering if something went wrong after all...

        --- Keith

On Mon, 2016-10-10 at 21:52 -0700, Keith Amidon wrote:
> This commit expands docstrings for notmuch-fcc-dirs and
> notmuch-maildir-fcc-with-notmuch-insert to describe how quoted
> strings
> are processed and make the ability to configure sent folders
> containing
> whitespace more discoverable.
> ---
>  emacs/notmuch-maildir-fcc.el | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-
> fcc.el
> index 95e5650..cfe1931 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -54,7 +54,10 @@ If `notmuch-maildir-use-notmuch-insert' is set
> (the default) then
>  the header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message.
> +stored message.  This string is split using `split-string-and-
> unquote',
> +so a folder name containing whitespace can be specified by
> +quoting the whitespace with an immediately preceeding backslash
> +or surrounding the entire folder name in double quotes.
>  
>  If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
>  header should be the directory where the message should be
> @@ -230,8 +233,12 @@ should be a list of tag changes to apply to the
> inserted message."
>  The fcc-header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message. If CREATE is non-nil then create the folder if
> -necessary."
> +stored message. This string is split using `split-string-and-
> unquote',
> +so a folder name containing whitespace can be specified by quoting
> +the whitespace with an immediately preceeding 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))
>  	 (folder (car args))
>  	 (tags (cdr args)))

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-13 22:40 ` Keith Amidon
@ 2016-10-14  1:30   ` David Bremner
  2016-10-14  2:57     ` Keith Amidon
  0 siblings, 1 reply; 9+ messages in thread
From: David Bremner @ 2016-10-14  1:30 UTC (permalink / raw)
  To: Keith Amidon, notmuch

Keith Amidon <camalot@picnicpark.org> writes:

> Did my attempt to submit via git send-email the documentation patch
> quoted below somehow not get forwarded by the list server?  I never got
> a copy forwarded by the list but just assumed that it was suppressing
> copies to the authors.  Having observed that folks here are usually
> very good about reviewing patch submissions quickly and not having
> gotten any feedback, I'm wondering if something went wrong after all...
>
>         --- Keith

Hi Keith;

No technical difficulties, we're just not as good as you think we are at
quick reviews ;). I wanted to hear what Mark felt about exposing these
internals as docstring. I OK with it, but it does make it slightly
harder to change things later.

d

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-14  1:30   ` David Bremner
@ 2016-10-14  2:57     ` Keith Amidon
  0 siblings, 0 replies; 9+ messages in thread
From: Keith Amidon @ 2016-10-14  2:57 UTC (permalink / raw)
  To: David Bremner, notmuch

On Thu, 2016-10-13 at 22:30 -0300, David Bremner wrote:
> No technical difficulties, we're just not as good as you think we are
> at quick reviews ;). I wanted to hear what Mark felt about exposing
> these internals as docstring. I OK with it, but it does make it
> slightly harder to change things later.

Thanks for getting back to me.  In case it helps, part of the reason
why I mentioned exactly how it was done was because I wasn't 100% sure
I captured the behavior of split-string-and-unquote correctly.  I
personally found the docstring, elisp manual page, and the source for
that function all somewhat opaque.  This way if someone ran into a
problem trying to quote the folder as I described they would know where
to go look for more detail.  :-)

       --- Keith

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-11  4:52 [PATCH] Expand docstrings about fcc using notmuch-insert Keith Amidon
  2016-10-13 22:40 ` Keith Amidon
@ 2016-10-14  6:58 ` Mark Walters
  2016-10-19 10:05   ` [PATCH v2] " Keith Amidon
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Walters @ 2016-10-14  6:58 UTC (permalink / raw)
  To: Keith Amidon, notmuch


Hi

Many thanks for doing this (and bringing this to out attention). I have
a couple of minor suggestions for tweaking what you have written, but I
am not certain they are improvements, so comments gratefully received.

On Tue, 11 Oct 2016, Keith Amidon <camalot@picnicpark.org> wrote:
> This commit expands docstrings for notmuch-fcc-dirs and
> notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
> are processed and make the ability to configure sent folders containing
> whitespace more discoverable.
> ---
>  emacs/notmuch-maildir-fcc.el | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
> index 95e5650..cfe1931 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -54,7 +54,10 @@ If `notmuch-maildir-use-notmuch-insert' is set (the default) then
>  the header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message.
> +stored message.  This string is split using `split-string-and-unquote',
> +so a folder name containing whitespace can be specified by
> +quoting the whitespace with an immediately preceeding backslash
> +or surrounding the entire folder name in double quotes.
>  
>  If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
>  header should be the directory where the message should be
> @@ -230,8 +233,12 @@ should be a list of tag changes to apply to the inserted message."
>  The fcc-header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message. If CREATE is non-nil then create the folder if
> -necessary."
> +stored message. This string is split using `split-string-and-unquote',
> +so a folder name containing whitespace can be specified by quoting
> +the whitespace with an immediately preceeding backslash or
> +surrounding the entire folder name in double quotes.

Maybe "...containing whitespace can be specified by quoting each
whitespace character with an immediately preceding backslash ..."

Or maybe "...so a folder name containing spaces can be specified by
quoting each space with an immediately preceding backslash ..."

The former is more accurate but the latter is simpler, and I don't think
tabs and newlines in filenames occur often enough to care about (in fact
I am not sure we cope with a newline in an fcc header anyway)

Best wishes

Mark


> +
> +If CREATE is non-nil then create the folder if necessary."
>    (let* ((args (split-string-and-unquote fcc-header))
>  	 (folder (car args))
>  	 (tags (cdr args)))
> -- 
> 2.10.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* [PATCH v2] Expand docstrings about fcc using notmuch-insert
  2016-10-14  6:58 ` Mark Walters
@ 2016-10-19 10:05   ` Keith Amidon
  2016-10-19 10:05     ` [PATCH] " Keith Amidon
  0 siblings, 1 reply; 9+ messages in thread
From: Keith Amidon @ 2016-10-19 10:05 UTC (permalink / raw)
  To: notmuch


Tnis version implements Mark's second, simpler, suggestion.  Since
the reference to split-string-and-unquote remains, someone with
sufficiently esoteric requirements will know where to look to
determine exactly what is possible.

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

* [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-19 10:05   ` [PATCH v2] " Keith Amidon
@ 2016-10-19 10:05     ` Keith Amidon
  2016-10-19 11:25       ` Mark Walters
  2016-10-22 15:52       ` David Bremner
  0 siblings, 2 replies; 9+ messages in thread
From: Keith Amidon @ 2016-10-19 10:05 UTC (permalink / raw)
  To: notmuch

This commit expands docstrings for notmuch-fcc-dirs and
notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
are processed and make the ability to configure sent folders containing
whitespace more discoverable.
---
 emacs/notmuch-maildir-fcc.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
index 95e5650..ea75bb9 100644
--- a/emacs/notmuch-maildir-fcc.el
+++ b/emacs/notmuch-maildir-fcc.el
@@ -54,7 +54,10 @@ If `notmuch-maildir-use-notmuch-insert' is set (the default) then
 the header should be of the form \"folder +tag1 -tag2\" where
 folder is the folder (relative to the notmuch mailstore) to store
 the message in, and tag1 and tag2 are tag changes to apply to the
-stored message.
+stored message. This string is split using `split-string-and-unquote',
+so a folder name containing spaces can be specified by
+quoting each space with an immediately preceding backslash
+or surrounding the entire folder name in double quotes.
 
 If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
 header should be the directory where the message should be
@@ -230,8 +233,12 @@ should be a list of tag changes to apply to the inserted message."
 The fcc-header should be of the form \"folder +tag1 -tag2\" where
 folder is the folder (relative to the notmuch mailstore) to store
 the message in, and tag1 and tag2 are tag changes to apply to the
-stored message. If CREATE is non-nil then create the folder if
-necessary."
+stored message. This string is split using `split-string-and-unquote',
+so a folder name containing spaces can be specified by
+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))
 	 (folder (car args))
 	 (tags (cdr args)))
-- 
2.10.0

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-19 10:05     ` [PATCH] " Keith Amidon
@ 2016-10-19 11:25       ` Mark Walters
  2016-10-22 15:52       ` David Bremner
  1 sibling, 0 replies; 9+ messages in thread
From: Mark Walters @ 2016-10-19 11:25 UTC (permalink / raw)
  To: Keith Amidon, notmuch


Hi

This version look good to me +1.  I recommend it for 0.23.1.

Best wishes

Mark



On Wed, 19 Oct 2016, Keith Amidon <camalot@picnicpark.org> wrote:
> This commit expands docstrings for notmuch-fcc-dirs and
> notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
> are processed and make the ability to configure sent folders containing
> whitespace more discoverable.
> ---
>  emacs/notmuch-maildir-fcc.el | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el
> index 95e5650..ea75bb9 100644
> --- a/emacs/notmuch-maildir-fcc.el
> +++ b/emacs/notmuch-maildir-fcc.el
> @@ -54,7 +54,10 @@ If `notmuch-maildir-use-notmuch-insert' is set (the default) then
>  the header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message.
> +stored message. This string is split using `split-string-and-unquote',
> +so a folder name containing spaces can be specified by
> +quoting each space with an immediately preceding backslash
> +or surrounding the entire folder name in double quotes.
>  
>  If `notmuch-maildir-use-notmuch-insert' is nil then the Fcc
>  header should be the directory where the message should be
> @@ -230,8 +233,12 @@ should be a list of tag changes to apply to the inserted message."
>  The fcc-header should be of the form \"folder +tag1 -tag2\" where
>  folder is the folder (relative to the notmuch mailstore) to store
>  the message in, and tag1 and tag2 are tag changes to apply to the
> -stored message. If CREATE is non-nil then create the folder if
> -necessary."
> +stored message. This string is split using `split-string-and-unquote',
> +so a folder name containing spaces can be specified by
> +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))
>  	 (folder (car args))
>  	 (tags (cdr args)))
> -- 
> 2.10.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch

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

* Re: [PATCH] Expand docstrings about fcc using notmuch-insert
  2016-10-19 10:05     ` [PATCH] " Keith Amidon
  2016-10-19 11:25       ` Mark Walters
@ 2016-10-22 15:52       ` David Bremner
  1 sibling, 0 replies; 9+ messages in thread
From: David Bremner @ 2016-10-22 15:52 UTC (permalink / raw)
  To: Keith Amidon, notmuch

Keith Amidon <camalot@picnicpark.org> writes:

> This commit expands docstrings for notmuch-fcc-dirs and
> notmuch-maildir-fcc-with-notmuch-insert to describe how quoted strings
> are processed and make the ability to configure sent folders containing
> whitespace more discoverable.

pushed to release and master

d

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

end of thread, other threads:[~2016-10-22 15:52 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11  4:52 [PATCH] Expand docstrings about fcc using notmuch-insert Keith Amidon
2016-10-13 22:40 ` Keith Amidon
2016-10-14  1:30   ` David Bremner
2016-10-14  2:57     ` Keith Amidon
2016-10-14  6:58 ` Mark Walters
2016-10-19 10:05   ` [PATCH v2] " Keith Amidon
2016-10-19 10:05     ` [PATCH] " Keith Amidon
2016-10-19 11:25       ` Mark Walters
2016-10-22 15:52       ` David Bremner

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).