org mode |
您所在的位置:网站首页 › gtt通信 › org mode |
I am not sure how you are toggling the themes, but I guess you use modus-themes-toggle. Then you can create a function that conditionally adds/removes the element to/from the org-src-block-faces list and updates font-lock in all org buffers, and add that function to the modus-themes-after-load-theme-hook as follows: (defun gb/org-src-block-faces () (interactive) ;; conditionally add/remove element (setq org-src-block-faces (funcall (if (memq 'modus-vivendi custom-enabled-themes) #'cons #'delete) '("php" modus-themes-nuanced-magenta) org-src-block-faces)) ;; get all org buffers (let ((org-buffers (seq-filter (lambda (buf) (eq (buffer-local-value 'major-mode buf) 'org-mode)) (buffer-list)))) ;; update font-lock in all org buffers (dolist (b org-buffers) (with-current-buffer b (font-lock-update)))))The code looks a little over-complicated to me. Maybe someone can come up with a simpler solution (e.g. does there exist a 'global' font-lock update function? Of course, to make the code simpler, we could remove the 'org' filter, and just update font-lock in all buffers). |
今日新闻 |
点击排行 |
|
推荐新闻 |
图片新闻 |
|
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭 |