Skip to Content.
Sympa Menu

texmacs-users - Re: [TeXmacs] Adding a language to 'Insert->Program->Block of code

Subject: mailing-list for TeXmacs Users

List archive

Re: [TeXmacs] Adding a language to 'Insert->Program->Block of code


Chronological Thread 
  • From: Miguel de Benito Delgado <address@hidden>
  • To: "Sorin Mitran" <address@hidden>
  • Cc: address@hidden
  • Subject: Re: [TeXmacs] Adding a language to 'Insert->Program->Block of code
  • Date: Sun, 31 Mar 2013 10:48:19 +0200

Hi,

this is the trick I use to find how most things are done in the gui:

* Find the menu item you want to investigate
* Search for the string in the scheme source code: inside TeXmacs press
Shift+F1, type the string and select "In Scheme".
* In the list of results, click on the file named "something-menu.scm"
* Once there, search in the document for the string. Once you find the code
creating the menu entry, keep searching the code for the definitions of the
functions used.

In your case, the file is progs/text/text-menu.scm, and the definition of the
menu item is simply (note the usage of -> to create submenus)

(-> "Block of code"
("C++" (make 'cpp-code))
("Mathemagix" (make 'mmx-code))
("Scheme" (make 'scm-code))
("Shell" (make 'shell-code))
("Verbatim" (make 'verbatim-code)))

So you see that you need to first define your environment "fortran-code"
somewhere, then you can create it in the document calling (make
'fortran-code), which you do from a menu entry definition like these.

If you need to search for function definitions, activate the developer tool
in the Tools menu and use Cmd+Click (or ctrl or whatever, depending on your
platform and config) on the symbols to navigate through them (this won't work
for symbols defined in c++ or dynamically generated in scheme code)

hth
--
Miguel de Benito.

On 19/03/2013, at 17:45, Sorin Mitran wrote:

> Hi,
>
> Could someone indicate in brief steps needed to add another language to
> Insert->Program->Block of code?
>
> Immediate interest is Python, Fortran. I'm happy to add these, but could use
> guidance on where to look within the source tree.
>
> Thanks.




Archive powered by MHonArc 2.6.19.

Top of Page