yasnippet-snippets
yasnippet-snippets copied to clipboard
commentblock in emacs-lisp mode is strange
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.
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.
See PR #454