Fix variable height org-level-N faces in eldoc

It only uses the face's :foreground, which should be enough, but it
prevents the minibuffer from being resized when eldoc displays
breadcrumbs in org-mode.
This commit is contained in:
Henrik Lissner 2018-07-05 13:44:34 +02:00
parent b67745a9b6
commit 4ebbf8f056
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -349,6 +349,20 @@ between the two."
"Getting org to behave."
;; Don't open separate windows
(setf (alist-get 'file org-link-frame-setup) #'find-file)
;; Fix variable height org-level-N faces in the eldoc string
(defun +org*fix-font-size-variation-in-eldoc (orig-fn)
(cl-letf (((symbol-function 'org-format-outline-path)
(lambda (path &optional _width _prefix separator)
(string-join
(cl-loop with i = -1
for seg in (delq nil path)
for face = (nth (% (cl-incf i) org-n-level-faces) org-level-faces)
for spec = (face-all-attributes face)
collect (propertize (replace-regexp-in-string "[ \t]+\\'" "" seg)
'face (if face `(:foreground ,(face-foreground face)))))
separator))))
(funcall orig-fn)))
(advice-add #'org-eldoc-get-breadcrumb :around #'+org*fix-font-size-variation-in-eldoc)
;; Let OS decide what to do with files when opened
(setq org-file-apps
`(("pdf" . default)