larstvei / Focus

Dim the font color of text in surrounding paragraphs
470 stars 14 forks source link

focus-get-thing patch #15

Closed dieggsy closed 6 years ago

dieggsy commented 6 years ago

Previously, a value for focus-mode-to-thing like:

'((prog-mode . defun)
  (text-mode . sentence)
  (org-mode . paragraph))

Wouldn't work, since org-mode is dervied from text-mode. Now focus-get-thing checks if the current mode is explicitly in focus-mode-to-thing before checking if it's a derived mode.

Also, derived-mode-p already takes a list of modes as arguments, so we can just apply it instead of calling it with a custom "any" function.

larstvei commented 6 years ago

This looks great! I'll quickly test it out before I pull it.

larstvei commented 6 years ago

Sorry for not answering this obvious improvement more promptly. I'm happy to merge the changes.

Thank you very much for contributing!

dieggsy commented 6 years ago

No worries, you were prompt enough for me - my pleasure, thanks for merging.