Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adaptation to various platforms #12

Open
christophe-gouel opened this issue Aug 1, 2024 · 2 comments
Open

Adaptation to various platforms #12

christophe-gouel opened this issue Aug 1, 2024 · 2 comments

Comments

@christophe-gouel
Copy link
Collaborator

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:

  • Adjust gams-process-command-name default to (executable-find "gams"): this provides the complete path to the executable as long as it is in the PATH (on my Windows laptop, I get "c:/GAMS/47/gams.exe"; on my Linux desktop, I get "/usr/bin/gams"))
  • Then use (find-name-directory gams-process-command-name) to fill gams-system-directory default
  • Adjust gams-gamslib-command accordingly

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
Copy link
Owner

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
Copy link
Collaborator Author

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).

@christophe-gouel christophe-gouel mentioned this issue Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants