Re: notmuch-emacs: Fcc to top-level directory given by database.path

2018-06-22 Thread Arun Isaac

>> notmuch insert --folder= or --folder="" does not work:
>>
>> String argument for option "folder" must be non-empty.
>> Unrecognized option: --folder=
>>
> This should be fixed in 733ccfabc, as part of 0.26

I have verified this, and it works.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2018-06-06 Thread David Bremner
Jani Nikula  writes:

> On Sat, 23 Sep 2017, David Bremner  wrote:
>> Do you happen to know if it calls with an empty string as the folder
>> name? It would be consistent with searching for that to insert at the
>> top level.
>
> notmuch insert --folder= or --folder="" does not work:
>
> String argument for option "folder" must be non-empty.
> Unrecognized option: --folder=
>

This should be fixed in 733ccfabc, as part of 0.26

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-10-04 Thread Arun Isaac
Jani Nikula  writes:

> On Sat, 23 Sep 2017, David Bremner  wrote:
>> Do you happen to know if it calls with an empty string as the folder
>> name? It would be consistent with searching for that to insert at the
>> top level.
>
> notmuch insert --folder= or --folder="" does not work:
>
> String argument for option "folder" must be non-empty.
> Unrecognized option: --folder=
>
> It seems that our argument parser doesn't accept empty strings at all,
> which is a bit of a limitation. It would be logical for the empty string
> to work here, and AFAICT the notmuch insert code would handle this if
> the argument was let through the parsing.

I agree. Fixing this in the `notmuch insert' argument parser is a better
solution.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-10-02 Thread Jani Nikula
On Sat, 30 Sep 2017, Jani Nikula  wrote:
> On Sat, 23 Sep 2017, David Bremner  wrote:
>> Do you happen to know if it calls with an empty string as the folder
>> name? It would be consistent with searching for that to insert at the
>> top level.
>
> notmuch insert --folder= or --folder="" does not work:
>
> String argument for option "folder" must be non-empty.
> Unrecognized option: --folder=
>
> It seems that our argument parser doesn't accept empty strings at all,
> which is a bit of a limitation. It would be logical for the empty string
> to work here, and AFAICT the notmuch insert code would handle this if
> the argument was let through the parsing.

Turns out this is trivial to address on top of the arg parsing series:
id:20171002162552.4827-1-j...@nikula.org.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-10-02 Thread Jani Nikula
On Mon, 02 Oct 2017, Arun Isaac  wrote:
> Mark Walters  writes:
>
>> Incidentally, I think "/" is an alternative for the fcc line which
>> already works, which is "\"/\" in notmuch-fcc-dirs.
>
> Perhaps, notmuch should be made to tolerate a "/" at the beginning of the
> Fcc folder argument. That is, notmuch should not complain about absolute
> paths, and it should interpret these as relative to the root. To
> maintain backward compatibility, we could add a "/" at the beginning if
> it is not already there.
>
> So,
>
> "/" => database.path
> "/sent" => database.path/sent
> "sent" => database.path/sent
>
> etc.
>
> Is this a better idea?

At the cli notmuch insert level, I'd actually rather do the opposite and
be even stricter about folder being relative. I just had to look at the
code for other reasons, and it seems to accept all sorts of weird combos
with "/" and "." that I think should be rejected. Or at the very least
sanitized. Otherwise we end up with filenames with "//" or "/./" in
them, probably confusing notmuch later on.

I'd argue notmuch insert --folder="" should Fcc to the mail store root,
but alas that doesn't work at the cli level. It doesn't appear to work
at the emacs level either, but perhaps notmuch-emacs could translate ""
to dropping the --folder argument? Could even add that as a choice
option in notmuch-fcc-dirs customization. Mark?

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-10-02 Thread Mark Walters

Hi

On Sun, 01 Oct 2017, Arun Isaac  wrote:
> Mark Walters  writes:
>
>> Incidentally, I think "/" is an alternative for the fcc line which
>> already works, which is "\"/\" in notmuch-fcc-dirs.
>
> Perhaps, notmuch should be made to tolerate a "/" at the beginning of the
> Fcc folder argument. That is, notmuch should not complain about absolute
> paths, and it should interpret these as relative to the root. To
> maintain backward compatibility, we could add a "/" at the beginning if
> it is not already there.
>
> So,
>
> "/" => database.path
> "/sent" => database.path/sent
> "sent" => database.path/sent
>
> etc.
>
> Is this a better idea?

The reason for the warning is that this behaviour is completely
different from what you would get with normal file fcc. Given that, I am
a little reluctant to drop the warning.

Best wishes

Mark

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-10-01 Thread Arun Isaac
Mark Walters  writes:

> Incidentally, I think "/" is an alternative for the fcc line which
> already works, which is "\"/\" in notmuch-fcc-dirs.

Perhaps, notmuch should be made to tolerate a "/" at the beginning of the
Fcc folder argument. That is, notmuch should not complain about absolute
paths, and it should interpret these as relative to the root. To
maintain backward compatibility, we could add a "/" at the beginning if
it is not already there.

So,

"/" => database.path
"/sent" => database.path/sent
"sent" => database.path/sent

etc.

Is this a better idea?
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-30 Thread Jani Nikula
On Sat, 23 Sep 2017, David Bremner  wrote:
> Do you happen to know if it calls with an empty string as the folder
> name? It would be consistent with searching for that to insert at the
> top level.

notmuch insert --folder= or --folder="" does not work:

String argument for option "folder" must be non-empty.
Unrecognized option: --folder=

It seems that our argument parser doesn't accept empty strings at all,
which is a bit of a limitation. It would be logical for the empty string
to work here, and AFAICT the notmuch insert code would handle this if
the argument was let through the parsing.

BR,
Jani.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-30 Thread Mark Walters
On Sun, 24 Sep 2017, David Bremner  wrote:
> Arun Isaac  writes:
>
>>> In any case I've noted your feature request/bug-report. It doesn't sound
>>> terribly difficult to change, but it will need someone motivated to
>>> think about all of the related details like updating the test suite and
>>> changing docstrings.
>>
>> I can contribute this patch. Shall I make it such that if the folder
>> part of `notmuch-fcc-dirs' is an empty string, then `notmuch insert' is
>> called without a `--folder=' argument?
>
> Sounds reasonable to me. Any objections Mark?

I am not sure: do we want an empty Fcc header to save the message to the
root folder? (At the moment the insert fails for an empty Fcc header
which isn't good either) In general though are suggesting Fcc header
lines of the form

""

or

"" +sent

save to the root folder?

Apart from the empty header case that sounds fine. I am not sure about
the documentation for it -- the variable is already a little
complicated, so I wouldn't want to clutter it further.

Incidentally, I think "/" is an alternative for the fcc line which
already works, which is "\"/\" in notmuch-fcc-dirs.

Best wishes

Mark



___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-25 Thread Tomi Ollila
On Sun, Sep 24 2017, David Bremner wrote:

> Arun Isaac  writes:
>
>>> In any case I've noted your feature request/bug-report. It doesn't sound
>>> terribly difficult to change, but it will need someone motivated to
>>> think about all of the related details like updating the test suite and
>>> changing docstrings.
>>
>> I can contribute this patch. Shall I make it such that if the folder
>> part of `notmuch-fcc-dirs' is an empty string, then `notmuch insert' is
>> called without a `--folder=' argument?
>
> Sounds reasonable to me. Any objections Mark?

Will the eventual fate of the --folder argument be decided based on the

Fcc:

header string in Message[Notmuch] mode: buffer ?

i.e. if it is empty, then call notmuch insert w/o --folder argument,
and is absent, don't do fcc  (and e.g. './' would save directly...?)

> d

Tomi
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-24 Thread David Bremner
Arun Isaac  writes:

>> In any case I've noted your feature request/bug-report. It doesn't sound
>> terribly difficult to change, but it will need someone motivated to
>> think about all of the related details like updating the test suite and
>> changing docstrings.
>
> I can contribute this patch. Shall I make it such that if the folder
> part of `notmuch-fcc-dirs' is an empty string, then `notmuch insert' is
> called without a `--folder=' argument?

Sounds reasonable to me. Any objections Mark?

d
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-23 Thread Arun Isaac

Mark Walters  writes:

> Alternatively, does just using / as the folder work?

notmuch complains about absolute paths if / is used as the folder. Look
at function `notmuch-maildir-add-notmuch-insert-style-fcc-header' in
notmuch-maildir-fcc.el.

David Bremner  writes:

> Do you happen to know if it calls with an empty string as the folder
> name? It would be consistent with searching for that to insert at the
> top level.

Setting notmuch-fcc-dirs to "\"\"" fails, if that's what you are asking.

I also tried "." as the folder. This works, but if I search using
`notmuch search --output=files ...', the filename is of the form
"database.path/./cur/some.mail.file". This is not so clean.

> In any case I've noted your feature request/bug-report. It doesn't sound
> terribly difficult to change, but it will need someone motivated to
> think about all of the related details like updating the test suite and
> changing docstrings.

I can contribute this patch. Shall I make it such that if the folder
part of `notmuch-fcc-dirs' is an empty string, then `notmuch insert' is
called without a `--folder=' argument?
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-23 Thread Mark Walters

On Sat, 23 Sep 2017, David Bremner  wrote:
> Arun Isaac  writes:
>
>> I am using notmuch-emacs, and I would like to Fcc my sent mail to the
>> top-level directory given by database.path, instead of using a folder
>> like "sent" relative to the top-level directory.
>>
>> The function `notmuch-maildir-notmuch-insert-current-buffer' in
>> notmuch-maildir-fcc.el calls `notmuch insert' with the `--folder='
>> argument. I would like it to not do this.
>
> Do you happen to know if it calls with an empty string as the folder
> name? It would be consistent with searching for that to insert at the
> top level.
>
> In any case I've noted your feature request/bug-report. It doesn't sound
> terribly difficult to change, but it will need someone motivated to
> think about all of the related details like updating the test suite and
> changing docstrings.

Alternatively, does just using / as the folder work?

Best wishes

Mark

___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-23 Thread David Bremner
Arun Isaac  writes:

> I am using notmuch-emacs, and I would like to Fcc my sent mail to the
> top-level directory given by database.path, instead of using a folder
> like "sent" relative to the top-level directory.
>
> The function `notmuch-maildir-notmuch-insert-current-buffer' in
> notmuch-maildir-fcc.el calls `notmuch insert' with the `--folder='
> argument. I would like it to not do this.

Do you happen to know if it calls with an empty string as the folder
name? It would be consistent with searching for that to insert at the
top level.

In any case I've noted your feature request/bug-report. It doesn't sound
terribly difficult to change, but it will need someone motivated to
think about all of the related details like updating the test suite and
changing docstrings.

d


___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


notmuch-emacs: Fcc to top-level directory given by database.path

2017-09-23 Thread Arun Isaac

I am using notmuch-emacs, and I would like to Fcc my sent mail to the
top-level directory given by database.path, instead of using a folder
like "sent" relative to the top-level directory.

The function `notmuch-maildir-notmuch-insert-current-buffer' in
notmuch-maildir-fcc.el calls `notmuch insert' with the `--folder='
argument. I would like it to not do this.

For my immediate purposes, I have overridden
`notmuch-maildir-notmuch-insert-current-buffer' with the following
advice. But, it would be nice if this feature existed out of the box.

(define-advice notmuch-maildir-notmuch-insert-current-buffer
  (:override (folder  create tags)
 insert-into-root)
(apply 'notmuch-call-notmuch-process
   :stdin-string (buffer-string)
   "insert" tags))
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch