zsh-users
 help / color / mirror / code / Atom feed
* global alias as function - "--attach"
@ 2003-06-11 13:13 Sven Guckes
  2003-06-11 15:53 ` DervishD
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sven Guckes @ 2003-06-11 13:13 UTC (permalink / raw)
  To: ZShell Users

can i use a global alias as a function within a command?

the real problem:
someone asked (yet again) whether mutt (the mailer)
can attach a list of files or a directory of files.
this is not possible yet - mutt can only attach files given
on the command line when *every* file is preceded by "-a".

suggestion:
a patch might get this to work (as usual).
however, i can imagine something like this:

  mutt --attach file dir/ -xyz

here, the "--attach" would be a global alias
which test the following parameters for
files and files within directories.

if these are existing files and directories then
they are simply attached each file (or file within
a given directory) by expanding it to "-a file":

  mutt -a file -a dir/file1 -a dir/file2 -xyz

however, i am not sure how this can be achieved.
the global alias might contain a backtick, of course -
but where should the closing backtick come from? hmm..

maybe there is an even simpler way of solving this.

i have to admit that i did not do any
manual reading or searching the web.
if this has been discussed before
then i'd appreciate some pointers.
key words, URLs etc are fine.
thanks! :-)

Sven


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

* Re: global alias as function - "--attach"
  2003-06-11 13:13 global alias as function - "--attach" Sven Guckes
@ 2003-06-11 15:53 ` DervishD
  2003-06-11 16:00 ` Stephen Rueger
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: DervishD @ 2003-06-11 15:53 UTC (permalink / raw)
  To: ZShell Users


 * Sven Guckes <guckes@math.fu-berlin.de> dixit:
> i have to admit that i did not do any
> manual reading or searching the web.

    I have seen you many times flaming people on the mutt list for
doing exactly the same... I won't flame you, but I will give you the
same answer you give to mutt newbies: RTFM.

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736
http://www.pleyades.net & http://raul.pleyades.net/


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

* Re: global alias as function - "--attach"
  2003-06-11 13:13 global alias as function - "--attach" Sven Guckes
  2003-06-11 15:53 ` DervishD
@ 2003-06-11 16:00 ` Stephen Rueger
  2003-06-11 17:44 ` Pavol Juhas
  2003-06-11 20:33 ` Thorsten Haude
  3 siblings, 0 replies; 5+ messages in thread
From: Stephen Rueger @ 2003-06-11 16:00 UTC (permalink / raw)
  To: ZShell Users

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

On Wed, Jun 11, 2003 at 03:13:17PM +0200, Sven Guckes wrote:
> the real problem:
> someone asked (yet again) whether mutt (the mailer)
> can attach a list of files or a directory of files.
> this is not possible yet - mutt can only attach files given
> on the command line when *every* file is preceded by "-a".

Something like 

mutt -s subject **/*(.e:'reply=-a${(q)^REPLY}':) some@one

does the trick.

--
Stephen Rüger
stephen.rueger@rechnerpost.org

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

* Re: global alias as function - "--attach"
  2003-06-11 13:13 global alias as function - "--attach" Sven Guckes
  2003-06-11 15:53 ` DervishD
  2003-06-11 16:00 ` Stephen Rueger
@ 2003-06-11 17:44 ` Pavol Juhas
  2003-06-11 20:33 ` Thorsten Haude
  3 siblings, 0 replies; 5+ messages in thread
From: Pavol Juhas @ 2003-06-11 17:44 UTC (permalink / raw)
  To: ZShell Users

On Wed, Jun 11, 2003 at 03:13:17PM +0200, Sven Guckes wrote:
> can i use a global alias as a function within a command?
> 
> the real problem:
> someone asked (yet again) whether mutt (the mailer)
> can attach a list of files or a directory of files.
> this is not possible yet - mutt can only attach files given
> on the command line when *every* file is preceded by "-a".
> 
> suggestion:
> a patch might get this to work (as usual).
> however, i can imagine something like this:
> 
>   mutt --attach file dir/ -xyz
> 
> here, the "--attach" would be a global alias
> which test the following parameters for
> files and files within directories.

Instead of using alias, you could write a wrapper script (or
shell function) for mutt, which would handle the --attach option
and call the normal /usr/bin/mutt.

Pavol


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

* Re: global alias as function - "--attach"
  2003-06-11 13:13 global alias as function - "--attach" Sven Guckes
                   ` (2 preceding siblings ...)
  2003-06-11 17:44 ` Pavol Juhas
@ 2003-06-11 20:33 ` Thorsten Haude
  3 siblings, 0 replies; 5+ messages in thread
From: Thorsten Haude @ 2003-06-11 20:33 UTC (permalink / raw)
  To: ZShell Users

[-- Attachment #1: Type: text/plain, Size: 324 bytes --]

Hi,

* Sven Guckes <guckes@math.fu-berlin.de> [2003-06-11 15:13]:
>i have to admit that i did not do any
>manual reading or searching the web.

Could you please keep this sentence in mind while pouring your bile
over the next poor fellow on mutt-users?


Thorsten
-- 
Auch Hunger ist Krieg.
    - Willy Brandt

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2003-06-11 20:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-11 13:13 global alias as function - "--attach" Sven Guckes
2003-06-11 15:53 ` DervishD
2003-06-11 16:00 ` Stephen Rueger
2003-06-11 17:44 ` Pavol Juhas
2003-06-11 20:33 ` Thorsten Haude

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