Open Abdillah opened 9 years ago
You set mmm-indent-line-function
in the primary major mode. See mmm-erb.el
for an example. That function can look up in which submode point is and delegate appropriately.
As another option, you can create a new major mode deriving from js-mode
to use in subregions. That mode's indent-line-function
will be the one to change.
Great, It works..!
I choose to add new mode : js-embed-mode
. Something like this,
(define-derived-mode js-embed-mode js-mode "JSed"
"Javascript embedded mode as `js-mode' extension to be used in mmm-mode (or any mulimode package, if possible). Currently only adjust indentation."
(set (make-local-variable 'mmm-indent-line-function) 'js-embed-indent-line)
(set (make-local-variable 'standard-indent) 'js-embed-indent-after-tag))
Thanks.
In that case, I don't think you need to set mmm-indent-line-function
.
Hmm, why? (Is it is because js-mode
is not primary mode)
Then, what should I set?
I figuring out that using mode derived from js-mode
in mmm-mode
now failed. I will experiment with it more, and so I reopen this..
Hmm, why? (Is it is because js-mode is not primary mode)
Yes.
Then, what should I set?
indent-line-function
, I suppose.
How exactly I can set indentation function of sub-mode?
I have tried to
:creation-hook
of class. But it affecting the whole buffer.Any idea?