zsh-users
 help / color / mirror / code / Atom feed
* can't run _email-mutt
@ 2005-05-27 14:16 Marc Chantreux
  2005-05-30  9:18 ` Oliver Kiddle
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Chantreux @ 2005-05-27 14:16 UTC (permalink / raw)
  To: zsh-users

Hi all,

i'm trying to write an _email-mutt plugin. it doesn't work and i don't
know what's wrong with it. it's conform to the "documentation" ( the 3
lines of comments that comes with _email_adresses ;-) ).

% ( _email-mutt ; echo $reply )
rv:rv@ulp.fr douphi:douphi@ulp.fr

mutt <tab> give me the list of local users 

can someone help ?

regards
mc


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

* Re: can't run _email-mutt
  2005-05-27 14:16 can't run _email-mutt Marc Chantreux
@ 2005-05-30  9:18 ` Oliver Kiddle
  2005-05-30 13:57   ` Marc Chantreux
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Kiddle @ 2005-05-30  9:18 UTC (permalink / raw)
  To: Marc Chantreux; +Cc: zsh-users

On 27 May, Marc Chantreux wrote:
> i'm trying to write an _email-mutt plugin. it doesn't work and i don't
> know what's wrong with it. it's conform to the "documentation" ( the 3
> lines of comments that comes with _email_adresses ;-) ).
> 
> % ( _email-mutt ; echo $reply )
> rv:rv@ulp.fr douphi:douphi@ulp.fr

Does your _email-mutt function return a status of 300?

> mutt <tab> give me the list of local users 

That's the _email-local function running. Do you perhaps have an old
tag-order style specifying email functions.

There's an _email-mutt in _email_adresses which looks for aliases in
.muttrc. Does that work for you?

Oliver


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

* Re: can't run _email-mutt
  2005-05-30  9:18 ` Oliver Kiddle
@ 2005-05-30 13:57   ` Marc Chantreux
  2005-05-30 14:43     ` Oliver Kiddle
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Chantreux @ 2005-05-30 13:57 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: Marc Chantreux, zsh-users

le 30/05/2005,
Oliver Kiddle nous écrivait :
> On 27 May, Marc Chantreux wrote:
> Does your _email-mutt function return a status of 300?

yes 

% which _email-mutt
_email-mutt () {
        reply=(rv:rv@ulp.fr douphi:douphi@ulp.fr)
        return 300
}

> That's the _email-local function running. Do you perhaps have an old
> tag-order style specifying email functions.

% zstyle
command-path
        :completion:*:sudo:* /usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /usr/X11R6/bin
use-compctl
        :completion:* false
verbose
        :completion:* yes
format
        :completion:*:descriptions %B%d%b
        :completion:*:messages %d
        :completion:*:warnings 'No matches for: %d'
group-name
        :completion:* ''

> There's an _email-mutt in _email_adresses which looks for aliases in
> .muttrc. Does that work for you?

it didn't because my aliases are stored into different files :

in my muttrc, i've :

set alias_file=~/.mutt/aliases/unsorted
source ~/.mutt/aliases/unsorted
source ~/.mutt/aliases/friends
source ~/.mutt/aliases/job
source ~/.mutt/aliases/family
...


regards

mc


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

* Re: can't run _email-mutt
  2005-05-30 13:57   ` Marc Chantreux
@ 2005-05-30 14:43     ` Oliver Kiddle
  2005-06-02 12:37       ` Marc Chantreux
  0 siblings, 1 reply; 6+ messages in thread
From: Oliver Kiddle @ 2005-05-30 14:43 UTC (permalink / raw)
  To: Marc Chantreux; +Cc: zsh-users

Marc Chantreux wrote:
> > There's an _email-mutt in _email_adresses which looks for aliases in
> > .muttrc. Does that work for you?
> 
> it didn't because my aliases are stored into different files :

Ah, the problem is probably related to the section of _email-addresses
starting with the comment "# get list of all plugins except any with
missing config files". For the builtin plugins, it excludes those for
which it doesn't find a config file. It's perhaps a new change to mutt
that .muttrc can also be .mutt/muttrc. Can it have other names?

> in my muttrc, i've :

Is that a ~/.mutt/muttrc file? If so we can basically fix this by
checking for that in addition to ~/.muttrc.

We could probably do with a more sophisticated plugin for mutt aliases,
however. I assume you've got some form of include directives to pull in
aliases from all those other files. Any idea how we could get a full
list of mutt aliases?

Oliver


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

* Re: can't run _email-mutt
  2005-05-30 14:43     ` Oliver Kiddle
@ 2005-06-02 12:37       ` Marc Chantreux
  2005-06-02 12:59         ` Oliver Kiddle
  0 siblings, 1 reply; 6+ messages in thread
From: Marc Chantreux @ 2005-06-02 12:37 UTC (permalink / raw)
  To: Oliver Kiddle; +Cc: zsh-users

le 30/05/2005,
Oliver Kiddle nous écrivait :
> Ah, the problem is probably related to the section of _email-addresses
> starting with the comment "# get list of all plugins except any with
> missing config files". For the builtin plugins, it excludes those for
> which it doesn't find a config file. It's perhaps a new change to mutt
> that .muttrc can also be .mutt/muttrc. Can it have other names?

i wasn't skilled enought in zsh to understand those lines. thanks for
explains.

you're right : i've added .mutt/muttrc to the list and it works fine
now.

i've just seen in the mutt man that a system-wide configuration file
exists too : /etc/Muttrc

so, there are 3 configuration files :

~/.muttrc
~/.mutt/muttrc
/etc/Muttrc
              
> We could probably do with a more sophisticated plugin for mutt aliases,
> however. I assume you've got some form of include directives to pull in
> aliases from all those other files. Any idea how we could get a full
> list of mutt aliases?

well, the simplest way is to use an extern program that does it well :

lbdbq | sed -n '/alias/{s/\(^[^  ]\+\).*alias\(.*\)/\2:\1/;p}'

or something like that.

a pure zsh solution is trying to parse all files that are sourced (
using the source command ) by .muttrc.

regards

mc


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

* Re: can't run _email-mutt
  2005-06-02 12:37       ` Marc Chantreux
@ 2005-06-02 12:59         ` Oliver Kiddle
  0 siblings, 0 replies; 6+ messages in thread
From: Oliver Kiddle @ 2005-06-02 12:59 UTC (permalink / raw)
  To: Marc Chantreux; +Cc: zsh-users

Marc Chantreux wrote:
> you're right : i've added .mutt/muttrc to the list and it works fine
> now.
> 
> i've just seen in the mutt man that a system-wide configuration file
> exists too : /etc/Muttrc

I don't think it's worth worrying too much about the system-wide one. It
can probably be in other places such as /usr/local/etc/Muttrc. We can
perhaps use the muttrc style, though.

> well, the simplest way is to use an extern program that does it well :
> 
> lbdbq | sed -n '/alias/{s/\(^[^  ]\+\).*alias\(.*\)/\2:\1/;p}'

Except that lbdbq is unlikely to be installed. I've never seen it and
it's on none of the machines I use.

> a pure zsh solution is trying to parse all files that are sourced (
> using the source command ) by .muttrc.

I think that would be better. Pulling out source commands can't be any
harder than pulling out alias commands.

It's arguably applicable to other mail config files like zmail, nail
and mush. I'll try making it applicable to those too, though it might
potentially be a problem in some mush setups where if statements are used.

Oliver


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.


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

end of thread, other threads:[~2005-06-02 13:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-27 14:16 can't run _email-mutt Marc Chantreux
2005-05-30  9:18 ` Oliver Kiddle
2005-05-30 13:57   ` Marc Chantreux
2005-05-30 14:43     ` Oliver Kiddle
2005-06-02 12:37       ` Marc Chantreux
2005-06-02 12:59         ` Oliver Kiddle

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).