wolray / symbol-overlay

Highlight symbols with keymap-enabled overlays
332 stars 42 forks source link

add function to ignore keywords for SAS-mode #74

Closed con5tella closed 3 years ago

con5tella commented 3 years ago

add function symbol-overlay-ignore-function-sas to ignore some keywords for SAS-mode (supported by ESS).

con5tella commented 3 years ago

I tried appending custom functions, but it didn't seem to work. Then I changed the source code and submit this PR.

purcell commented 3 years ago

Thanks for submitting this. What code did you try for appending the custom function? Maybe I can help.

I'm not opposed to merging this, but I don't know if it's scalable to cover all the languages here, so I feel it might be preferable to only include the most popular ones.

con5tella commented 3 years ago

Thank you Steve!

I didn't want to modify it either, because I didn't fully understand the functions of this project.

I added the symbol-overlay-ignore-function-sas function in the hope that it supports the SAS language and added it to the symbol-overlay-ignore-functions by add-to-list. Unfortunately, the code doesn't work properly, unless I just added the same code to the source, as shown in PR #74.

purcell commented 3 years ago

My guess is that you'd have to write something like

(with-eval-after-load 'symbol-overlay
  (add-to-list 'symbol-overlay-ignore-functions '(SAS-mode . symbol-overlay-ignore-function-sas)))
con5tella commented 3 years ago

I'm still debugging, but I guess it's the loading sequence that affects whether it works or not.

con5tella commented 3 years ago

Thanks again!

What I wrote at first was the same as your suggestion, but after I removed with-eval-after-load, it worked instead. -_-!