Macaulay2 / M2-emacs

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

Fix d-mode #12

Closed d-torrance closed 3 years ago

d-torrance commented 4 years ago

I recently noticed that D-mode.el exists (and apparently has for a very long time). However, it's not installed and the corresponding lines in M2-init.el are commented out by default.

Is there a reason it's not installed? There's the possibility of a name clash, e.g., with d-mode, especially on systems where filenames are case insensitive. Perhaps a rename to something like M2-D-mode.el?

DanGrayson commented 4 years ago

Yes, I haven't used it in years. (I just activate M2-mode on *.d files.) Renaming it and providing it would be good. Checking that it behaves well would also be good. (Notice that the file is now in a submodule.)

mahrud commented 4 years ago

The distributed M2 packages don't carry .d/dd files or the scc1 compiler, so there's no need to install the emacs mode for those files.

Developers, of course, can still install it manually from the source repository.

DanGrayson commented 4 years ago

Good point.

d-torrance commented 4 years ago

Personally, I like apt to install everything for me so I can just get to coding without fiddling with installing more things manually. :)

But if Dan uses M2 mode, does anyone use D mode? Perhaps it should just disappear completely? There's a lot of overlap anyway. Maybe add some of the D-only keywords to M2-symbols.el?

DanGrayson commented 4 years ago

It would be nice if D-mode were made to work -- then I would use it again.

DanGrayson commented 4 years ago

One fix needed:

--- a/D-mode.el
+++ b/D-mode.el
@@ -109,7 +109,7 @@

 (defun D-electric-semi ()
      (interactive)
-     (insert ?;)
+     (insert ?\;)
      (and (eolp) (next-line-blank) (= 0 (paren-change))
     (D-newline-and-indent))
      )