[ROOT] keyboard macros ala the GNU readline library

From: Matthew D. Langston (langston@SLAC.stanford.edu)
Date: Mon Nov 27 2000 - 03:20:15 MET


Is it possible to create keyboard macros for use in interactive sessions of
ROOT similar to the macros one can create for applications that use the GNU
readline library?

In the GNU readline library, each user can put keyboard macros in their
~/.inputrc file and specify key bindings for each application that uses the
GNU readline library for it's command input (e.g. bash, gdb, etc.).

During interactive sessions in ROOT, I find myself always typing the same
lines over and over again with different parameters.  For example, I find
myself always doing this at the ROOT prompt:

TH1* my_hist = dynamic_cast< TH1* >( gFile->Get( "my_hist") );

It would be nice if I could write a macro named "get-hist" that I could bind
to "C-x g h"  that would display the above line with the cursor placed just
inside the first quote.  Is it possible to write such a macro in ROOT?

The comments at the top of clib/src/Getline.c document the key bindings that
are available during interactive ROOT sessions, but it didn't say anything
about keyboard macros.

If it isn't currently possible to write keyboard macros, would it be much
trouble to convert ROOT to using the GNU readline library instead of
clib/src/Getline.c?

Thanks for any help.

Regards, Matt

--
Matthew D. Langston
SLD, Stanford Linear Accelerator Center
langston@SLAC.Stanford.EDU



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:38 MET