summaryrefslogtreecommitdiffstats
path: root/lisp/ravi-init-org.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/ravi-init-org.el')
-rw-r--r--lisp/ravi-init-org.el23
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)