Symex makes some efforts to handle comments smartly, but this doesn't currently work for Janet, which uses # to begin comments (which run to the end of the line). For instance, in the following buffer:
(first sexp)
# comment for second sexp
(second sexp)
Deleting the first sexp with symex will delete the comment, too. (Whereas this seems to work if the comment is a semicolon comment.)
Overriding the following functions appears to fix this issue:
(defun symex-comment-line-p ()
"Check if we're currently at the start of a comment line."
(save-excursion
(back-to-indentation)
(or (looking-at-p ";") (looking-at-p "#"))))
(defun symex-inline-comment-p ()
"Check if there is an inline comment following point."
(looking-at-p "[[:space:]]*[;#]"))
However, I think these changes, as they are, would probably break things for other lisps. Not a problem for me as I largely use Janet, but I wouldn't want to put them into the code base, without some mechanism to check conditionally what the currently comment character is or similar, which is beyond my knowledge.
There may also be other functions which would need amending but these are the ones I found for now.
Symex makes some efforts to handle comments smartly, but this doesn't currently work for Janet, which uses
#to begin comments (which run to the end of the line). For instance, in the following buffer:Deleting the first sexp with symex will delete the comment, too. (Whereas this seems to work if the comment is a semicolon comment.)
Overriding the following functions appears to fix this issue:
However, I think these changes, as they are, would probably break things for other lisps. Not a problem for me as I largely use Janet, but I wouldn't want to put them into the code base, without some mechanism to check conditionally what the currently comment character is or similar, which is beyond my knowledge.
There may also be other functions which would need amending but these are the ones I found for now.