mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] scheme functions for keyboard input


Chronological Thread 
  • From: Joris van der Hoeven <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] scheme functions for keyboard input
  • Date: Wed, 26 Feb 2014 19:57:32 +0100

Hi Scott,

On Thu, Jan 30, 2014 at 03:41:45PM -0700, Scott Michael Sullivan wrote:
> I've already figured out how to set static keyboard maps, but I would
> really like to create dynamic keymaps. For example, suppose I wanted to map
> the pauli matrices to M-x, M-y, and M-z during a texmacs session, without
> opening the Guile interpreter (obviously I would also need to set aside a
> shortcut for mapping, let's call it "C-m"). I want a function where I could
> type out the x-matrix, select it, type "C-m M-x <enter>", and from now on
> in this session, typing "M-x" creates the x-matrix. This type of dynamic
> mapping is only one example of what I have in mind.

You probably want to contextually overload the low level keyboard
call back handler 'keyboard-press' in order to achieve this.
Similar call back handlers are 'keyboard-focus' and 'mouse-event'
(see kbd-handlers.scm).

Please read the available documentation on Scheme programming
inside TeXmacs; the idea of contextual overloading is explained there.

I would be happy to know if you manage to get the above idea working.
Notice however that keyboard mappings may need to be contextual.
How do you plan to achieve that? Or maybe you do not care.

> My goal for now is being able to type mathematics extremely fast, mainly
> since I have to do a lot of physics assignments for grad school. I
> currently use pencil/paper for everything, but if I could type math faster
> than I could write, I would switch over to Texmacs for everything (also I
> like that sage can add powerful functionality).
>
> Anyways, will I have to write a c++ plugin, or can I do everything in
> Scheme? I suppose I could redefine the keyboard-press for search-mode. But
> how do I tell texmacs to enter/leave search-mode?

I recommend using Scheme for this kind of high level interface customizations.

If you like to use Sage, it would also be interesting if someone could
program a basic API for rendering using native TeXmacs markup
(similar to what exists for LaTeX, MathML, etc.).
This might make it much easier to write interesting and better interfaces.

Best wishes, --Joris



Archive powered by MHonArc 2.6.19.

Top of page