Z <[email protected]> wrote in
<61684b71.hlwju2xf9gm3gcoz%[email protected]>:
|Steffen Nurpmeso <[email protected]> wrote:
|> Z <[email protected]> wrote in
|> <61676f30.O/q/a8uppae86zoh%[email protected]>:
|>|I was wondering if there was a way to define a new internal variable
|>|that could then be updated as needed via folder hooks. Specifially
|>|I'd like to isolate the IMAP [/path] value which is present in both
|>|the 'mailbox-displayed' and 'mailbox-resolved' internal variables
|>|whenever an IMAP mailbox is accessed.
|>|
|>|My end goal is to use the IMAP [/path] value in the s-mailx prompt
|>|along with the 'account' variable so as to always display the active
|>|IMAP account name and folder without showing the entire protocol:// URI.
|>
|> A bit ugly but could you use
|>
|> vput vexpr prompt regex "$mailbox-resolved" ([^/]+)$ '\$1'
|> if -z "$prompt"; set prompt=nada; endif
|>
|> If you put this in a folder hook this should work.
|
|Yes that seems to be what I was looking for but now I'm wondering
|if there is some way to do this within the 'set prompt=' assignment
|since prompt is basically a universal folder hook. The following
|produces the prompt I'm after:
|
| vput vexpr prompt regex "$mailbox-resolved" ([^/]+)$ '[\$account/\$1] > '
|
|Can that be executed whenever the prompt is updated?
No. That is, not yet. *prompt* is always shell-style evaluated
"as if specified within $''" before it is displayed, but $'' does
not yet support the envisaged \`{...} extension to execute
commands. For now *folder-hook* has to be used, which .. should
satisfy your reported needs? I mean we could introduce
a *mailbox-basename* variable. Ok i did that. Be warned you got
credited.
Ciao from Germany,
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)