skeeto / nasm-mode

Major mode for editing NASM assembly programs
The Unlicense
79 stars 17 forks source link

Don't highlight constants in symbols #17

Closed 8dcc closed 5 months ago

8dcc commented 5 months ago

In the following assembly, the numbers in the labels currently get highlighted, since label and 1 are interpreted as separate words because of the _.

image

After the PR:

image

From Emacs manual, Backslash in Regular Expressions:

\<: matches the empty string, but only at the beginning of a word.

\>: matches the empty string, but only at the end of a word.

\_<: matches the empty string, but only at the beginning of a symbol. A symbol is a sequence of one or more symbol-constituent characters.

\_>: matches the empty string, but only at the end of a symbol.


Related to #12 and #15.

skeeto commented 5 months ago

Since you've taken such interest in this mode, @8dcc, I've added you as a collaborator. I haven't used Emacs for editing in years, and I'm no longer interested in working in Emacs Lisp. You're free to push into my repository at your own discretion — keeping in mind that it's published through MELPA and therefore has active users on master — and I'm happy to hand the project off further if you'd like to just completely take it over.

8dcc commented 5 months ago

Since you've taken such interest in this mode, @8dcc, I've added you as a collaborator. I haven't used Emacs for editing in years, and I'm no longer interested in working in Emacs Lisp. You're free to push into my repository at your own discretion — keeping in mind that it's published through MELPA and therefore has active users on master — and I'm happy to hand the project off further if you'd like to just completely take it over.

I appreciate it. The repository should remain under your name, since my fork also has some personal tweaks.

As you said, since some people might use the upstream version from MELPA, I will try to keep it up to date without changing the current behavior (I personally hate when updates change something because the maintainer just felt like adding some personal modifications).