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

commentblock in emacs-lisp mode is strange #387

Open
quazgar opened this issue Jun 17, 2020 · 2 comments
Open

commentblock in emacs-lisp mode is strange #387

quazgar opened this issue Jun 17, 2020 · 2 comments

Comments

@quazgar
Copy link
Contributor

quazgar commented Jun 17, 2020

Observed behaviour

For me, using the cob (commentblock, from the prog-mode section) snippet in elisp mode produces this result:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
                                        ;             Some comment            ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

What seems wrong to me

There are lots of whitespaces before the first ; and it's only a single ;, not as I expected ;;. Opposed to this behaviour, comment-region prepends double semicolons.

What the snippet should do

  • All three lines should start with ;; at the beginning of the line.

Discussion

If the current behaviour is as intended, that's fine for me and the issue could be closed.

@quazgar
Copy link
Contributor Author

quazgar commented Dec 11, 2022

On further investigation, this seems to be a general problem with yasnippet in lisp-mode: If the return value of a ${1:$( ... )} expression starts with a single semicolon, that line will be indented to column 40, which makes no sense for comment blocks.

So as a workaround I propose to put a double semicolon in front. I will post a pull request soon.

quazgar added a commit to quazgar/yasnippet-snippets that referenced this issue Dec 11, 2022
The workaround here is to add a double semicolon, iff the start comment is a
single semicolon.  This also required some fixing of the whitespace
calculations.  This commit is for issue
387 (AndreaCrotti#387).
@quazgar
Copy link
Contributor Author

quazgar commented Dec 11, 2022

See PR #454

AndreaCrotti pushed a commit that referenced this issue Jan 5, 2024
The workaround here is to add a double semicolon, iff the start comment is a
single semicolon.  This also required some fixing of the whitespace
calculations.  This commit is for issue
387 (#387).
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