Using emacs-24.1, how can we extend/customize existing color-theme in emacs ? I tried doing this
(custom-theme-set-faces
'tango
'(ido-first-match ((t (:foreground "008800" :weight bold))))
It worked fine when I had tango loaded. But when I put this in .emacs.d/init.el file, it failed because tango was not loaded by then and emacs complained of undefined tango. This certainly is not going to help as I tend to change theme regularly using (load-theme ...). What I'm looking at is some kind of hook to run when the theme is loaded. Is it possible ?
Ofcourse, I can modify tango-theme.el file but that is not my goal. I want to extend the existing theme. I tried this in my init file
(load-theme 'tango-dark)
(custom-theme-set-faces
'tango-dark
'(ido-first-match ((t (:foreground "#00cdef" :weight bold))))
(deftheme tango)
(custom-theme-set-faces
'tango
'(ido-first-match ((t (:foreground "#008800" :weight bold))))
This worked fine for tango theme.. But tango-dark is show the same color as tango. So, how to customize existing themes even before loading them or set the custom faces at the time of loading the theme.
When I want to define a new theme, I modify a given theme, and afterwards I call (color-theme-print). This function will generate a function that helps to restore my modified color theme.Put/include the generated function in .emacs.
color-theme-print is used to generate new color themes.
The command you are looking for is eval-after-load.
Related
I just installed Doom Emacs, and I get this screen:
picture link
I'd like for this "highlighting" feature to go away.
I thought it was hl-line-mode or global-hl-line-mode, but disabling those have no effect.
Using Emacs 27.2 on macOS 10.15.7 on Doom Emacs commit 2731685 (the current head).
Doom sets up a variable to control which modes it shows hl-line
global-hl-line-modes ;; What modes to enable hl-line-mode in.
I like to use hl-line mode at times, but disliked it appearing as a default so:
(setq global-hl-line-modes nil)
It should either be a list of modes, or nil.
;; for example...
(setq global-hl-line-modes '(prog-modes markdown-mode))
But for the love of Pete... don't fix this problem with a color change uurgh!!.
Forcibly change the background color:
(custom-set-faces
'(default ((t (:background "#000000"))))
'(hl-line ((t (:background "#000000"))))
)
add this to the end of ~/.doomd.d/config.el.
I have tried the following things:
including the following in my .spacemacs
dotspacemacs-default-font '("Fira Code"
:size 16
:weight normal
:width normal
:powerline-scale 1.1)
Doing options, set default font, save options
neither of which has actually updated my font settings. When I restart spacemacs, the font is back to the default 12pt Source Code Pro. However, when I run spacemacs -nw so that spacemacs runs inside my terminal, my font settings ARE preserved. What am I doing wrong?
My emacs version is 26.3.
Thank you!
Hack found here:
If I add
(set-face-attribute 'default nil :family "Fira Code")
(set-face-attribute 'default nil :height 160)
to my .spacemacs above the automatically generated code for setting the font, it works.
I would like to prevent flyspell from changing the foreground color of words, and just add a red underline.
I've tried the suggestions here, but it doesn't have any effect: How to overlay a face in Emacs that ONLY modifies the underline. Perhaps I'm missunderstanding the answer, but setting inherit: undefined in the customize interface does nothing.
Guessing I should customize flyspell-duplicate and flyspell-incorrect, but how?
As suggested by #chakravarthy-raghunandan the issue was with a local customization.
Turns out the theme I'm using set this, so my customizations were overwritten.
Putting this in my init.el fixed the issue:
(custom-theme-set-faces
'cyberpunk
'(flyspell-duplicate ((t (:weight bold :underline (:color "#ff0000" :style wave)))))
'(flyspell-incorrect ((t (:weight bold :underline (:color "#ff0000" :style wave))))))
I've recently moved to emacs and have a pretty simple question: when I'm on an specific line, linum changes it's foreground and background color. How can I disable this? What I'm trying to disable is the yellow foreground and grey background. I just get slightly distracted with it.
You seem to have linum-relative installed, it uses the face linum-relative-current-face to highlight current line, you can customize it so that it is less distractive. Here is an example of disabling the highlight completely
(set-face-attribute 'linum-relative-current-face nil :background nil :foreground nil :weight 'normal)
I have the issue visualized here:
The problem is the fringe is not colouring the background of my linum line numbers. I'm using Emacs 24.3.1 with Solarized color theme.
I've looked over various threads, which claims to fix this issue. However, I couldn't get any of them to work.
Any clues?
Try M-x customize-face linum and then Show All Attributes. Change the value of the Background variable and it should change. Easier than having to edit the actual theme file.
(set-face-attribute 'fringe nil :background "white" :foreground "white")
Set the fringe color to whatever you want.