stan-dev / stan-mode

Emacs mode for Stan.
GNU General Public License v3.0
71 stars 15 forks source link

Emacs 25 compatibility #47

Closed lionel- closed 8 years ago

lionel- commented 8 years ago

It seems that stan-mode does not work with Emacs 25.

It fails to load:

Eval error in the ‘c-lang-defconst’ for ‘c-:$-multichar-token-regexp’ in stan-mode:
Eval error in the ‘c-lang-defvar’ or ‘c-lang-setver’ for ‘c-:$-multichar-token-regexp’ (source eval): (wrong-type-argument stringp (\, "%"))

And fails to indent:

c-looking-at-decl-block: Wrong type argument: stringp, nil

Tested with RC1.

jrnold commented 8 years ago

Hmmm. I think I need to get rid of the dependence and/or simplify how I use cc-mode. I never fully groked all of that mode, and it's been giving stan-mode issues.

lionel- commented 8 years ago

IIRC Stefan Monnier once posted a minimal SMIE-based C mode on emacs-devel, if that can help.

jrnold commented 8 years ago

That was my thinking in #44

jrnold commented 8 years ago

Is this what you were thinking of?

lionel- commented 8 years ago

Yes I think so. Direct link: http://git.savannah.gnu.org/cgit/emacs/elpa.git/tree/packages/sm-c-mode

lionel- commented 8 years ago

There's no guarantee that SMIE will make your life easier than CC-mode though. I've read that it's not 100% straightforward to use for C-like languages. Maybe ask Stefan about it before venturing in the rewrite? He may have some plans for SMIE.

jrnold commented 8 years ago

On the plus side, Stan is a much simpler language than C++ and C. In the short term, I should have stan-mode simply inherit from c++-mode or similar when defining the language, rather than defining all the low level cc-mode macros (which is where the problems are). I did the latter so I would have a better idea of exactly what was being defined and to keep certain things from being inherited from c++-mode that made no sense for Stan. However, this method seems to be breaking with almost every new version of emacs.

lionel- commented 8 years ago

The cc-mode maintainer is quite enthusiastic and involved, so he may help you find the best strategy.