folder-hook for sending to lists

2014-02-02 Thread glphvgacs
when starting the Mail composition in mutt, is there a way skip the 'To:'
header by filling it up based on a given pattern?
i don't think a folder-hook would do this since i don't think there is such
a thing as 'set to = ' in configuration file (correct me if i'm wrong
please). so perhaps a macro?


how do disable Fcc?

2014-02-02 Thread glphvgacs
right now i have:
set record = /dev/null

but i have a feeling that's not the canonical way of doing this. any
suggestions?


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:24:19PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:06]:
> > when starting the Mail composition in mutt, is there a way skip the
> > 'To:' header by filling it up based on a given pattern?
> > i don't think a folder-hook would do this since i don't think there is
> > such a thing as 'set to = ' in configuration file (correct me if i'm
> > wrong please).  so perhaps a macro?
> 
> check the "subscribed" section of your example .muttrc or the mutt docs.

i was just reading that and actually just added that to muttrc. here is the
thing though, it just adds the 'L' to the threads/msgs that belong to the
list. i doesn't _skip_ the 'To:' part of mail composition.
i mean i don't see how ``subscribe'' is relevant here.


Re: how do disable Fcc?

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:27:34PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:09]:
> > right now i have:
> > set record = /dev/null
> > 
> > but i have a feeling that's not the canonical way of doing this. any
> > suggestions?
> 
> use the force, luke
> 
> check "man muttrc" and look for record

you mean $force_name ?


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:24:19PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:06]:
> > when starting the Mail composition in mutt, is there a way skip the
> > 'To:' header by filling it up based on a given pattern?
> > i don't think a folder-hook would do this since i don't think there is
> > such a thing as 'set to = ' in configuration file (correct me if i'm
> > wrong please).  so perhaps a macro?

maybe i can use my_hdr


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs

starting a thread is the problem. to reply to a mailing list, list-reply
works just fine. but when one wants to start a thread, that's when you need
to skip the 'To:'


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:44:58PM -0500, Patrick Shanahan wrote:
> How are you trying to "reply to list"?  Are you using the "L" key as
> described in the fine manual?

yes. i'm not talking about _reply_, i'm talking about starting a thread.


Re: how do disable Fcc?

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:45:51PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:41]:
> > On Sun, Feb 02, 2014 at 02:27:34PM -0500, Patrick Shanahan wrote:
> > > * glphvgacs  [02-02-14 14:09]:
> > > > right now i have:
> > > > set record = /dev/null
> > > > 
> > > > but i have a feeling that's not the canonical way of doing this. any
> > > > suggestions?
> > > 
> > > use the force, luke
> > > 
> > > check "man muttrc" and look for record
> > 
> > you mean $force_name ?
> 
> No, I mean to read the man pages.  Did you look for "record" in "man
> muttrc".  It is explained there.

$record is a path, i'm looking for a boolean.
i asked about $force_name because it overwrites $record, i thought you mean
that since obviously i know what record does, if cared to read the
question. much less than the man page i might add.


Re: how do disable Fcc?

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 08:53:57PM +0100, Rejo Zenger wrote:
> Untested, but I presume "unset record" will work.

nice, thanks.


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 03:01:41PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:54]:
> > 
> > starting a thread is the problem. to reply to a mailing list, list-reply
> > works just fine.  but when one wants to start a thread, that's when you
> > need to skip the 'To:'
> 
> Then list-reply to an existing thread, and remove the "In-Reply-To:"
> header and adjust the Subject:.

that's your solution? never mind.


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:57:13PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:46]:
> > On Sun, Feb 02, 2014 at 02:24:19PM -0500, Patrick Shanahan wrote:
> > > * glphvgacs  [02-02-14 14:06]:
> > > > when starting the Mail composition in mutt, is there a way skip the
> > > > 'To:' header by filling it up based on a given pattern?
> > > > i don't think a folder-hook would do this since i don't think there is
> > > > such a thing as 'set to = ' in configuration file (correct me if i'm
> > > > wrong please).  so perhaps a macro?
> > 
> > maybe i can use my_hdr
> 
> why?
> 
> Didn't you ask about mail-lists?
> 
> From the fine manual, "subscribed" tells mutt about the mailing lists you
> are subscribed to and allows mutt to assign a to and from address for
> *that* list.  You also need to set up aliases and, perhaps, send-hooks,
> for the "subscribed" lists.

where doesn't it say "assing a to and from"?


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 09:00:56PM +0100, Rejo Zenger wrote:
> ++ 02/02/14 14:05 -0500 - glphvgacs:
> >when starting the Mail composition in mutt, is there a way skip the 'To:'
> >header by filling it up based on a given pattern?
> >i don't think a folder-hook would do this since i don't think there is such
> >a thing as 'set to = ' in configuration file (correct me if i'm wrong
> >please). so perhaps a macro?
> 
> Untested, probably something like the following will work:
> 
>   unmy_hdr To:

my_hdr To: works, almost. 
folder-hook to:mutt-users@mutt.org '\
 my_hdr To:mutt-users@mutt.org'

it fills up the To: header but it's missing '\n' to go
to Subject:
i tried this but didn't work:
 my_hdr To:mutt-users@mutt.org\n'

is there a way to add the '\n' there?



sidebar_{width,refresh} in man muttrc

2014-02-02 Thread glphvgacs

is that swapped or what?


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 02:57:13PM -0500, Patrick Shanahan wrote:
> * glphvgacs  [02-02-14 14:46]:
> > On Sun, Feb 02, 2014 at 02:24:19PM -0500, Patrick Shanahan wrote:
> > > * glphvgacs  [02-02-14 14:06]:
> > > > when starting the Mail composition in mutt, is there a way skip the
> > > > 'To:' header by filling it up based on a given pattern?
> > > > i don't think a folder-hook would do this since i don't think there is
> > > > such a thing as 'set to = ' in configuration file (correct me if i'm
> > > > wrong please).  so perhaps a macro?
> > 
> > maybe i can use my_hdr
> 
> why?

folder-hook to:mutt-users@mutt.org '\
 my_hdr To:mutt-users@mutt.org'

that's why.
in fact passing an '\n' at the end would be nice too.


Re: folder-hook for sending to lists

2014-02-02 Thread glphvgacs
On Sun, Feb 02, 2014 at 05:45:54PM -0600, David J. Weller-Fahy wrote:
> * glphvgacs  [2014-02-02 14:28 -0600]:
> > > ++ 02/02/14 14:05 -0500 - glphvgacs:
> > > >when starting the Mail composition in mutt, is there a way skip the
> > > >'To:' header by filling it up based on a given pattern?
> > 
> > is there a way to add the '\n' there?
> 
> I didn't find a way to add the '\n', instead I looked for another way to
> skip that prompt entirely.  For each mailing list you want to use in
> this way, do the following.
> 
> #v+
> folder-hook . "unset autoedit; set edit_headers=yes"
> folder-hook '=lists\.mutt-users'  "set autoedit=yes; set edit_headers=yes"
> folder-hook . "unmy_hdr To:"
> folder-hook '=lists\.mutt-users'  "my_hdr To: mutt-users@mutt.org"
> #v-

now that is what i'm talking about. great stuff, thanks.

> Note that both "set autoedit=yes" and "set edit_headers=yes" together
> are what gets you to the message without setting the recipient first.
> Also note that the folder-hook to execute in all other folders is based
> on my defaults, change to suit.  

i already had:
  set edit_header=yes
so i added this to muttrc:
  unset autoedit

and this to hooks:
  folder-hook to:mutt-users@mutt.org '\
set autoedit=yes
my_hdr To:'
  folder-hook to:mutt-users@mutt.org '\ 
my_hdr To:mutt-users@mutt.org'

> Also, also note that the folder name is
> based on my folder layout, not yours, so that'll have to change.

np, i use mutt-kz and folder are actually vfolder and easy grep (Get with
rexp)

> See section "3.18. autoedit" in TFM.

a 'see also' pointer to that from mailing list section would be nice.


Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Sun, Feb 02, 2014 at 07:37:49PM -0600, David J. Weller-Fahy wrote:
> * glphvgacs  [2014-02-02 18:25 -0600]:
> > and this to hooks:
> >   folder-hook to:mutt-users@mutt.org '\
> > set autoedit=yes
> > my_hdr To:'
> >   folder-hook to:mutt-users@mutt.org '\ 
> > my_hdr To:mutt-users@mutt.org'
> 
> By the way, you may want to check your hooks thoroughly, as a second
> address seems to have crept into your response.  The second address
> includes a trailing single quote (').  The "To:" header I received from
> you via the mailing list is below.
> #v+
> To: mutt-users@mutt.org, mutt-users@mutt.org'
> #v-
> 

appended address, i think, has to do with the order of folder's in my
sidebar.

so this is a snippet of my config:
"drw  [   -->   ]" "notmuch://?query=folder:drw AND tag:unread NOT 
from:darwinsker...@gmail.com" \
" [  <--]" 
"notmuch://?query=from:darwinsker...@gmail.com&limit=512" \
" [  <-->   ]" "notmuch://?query=folder:drw AND 
from:darwinsker...@gmail.com AND to:darwinsker...@gmail.com" \
" [   ..]" "notmuch://?query=folder:drw" \
"list [   ycm   ]" "notmuch://?query=tag:ycm-users" \
" [   vim   ]" "notmuch://?query=tag:vim_use" \
" [   zsh   ]" "notmuch://?query=tag:zsh-users" \
" [   mutt  ]" "notmuch://?query=to:mutt-users@mutt.org"  \

'folder:' is for filesystem directories here; in particular there is path:

.maildir/gmail/drw

if i go to this very thread in [ <-- ], _after_ i've gone over [ ycm ] and
do  from there guess what happens:
folder-hook tag:ycm-users "set autoedit=yes; my_hdr 
To:ycm-us...@googlegroups.com

and so i get:
To: mutt-users@mutt.org, ycm-us...@googlegroups.com

i don't know if there is a way to un-hook a hook when one leaves a folder,
or rather when a pattern for a hook stops to evaluate TRUE.

another guess, this might have something to do with the fact that
there is no List-id: in mutt-users's headers (wonder why?)

> This may or may not be related to the trailing space I noticed in your
> hooks (the trailing space i on the first line of the second folder-hook
> in the quoted content above).
> 
> Regards,
> -- 
> dave [ please don't CC me ]


(') has to do with me not ever knowing how to wrap a *-hook line. brackets
would be nice; something like:

foo-hook (pattern) {
  set bar = baz
}

shouldn't harm anyone and help with clarity, imho. (hmm, i will check the
man after i send this, it might be implemented and then i'm in trouble:) )


Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Mon, Feb 03, 2014 at 11:03:36AM -0500, glphvgacs wrote:
> On Sun, Feb 02, 2014 at 07:37:49PM -0600, David J. Weller-Fahy wrote:
> > * glphvgacs  [2014-02-02 18:25 -0600]:
> > > and this to hooks:
> > >   folder-hook to:mutt-users@mutt.org '\
> > > set autoedit=yes
> > > my_hdr To:'
> > >   folder-hook to:mutt-users@mutt.org '\ 
> > > my_hdr To:mutt-users@mutt.org'
> > 
> > By the way, you may want to check your hooks thoroughly, as a second
> > address seems to have crept into your response.  The second address
> > includes a trailing single quote (').  The "To:" header I received from
> > you via the mailing list is below.
> > #v+
> > To: mutt-users@mutt.org, mutt-users@mutt.org'
> > #v-
> > 
> 
> appended address, i think, has to do with the order of folder's in my
> sidebar.
> 
> so this is a snippet of my config:
> "drw  [   -->   ]" "notmuch://?query=folder:drw AND tag:unread NOT 
> from:darwinsker...@gmail.com" \
> " [  <--]" 
> "notmuch://?query=from:darwinsker...@gmail.com&limit=512" \
> " [  <-->   ]" "notmuch://?query=folder:drw AND 
> from:darwinsker...@gmail.com AND to:darwinsker...@gmail.com" \
> " [   ..]" "notmuch://?query=folder:drw" \
> "list [   ycm   ]" "notmuch://?query=tag:ycm-users" \
> " [   vim   ]" "notmuch://?query=tag:vim_use" \
> " [   zsh   ]" "notmuch://?query=tag:zsh-users" \
> " [   mutt  ]" "notmuch://?query=to:mutt-users@mutt.org"  \
> 
> 'folder:' is for filesystem directories here; in particular there is path:
> 
> .maildir/gmail/drw
> 
> if i go to this very thread in [ <-- ], _after_ i've gone over [ ycm ] and

bad idea, to to re-send? maybe, list-reply from [ mutt ], which is what i'm
dong now, is actually better, since my previous commnets get quoted, which
is nice.

> do  from there guess what happens:
> folder-hook tag:ycm-users "set autoedit=yes; my_hdr 
> To:ycm-us...@googlegroups.com
> 
> and so i get:
> To: mutt-users@mutt.org, ycm-us...@googlegroups.com
> 
> i don't know if there is a way to un-hook a hook when one leaves a folder,
> or rather when a pattern for a hook stops to evaluate TRUE.
> 
> another guess, this might have something to do with the fact that
> there is no List-id: in mutt-users's headers (wonder why?)
> 
> > This may or may not be related to the trailing space I noticed in your
> > hooks (the trailing space i on the first line of the second folder-hook
> > in the quoted content above).
> > 
> > Regards,
> > -- 
> > dave [ please don't CC me ]
> 
> 
> (') has to do with me not ever knowing how to wrap a *-hook line. brackets
> would be nice; something like:
> 
> foo-hook (pattern) {
>   set bar = baz
> }
> 
> shouldn't harm anyone and help with clarity, imho. (hmm, i will check the
> man after i send this, it might be implemented and then i'm in trouble:) )

alright, i saw the unhook, let me think if and how i can use it here.



Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Mon, Feb 03, 2014 at 11:16:50AM -0500, glphvgacs wrote:
> On Mon, Feb 03, 2014 at 11:09:42AM -0500, glphvgacs wrote:
> > alright, i saw the unhook, let me think if and how i can use it here.
> > 
> 
> cann't unhook from within a hook :
>  folder-hook . "unhook *"
> 
> this has no effect, or not the effect i want it to have:
>  unhook *
> 
this is how i changes folders:
macro index J ""
macro index K ""
macro index  ""
macro index  ""

but don't know if unhook has an equivalent function that can be called at
the end of a those macros.


Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Mon, Feb 03, 2014 at 11:09:42AM -0500, glphvgacs wrote:
> alright, i saw the unhook, let me think if and how i can use it here.
> 

cann't unhook from within a hook :
 folder-hook . "unhook *"

this has no effect, or not the effect i want it to have:
 unhook *



Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Mon, Feb 03, 2014 at 10:40:24AM -0800, Gary Johnson wrote:
> On 2014-02-03, glphvgacs wrote:
> > On Mon, Feb 03, 2014 at 11:09:42AM -0500, glphvgacs wrote:
> > > alright, i saw the unhook, let me think if and how i can use it here.
> > > 
> > 
> > cann't unhook from within a hook :
> >  folder-hook . "unhook *"
> > 
> > this has no effect, or not the effect i want it to have:
> >  unhook *
> 
> Sure you can.  At least you can unhook specific hook types and I see
> no reason that you couldn't unhook all hooks, although that might
> kill the execution of other folder-hooks until they are redefined.
> As an example from my muttrc:
> 
> folder-hook . 'unhook message-hook'
> 
> Regards,
> Gary
> 

true, i don't know what i was doing earlier. it works for both folder-hook
and (*). however changing folders now happen in slow-motion. i haven't test
the effect either.


Re: folder-hook for sending to lists

2014-02-03 Thread glphvgacs
On Mon, Feb 03, 2014 at 02:10:13PM -0500, glphvgacs wrote:
> On Mon, Feb 03, 2014 at 10:40:24AM -0800, Gary Johnson wrote:
> > On 2014-02-03, glphvgacs wrote:
> > > On Mon, Feb 03, 2014 at 11:09:42AM -0500, glphvgacs wrote:
> > > > alright, i saw the unhook, let me think if and how i can use it here.
> > > > 
> > > 
> > > cann't unhook from within a hook :
> > >  folder-hook . "unhook *"
> > > 
> > > this has no effect, or not the effect i want it to have:
> > >  unhook *
> > 
> > Sure you can.  At least you can unhook specific hook types and I see
> > no reason that you couldn't unhook all hooks, although that might
> > kill the execution of other folder-hooks until they are redefined.
> > As an example from my muttrc:
> > 
> > folder-hook . 'unhook message-hook'
> > 
> > Regards,
> > Gary
> > 
> 
> true, i don't know what i was doing earlier. it works for both folder-hook
> and (*). however changing folders now happen in slow-motion. i haven't test
> the effect either.

it works, but the performance is not practical. mutt struggles to change
folder.  note that all my maildir's are on local fs not to mention the use
of notmuch.


Re: folder-hook for sending to lists

2014-02-07 Thread glphvgacs
On Wed, Feb 05, 2014 at 04:23:31PM +1300, Chris Bannister wrote:
> On Mon, Feb 03, 2014 at 11:03:36AM -0500, glphvgacs wrote:
> > and so i get:
> > To: mutt-users@mutt.org, ycm-us...@googlegroups.com
> > 
> > i don't know if there is a way to un-hook a hook when one leaves a folder,
> > or rather when a pattern for a hook stops to evaluate TRUE.
> > 
> > another guess, this might have something to do with the fact that
> > there is no List-id: in mutt-users's headers (wonder why?)
> 
> I have an idea that it uses the List-Post: tag.

true, but why? i mean can i set list-reply to look for List-Post in the
header then?