You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(aside; just started using mmm-mode, and so far it works fine, except for this issue)
I'm writing wisi-grammar-mode, a mode for wisi grammar files; similar to bison/yacc grammar files; they have embedded code in elisp or Ada in the grammar actions. To get proper indentation in the grammar actions, I'm using mmm-mode.
It works fine interactively, but fails in my tests. To run a test, I spawn a new emacs, load a wisi-grammar file, run indent, save the result. Then a makefile diffs the test result with the original.
I saw issue #80 about -batch mode; I'm using emacs -Q, so that's not the issue.
That relies on post-command-hook to start mmm-mode, which means it runs after the test function, which is the first command run in the spawned emacs. So in the test code, I set:
(add-hook 'wisi-grammar-mode-hook 'mmm-mode-on)
That sets indent-line-function, and an overlay, but the indent is still wrong, so something is still not being set properly.
The text was updated successfully, but these errors were encountered:
I figured out the cause of the problem; my test uses 'indent-region', and wisi-grammar-mode provides 'indent-region-function', but mmm only provides 'indent-line-function'. My indent-region sends the buffer contents to an external process that computes the indent.
It might make sense for a new mmm-indent-region to call the appropriate indent-region on each subregion. I'll give that a try.
(aside; just started using mmm-mode, and so far it works fine, except for this issue)
I'm writing wisi-grammar-mode, a mode for wisi grammar files; similar to bison/yacc grammar files; they have embedded code in elisp or Ada in the grammar actions. To get proper indentation in the grammar actions, I'm using mmm-mode.
It works fine interactively, but fails in my tests. To run a test, I spawn a new emacs, load a wisi-grammar file, run indent, save the result. Then a makefile diffs the test result with the original.
I saw issue #80 about -batch mode; I'm using emacs -Q, so that's not the issue.
To start mmm normally, I've set:
(setq mmm-global-mode 'classes)
(add-to-list 'mmm-mode-ext-classes-alist '(wisi-grammar-mode nil wisi-action))
That relies on post-command-hook to start mmm-mode, which means it runs after the test function, which is the first command run in the spawned emacs. So in the test code, I set:
(add-hook 'wisi-grammar-mode-hook 'mmm-mode-on)
That sets indent-line-function, and an overlay, but the indent is still wrong, so something is still not being set properly.
The text was updated successfully, but these errors were encountered: