-
Notifications
You must be signed in to change notification settings - Fork 4
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
Comments
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. |
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 So a code block such as ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;;; Define variables.
;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; could be changed in ;;;; Define variables and it would be a subsection inside the Alternatively, it could be ;;; Define variables if one wants it to be a section (this is the convention in Magit for example). |
Hi @ShiroTakeda, I have done the adjustments required for GAMS mode to behave better on all platforms. The changes are in the develop branch. They should not be merged in master right now. Some testing is required first, which I will do in the following weeks, but I encourage you to try it too. I have also to edit the README to update the configuration instructions to the changes. I will also do this soon. There are a lot of changes in the file, but those are mostly small fixes to compilation warnings/notes. The substantial changes are limited and described in the CHANGELOG.md. I have taken the liberty to update the version number to 7.0 since some of the changes can break backward compatibility in minor ways. Best, |
Hi @ShiroTakeda, I am thinking about adding from faces for common mathematical operators (-, +, *, **, /). This would ease a lot reading equations, especially when people do not leave spaces around operators. Such faces are for example use in the mode for R. Here are 2 examples of the same equation in GAMS and R modes: I find the R mode version more readable. Would you have an objection to this change? |
I have no particular objections, so please go ahead and add it. However, symbols such as |
Great, I have just pushed the changes in the develop branch. There is problem of conflicts with comments or other things. |
By the way, if the changes you made to the develop branch don't cause any particular problems, you can merge them into the master branch. Alternatively, I can merge them for you. I don't think there are any problems with the changes you made in November. |
Thanks for validating the changes. I would like to add a bit of documentation and check everything before merging. I would do it sometimes in January. |
I would like to know what is the interest of the function I understand that it recenters the font-locking and the point, but is this really necessary as of now? With recent emacs versions and recent computers, font locking is no longer an issue in terms of computational power. And by binding it to Do you think it is still necessary? |
If the value of the variable However, the issue of improper coloring can be resolved by setting a sufficiently large value for Therefore, I believe there is no particular problem in discontinuing the binding of In |
Previously, in the BUGS_PROBLEMS.md I explained the cases where font-lock does not work well (and how to deal with them). But now it is not in BUGS_PROBLEMS.md because I removed it in the following commit: 51ab6b5 |
OK I get it. Thanks for your explanations. I have looked as my config and my I think that many big models have large comment blocks, so this is likely to be a common issue. At this point, I think it better to leave the command as it is. I will just deactivate it in my config since I have no use for it. However, I will add to the README file the recommentation about increasing |
I think your suggested revision is fine. |
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:
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"))(find-name-directory gams-process-command-name)
to fillgams-system-directory
defaultgams-gamslib-command
accordinglyWith 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?
The text was updated successfully, but these errors were encountered: