From: CRSHCMDR <firstname.lastname@example.org>
Subject: org-format-outline-path fonts sizes in the minibuffer
Date: Mon, 31 Aug 2020 10:16:08 -0400 [thread overview]
Message-ID: <21ef0e94-e766-455c-a45c-fe30e316c121@Spark> (raw)
[-- Attachment #1: Type: text/plain, Size: 3029 bytes --]
*I’m not sure If this is actually a bug so I haven’t included any backtrace/debug information.*
Forgive me I am not sure the exact terminology. I have, within the last two weeks, began to transition to emacs from vim, specifically for org mode. In addition I am not a developer by trade and my knowledge of elisp is limited.
What exactly did you do?
Move cursor to any header in a .org file.
What did you expect to happen?
An outline to appear within the “echo area,” which does not resize the minibuffer.
What happened instead?
I have set various headers to various faces and sizes, when I move my cursor over a header the outline appears to use all of the fonts information when displaying it in the minibuffer/echo area.
What should happen?
Of course this is subjective, but I believe that only the color should be passed on in the outline if anything. Or some variables exposed that can be set to change this behavior.
(setq org-outline-echo OPTION)
t - Defualt Behavior
color-only - Passes the color of the headers to the outline in the echo area
plain-text - just passes the text letting the fonts already set elsewhere display
Or some kind of hook that lets us choose what fonts to use for which heading in the echo.
You can see a picture of what is occurring here. https://preview.redd.it/2cgllvc9aak51.png?width=1638&format=png&auto=webp&s=f7636f477b08aba5c0b34b3e49611de3fba82188
A fellow Redditor u/BulkyLoad87 proposed this solution, which appears to work, but I’m not sure what else this might effect.
(defun org-format-outline-path (path &optional width prefix separator)
"Format the outline path PATH for display.
WIDTH is the maximum number of characters that is available.
PREFIX is a prefix to be included in the returned string,
such as the file name.
SEPARATOR is inserted between the different parts of the path,
the default is \"/\"."
(setq width (or width 79))
(setq path (delq nil path))
(unless (> width 0)
(user-error "Argument `width' must be positive"))
(setq separator (or separator "/"))
(let* ((org-odd-levels-only nil)
prefix (and prefix path separator)
(lambda (s) (replace-regexp-in-string "[ \t]+\\'" "" s))
(cl-loop for head in path
for n from 0
for face = (nth (% n org-n-level-faces) org-level-faces)
head nil 'face
`(:foreground ,(face-foreground face nil t) :weight bold)))
(when (> (length fpath) width)
(if (< width 7)
;; It's unlikely that `width' will be this small, but don't
;; waste characters by adding ".." if it is.
(setq fpath (substring fpath 0 width))
(setf (substring fpath (- width 2)) "..")))
[-- Attachment #2: Type: text/html, Size: 3665 bytes --]
next parent reply other threads:[~2020-08-31 14:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1f08be2e-0299-462b-9cfd-fcc0a447d7d8@Spark>
2020-08-31 14:16 ` CRSHCMDR [this message]
2020-09-04 8:05 ` org-format-outline-path fonts sizes in the minibuffer Bastien
2020-09-04 8:18 ` Carsten Dominik
2020-09-09 8:00 ` Bastien
2020-09-04 9:15 ` TEC
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
List information: https://www.orgmode.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).