Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a customise face for the careful keywords. #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bhrgunatha
Copy link

Brief summary of what the changes does

[Please write a quick summary of the changes.]
It seems harsh to mark "careful" keywords with a warning so I added a face (derived from font-lock-keyword-face) to add some visual feedback for those keywords that supports light and dark themes.

Since I suck at colours I added it as a custom so user's could modify the setting to their liking.

Checklist

Please confirm with x:

  • I own the copyright to the submitted changes and indemnify v-mode from any copyright claim that might result from my not being the authorized copyright holder.
  • I've read CONTRIBUTING.md
  • I've used the latest version of package-lint to check for packaging issues, and addressed its feedback
  • My elisp byte-compiles cleanly
  • M-x checkdoc is happy with my docstrings
  • I have confirmed some of these without doing them

@damon-kwok
Copy link
Owner

In order to adapt to all themes, hard coding of colors is not recommended

@bhrgunatha
Copy link
Author

Thank you for replying.
Would inheriting from font-lock-warning-face (to match the current assignment) be acceptable, or do you reject the idea?

@damon-kwok
Copy link
Owner

Added:

(defvar v-mode-careful-keywords-face 'font-lock-warning-face)

This configuration can be placed in your .emacs

(defface my-careful-keywords-face
  '((((background light)) :inherit font-lock-keyword-face :weight thin :slant italic :background "#d8d8d8")
    (((background dark)) :inherit font-lock-keyword-face :weight thin :slant italic :background "#404040"))
  "Face `v-mode' uses to highlight keywords that need careful use."
  :tag "V Careful Keywords"
  :group 'v-mode)

(setq v-mode-careful-keywords-face 'my-careful-keywords-face)

@damon-kwok
Copy link
Owner

The user's theme is all kinds of strange, my principle only applies to the theme's own color value.
#d8d8d8 and #404040 are not recommended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants