lang/org: fix variable font-size for agenda paths
When you hover your cursor over agenda items, the path to that headline is displayed in the minibuffer. If org-level-N have unusual :height values, they'll cause the minibuffer to grow. This removes any variable font sizes from this display.
This commit is contained in:
parent
75ad188e01
commit
736bdeb205
1 changed files with 11 additions and 12 deletions
|
@ -382,18 +382,17 @@ conditions where a window's buffer hasn't changed at the time this hook is run."
|
||||||
(add-hook 'org-follow-link-hook #'+org|delayed-recenter)
|
(add-hook 'org-follow-link-hook #'+org|delayed-recenter)
|
||||||
|
|
||||||
;; Fix variable height org-level-N faces in the eldoc string
|
;; Fix variable height org-level-N faces in the eldoc string
|
||||||
(defun +org*fix-font-size-variation-in-eldoc (orig-fn)
|
(defun +org*format-outline-path (orig-fn path &optional width prefix separator)
|
||||||
(cl-letf (((symbol-function 'org-format-outline-path)
|
(let ((result (funcall orig-fn path width prefix separator))
|
||||||
(lambda (path &optional _width _prefix separator)
|
(seperator (or separator "/")))
|
||||||
(string-join
|
(string-join
|
||||||
(cl-loop with i = -1
|
(cl-loop for part
|
||||||
for seg in (delq nil path)
|
in (split-string (substring-no-properties result) separator)
|
||||||
for face = (nth (% (cl-incf i) org-n-level-faces) org-level-faces)
|
for n from 0
|
||||||
collect (propertize (replace-regexp-in-string "[ \t]+\\'" "" seg)
|
for face = (nth (% n org-n-level-faces) org-level-faces)
|
||||||
'face (if face `(:foreground ,(face-foreground face nil t)))))
|
collect (org-add-props part nil 'face `(:foreground ,(face-foreground face nil t) :weight bold)))
|
||||||
separator))))
|
separator)))
|
||||||
(funcall orig-fn)))
|
(advice-add #'org-format-outline-path :around #'+org*format-outline-path)
|
||||||
(advice-add #'org-eldoc-get-breadcrumb :around #'+org*fix-font-size-variation-in-eldoc)
|
|
||||||
|
|
||||||
(setq org-file-apps
|
(setq org-file-apps
|
||||||
`(("pdf" . default)
|
`(("pdf" . default)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue