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
Using emacs 24, I'm trying to use mmm-mode with noweb and C code.
But the indentation is not working correctly.
Here's an example cut from a very large file:
thousands of lines here
<<johnny>>=
void f(int a) {
return g(a);
}
@
Placing the cursor on return and calling c-indent-line doesn't accomplish anything.
I've tracked the problem as far as the c-in-literal function, which claims that this position occurs inside a string. Function c-in-literal calls widen, which is unfortunate, and my Emacs Lisp skills are not good enough to find a fluid let that would prevent that widen from going beyond the region in mmm-mode that contains the code in question.
Here's another example from a complete file:
% -*- mmm-noweb-code-mode: c-mode; -*-
just one line here
<<johnny>>=
int f(int a) {
return z;
}
@
In this example, the failure mode on calling c-indent-line is different: c-in-literal returns the right thing, but a different error occurs: c-after-conditional: Wrong type argument: stringp, nil.
There's nothing obviously wrong with mmm-mode here; when indentation is asked for, it is correctly calling c-indent-line. But it is not working for its intended purpose. I would welcome some help figuring out how either mmm-mode or c-mode could be modified so they could work together.
The text was updated successfully, but these errors were encountered:
I've got rid of some Wrong type argument errors (hopefully all?), but the indentation is still going crazy, and CC Engine is a rabbit hole too deep to get into. Maybe you should just set mmm-noweb-code-mode to js-mode, its syntax is similar, and it's less crazy.
mmm-noweb.el still contains the traces of trying to make different code believe everything beyond the current subregion is whitespace (see mmm-space-other-regions and nearby), but I'm not sure what the exact goals were, and how far it progressed.
Using emacs 24, I'm trying to use mmm-mode with noweb and C code.
But the indentation is not working correctly.
Here's an example cut from a very large file:
Placing the cursor on
return
and callingc-indent-line
doesn't accomplish anything.I've tracked the problem as far as the
c-in-literal
function, which claims that this position occurs inside a string. Functionc-in-literal
callswiden
, which is unfortunate, and my Emacs Lisp skills are not good enough to find a fluid let that would prevent thatwiden
from going beyond the region in mmm-mode that contains the code in question.Here's another example from a complete file:
In this example, the failure mode on calling
c-indent-line
is different:c-in-literal
returns the right thing, but a different error occurs:c-after-conditional: Wrong type argument: stringp, nil
.There's nothing obviously wrong with mmm-mode here; when indentation is asked for, it is correctly calling
c-indent-line
. But it is not working for its intended purpose. I would welcome some help figuring out how either mmm-mode or c-mode could be modified so they could work together.The text was updated successfully, but these errors were encountered: