mailing-list for TeXmacs Users

Text archives Help


Re: [TeXmacs] Add language to Insert->Code with syntax highlighting?


Chronological Thread 
  • From: Darcy Shen <address@hidden>
  • To: "texmacs-users" <address@hidden>
  • Subject: Re: [TeXmacs] Add language to Insert->Code with syntax highlighting?
  • Date: Wed, 24 Oct 2018 09:38:34 +0800
  • Arc-authentication-results: i=1; mx.zoho.com; dkim=pass header.i=zoho.com; spf=pass smtp.mailfrom=address@hidden; dmarc=pass header.from=<address@hidden> header.from=<address@hidden>
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1540345115; h=Content-Type:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To:ARC-Authentication-Results; bh=7necGnmZ0vlqSHV+tVORhtej+2mEx1VBLtNBwMgVJUo=; b=oGfRz8nyAAmSRBWE1csheYJYlD/3EQjl9LPp/tRi+gXpEYwkWiXfExajZYfPEMg4UJBVrZti4cw0CBR+oBbhRQ06S14XyBMKLcJUtDrBpbAHV+ayZxJEJKNJrfIGGLbg/KsVwmFXYUZpu0yhdXiFPlmZU/0iC/AqTvL3uFGDEdw=
  • Arc-seal: i=1; a=rsa-sha256; t=1540345115; cv=none; d=zoho.com; s=zohoarc; b=UhAn/qDQ87lOGOe2jA4ShXpkaONVOtU8FeAeFjcAnE0mh/zjNWVimiYOCgl8jVSPWx7Snfsjo3cwmpAeRZ4eo9ww7tXQQj+0j3Ro2Bl+jRolUUGUPUTTwa+BwZnSSvXkfBzLWM2b5RgpSHMVKcXyN9BSr8S0Pdfqo4GntVoxxjo=
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=zapps768; d=zoho.com; h=date:from:to:message-id:in-reply-to:references:subject:mime-version:content-type:user-agent; b=bN2w0OtPT1lb9ulE+tPmo5+SY4o955moKOEOY+oBVitEGVlIMBX3MaUzyL8Hevoo6SkzALrzJ1Af XZahWMCmd0L+0K7X6tCB6jOaqtp8cgMUfMI6DpWfBAM7Wxz50gl7


:) aha, forgot to post on the mail list.

============ Forwarded message ============
From : Darcy Shen <address@hidden>
To : "Marduk BP"<address@hidden>
Date : Wed, 24 Oct 2018 09:20:31 +0800
Subject : Re: [TeXmacs] Add language to Insert->Code with syntax highlighting?
============ Forwarded message ============

See below!!!


---- On Thu, 18 Oct 2018 18:12:02 +0800 Marduk BP <address@hidden> wrote ----

First of all, thank you Max for your efforts on the Qt GUI! I will try your branch soon 
and report back.

I was thinking that migrating TeXmacs to Racket would be a very good idea. First, it
implements a cross-platform GUI library that uses native widgets. Second, Racket 
is designed for implementing languages. Therefore, we can teach it what Darcy Shen 
calls TIM-Scheme. Racket also has a pretty good interaction with C, an awesome 
plotting library and a very thorough documentation. I think it would solve a lot of
problems and simplify the development.


Guys may be interested in this issue. I think support 2 or more scheme implementation is ideal.
However, sticking to guile is a good idea for a GNU project. I will try to join the Guile project (I am interested in the JIT part) and
get familliar the Guile guys. We may not work alone. We should work together and help each other.

Besides, I do think Chez Scheme is awesome.


I also agree with Max on implementing the Jupyter protocol. However, I would do it 
completely independent from Python. Nowadays there are tons of languages that 
have a Jupyter kernel. TeXmacs should become an alternative (and saner and more
powerful) interface for a notebook-based workflow with any language.

I do think maintain the current plugins is more import than implement a brand new protocol.
However, Jupyter protocol is a great idea.


Howl is a Lua-based text editor that implements an LPEG parser for each language 
it supports. I think this is a good way to do it. See here for examples: 



I still think the kate syntax highlighter is the best one. However, I will take a look at it.


@Darcy, I would like to suggest that we use GitHub's Projects feature or at least the
Wiki for keeping track of the proposals and the tasks involved in undertaking major
changes to TeXmacs.


Great suggestions! However, I think Github Pull Request is enough for us. I tried open issues and projects on Github,
but Massimiliano Gubinelli sugguest that we should use only one bug tracker and only one project manager.

I agreed with it and had already close the issue tracker on Github.

Recently, I have new ideas about Github. As a result, I synced this sub projects:

https://github.com/texmacs/plugins There is a issue tracker for Contributors interested in the GNU TeXmacs plugins
https://github.com/texmacs/devel  There is a issue tracker for Developers in favor of Github. (New ideas and bugs, And I will manually submit some of it to savannah.)

And I have switched https://github.com/texmacs/texmacs to the Source Code only repo.

I still agree we should use the savannah as a bug tracker. However, we should not prevent the usage on Github.

I have not open issue tracker for https://github.com/texmacs/texmacs . I think we should make a robot to sync issues from this repo to savannah, and then open it.


For example, I think it would be great to decouple the typesetting system from 
TeXmacs. Then it could become a frontend for other typesetting systems like LuaTeX
or Patoline. And people would become aware of the existence of a great typesetting system :)

@Max It would be great to document how the GUI works, independently from the toolkit, to 
make it easy for others to contribute to its development and potential migration to another toolkit.


Documentation is important. By blogs or internal docs.


Best regards,
Marduk


On Tue, Oct 16, 2018 at 11:23 AM Massimiliano Gubinelli <address@hidden> wrote:

Dear all

On 16. Oct 2018, at 09:21, Marduk BP <address@hidden> wrote:

Before adding something to the Qt code, it is necessary to fix the 
memory leaks that crash TeXmacs. Once it is safe and stable, one
can even consider adding QCustomPlot. With plotting, syntax highlighting
and code completion, TeXmacs would become a pretty good alternative
to the Jupyter Notebook.

I have a branch with a half-working Qt5 version of TeXmacs. You can find it on my github (mgubi).
The only problem with this (as far as I can see) is that the widgets in the main menu in the mac version (e.g. the color widget) does not work since Qt5 do not have custom widget facility for main menus on mac. It should work find on Linux and WIndows, so maybe somebody could give it a try. Also Dark mode (in Mojave) is currently not properly supported by Qt5.

As for the proposal to add a more heavy dependence on Qt I’m not really into it. In my opinion Qt very much bloated for what TeXmacs really needs and it is starting to cause many problems (see breaking our code between Qt4 and Qt5). We use a very small subset of it and I do not think TeXmacs should rely on more.

My long term goal is to have the Cocoa layer back on the Mac (we will need anyway at least Cocoa menus since the support in Qt/mac for custom menus is shitty and this is source of many of the crashes). And also I’m evaluating to try out a wkwidgets plugins which would have the advantage to be leaner.

As far as competition with Jupyter notebooks, to me the right way to go is to implement the jupyter protocol so that TeXmacs can talk directly to the python core as a TeXmacs session. This would be really great and not very difficult and would not rely on Qt. The plotting has to be done in Python, that would avoid us to carry on code which we cannot reliably maintain. (matplotlib seems ok for that)

Also for the syntax highlighter: maybe having a way to use the Kate syntax files within TeXmacs would be better. One has to keep in mind that TeXmacs has his own C++ programming ecosystem (lists, strings, etc…) bringing in Qt code in areas not directly connected to the bridge between the internal gui representations and the Qt library would spread incompatible data structures (eg:  Qt list vs. texmacs lists etc…) which would need converstions, etc… very painful. We should try to keep the internal coding of the program consistent and allow other paradigms only at the interface with external libraries. 

Again, much of the problem is not to bloat the code so to make long term maintenance more difficult.

Best
Max



On Sun, Oct 14, 2018 at 3:59 PM Darcy Shen <address@hidden> wrote:

Great!

I have another idea. Just introduce the highlight part of kate.


This library only depends on Qt 5.


---- On Fri, 24 Aug 2018 17:26:25 +0800 Marduk BP <address@hidden> wrote ----

Unfortunately, given the way it works at the moment, you have to add a file your_language.cpp to /svn_root/src/System/Language/ based on one of the other language files there and compile TeXmacs.

In order to make this friendlier and more efficient, it is necessary to expose the packrat parser included with TeXmacs to the Guile frontend.

I am also interested in this feature. I hope to find time soon to work on it.

On Tue, Aug 7, 2018 at 1:51 AM, Mitran, Sorin <address@hidden> wrote:

Hello,

Does anyone know the steps required to add another programming language to Insert->Code with syntax highlighting support?

Thanks.








Archive powered by MHonArc 2.6.19.

Top of page