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? Regards, Z
