ShiroTakeda / gams-mode

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

Adaptation to various platforms #12

Open christophe-gouel opened 1 month ago

christophe-gouel commented 1 month ago

Hi @ShiroTakeda,

Thanks for giving me the right to push to the repositories.

I will soon leave on vacation, so I won't do anything else before September. In September, I would like to make some small changes for gams-mode to be easier to work with out of the box and to work better on various platforms. I have just moved my desktop computer to Linux, and I was surprised that the extraction from the gams library failed on this platform. More generally, it is quite a pain to have to maintain different emacs configs for different platforms, where GAMS will have different locations, and I am sure we can ease this.

I have the following ideas to simplify things:

With these changes in place, people would not see any difference if they had customized the variables. But this should streamline the gams-mode config since there won't be any path to set if the GAMS folder is in the PATH.

What do you think?

ShiroTakeda commented 1 month ago

Since I primarily use Windows systems, I have very little understanding of the situation with GAMS on other platforms or the issues that might arise with GAMS mode.

I think your suggestion is a very good idea.

However, the following command

(find-name-directory gams-process-command-name)

will actually be the following command:

(file-name-directory gams-process-command-name)



Changing the topic a bit, one of the issues with GAMS mode is that the program file (gams-mode.el) is too large.

Emacs Lisp packages of a certain size are usually created by splitting the program into multiple files, typically divided by functionality. This approach makes the program easier to understand and manage.

However, since I have developed almost all parts of GAMS mode by myself, there hasn’t been much need to enhance readability for others, leading to the inclusion of everything in a single file.

While there may be some advantages to including everything in one file, the current gams-mode.el exceeds 17,000 lines, making it quite difficult to understand. Even I find it challenging to keep track of where I wrote what.

Ideally, GAMS mode should also be divided into files by functionality. However, it is not easy to do this effectively, so that task has remained untouched.

If there is anything you don't understand in the program, please feel free to ask.

christophe-gouel commented 1 week ago

Changing the topic a bit, one of the issues with GAMS mode is that the program file (gams-mode.el) is too large.

Emacs Lisp packages of a certain size are usually created by splitting the program into multiple files, typically divided by functionality. This approach makes the program easier to understand and manage.

However, since I have developed almost all parts of GAMS mode by myself, there hasn’t been much need to enhance readability for others, leading to the inclusion of everything in a single file.

While there may be some advantages to including everything in one file, the current gams-mode.el exceeds 17,000 lines, making it quite difficult to understand. Even I find it challenging to keep track of where I wrote what.

Ideally, GAMS mode should also be divided into files by functionality. However, it is not easy to do this effectively, so that task has remained untouched.

Yes, gams-mode.el is too large, but I don't think anything should be done about this. GAMS mode is stable at this point. I am just contributing minor enhancements, which I am able to do even with this large file. I don't think it is worth anyone's time to break it down into smaller files.

The only thing I would suggest is to change the comments to follow the outline-minor-mode standards. This would make code navigation much easier in the file (org-like). In lisp-mode, sections starts by ;;;, subsections by ;;;;, ;;;;;, ...

So a code block such as

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;;     Define variables.
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

could be changed in

;;;; Define variables

and it would be a subsection inside the ;;; Code: section.

Alternatively, it could be

;;; Define variables

if one wants it to be a section (this is the convention in Magit for example).