Macaulay2 / M2-emacs

Macaulay2 emacs files
GNU General Public License v3.0
5 stars 3 forks source link

Remove M2-mode.el #62

Closed d-torrance closed 3 months ago

d-torrance commented 4 months ago

We remove M2-mode.el. Its content was removed in 2003! See 4ecb0aea56b5eb2f62b6f2150978b50d9deba03b.

mahrud commented 4 months ago

Shouldn't we put everything in M2-mode.el instead of M2.el?

d-torrance commented 4 months ago

I don't think so -- the package name is M2. M2-mode is just one of the two major modes that it provides.

mahrud commented 4 months ago

Looking on my computer, I see loads of X-mode.el files and occasionally X.el in addition. I figured the convention was to put major modes in X-mode.el and if there is more (e.g. send-to-program) that could go in X.el. I don't know if this is formal though, and I don't have strong feelings about it.

d-torrance commented 4 months ago

M2 is the "feature" provided by M2.el (since M2.el ends with (provide 'M2) and it can be loaded with (require 'M2)). According to the https://www.gnu.org/software/emacs/manual/html_node/elisp/Named-Features.html:

Features are normally named after the files that provide them

Most of the X-mode.el files on my system end with (require 'X-mode).

mahrud commented 4 months ago

Is it just a matter of picking which of M2 or M2-mode are the main feature? Would it be more proper if they were split?

d-torrance commented 4 months ago

I don't think we'd need to split it. Other interpreted languages like Python and Octave that have at least two major modes in Emacs (one for editing code and one for interacting with the REPL) are set up just like ours using one file/feature.

mikestillman commented 4 months ago

@d-torrance @mahrud So can I accept this one? Are you both happy with it?

d-torrance commented 4 months ago

I'm not sure if I'm happy with it. I didn't realize initially that (require 'M2-mode) was mentioned in the README. I've changed that in 4c617cd, but if anyone has that in their config, this would break it.

mahrud commented 4 months ago

For what it's worth, my goal in separating this repository away was to make it possible to use M2 syntax highlighting even if M2 isn't installed, so I saw M2-mode as the main "feature" here and send-to-program as a nice utility which could even be separated. (In fact, I've used it for other repls by simply changing the program to like python several times).

Could one of M2 or M2-mode be added as an alias so nobody's system breaks?

d-torrance commented 3 months ago

Could one of M2 or M2-mode be added as an alias so nobody's system breaks?

Unless a second optional argument with a specific filename is passed to require, it will use the feature name to figure out the file to load, e.g., (require 'M2-mode) will look for M2-mode.el.

I'm going to close this.