Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multi-line comments #18

Open
sapristi opened this issue Jul 28, 2017 · 5 comments
Open

multi-line comments #18

sapristi opened this issue Jul 28, 2017 · 5 comments

Comments

@sapristi
Copy link

sapristi commented Jul 28, 2017

Hello tj64,
I am using the outshine/outline mode for emacs, and am having issues regarding multi-line comments. I got from the readme that outorg wasn't designed with multi-line comments in mind, but it says it uses the comment-region function, and I didn't manage to make it work.
I'm programming in OCaml (with tuareg-mode), do you have any idea of why it wouldn't work ?

I contacted alphapapa, but he was clueless on the topic.

Anyway thanks a lot for these modes, they have been really helpfull to me :)

@alphapapa
Copy link

alphapapa commented Jul 28, 2017

As it says on this repo's readme, Thorsten is no longer maintaining this package, as he transferred it to me. I'm sorry you found my response "clueless," but the readme explains that outorg is line-oriented, and I'm
not interested in doing a major rewrite to change that:

But using outorg on such multi-line comments will probably change their syntax back to single-line whenever comment-region uses this style.

I wish you wouldn't bother Thorsten, as he transferred the package for a reason.

@sapristi
Copy link
Author

Hello alphapapa,
the change their syntax back to single-line whenever comment-region uses this style seems to say that outorg should work accordingly with the comment-region function, which it does not in my case.

I'm sorry for being crude about your answer (it was late in the night...), and I get it that you don't want to rewrite the module for this, which is totally understandable, but I was just wondering whether tj64 would know more about this. If he feels bothered about this topic he can just tell it to me or ignore me.

@alphapapa
Copy link

the change their syntax back to single-line whenever comment-region uses this style seems to say that outorg should work accordingly with the comment-region function,

I think it means that, if comment-region reads in a multi-line comment, outorg will change it back to a single-line comment when output.

@tj64
Copy link
Owner

tj64 commented Jul 29, 2017

Hello, IIRC alphapapa nailed it with his last comment, thats just the way it works - because thats the way Emacs works when you call comment-region.
I would recommend to try it with e.g. a C or a Java multiline comment.

If anyone becomes more and more clueless here its me, I just seem to remember that it worked for some common languages (though transforming multi-line to single-line comments).
Anyway, outorg uses major-mode customizing and standard 'comment' functionality, the idea is that it should even work with some future major mode not yet written, if that mode defines its comment syntax correctly. Can you interactively do '(un)comment region' on multiline comments in OCaml?
Cheers
Thorsten

@sapristi
Copy link
Author

Hello Thorsten.

Using the tuareg-mode for OCaml, comment-region works on multi-line comments (with apparently a custom setting, since it is not affected by the comment-style variable). It generates a multi-line comment, and then individual lines cannot be uncommented using uncomment-region (uncomment-region works only when selecting the whole comment).

Outorg does work, and transforms multi-line comments to single-line comments. It just seemed to me that the description of commenting in the readme said that the comments generated by oultine would be single line only if that was the style set in comment-style.

(although there seems to be a problem handling multi-line comments that are inside a code block :
only the first line of these comments gets commented back in the source file).

Anyway thank you both for your efforts,
I fear I always try to get the most out of the tools I use,
but I absolutely recognize that having a tool that works (even though not exactly in the way one would like) is much better than a bugged full-featured tool !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants