diff options
| author | Ravi R Kiran <aine.marina@gmail.com> | 2021-06-01 02:45:35 (GMT) |
|---|---|---|
| committer | Ravi R Kiran <aine.marina@gmail.com> | 2021-06-01 02:45:35 (GMT) |
| commit | 2ecd1f52b071bc7fd25c0e88c2089feac0efd23a (patch) | |
| tree | 973e240bfefb53299671792fe70b4ba7dc909002 /lisp/ravi-init-org.el | |
| parent | 6953823d0768cab6ecf463446f4c6d619fd1893d (diff) | |
| download | dotemacs-2ecd1f52b071bc7fd25c0e88c2089feac0efd23a.zip dotemacs-2ecd1f52b071bc7fd25c0e88c2089feac0efd23a.tar.gz dotemacs-2ecd1f52b071bc7fd25c0e88c2089feac0efd23a.tar.bz2 | |
Set up background for translucent images
Diffstat (limited to 'lisp/ravi-init-org.el')
| -rw-r--r-- | lisp/ravi-init-org.el | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lisp/ravi-init-org.el b/lisp/ravi-init-org.el index fb1dabc..1b008a1 100644 --- a/lisp/ravi-init-org.el +++ b/lisp/ravi-init-org.el @@ -35,6 +35,23 @@ (defconst ravi/mathjax-v2-file "./MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML" "MathJax file for v2") +;; https://emacs.stackexchange.com/questions/20574/default-inline-image-background-in-org-mode +(defvar ravi/inline-image-background nil + "The color used as the default background for inline images. +When nil, use the default face background.") +(defun ravi/create-image-with-background-color (args) + "Specify background color of Org-mode inline image through modify `ARGS'." + (let* ((file (car args)) + (type (cadr args)) + (data-p (caddr args)) + (props (cdddr args))) + ;; Get this return result style from `create-image'. + (append (list file type data-p) + (list :background (or ravi/inline-image-background (face-background 'default))) + props))) +(advice-add 'create-image :filter-args + #'ravi/create-image-with-background-color) + (use-package org :ensure org-plus-contrib :mode ("\\.org\\'" . org-mode) @@ -73,6 +90,12 @@ (setq org-modules '(ol-bbdb ol-bookmark ol-git-link ol-info ol-man org-id)) (setq org-use-speed-commands t) + (defun ravi/org-color-customization () + "Color customization for org mode" + (setq ravi/org-html-code-block-parameter-set t) + (set (make-local-variable 'ravi/inline-image-background) "white")) + (add-hook 'org-mode-hook #'ravi/org-color-customization) + ;; don't prompt me to confirm everytime I want to evaluate a block (setq org-confirm-babel-evaluate nil) |
