while trying to fix some issues with the regular expressions use for font-locking (i.e, #147) and looking into pull requests from others that have changed them (i.e., #144), I had the feeling that these regular expressions could be improved by some refactoring, because they seem to share a lot of common structure which is explicitly duplicated. After discussing this with @mtoboid in #144 I think the following two changes would be helpful:
Refactor common patterns in the regular expressions like "space-at-beginning-of-line" or "whitespace-stuff-at-end-of-line" into separate variables and using those consistently in all other regular expressions;
Adding a small function to reevaluate all regular expressions, i.e., reset all regular expressions to their original values (this might be useful during debugging, at least I had quite a hard time trying to fix a regular expression and then manually reevaluating all the necessary defvars afterwards)
What do you think about this? Is this a worthwhile endeavor from your point of view? If so, I could give it a try.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey @skuro,
while trying to fix some issues with the regular expressions use for font-locking (i.e, #147) and looking into pull requests from others that have changed them (i.e., #144), I had the feeling that these regular expressions could be improved by some refactoring, because they seem to share a lot of common structure which is explicitly duplicated. After discussing this with @mtoboid in #144 I think the following two changes would be helpful:
defvar
s afterwards)What do you think about this? Is this a worthwhile endeavor from your point of view? If so, I could give it a try.
Best,
Daniel