There are some problem with the code:
put-text-property is applied to an object. In this case your string. You need to pass it as as the last parameter.
put-text-property starts counting at zero.
If font-lock-mode is enabled, it will strip any text of the face property.
The following piece of code works, if font-lock mode is disabled:
Try replacing the code for setting the font size with this:
(set-face-attribute 'default nil :font "DejaVu Sans Mono-14")
(set-face-attribute 'mode-line nil :font "DejaVu Sans Mono-10")
Of course, you'll want to change the sizes (14 and 10) to values of your liking.
If you want to customize a specific face and don't know the name of it, try doing
You can customize org-priority-faces to give specific attributes for each priority.
From C-h v org-priority-faces,
Faces for specific Priorities.
This is a list of cons cells, with priority character in the car
and faces in the cdr. The face can be a symbol, a color as
as a string, or a property list of attributes, like
No they don't get printed as text. :-)
Evaluate the following function, then call M-x mes. Doesn't it work?
(defun mes ()
(message (propertize "text" 'face 'font-lock-warning-face)))
The problem, I imagine, is that you're evaluating your snippet with
something like eval-last-sexp (C-x C-e). This function (and its
Put the cursor on the blue word, and say C-u C-x =. Find the face entry and click on its value. Then click on customize this face and change the foreground value to e.g. Cyan1.
If you are in a console or are doing emacs -nw in a terminal, instead of clicking, put the cursor on the appropriate element and press RET.
Okay I found a solution that worked for me.
(defun my/org-mode-hook ()
"Stop the org-level headers from increasing in height relative to the other text."
(dolist (face '(org-level-1
(set-face-attribute face nil :weight 'semi-bold ...
This looks like a bug triggered by org-mode's org-activate-bracket-links function.
This is what this function looks like:
(defun org-activate-bracket-links (limit)
"Run through the buffer and add overlays to bracketed links."
(if (and (re-search-forward org-bracket-link-regexp limit t)
(let* ((hl (org-match-...
As noted by @phils in the comment below, the Emacs manual suggests not modifying the face-remapping-alist directly due to possible unintended side effects: . . .to avoid trampling on remappings applied elsewhere. Thus, (setq-local face-remapping-alist '((stripe-highlight (:background "white" :foreground "black")))) is not considered to be the preferred ...
There are 4 regions where text may be displayed in Emacs, here is what
you can do to inspect each of them.
The mode-line: See the value of mode-line-format.
The header-line: See the value of header-line-format.
Buffer: If the face is in a region of the buffer you can't reach, see the value of (buffer-string).
Minibuffer: If point is currently in the ...
Thanks to @MadhavanKumar, I focused on deriving a solution based on defface.
I realized that I can't override an existing defface but I can always create my own background color sensitive defface. Then the only question was how to use my custom defface instead of the original.
I'll use the same example of overriding the stripe-hl-line face to walk through ...
Customize option show-paren-priority to have a negative value, e.g., -50.
No, this is not documented anywhere. Yes, a bug was filed about that. No, the bug report was never responded to.
See Emacs bugs #20253, #15899, and #16192.
Faces are global so changing its attributes anywhere changes it
everywhere, as you've noticed. To change it locally, make a copy of
the face, change the attributes in the copy and then use a mode hook
to locally set the old face to the copy on a per-buffer basis. The
sample below does it for font-lock-comment-face, but the same
incantation will work for ...
If of use: I came across Sacha's post that talks about how to do this.
Based on the code in her post and on the feedback from the comments, I now use the code below (I have a light theme). You may note lazy loading, this prevents an 'undefined' error at start up as per a comment in original blog post:
(defun my/modify-org-done-face ()
Run M-x ibuffer to show all open buffers.
Press m to mark buffers of interest (or one of the other more interesting marking commands).
Press E to evaluate a lisp form in each marked buffer, for example,
(highlight-regexp "regexp-custard" 'hi-yellow)
You can save the patterns for a particular file with hi-lock-write-interactive-patterns (Default binding: ...
Emacs doesn't allow fonts that have hyphens in them. I would rename the font to something that doesn't contain hyphens.
You can do this using ttx. For example, assuming you have a font named Inconsolata-dz for Powerline.otf in your current working directory:
# Convert the font to ttx format (an xml-like font format)
ttx "Inconsolata-dz for Powerline.otf"
This is because isearch does not use the minibuffer to read input from the user, rather it simply updates the echo area with the characters entered during isearch. Please note that the minibuffer and the echo area are different. From the GNU Emacs Manual
The echo area is used for displaying error messages (see Errors), for
messages made with the message ...
Use custom-theme-set-faces in a with-eval-after-load to easily customize a theme.
For example, this modifies ample-theme to have a lighter background and green keywords instead of the defaults.
'(default ((t (:foreground "#bdbdb3" :background "gray15"))))
Thanks to the answer provided by itsjeyd I managed to write a short expression to change the size of all mode-line related faces for all current and future frames.
If you're using other themes besides the default one (such as zenburn, etc.), the code should be put after you've declared the theme; i.e., after this line:
(load-theme 'solarized-light t)
I do not know about using the mouse, but I've often found it's easiest for me to run list-faces-display and then just i-search for what the face is likely called or visually scan for text that looks the same.
The second element of the font-info is the font's pixelsize, which is (roughly speaking) its height. Getting the width of any particular glyph in the font is a little more work:
(aref (aref (font-get-glyphs (font-at (point)) 65 66) 0) 4)
Use the raise display property. As explained in (info "(elisp) Other Display Specs"):
This kind of display specification raises or lowers the text it
applies to, relative to the baseline of the line.
FACTOR must be a number, which is interpreted as a multiple of the
height of the affected text. If it is positive, that ...
From make-mode.el, line 395 and forwards (Emacs 24.4.1):
'(;; Highlight lines that contain just whitespace.
;; They can cause trouble, especially if they start with a tab.
("^[ \t]+$" . makefile-space)
;; Highlight shell comments that Make treats as commands,
;; since these can fool people.
("^\t+#" 0 makefile-space t)
You can customize indicate-empty-lines to enable a fringe marker on lines after the end of the file, or call toggle-indicate-empty-lines to turn it on and off interactively.
There's a package on MELPA that replaces the default fringe indicator with a ~ for a look that is closer to what you get with vi. See vi-tilde-fringe.
An alternative approach ...
"Who's playing behind my back?" with respect to the most common choice of installing the GTK gui version of Emacs.
The GTK build of Emacs supports GConf settings, which is what is causing the font change "behind your back". To disable GConf settings add this to your .emacs:
(define-key special-event-map [config-changed-event] 'ignore)
Prior to Emacs 25.1 ...
You can also achieve this using rainbow-mode, which is part of ELPA. Install it with M-x package-install rainbow-mode and activate it with M-x rainbow-mode. It seems that the color changes don't occur until you edit the buffer.
The problem here is that there’s no face to control the appearance of
the margins. You can display text in the margin using overlays (that’s
what linum-mode does) but, like any text in Emacs, it’s constrained
to the limits of the buffer. So you can’t have any control over the
margin display beyond the last line of the buffer.
What you can do, ...
minibuffer-setup-hook is used only when the minibuffer is set up, i.e., activated, not when it is deactivated.
minibuffer-exit-hook takes effect when the minibuffer is exited. There is also minibuffer-inactive-mode-hook.
But although those do initiate the color change (as shown by adding (debug) at the beginning of the hook function, and then stepping ...
Turns out this is actually related to org-block-background face, which has been removed in org version 8.3.1 in commit f8b42e8, thus the bug. The rationale seems to be
it causes a bug with ps export
Maybe in the future there will be an alternative, but not yet.