mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] keymaps II


Chronological Thread 
  • From: David Allouche <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] keymaps II
  • Date: Mon, 1 Dec 2003 14:32:42 +0100

Hahem... I see source code, maybe this should be discussed in
texmacs-dev instead :-)

On Mon, Dec 01, 2003 at 01:37:01AM +0000, Juan Pablo Romero wrote:
> Ok, I found how to bind "left shift" to "enter/leave math mode".
>
> In "src/Windows/X/x_init.cpp", after line 675, added this:
>
> Map (XK_Find, "find");
> Map (XK_Shift_L, "shift_l");
>
> Then recompile texmacs, and modify my-init-texmacs.scm:
>
> (kbd-map in-math?
> ...
> ("shift_l" (go-end-with "mode" "math"))
> )
>
> (kbd-map in-text?
> ...
> ("shift_l" (if (inside? "hybrid") (insert-string "$") (make-with "mode"
> "math")))
> )

That makes sense.

However, I find the shift_l stuff dangerous. If no binding is defined
for "shift_l", is the default behaviour (i.e. usual shift modifier)
retained?

> So this makes me think perhaps it is a good idea to add many more XK_xxxx
> symbols to x_init.cpp (perhaps all from /usr/X11R6/include/X11/keysymdef.h
> ?).

In my opinion, all this symbol mapping is dangerous cruft.

Some time ago, I made a major modification to the keyboard handling to
make it work correctly with Alt-Gr on recent systems (and to use
essentially the same symbol lookup method as any sane software).

See x_display_rep::look_up_key in x_loop.cc.

Similarly, keysym names should be replaced by appropriate uses of
XKeySymToString (for action keys) and XLookupString (for character
keys). Maybe adding a bit of case munging to retain most of backward
compatibility.


> Also tryied this:
>
> (kbd-map in-text?
> ("ordfeminine" (insert-string "ª"))
> ("masculine" (insert-string "º"))
> ...
> )
>
>
> But texmacs inserts some other characters (something like z + "check"), so
> no luck here :(

You have been bitten by incompatible encodings. INSERT-STRING expects a
string in the Cork encoding (used internally by TeXmacs).

Instead, you should use something like:

(insert-object '(rsup (underline "a")))

But this demonstrates an interesting bug: underline does not work in
indices (or in tables for that matter...)

If you really need this feature now, you may use this very ugly hack:

(insert-object '(rsup (underline (tabular (tformat (cwith "1" "-1"
"1" "-1" "cell-lsep" "0") (cwith "1" "-1" "1" "-1" "cell-rsep" "0")
(cwith "1" "-1" "1" "-1" "cell-tsep" "0") (cwith "1" "-1" "1" "-1"
"cell-vcorrect" "n") (cwith "1" "-1" "1" "-1" "cell-bborder"
"0.5ln") (cwith "1" "-1" "1" "-1" "cell-bsep" "1.5ln") (table (row
(cell "a"))))))))


Please post followups to texmacs-dev.
--
-- ddaa


  • keymaps II, Juan Pablo Romero, 12/01/2003
    • Re: [TeXmacs] keymaps II, David Allouche, 12/01/2003

Archive powered by MHonArc 2.6.19.

Top of page