ShiroTakeda / gams-mode

GAMS mode for Emacs
http://shirotakeda.org/en/gams/gams-mode/
12 stars 4 forks source link

Polymode #2

Open christophe-gouel opened 2 years ago

christophe-gouel commented 2 years ago

Hi,

I have started implementing a polymode (https://polymode.github.io) for your gams-mode to handle the Python code embedded in GAMS ($onembedded Python:).

For now, this just lives in my init.el. Are you interested in a PR?

Best, Christophe

ShiroTakeda commented 2 years ago

Hi,

I'm not sure if the polymode works consistently with gams mode, but I'd like to see your code anyway, so can you send me a pull request?

ShiroTakeda commented 2 years ago

Hi

When defining a new polymode, it is often necessary to create a separate lisp program. Following the same method, I created a program called poly-gams.el to use polymode in GAMS.

https://www.dropbox.com/s/t7mtzijkb9rx8g2/poly-gams.el?dl=0

Could you please try to use this program? Put this in the folder included in the load-path and add the following code to init.el

(require 'poly-gams)

When you open gms files, you should be able to use polymode in GAMS mode automatically.

Please let me know if you find some problems and let me know if you have any requests.

christophe-gouel commented 2 years ago

Hi,

I have removed the loading of gams-mode in my init file and put instead

(setq load-path (cons "~/.emacs.d/site-lisp/gams-mode/" load-path)) (require 'poly-gams)

It works at loading gams and polymode, but when I go to one of the embedded code section, it does not load the corresponding mode (no syntax highlighting either).

Best, Christophe

De : ShiroTakeda @.> Envoyé : dimanche 26 juin 2022 11:13 À : ShiroTakeda/gams-mode @.> Cc : Christophe Gouel @.>; Author @.> Objet : Re: [ShiroTakeda/gams-mode] Polymode (Issue #2)

Hi

When defining a new polymode, it is often necessary to create a separate lisp program. Following the same method, I created a program called poly-gams.el to use polymode in GAMS.

https://www.dropbox.com/s/t7mtzijkb9rx8g2/poly-gams.el?dl=0

Could you please try to use this program? Put this in the folder included in the load-path and add the following code to init.el

(require 'poly-gams)

When you open gms files, you should be able to use polymode in GAMS mode automatically.

Please let me know if you find some problems and let me know if you have any requests.

— Reply to this email directly, view it on GitHubhttps://github.com/ShiroTakeda/gams-mode/issues/2#issuecomment-1166463557, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFDHVQSBW2V2AH2L4IHVXLVRANLNANCNFSM5YG2VYMQ. You are receiving this because you authored the thread.Message ID: @.**@.>>

ShiroTakeda commented 2 years ago

Hi Christophe,

I want to check what the problem is. Could you upload (or send me by email) a file where the coloring feature doesn't work well?

christophe-gouel commented 2 years ago

Hi Shiro,

Actually, the coloring works really well.

The problem I had was related to my choice of theme: the (dark) material theme is not fully compatible with the coloring and some differences disappeared. Because of this, I have now switched to the solarized theme, which is perfectly compatible.

There is also one thing that does not work, but this is really a minor detail: $ expressions inside lists. See in the attached file the lines 347 to 350, the $ expressions are not recognized.

Finally, there is one coloring feature missing compared to GAMS Studio: there is no coloring for global variables that are surrounded by %%. But again, this is minor.

Best, Christophe

De : ShiroTakeda @.> Envoyé : jeudi 30 juin 2022 02:03 À : ShiroTakeda/gams-mode @.> Cc : Christophe Gouel @.>; Author @.> Objet : Re: [ShiroTakeda/gams-mode] Polymode (Issue #2)

Hi Christophe,

I want to check what the problem is. Could you upload (or send me by email) a file where the coloring feature doesn't work well?

— Reply to this email directly, view it on GitHubhttps://github.com/ShiroTakeda/gams-mode/issues/2#issuecomment-1170607516, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFDHVTJPS3K6AS62R6E22TVRTP4XANCNFSM5YG2VYMQ. You are receiving this because you authored the thread.Message ID: @.**@.>>

christophe-gouel commented 4 days ago

Hi @ShiroTakeda,

Your poly-gams.el works really well for me. Do you plan to integrate it to the package?

ShiroTakeda commented 1 day ago

poly-gams.el" depends on the package "polymode".

In such a case, it seems preferable to provide "poly-gams.el" as an independent package instead of including it in GAMS mode. For the same reason, my "gams-ac.el" is in a separate package. If there are no problems, I would like to provide "poly-gams.el" as a separate package. In that case, I would like to create a repository for the "poly-gams" package on Github.

Any opinions on this?