diff options
| author | Miquel Sabaté Solà <msabate@suse.com> | 2016-06-29 15:42:34 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <msabate@suse.com> | 2016-06-29 15:42:34 +0200 |
| commit | 533964d56966b9570bacf5534005140c4240250f (patch) | |
| tree | 52ebe32e5de6c6a5d96336159bc14d6d4e64789f | |
| parent | f3f2e3155c400e47f3ccc5c05e830a70c3addbe3 (diff) | |
| download | soria-533964d56966b9570bacf5534005140c4240250f.tar.gz soria-533964d56966b9570bacf5534005140c4240250f.zip | |
Added the `soria-purple-identifiers` function
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
| -rw-r--r-- | README.md | 22 | ||||
| -rw-r--r-- | TODO | 1 | ||||
| -rw-r--r-- | soria-theme.el | 20 |
3 files changed, 38 insertions, 5 deletions
@@ -13,6 +13,28 @@ In the `soria-theme.el` file I list further acknowledgements. To install it, just drop the `soria-theme.el` file into your `~/.emacs.d` and load it with `load-theme`. +## Configuration + +This color theme defines the `soria` group, which in turn has only one +configuration option: + +- `soria-hide-helm-header`: the Helm package in combination with Projectile + shows a header that in my humble opinion is quite useless and it's + distracting. For this reason, this header is hidden by default. If you set + it to false, then you'll see the header with the same colors as the status + line. + +Moreover, this theme also provides one function that can be used as a hook: +`soria-purple-identifiers`. As a reminder, this color theme is a port from Vim, +and Vim and Emacs have some different takes on function identifiers. As such, +the original Vim theme defines identifiers as purple, but only method +definitions in Ruby, Perl and PHP (languages that I've used with these theme, +there might be more) were highlighted this way, but that wasn't the case for C, +C++ or Go. This is certainly a bug in Vim, but I got used to it, and when doing +this port I could notice this a lot. For this reason, by default this color +theme for Emacs defines function identifiers as white, but it provides this +function so in other languages can be drawn in purple. + ## License Copyright (C) 2016 Miquel Sabaté Solà <mikisabate@gmail.com> @@ -1 +0,0 @@ -- The first match on incremental search should be orange instead of green diff --git a/soria-theme.el b/soria-theme.el index fba49b7..d87f29d 100644 --- a/soria-theme.el +++ b/soria-theme.el @@ -63,9 +63,10 @@ The theme has to be reloaded after changing anything in this group." (set-face-attribute 'font-lock-number-face nil :inherit font-lock-constant-face) (setq font-lock-number-face 'font-lock-number-face) -; add-font-lock-numbers adds to the list of keywords of font-lock-number-face -; the supported numeric formats (decimal, octal, hex and bin). (defun add-font-lock-numbers () + "Add to the list of keywords numeric formats. +It adds to font-lock-number-face decimal, octal, hex and bin formats." + (defvar font-lock-number "[0-9]+\\([eE][+-]?[0-9]*\\)?") (defvar font-lock-hexnumber "0[xX][0-9a-fA-F]+") (defvar font-lock-binnumber "0[bB][01]+") @@ -199,7 +200,7 @@ The theme has to be reloaded after changing anything in this group." ((,class (:inherit font-lock-comment-face)))) `(font-lock-function-name-face - ((,class (:foreground ,soria-purple)))) + ((,class (:foreground ,soria-white)))) `(font-lock-variable-name-face ((,class (:foreground ,soria-white)))) @@ -392,7 +393,7 @@ The theme has to be reloaded after changing anything in this group." ;; eldoc `(eldoc-highlight-function-argument - ((,class (:foreground ,soria-darkgreen + ((,class (:foreground ,soria-green :underline nil)))) ;; eshell @@ -436,6 +437,17 @@ The theme has to be reloaded after changing anything in this group." (add-hook 'prog-mode-hook 'add-font-lock-numbers) +(defun soria-purple-identifiers () + "Make function identifiers purple. +This function might be used as a hook for modes that prefer having purple +function identifiers instead of the default white. This might seem hachish, but +it tries to workaround discrepencies between Vim and Emacs in terms of +identifiers" + + (let ((soria-purple "#dfafdf")) + (set (make-local-variable 'face-remapping-alist) + `((font-lock-function-name-face :foreground ,soria-purple))))) + (provide-theme 'soria) ;; Local Variables: |
