Re: How to simulate entering keys into mutt?

2020-01-14 Thread Cameron Simpson

On 07Jan2020 16:44, Chris Green  wrote:

I want to emulate typing a dozen or so keys into mutt 'automatically'
so my typing doesn't slow things down.  One can't just redirect
standard input because that makes mutt think you want to run in
scripting mode with everything on the command line.

Is there a quick and easy way to do what I want?


Would mutt's "push" command do you? It pushes keystrokes onto mutt's 
logical keyboard input queue. For example, my muttrc has this:


   folder-hook . 'push ":set collapse_unread=no"'
   folder-hook . 'push ":set 
auto_tag=no~T~P~NN~T:set
 auto_tag=yes"'
   folder-hook . 'push ""'

to run a set of keyboard based stuff when I enter a folder.

You can bind things like this to a keyboard macro, and my "mboxify" 
sheel script includes this incantation:


   mutt -n -F /dev/null -f "$mailbox" -e "set sort=mailbox-order; set confirmappend=no; set delete=yes; push 
'.$mailboxtmp'"

to copy one mail folder's messages into a plain "mbox" mail folder.

Cheers,
Cameron Simpson 


Re: How to simulate entering keys into mutt?

2020-01-07 Thread Chris Green
On Tue, Jan 07, 2020 at 05:06:28PM +, Matthias Apitz wrote:
> On Tue, 7 Jan 2020 16:44:41 +, Chris Green wrote:
> > I want to emulate typing a dozen or so keys into mutt 'automatically'
> > so my typing doesn't slow things down.  One can't just redirect
> > standard input because that makes mutt think you want to run in
> > scripting mode with everything on the command line.
> >
> > Is there a quick and easy way to do what I want?
> >
> 
> In an X11 environment this should be easy. I did this in the past some 
> 20 years ago for controlling a web site and could look for the C source 
> in my backups. 
> 
That's what I thought but xdotool doesn't seem to work (there is a
warning in the man page about sending key strokes often not working).

I'll try the other suggestion here of appending some commands to the
end of my muttrc file, that should do what I need.

-- 
Chris Green


Re: How to simulate entering keys into mutt?

2020-01-07 Thread Francesco Ariis
Hello Chris,

On Tue, Jan 07, 2020 at 04:44:41PM +, Chris Green wrote:
> I want to emulate typing a dozen or so keys into mutt 'automatically'
> so my typing doesn't slow things down.  One can't just redirect
> standard input because that makes mutt think you want to run in
> scripting mode with everything on the command line.

Not sure if this answers the question, but macros accept "raw" keys

macro index e mpr...@example.orgtest
# this composes a new message and fills to/subject on my machine

or you mean at startup? in that case, just put something like this
as the last line of your .muttrc

push "?"


Re: How to simulate entering keys into mutt?

2020-01-07 Thread Matthias Apitz
On Tue, 7 Jan 2020 16:44:41 +, Chris Green wrote:
> I want to emulate typing a dozen or so keys into mutt 'automatically'
> so my typing doesn't slow things down.  One can't just redirect
> standard input because that makes mutt think you want to run in
> scripting mode with everything on the command line.
>
> Is there a quick and easy way to do what I want?
>

In an X11 environment this should be easy. I did this in the past some 20 years 
ago for controlling a web site and could look for the C source in my backups.

matthias


--
Sent using Dekko from my Ubuntu device