I'm trying to set the font sizes of org-mode titles.
They are, by default, too big (yeah, size does matter).
I've been trying to find a reference, but very annoyingly, I couldn't.
How do I customize the scale value of all headlines through my config file?
Via group settings inside emacs --> org-faces I've found that it's set to height and scale.
I want to set all scales to 1.
Found the answer. Too obvious, but still annoying.
(custom-set-faces
'(org-level-1 ((t (:inherit outline-1 :height 1.0))))
'(org-level-2 ((t (:inherit outline-2 :height 1.0))))
'(org-level-3 ((t (:inherit outline-3 :height 1.0))))
'(org-level-4 ((t (:inherit outline-4 :height 1.0))))
'(org-level-5 ((t (:inherit outline-5 :height 1.0))))
)
Related
How can I change the color of the current line number of the current window in Spacemacs/Emacs?
I currently use this code in Spacemacs:
(custom-set-faces
'(line-number-current-line ((t (:inherit line-number :background "white" :foreground "color-16"))))
)
However, this code applies to all existing windows. How can I change the color only on the current window?
Thank you!
Windows 7, Emacs 25.1, Helm package
My helm-grep-do-git-grep command screenshot:
I want to change match text color (dark red) to another (e.g. green).
I try to find in helm-grep-face, but not found.
So how I can change this face color?
Depending on what you are using, you are looking for either of the following:
(defface helm-git-grep-match
'((default (:inherit helm-match)))
"Face used to highlight git-grep(1) matches."
:group 'helm-git-grep-faces)
or
(defface helm-grep-match
'((((background light)) :foreground "#b00000")
(((background dark)) :foreground "gold1"))
"Face used to highlight grep matches."
:group 'helm-grep-faces)
Accordingly, you'll be able to change the color by calling M-x customize-group helm-grep-faces (or helm-git-grep-faces).
I found solution. I change "d:\Programs\emacs\ .gitconfig".
Add section:
[color "grep"]
match = black yellow
And now match text color has foreground color = black, and bakground color = yellow
I want to change the default colors in the powerline-evil-center-color-theme. I am specifically looking to change the the face colors of the evil-state face such that the background and foreground colors matches my Emacs color theme.
I have tried to look at the readme on powerline-evil, but it doesn't tell me how to configure the colors via my init.el, and I've tried modifying the code in powerline-evil.el to change the colors manually, but it still didn't work.
The following code is taken from my powerline-evil.el:
(defface powerline-evil-base-face
'((t (:foreground "green" :inherit mode-line)))
"Base face for powerline evil faces."
:group 'powerline)
(defface powerline-evil-normal-face
'((t (:background "#909737" :inherit powerline-evil-base-face)))
"Powerline face for evil NORMAL state."
:group 'powerline)
(defface powerline-evil-insert-face
'((t (:background "blue" :inherit powerline-evil-base-face)))
"Powerline face for evil INSERT state."
:group 'powerline)
(defface powerline-evil-visual-face
'((t (:background "orange" :inherit powerline-evil-base-face)))
"Powerline face for evil VISUAL state."
:group 'powerline)
(defface powerline-evil-operator-face
'((t (:background "cyan" :inherit powerline-evil-operator-face)))
"Powerline face for evil OPERATOR state."
:group 'powerline)
(defface powerline-evil-replace-face
'((t (:background "red" :inherit powerline-evil-base-face)))
"Powerline face for evil REPLACE state."
:group 'powerline)
(defface powerline-evil-motion-face
'((t (:background "magenta" :inherit powerline-evil-base-face)))
"Powerline face for evil MOTION state."
:group 'powerline)
Even if I set the foreground to be green, as you can see in the code above, it still displays as white. I don't know what to do. Can anyone help?
EDIT:
I actually have another problem now. What #AaronHarris told me works fine for the foreground color, but I cannot change the background color for the other states. My entire mode-line becomes the background color of my theme instead.
I have added the following code to my init.el
(custom-theme-set-faces 'jazz '(powerline-evil-base-face
((t (:foreground "jazz-fg" :inherit mode-line)))
:group 'powerline))
(custom-theme-set-faces 'jazz '(powerline-evil-insert-face
((t (:background "jazz-blue" :inherit powerline-evil-base-face)))
:group 'powerline))
The first part works fine for the foreground color, but the second part is doing something bad.
I think you want to use custom-theme-set-faces to tell your theme what to do with this face, e.g.:
(custom-theme-set-faces 'my-theme '(powerline-evil-base-face
((t (:foreground "green")))))
My not-very-educated guess on what's happening here is that your theme already knows about this face and its default for it is also white, so anything you do to the original definition will get wiped out by the theme.
How to get background type of Emacs? e.g. 'light or 'dark
You can define a face like this:
(defface moedict-type
'((((class color) (background light))
(:foreground "#ffffd7" :background "#525252"))
(((class color) (background dark))
(:foreground "#525252" :background "#c1c1c1")))
"Face for type. ex: [動]、[名]")
And Emacs will select correct font face automatically by current background type.
But I want to know how it do. (It is better if there is an build-in function in Emacs)
By the way, I try to seek in source code and found a function (frame-background-color), but its output is string like "#ffffff".
You can use the function frame-parameter to get the attributes of a frame. For your particular case you can do
(frame-parameter nil 'background-mode)
To get background-mode of the current frame. The first parameter is the frame for which you want to the get specified parameter, if nil the currently selected frame is used. You can do C-hfframe-parameterRET
I'm using fixed size pixel fonts in emacs when writing code. When specifying font sizes in emacs, it wants the font size in points. Since I use my .emacs file on several different machines with varying monitor sizes, it means that when the font looks great on one machine, it's typically blurry or too large on another. I've worked around this in my .emacs by checking the actual monitor size in pixels, but the right way to do this would be to specify the fontsize in pixels, or have a small lisp stub that calculates the proper point size from a given pixel size, assuming the dpi values are available from within emacs.
Suggestions?
Update Sep 26
I'm on Linux (Ubuntu 10.04, x64).
My current hackish solution is:
(if (>= (x-display-pixel-height) 1200)
(custom-set-faces
'(default ((t (:stipple nil :background "black" :foreground "cornsilk" :inverse-video nil :box nil :strike-through nil :overline nil :underline nil :slant normal :weight normal :height 120 :width normal :family "proggycleanttsz"))))))
Only the height attribute is different from where I already set it earlier in the .emacs file. On another machine I have to set it to 90 to get it "pixel perfect". I tried putting in a:
(set-frame-font "proggycleanttsz")
instead, but that isn't working. When I look back on my earlier attempts, I see that I now use the truetype version of the font, which means that the subject of the question is not entirely right, but anyway, it looks very much like pixel font, but only at the exact right size. Not sure how this works with truetype.
I've been using
(set-frame-font "font-name:pixelsize=16")
for a while now. Works fine with Emacs 25 on Linux. This style of font name is documented for MS Windows, but I've been using it for years with Linux.
As mentioned in the comments to your question, if you are on linux, XFT is what you want, so use something like (set-frame-font "Terminus-8") in your .emacs would work well.
Borbus mentions ~/.Xresources - I think you can use Emacs*font: Font-name in ~/.Xdefaults.
I had a quick look on your profile to try and determine the operating system you use, but I couldn't guess. Some more information might be good (OS, emacs version)