Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
347 stars 231 forks source link

emacs: comment with a string (in quotes) does not highlight properly #616

Closed antonleykin closed 4 years ago

antonleykin commented 7 years ago

-- comment without string is fine, but -- comment with "a string" does not highlight as a comment

DanGrayson commented 7 years ago

It looks fine at this end:

screen shot 2017-05-28 at 3 19 03 pm
DanGrayson commented 7 years ago

I'm using emacs 25.1.1

antonleykin commented 7 years ago

I have this problem both in

GNU Emacs 22.1.1 (mac-apple-darwin) of 2017-03-16 on osx338.sd.apple.com

and

Aquamacs 3.3 GNU Emacs 25.1.1 (x86_64-apple-darwin14.1.0, NS appkit-1344.72 Version 10.10.2 (Build 14C109)) of 2016-09-19 on 24a02dbf6b34ae061ef4df89f15bfbc5d3ed497e

DanGrayson commented 7 years ago

Then that indicates it was a bug in emacs that has been fixed.

DanGrayson commented 7 years ago

... although, your aquamacs indicates it is up-to-date, since it's 25.1.1. Hmm...

DanGrayson commented 7 years ago

It works at this end in aquamacs:

screen shot 2017-05-28 at 4 00 50 pm
pzinn commented 7 years ago

I'm afraid this is a side effect of #551. Basically, -- comments are no more considered comments for highlighting purposes: as explained in #537, emacs allows 2 types of comment sequences only if they share the first character, which is not the case in Macaulay2, -- vs {*. So I suggested to recode -- as normal syntax highlighting, which means the quote highlighting takes priority. I'll provide a fix.

DanGrayson commented 7 years ago

See https://github.com/Macaulay2/M2/issues/674 . The changes in the commits that resolved that may have resolved this.

pzinn commented 7 years ago

so what's the status now? is { ... } still valid, or is it only - ... - from now on, potentially breaking old code?

On Sun, Aug 6, 2017 at 10:12 PM, Daniel R. Grayson <notifications@github.com

wrote:

See #674 https://github.com/Macaulay2/M2/issues/674 . The changes in the commits that resolved that may have resolved this.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Macaulay2/M2/issues/616#issuecomment-320503149, or mute the thread https://github.com/notifications/unsubscribe-auth/AEawh-GlhvSxWdbQiZykWcvfk_yjBdwMks5sVa2dgaJpZM4NouIE .

DanGrayson commented 7 years ago

The old syntax still works, but M2-mode in emacs won't attempt to colorize it -- no code will break.


i1 : {* asdf *} 5

o1 = 5

i2 : -* asdf *- 5

o2 = 5

We also fixed the ///.../// string parsing, but mixtures of the two won't work properly, I think.

DanGrayson commented 7 years ago

I should have paid more attention to your June 29 message! We could have come up with the idea then, if I had been attentive.

mahrud commented 4 years ago

This issue seems to be fixed.