Open ffevotte opened 9 years ago
Unfortunately "block configuration" is not that well named. The blocks refer to "blocks of code" demarked in comments, rather than block comments. At the moment, it really only supports beginning of line comments. This is not to say that it could not support C-style block comments, and it is something that I would like to add. The simple case (where /* and / appear on their own line) would not be hard. Supporting / single line */ comments would be a little harder. I'm not sure when I will support this form of comment yet, though. It may take a little while.
The :comment slot is used as a string (for insertion) and also to construct a regexp, so, yes, by default regexp special characters are going to break things. However, this can be modified with the lentic-blk-line-start-comment method. This should use regexp-quote by default though; I've opened a new issue for this, see #9.
The simple case (where /* and */ appear on their own line) would not be hard.
Nice to hear! I'll try implementing it, then. Would you think I should implement a new configuration from scratch, or simply specialize the block configuration? (I should mention that I know nothing of CLOS or EIEIO)
The EIEIO stuff isn't that hard. I think that quite a bit of the code could be shared with the block-configuration, but it makes a few assumptions that may not be true. It assumes, for instance, that all comments are the same (not true!), and that they start at the begining of the line.
You can use functionality from lentic-block even if you don't directly extent the block configuration.
Oh, if you try and have a go, please feel free to ask my about things you do not understand; I am updating the documentation as it stands and would welcome feedback about the parts which are not clear.
First, let me thank you for
lentic
: it looks a lot like the LP tool I've been wanting for years!The first application case I tried (which fits my current needs) is : Maxima code embedded into a LaTeX document. I thought about embedding Maxima fragments into
comment
environments, and usinglentic-(un)commented-block-configuration
to define thetex
to/frommaxima
conversion. I however stumbled upon two problems, caused by Maxima's use ofC
-like comments (/* ... */
)lentic-(un)commented-block-configuration
seems to only manage commented lines with a start marker, but can not add/remove line end comment markersI didn't quite understand the semantic of the
:comment
slot inlentic-(un)commented-block-configuration
: is it a plain string or a regular expression? In the case of C-like comment markers, I would like to use"/* "
as a comment marker, but I have encountered difficulties with the star (*
) character. Things behave strangely when I don't escape it::comment "/* "
and don't work at all when I escape it like so:
:comment "/\\\* "
Would it be hard to adapt the existing block conversion of define a new one for such cases? I might be able to try defining one if you give me the required pointers.
Many thanks in advance.