Hello Le,
this sounds very interesting.
Can I bother you and ask you to post a snippet on how exactly do you
set up Rinari to work with generic-edit-special? It would speed up the
uptake/adoption of your work.
When you say that you use Steve Purcell's MMM-mode setup, is this what
you are referring to:
https://github.com/purcell/emacs.d/blob/master/init-ruby-mode.el#L34
Thanks for your work and your time,
Aleksandar
Hey, that's great -- I look forward to trying it out. Years ago I tried
using a package called multi-mode (IIRC), which used a similar technique
based on indirect buffers, but the package was quite outdated and I
never got it to work properly.
-Steve
Maybe someone also want to try the support for .html.erb in nXhtml? Is
there something missing?
How about trying to fix that problem? Is there something in your work
I can borrow? Do you want to integrate it in the indenting functions
in mumamo?
I see. Perhaps you can give me an example that I can add to the bug
database in nXhtml and test.
Since I have been doing everything there alone I had not felt the need
for commit messages. It would have been different if others had join.
(However the main work with mumamo has been very complicated so it has
not been easy to join!)
Instead there is a bug database and a lot of test cases.
I do not have time to do very much any more, but if there are people
willing and able to continue it would be nice. But be warned that some
low level changes too Emacs is required to go much further. (After
that the core of mumamo can be extracted to some new library that will
be much more simple to handle.)
> The generic-edit-special mode looks nice, but I'll probably never use
> it, for two reasons:
> 1) It doesn't in any way solve the main problem I have left with my
> mmm-mode setup - adjustment of html elements indentation according to
> the surrounding <% if %>, <% else %>, <% end %>, etc blocks, something
> that rhtml-mode does successfully.
There is a generic handling of indentation too. It is a surprisingly
difficult problem. If you have some simple rules for how to indent in
your special case then why not add it?
> 2) It breaks the simple edit-save-reload workflow: C-x C-s closes the
> special buffer (and leaves the new window open, by the way). This
> looks fixable, though.
I have no idea what you mean here. Can you explain?
Several people has asked and my answer is always the same: Yes, but I
do not have time.
And there is no big reason doing it as long as not the (quite
difficult) changes to Emacs C sources are made. Currently you can not
get a multi major package to work in Emacs. (I.e. mumamo and other
frameworks of course works most of the times, but there are troubles
you can not get around.)
>> There is a generic handling of indentation too. It is a surprisingly
>> difficult problem. If you have some simple rules for how to indent in
>> your special case then why not add it?
>
> Here I meant my own fork of mmm-mode.
Ok, that is your choice. I do not have time to do anything now. I just
pointed you to how you can do it.
>> > 2) It breaks the simple edit-save-reload workflow: C-x C-s closes the
>> > special buffer (and leaves the new window open, by the way). This
>> > looks fixable, though.
>>
>> I have no idea what you mean here. Can you explain?
>
> That's simple. Suppose I'm editing a piece of CSS or JS code inside of
> an HTML file. I make an edit, save the change, reload the page in the
> browser, see if I like the result, repeat. If saving the change closes
> the special buffer, I'll have to open it again and again.
It looks to me you are not using mumamo here, or?
Ah, sorry ;-)
It can be separated, but I do not have time to maintain it then. (And
I do not have much time now either, unfortunately.)
>> And there is no big reason doing it as long as not the (quite
>> difficult) changes to Emacs C sources are made.
>
> What do you mean, no big reason? As far as I'm concerned, it would
> clear up package dependencies, lower the required amount of codebase
> knowledge if someone wants to contribute a fix or feature, and allow
> users to install only the packages they are going to use.
> What other reason could there be?
You do not have to know more than mumamo*.el to do something with it.
>> Currently you can not
>> get a multi major package to work in Emacs. (I.e. mumamo and other
>> frameworks of course works most of the times, but there are troubles
>> you can not get around.)
>
> I'm assuming you already brought this issue up with maintainers. Could
> you link to the discussion(s)?
I have had a private discussion with Stefan Monnier about it. The
problem is essentially that the code used by font-lock can see the
whole buffer.
>> >> There is a generic handling of indentation too. It is a surprisingly
>> >> difficult problem. If you have some simple rules for how to indent in
>> >> your special case then why not add it?
>>
>> > Here I meant my own fork of mmm-mode.
>>
>> Ok, that is your choice. I do not have time to do anything now. I just
>> pointed you to how you can do it.
>
> Sure. Judging by the corresponding bug's status (https://
> bugs.launchpad.net/nxhtml/+bug/579581), this more or less works in
> Mumamo already.
I see. If something in nXhtml does not work then try the latest code
from the repository.
Does it actually work for you, or?
It is, partly since I also add some things to the menus.
>> You do not have to know more than mumamo*.el to do something with it.
>
> All right. It's not apparent to a newcomer, though ("Why is it not
> separate, then?" is a natural question to ask).
> There's still an issue of seeing too many unrelated files and sifting
> through unrelated changes in the commit log.
Do whatever you want. It is GPL sw. But be aware of that a big job is
merging and keeping things together (so that the user does not have
that burden unnecessary).
>> I have had a private discussion with Stefan Monnier about it. The
>> problem is essentially that the code used by font-lock can see the
>> whole buffer.
>
> I'd love to read that, with details and stuff. AFAIK, there are
> several approaches different modes use in this area, and some are
> pretty clever.
It is not much to read. I told Stefan that I think a low level change
where you can "hide" parts of a buffer from every funciton in Emacs is
the only way I can see solving the problem if we want to allow old
code to be used in multi major mode buffers. No one of us have sofar
any better suggestion. The problem is perhaps rather how to implement
it and that is difficult - at least it is far above my C fu... ;-)
I have been thinking of taking up this discussion again, but I think
the maintainers have a lot of other things to do at the moment. (In
particulary mergin the lex-branch.)
If you are interested perhaps you want to look at the C code and think about it.
If you can isolate them and make bug reports for nXhtml it would be
great. Now and then I have some time to look into them. And others can
of course also do that.