Closed spacegoing closed 10 months ago
@spacegoing I'm curious why you closed this as complete? As far as I can see this wasn't added into the package yet, but I agree it's a good change.
I think this modification is best left as a customization, which hopefully is easy enough to achieve. The problem with a more permissive regexp is that one could get false positives, which are very annoying. So I'll close this ticket.
Dear astoff,
I hope this message finds you well. I'm writing to propose a small yet significant modification to the
code-cells-boundary-regexp
in thecode-cells
mode.Motivation: While using the
code-cells
mode for Python code, I noticed that the current implementation only recognizes cell boundary comments if they do not have any leading spaces. Specifically, it will catch a line such as# current implementation will catch this line
, but not a line with leading spaces like:This limitation can affect the usability of
code-cells
mode, especially when we structure Python code with indentation which is a common practice.Modification: I suggest a modification to the
code-cells-boundary-regexp
definition to handle leading whitespaces. The change involves using the(syntax whitespace)
function before(syntax comment-start)
, allowing for any number of whitespace characters before the comment start symbol.Here's the proposed change:
Results: With this modification,
code-cells
now recognizes cell boundary comments with leading spaces, enhancing its compatibility with indented Python code.For instance, previously, this block of code would not have its comments recognized:
With the modification, the above comment is successfully recognized as a cell boundary comment, as demonstrated in this example:
I hope this change will enhance the functionality of
code-cells
mode. I'm eager to hear your thoughts or any further suggestions you may have.