Bold Font settings for TODO keywords in org-mode - emacs

I have added a NEXT todo keyword using the below setting
(setq org-todo-keywords
'((sequence "TODO(t)" "NEXT(n)" "|" "DONE(d!/!)")))
I want to change the "NEXT" todo keyword font setting color to cyan and bold, i have used the following to set this up.
(setq org-todo-keyword-faces
'(("NEXT" . (:foreground "cyan" :bold t))))
The color gets changed but the "NEXT" keyword font is not displayed in bold as the "TODO" keyword gets displayed. How to make it to bold.

how about this.?
(setq org-todo-keyword-faces
(quote (("NEXT" :foreground "cyan" :weight bold))))

Related

Current line highlight (hl-line) does not respect existing highlights

I am trying to configure hl-line or hl-line+ in emacs to respect the existing highlights/text background colors in the buffer.
I have configured hl-line in ~/.emacs as follows:
(require 'hl-line)
(global-hl-line-mode 1)
Then I highlight the symbol at point using highlight-symbol-at-point (M-s h .). This highlights the symbol under the cursor all over the buffer with a yellow background.
However, when I move the cursor over a line containing that symbol, the hl-line overlay hides the yellow background. My expectation would be for the line to be highlighted, but for the yellow background to be respected.
After doing some digging, I also tried with the hl-line+ package as it has an overlay priority option that sounds promising. I downloaded the hl-line+.el file and setup my ~/.emacs as follows:
(add-to-list 'load-path (expand-file-name "~/.emacs.d/packages/hl-line+/"))
(require 'hl-line+)
(global-hl-line-mode 1)
(setq-default hl-line-overlay-priority -100)
However, this still has the same incorrect behivour to hide the existing yellow background.
Anybody knows how to configure either of these packages to respect the existing background colors?
highlight-symbol uses font-lock, which adds text properties (face or font-lock-face) to chars in the buffer.
Overlay properties (including face and `font-lock-face) are not applied to chars in the buffer. They're applied to buffer positions. They "overlay" the buffer contents; they're not part of the buffer contents.
Overlay properties always take priority over text properties. This means overlay highlighting always overrides text-property highlighting (e.g. by font-lock).
Overlay priorities only specify the relative priority among overlays. Again, any overlay highlighting overrides any text-property highlighting.
So I think the answer is that you can't do what you request. (Someone else will correct me, if there's a way around this.)
Reading the hi-lock.el documentation, this explanation stood out:
"In buffers where Font Lock mode is enabled, patterns are highlighted
using font lock. In buffers where Font Lock mode is disabled,
patterns are applied using overlays"
So as it turns out, the hi-lock.el package is able to highlight using overlays, but only when font lock mode is disabled. I tested this by disabling font lock with M-x font-lock-mode, and I can confirm the highlighting is now properly displayed when also highlighting the current line with hl-line. The problem is that all language syntax highlighting is now gone, so this option is no good.
If anybody knows how to configure hi-lock.el to use overlays with font-lock-mode enabled, then that would be the best answer.
In the meantime, there is an alternative MELPA package that supports overlay highlighting, and it woks like a charm with hl-line: symbol-overlay.el.
Having said that, I am not too fond of default key bindings and highlighting colors. For reference I leave here my configuration:
(require 'symbol-overlay)
(global-set-key (kbd "<f2>") 'symbol-overlay-jump-next)
(global-set-key (kbd "S-<f2>") 'symbol-overlay-jump-prev)
(global-set-key (kbd "C-<f2>") 'symbol-overlay-put)
(global-set-key (kbd "M-<f2>") 'symbol-overlay-query-replace)
(global-set-key (kbd "<f7>") 'symbol-overlay-mode)
(global-set-key (kbd "<f8>") 'symbol-overlay-remove-all)
(set-face-attribute 'symbol-overlay-default-face nil :background "coral1" :foreground "black")
(set-face-attribute 'symbol-overlay-face-1 nil :background "gold2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-2 nil :background "chocolate2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-3 nil :background "PaleGreen2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-4 nil :background "SkyBlue2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-5 nil :background "PaleVioletRed2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-6 nil :background "IndianRed2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-7 nil :background "PaleTurquoise2" :foreground "black")
(set-face-attribute 'symbol-overlay-face-8 nil :background "MediumOrchid2" :foreground "black")

Emacs org mode: background color of latex fragments (with `org-highlight-latex-and-related`) : which variable to change?

Ok, so my org-mode latex fragments have a slightly off background color, but only when I:
(setq org-highlight-latex-and-related '(native))
As seen here
It looks similar to the background highlighting functionality as involved in ~~ (code).
Does anyone know what to do?
BONUS:
I'm using doom emacs and the gruvbox theme.
TRIED:
I don't think this is related to the fragments themselves a la org-format-latex-options (as seen in many other posts)
This is NOT helped by setting font-latex-math-face :background
HINTS:
I feel like it IS related to the face org-latex-and-related, but I can work out how the chance the background, when I 'customise' the face i get the following:
(defface org-latex-and-related
(let ((font (cond ((assq :inherit custom-face-attributes)
'(:inherit underline))
(t '(:underline t)))))
`((((class grayscale) (background light))
(:foreground "DimGray" ,#font))
(((class grayscale) (background dark))
(:foreground "LightGray" ,#font))
(((class color) (background light))
(:foreground "SaddleBrown"))
(((class color) (background dark))
(:foreground "burlywood"))
(t (,#font))))
"Face used to highlight LaTeX data, entities and sub/superscript."
:group 'org-faces
:version "24.4"
:package-version '(Org . "8.0"))
Answering my own question.
As usual, tecosaur got there first and gives a good breakdown of the internals.
The code that does the magic is
(require 'org-src)
(add-to-list 'org-src-block-faces '("latex" (:inherit default :extend t)))

emacs - long line hightlight color too dark

I use below code to highlight characters longer than 78.
(setq whitespace-style '(face empty tabs lines-tail trailing))
(setq whitespace-line-column 78)
(global-whitespace-mode 1)
It works fine but the background color too dark!
How can I change the highlight characters background color?
Just customize the whitespace-line face.
just like below:
(setq whitespace-style '(face empty tabs lines-tail trailing))
(setq whitespace-line-column 78)
(global-whitespace-mode 1)
(custom-set-faces
'(whitespace-line ((t (:background "#eff0f1"))))

Change color of buffer name in mode-line

It would be nice to have the buffer/file name more visible inside the mode-line specially when working with many files.
How to change the color of buffer name inside mode-line?
You can also use:
(set-face-attribute 'mode-line-buffer-id nil :foreground "black")
or for carbon emacs:
(set-face-attribute 'modeline-buffer-id nil :foreground "black")
Just customize face mode-line-buffer-id: M-x customize-face.
I use this value, for instance (from my custom-file):
(mode-line-buffer-id ((t (:overline "red" :underline "red"))))
IOW, I have both an overline and an underline, for the buffer name.

How to disable auctex fontification, without losing color highlighting?

I like maximum syntax highlighting of AucTeX, but I don't like AucTeX messing with fonts. For example, if I use italics, it shows italicized letters in my emacs buffer, and shows subscripts and superscripts in small letters (slightly above or below the line). I prefer to use a fixed width font regardless of the latex environment I am in.
I tried changing the settings for the variable font-latex-deactivated-keyword-classes, but then the syntax coloring also disappears.
Could someone suggest a way to fix this?
Thanks.
From http://www.gnu.org/software/auctex/manual/auctex/Faces.html#Faces
In case you want to change the colors and fonts used by font-latex please refer to the faces mentioned in the explanations above and use M-x customize-face RET <face> RET. All faces defined by font-latex are accessible through a customization group by typing
M-x customize-group RET font-latex-highlighting-faces RET.
The above command opens the settings buffer where you can set the appropriate font face. Once you save changes, your .emacs file will contain a line similar to:
'(font-latex-sectioning-5-face ((((class color) (background light))
(:inherit variable-pitch :foreground "blue4" :weight normal :foundry
"outline" :family "Century Gothic")
In your example, you can customize the Font Latex Italic Face to your specifications. Your .emacs should then contain
'(font-latex-italic-face ...)
to whatever you set it to. You can similarly customize superscript, subscript and whole host of other font faces.
In recent versions of AUCTeX:
(setq font-latex-fontify-script nil)
(setq font-latex-fontify-sectioning 'color)
See this page in the manual and the section Deactivating defaults of built-in keyword classes.
Tested on Emacs 24.3. Put the following in your ~/.emacs file:
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(font-latex-bold-face ((t nil)))
'(font-latex-doctex-documentation-face ((t nil)))
'(font-latex-doctex-preprocessor-face ((t nil)))
'(font-latex-italic-face ((t nil)))
'(font-latex-math-face ((t nil)))
'(font-latex-sectioning-0-face ((t nil)))
'(font-latex-sectioning-1-face ((t nil)))
'(font-latex-sectioning-2-face ((t nil)))
'(font-latex-sectioning-3-face ((t nil)))
'(font-latex-sectioning-4-face ((t nil)))
'(font-latex-sectioning-5-face ((t nil)))
'(font-latex-sedate-face ((t nil)))
'(font-latex-slide-title-face ((t nil)))
'(font-latex-string-face ((t nil)))
'(font-latex-subscript-face ((t nil)))
'(font-latex-superscript-face ((t nil)))
'(font-latex-verbatim-face ((t nil)))
'(font-latex-warning-face ((t nil))))