Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-12 Thread Daniel Kahn Gillmor
On Wed 2019-12-11 10:00:07 -0400, David Bremner wrote:
> David Edmondson  writes:
>
>> It seems that only “notmuch new” is currently prepared to create a new
>> database, but it will also import all of my email before I have a chance
>> to set the above parameters.
>>
>> It seems that the obvious answer is “notmuch config” will create a
>> database if necessary. Is that the plan?
>
> Wouldn't it make sense to have "notmuch setup" do this?

It has always puzzled me that "notmuch setup" did not actually set up
the database in the first place.  So yes, i think this is the right
answer.

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-12 Thread Jorge P . de Morais Neto
Hello.

Em [2019-12-10 ter 12:01:06-0500], Daniel Kahn Gillmor escreveu:

> Perhaps you would be satisfied with some sort of "post-config-update" hook?

Yes, I think that would fulfill my needs.  And it would satisfy not only
people who use Unison, but also people who use some "realtime" (don't
know if that is the right word) synchronization tool like Netxcloud.

Regards
-- 
- 
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-11 Thread Daniel Kahn Gillmor
On Tue 2019-12-10 09:46:14 -0300, Jorge P. de Morais Neto wrote:
> I hope you don't mind my insistence

Insistence is fine -- it sounds like you have a real need for your
backup/sync strategy, and if we can figure out a way to support it, that
would be good.  perhaps we should talk about different ways to get what
you're looking for, though.

Perhaps you would be satisfied with some sort of "post-config-update" hook?

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-11 Thread David Edmondson
On Wednesday, 2019-12-11 at 10:00:07 -04, David Bremner wrote:

> David Edmondson  writes:
>
>> It seems that only “notmuch new” is currently prepared to create a new
>> database, but it will also import all of my email before I have a chance
>> to set the above parameters.
>>
>> It seems that the obvious answer is “notmuch config” will create a
>> database if necessary. Is that the plan?
>
> Wouldn't it make sense to have "notmuch setup" do this?

Oh, yes, of course. I had forgotten that existed :-)

dme.
-- 
Tell her I'll be waiting, in the usual place.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-11 Thread David Bremner
David Edmondson  writes:

> It seems that only “notmuch new” is currently prepared to create a new
> database, but it will also import all of my email before I have a chance
> to set the above parameters.
>
> It seems that the obvious answer is “notmuch config” will create a
> database if necessary. Is that the plan?

Wouldn't it make sense to have "notmuch setup" do this?

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


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-11 Thread David Edmondson
On Tuesday, 2019-12-10 at 08:11:56 -08, Jameson Graef Rollins wrote:

> Fwiw I support dkg's idea to store the config in the database itself.  I
> think that's a clean simplification that makes a lot of sense.

I'm not inherently against this, but I'm unsure exactly how it would
work.

For example, I set new.tags and new.ignore in my current
.notmuch-config. If they move into the database, how will I set them
before I have a database?

It seems that only “notmuch new” is currently prepared to create a new
database, but it will also import all of my email before I have a chance
to set the above parameters.

It seems that the obvious answer is “notmuch config” will create a
database if necessary. Is that the plan?

dme.
-- 
They like the smell of it in Hollywood.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-10 Thread Jameson Graef Rollins
On Sun, Dec 08 2019, Jorge P. de Morais Neto  wrote:
> Em [2019-12-08 dom 09:12:55-0800], Jameson Graef Rollins escreveu:
>
>> You can already use 'notmuch config list' to dump every configuration
>> item to stdout.  Would that be sufficient for personal synchronization
>> purposes.
>
> But then I would have to remember invoking
> ~notmuch config list > ~/notmuch-config~
> every time I changed Notmuch configuration.

Rather than remember, why not just have your synchronization script
retrieve the config at sync time using notmuch config/dump.  That way
you don't have to remember to do anything, and you can be agnostic about
how the configuration info is stored on disk.

Fwiw I support dkg's idea to store the config in the database itself.  I
think that's a clean simplification that makes a lot of sense.

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


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-10 Thread Jorge P . de Morais Neto
Hello.

Em [2019-12-09 seg 13:31:22-0500], Daniel Kahn Gillmor escreveu:

> One problem with such a "perennial text file" is that people will want
> to edit it.  When they do, what should happen?

Well, the file could be named "notmuch-config-view" and the contents
could include comments explaining it is just a view.  Besides, the
generation of such a file could be opt-in.

I hope you don't mind my insistence (it is my personality) and, of
course, there is still the problem of slightly increasing Notmuch's
complexity to provide a small benefit for relatively few people.  It is
(obviously) your call, since you understand much more about the Notmuch
codebase (and free/libre software development in general) than me.
Besides, it is not me who am going to actually implement this (I am
unfortunately unable to contribute C code to Notmuch at this moment).

Regards
-- 
- 
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]

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


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-09 Thread Daniel Kahn Gillmor
On Sun 2019-12-08 15:19:38 -0300, Jorge P. de Morais Neto wrote:
> Em [2019-12-08 dom 09:12:55-0800], Jameson Graef Rollins escreveu:
>
>> You can already use 'notmuch config list' to dump every configuration
>> item to stdout.  Would that be sufficient for personal synchronization
>> purposes.
>
> But then I would have to remember invoking
> ~notmuch config list > ~/notmuch-config~
> every time I changed Notmuch configuration.  It would be more convenient
> and less error-prone for Notmuch to keep a perennial text file
> reflecting the configuration in the database.  Oh, I that file should be
> updated not only by ~notmuch edit config~, but also by ~notmuch config
> set~.

One problem with such a "perennial text file" is that people will want
to edit it.  When they do, what should happen?

So the proposal to maintain such a file seems like we would be adding an
interface to notmuch that will not be used by many people, and will
eventually hurt (or at least confuse) users in surprising ways.

I'd rather keep notmuch itself simpler, and expect users who are syncing
to sync things like the output of "notmuch dump" (which already includes
all db-stored config).

--dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-08 Thread Jorge P . de Morais Neto
Em [2019-12-08 dom 09:12:55-0800], Jameson Graef Rollins escreveu:

> You can already use 'notmuch config list' to dump every configuration
> item to stdout.  Would that be sufficient for personal synchronization
> purposes.

But then I would have to remember invoking
~notmuch config list > ~/notmuch-config~
every time I changed Notmuch configuration.  It would be more convenient
and less error-prone for Notmuch to keep a perennial text file
reflecting the configuration in the database.  Oh, I that file should be
updated not only by ~notmuch edit config~, but also by ~notmuch config
set~.

Regards
-- 
- 
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-08 Thread Jameson Graef Rollins
On Sun, Dec 08 2019, Jorge P. de Morais Neto  wrote:
> Em [2019-11-22 sex 10:43:40+0800], Daniel Kahn Gillmor escreveu:
>
>> Better than documenting, i'd be happy if we would add a "notmuch config
>> edit" subcommand, which handles the above sequence for you, invoking
>> $EDITOR at the appropriate time.
>>
>> The only caveat i see there is if the end user wants to inject comments
>> in the config file, which would then be stripped out in between these
>> invocations.  perhaps someone who finds these comments in config files
>> super important could propose a way to stash them in the db and recover
>> them during "notmuch config edit" as well :)
>
> I sync my two Notmuch configuration files -- personal notebook and
> workplace desktop -- over Unison via a USB flash drive.  This way, when
> I want to reconfigure Notmuch in one machine, I have the other machine's
> configuration as reference.  However, I do not sync the entire Notmuch
> databases because, since they are big and change frequently, I suppose
> they would wear the USB flash drive and also increase the
> synchronization time.
>
> Thus for my use case it would be useful if "notmuch config edit" could
> automatically keep a perennial text file reflecting the configuration in
> the database.  That text file would then be synchronized by Unison.

You can already use 'notmuch config list' to dump every configuration
item to stdout.  Would that be sufficient for personal synchronization
purposes.

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


Re: moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-12-08 Thread Jorge P . de Morais Neto
Em [2019-11-22 sex 10:43:40+0800], Daniel Kahn Gillmor escreveu:

> Better than documenting, i'd be happy if we would add a "notmuch config
> edit" subcommand, which handles the above sequence for you, invoking
> $EDITOR at the appropriate time.
>
> The only caveat i see there is if the end user wants to inject comments
> in the config file, which would then be stripped out in between these
> invocations.  perhaps someone who finds these comments in config files
> super important could propose a way to stash them in the db and recover
> them during "notmuch config edit" as well :)

I sync my two Notmuch configuration files -- personal notebook and
workplace desktop -- over Unison via a USB flash drive.  This way, when
I want to reconfigure Notmuch in one machine, I have the other machine's
configuration as reference.  However, I do not sync the entire Notmuch
databases because, since they are big and change frequently, I suppose
they would wear the USB flash drive and also increase the
synchronization time.

Thus for my use case it would be useful if "notmuch config edit" could
automatically keep a perennial text file reflecting the configuration in
the database.  That text file would then be synchronized by Unison.

Regards
-- 
- 
- I am Brazilian.  I hope my English is correct and I welcome feedback.
- Please adopt free formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]

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


moving the config into the database [was: Re: [PATCH] Display extra headers for emacs-mua - db config option]

2019-11-21 Thread Daniel Kahn Gillmor
On Thu 2019-11-21 23:38:06 +0200, Tomi Ollila wrote:
> How can library open the database if it doesn't read the config file
> -- the config file defines where database is located =D

The *only* thing i think worth keeping in the config file is ultimately
the location of the database, though i would eventually prefer that we
introduce a NOTMUCH_DATABASE env var, and use it if we can't find a
config.

This is the moral equivalent of the NOTMUCH_CONFIG env var, as far as
i'm concerned, but more rationalized.

and *eventually eventually* drop the config file entirely, yes.

> If the library can somehow guess the location of the database without
> reading the config file ;D I think dumping -- editing -- restoring
> the database is tolerable solution -- provided it is clearly documented
> for people like me who wants to edit configuration files w/ text
> editor(*),

Better than documenting, i'd be happy if we would add a "notmuch config
edit" subcommand, which handles the above sequence for you, invoking
$EDITOR at the appropriate time.

The only caveat i see there is if the end user wants to inject comments
in the config file, which would then be stripped out in between these
invocations.  perhaps someone who finds these comments in config files
super important could propose a way to stash them in the db and recover
them during "notmuch config edit" as well :)

> (+) if we dropped the configuration file, then notmuch, and library could
> open database from ~/mail/notmuch/ by default, or from location pointed
> by e.g. NOTMUCH_DATABASE_DIR -- as an additional benefit(?) notmuch
> would pollute user's $HOME by one file less -- the `.notmuch-config`.

You named the env var differently than i did, but i'd be happy to go
with your name, since it seems we arrived at the same design
independently :)

 --dkg


signature.asc
Description: PGP signature
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch