mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Keyboard shortcuts on Mac OSX for tabular


Chronological Thread 
  • From: Miguel de Benito Delgado <address@hidden>
  • To: address@hidden
  • Subject: Re: [TeXmacs] Keyboard shortcuts on Mac OSX for tabular
  • Date: Wed, 25 Jul 2012 19:13:31 +0200

Hi,

there is no such master table (well there is, see more later). You
have some routines inside progs/kernel/gui/kbd-define.scm which might
help you. Specifically kbd-find-key-binding. Open a scheme session and
try this:

(kbd-find-key-binding "F1")

this returns a one element list with the command associated with the
key F1 in your current "input mode" (which is session mode):

(#<procedure #f ()> "")

So you'll want to take the first element of it and display the source code:

(procedure-source (car (kbd-find-key-binding "F1")))

This should output the following:

(lambda () (interactive docgrep-in-doc))

Now, keys can be overloaded, meaning that different contexts have
different commands assigned to keys. This is achieved with kbd-map
like this:

(kbd-map
(:mode in-math?)
("F1" (some-command-to-show-math-help)))

But kbd-find-key-binding shows only what is defined in the current
context. You'd need to use kbd-find-key-binding2, but this function is
not exported outside the file kbd-define.scm, so you'd need to
redefine it using (tm-define blahblah...) instead of (define
blahblah...)


As to the master table: you could use the hash table kbd-map-table,
but again it's not exported outside kbd-define.scm. And again you can
trick and modify that file inside the application bundle, then
relaunch TeXmacs to have access to all the data, then traverse it and
nicely format it.

This would actually be a nice thing to have...
________________
Miguel de Benito.


On Tue, Jul 10, 2012 at 8:22 PM, chowdhary, kenny <address@hidden> wrote:
> This is great! I finally got the hang of it. Do you happen to know what the
> Esc Button translates to in the kbd-map? Is there a master table that shows
> the keyboard letter and the corresponding kbd-map letter?
>
> Thank you so much!
>
>
> On Tue, Jul 10, 2012 at 10:49 AM, Massimiliano Gubinelli
> <address@hidden> wrote:
>>
>> yes, but they will be lost next time you update TeXmacs. You can add them
>> to your my-init-texmacs.scm file as described below to guarantee
>> persistency.
>>
>> max
>>
>>
>>
>> On 10 juil. 2012, at 19:43, chowdhary, kenny wrote:
>>
>> Cool! thanks. So if I edit the keyboard shortcuts in the generic-kbd.scm
>> file, will it be incorporated into texmacs upon the next startup?
>>
>> On Tue, Jul 10, 2012 at 1:14 AM, Miguel de Benito Delgado
>> <address@hidden> wrote:
>>>
>>> Hi,
>>>
>>> I meant you have examples inside the application bundle TeXmacs.app.
>>> Right click->show bundle contents, then go to
>>> Contents->Resources->share->TeXmacs->progs->generic
>>>
>>> There you'll find many examples inside generic-kbd.scm. It's mostly stuff
>>> like:
>>>
>>> (kbd-map
>>> ("M-A-x" (do-something)))
>>>
>>> Each item in the list of arguments to kbd-map is an assignment, each
>>> assignment consists of one list of keystrokes (with modifiers and keys
>>> being
>>> joined by dashes) and a scheme command to be executed. You can insert a
>>> tag
>>> into the document using (make 'name-of-tag). If you want to insert an
>>> equation array, because the name of the tag is "eqnarray" you can do the
>>> following:
>>>
>>> (kbd-map
>>> ("M-C-7" (make 'eqnarray)))
>>>
>>> Keystrokes can be overloaded: just redefine them by preceding the
>>> definition in the (kbd-map) block with (:mode somecheckhere). I like to
>>> define this (in my-init-texmacs.scm):
>>>
>>> (kbd-map
>>> (:mode in-math?)
>>> ("$" (make 'text)))
>>>
>>> But if you want to redefine keys you'll want to be sure that the original
>>> definitions are loaded first (or they might overwrite yours when they
>>> are).
>>> This is done with stuff like
>>>
>>> (use-modules (math math-kbd))
>>>
>>> Best,
>>> ________________
>>> Miguel de Benito.
>>>
>>>
>>>
>>> On Tue, Jul 10, 2012 at 1:48 AM, chowdhary, kenny <address@hidden>
>>> wrote:
>>>>
>>>> Hi,
>>>>
>>>> I grep'd the source directories and all I found was the file
>>>>
>>>> .TeXmacs/system/cache/doc_cache
>>>>
>>>> with kbd-map and I couldn't really make out what the code meant. I am
>>>> not very knowledgeable about how to create a kbd-map assignment, but
>>>> this is
>>>> what I want to do:
>>>>
>>>> I would like Control + Command + 7 to give me an equation array. How
>>>> would I go about doing this, from the bottom up. Just one simple example
>>>> and
>>>> I'll be good.
>>>>
>>>> Thanks,
>>>> K
>>>>
>>>>
>>>> On Mon, Jul 9, 2012 at 4:21 PM, Miguel de Benito Delgado
>>>> <address@hidden> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> the best way is to copy some examples from TeXmacs' own source. You
>>>>> can find the relevant files inside the application folder (I understand
>>>>> you
>>>>> are running MacOS X) after some grepping for kbd-map.
>>>>>
>>>>> One nice thing to keep in mind: anything appearing in a menu or
>>>>> button is a scheme (set of) command(s). Copy those literally in a
>>>>> kbd-map
>>>>> assignment and you'll see the shortcut in the menu.
>>>>>
>>>>> Sorry for the imprecise help, I'm not on my computer.
>>>>>
>>>>> Best,
>>>>> ___________________
>>>>> Miguel de Benito.
>>>>>
>>>>> Am 09.07.2012 22:22 schrieb "chowdhary, kenny" <address@hidden>:
>>>>>
>>>>>> Hello Users,
>>>>>>
>>>>>> I just started using texmacs for Mac OSX (formerly a user of texmacs
>>>>>> on linux) and I was wondering if there was a keyboard shortcut for the
>>>>>> \tabular function in the Mac setting. In widows, it is Esc+T->N->t.
>>>>>> Does
>>>>>> anyone have an example of how to customize the keyboard shortcuts?
>>>>>> There is
>>>>>> only minimal instructions in the help section.
>>>>>>
>>>>>> Thanks,
>>>>>> K
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Kenny Chowdhary
>>>> www.kennychowdhary.me
>>>> Division of Applied Mathematics
>>>> Brown University
>>>>
>>>
>>
>>
>>
>> --
>> Kenny Chowdhary
>> www.kennychowdhary.me
>> Division of Applied Mathematics
>> Brown University
>>
>>
>
>
>
> --
> Kenny Chowdhary
> www.kennychowdhary.me
> Division of Applied Mathematics
> Brown University
>



Archive powered by MHonArc 2.6.19.

Top of page