texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] shortcuts and big parenthesis


From: Nix N. Nix
Subject: Re: [Texmacs-dev] shortcuts and big parenthesis
Date: 10 Apr 2003 10:40:54 -0600

On Thu, 2003-04-10 at 06:10, address@hidden wrote:
[...]
> This is Joris attempt to put organization in the big number of
> shortcuts of TeXmacs. Yes, I know I once asked for "wilcarding keymap"
> but I was thinking of something completely different.
> 
> Each keybord profile defines a number of "wildcards" (I would rather
> call them keychords or key-aliases, because they are really nothing
> like wildcards) which associate a "prefix" to one or several keychords.
> 
> For example "math" is "A-" or "esc esc".
> 
> Then families of shortcuts are built either reusing the base shortcut
> or using a completely new one.
> 
> For example "math:bold" is "F6" and "math:left" is "math l" (that is
> "A-l" or "esc esc l").
> 
> The idea is this kind of namespacing would make it easier to partially
> redefine the keymaps.

This is all wonderful, but it has the same pitfalls as the IP
subclassing.  A lot of the address space is wasted.

For example:

C-[A-Za-z] can be "emacs:" for all I care, but AFAIK, emacs doesn't have
C-_ and C-^, so we could say that C-<non-alpha> (I can't think of the
regex off the top of my head) should not be part of the "emacs:" family.

This would take care of my version of (make-above), (make-below), as
well as (make-brackets "(" ")") et. al.
I suppose we could introduce a class
"mathconstruct:" == "C-" but only for "C-<non-alpha>"

[...]
> 
> In your example you use two keychord bases: "C-" and "M-A-".
> 
> Examination of kbd-emacs.scm (the default profile) shows that "C-" is
> associated to "emacs", for is generic editor operations and insertion
> of some format nodes.
> 
> "M-A-" is associated to "font" which is used in both math and text
> context to change the shape of the font (though the shortcuts are
> different).
> 
> Well, I like this shortcuts but I have no idea how we can make them
> fit properly in the current organization.
> 
> Maybe use "math _" as "math:under"...
> 
> And for your two "C-" shortcuts, maybe we could define "math:crowded"
> as an alias for "C-", reserved for useful shortcuts using horribly
> overloaded keys...

By "keys" you must mean "modifiers", because "_" is only used for
subscript so far.  Contrast that with, say "v", which is used for "v",
"phee", and "vector", or better yet, "u".  But yes, see above for an
idea for a keyboard class.  I'll try to flesh this idea out while you
are still busy :o)

[...]
> (define (make-brackets l r)
>   (let ((sel? (selection-active-normal?)))
>     (if sel? (cut "temp"))
>     (insert-object-go-to `(concat (left ,l) (right ,r)) '(1 0))
>     (if sel? (paste "temp"))))

Works beautifully ! Thanks !

[...]
> > (kbd-map in-math? 
> > ("C-(" (make-brackets "(" ")"))
> > ("C-)" (make-brackets "(" ")"))
> > ("C-[" (make-brackets "[" "]"))
> > ("C-]" (make-brackets "[" "]"))
> > ("C-{" (make-brackets "{" "}"))
> > ("C-}" (make-brackets "{" "}"))
> > ("C-<" (make-brackets "langle" "rangle"))
> > ("C->" (make-brackets "langle" "rangle"))
> > ("C-|" (make-brackets "|" "|"))
> > ("C-:" (make-brackets "||" "||"))
> > ("M-C->" (make-brackets "|" "rangle")) ;; "ket"
> > ("M-C-<" (make-brackets "langle" "|")) ;; "bra"
> 
> These might make sense. You just have to convince Joris. Designing
> good keymaps is difficult and you have too keep an eye on the big
> picture.

They would fit nicely within the "mathconstruct:" picture.  I can keep
"bra" and "ket" to myself.

[...]





reply via email to

[Prev in Thread] Current Thread [Next in Thread]