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

Feature request: command for block commenting #199

Open
hab25 opened this issue May 5, 2024 · 0 comments
Open

Feature request: command for block commenting #199

hab25 opened this issue May 5, 2024 · 0 comments

Comments

@hab25
Copy link

hab25 commented May 5, 2024

AFAICT it is not properly available through trivial combination of any existing command and customizeable variable.

One improper option is if one customizes comment-end and comment-start, but then they lose line comments (see https://emacs.stackexchange.com/questions/39291/c-mode-smartly-use-for-comment-dwim#:~:text=The%20reason%20that,syntax%20instead%20of%20%22//%22).

Another improper option is if one writes their own very short command that ad-hoc let-binds comment-end and comment-start and calls #'comment-region inside that. But then they would need to, AFAICT, hardcode the "/*" and "*/" strings there, which is not ideal since this information should already be known to and provided by nix-mode. E.g., c-mode provides the c-block-comment-starter and c-block-comment-ender variables.

To clarify, in comparison Intellij provides two independent commands:

  1. for line commenting (see https://blog.jetbrains.com/idea/2022/04/comment-your-code-like-a-pro-with-intellij-idea/#:~:text=Single%2Dline%20comments%20in%20Java%20start%20with%20two%20forward%20slashes%20(//).%20To%20quickly%20add%20a%20line%20comment%20in%20IntelliJ%20IDEA%2C%20press%20%E2%8C%98%20/%20on%20macOS%20or%20Ctrl%20%2B%20/%20on%20Windows%20and%20Linux. )
    and
  2. for block commenting (see https://blog.jetbrains.com/idea/2022/04/comment-your-code-like-a-pro-with-intellij-idea/#:~:text=Block%20comments%20or,Windows%20and%20Linux.)
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

1 participant