emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-format-outline-path fonts sizes in the minibuffer
       [not found] <1f08be2e-0299-462b-9cfd-fcc0a447d7d8@Spark>
@ 2020-08-31 14:16 ` CRSHCMDR
  2020-09-04  8:05   ` Bastien
  0 siblings, 1 reply; 5+ messages in thread
From: CRSHCMDR @ 2020-08-31 14:16 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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)
        (fpath (concat
                prefix (and prefix path separator)
                (mapconcat
                 (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)
                          collect (org-add-props
                                      head nil 'face
                                      `(:foreground ,(face-foreground face nil t) :weight bold)))
                 separator))))
   (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)) "..")))
   fpath))

Very Respectfully,
Brandon

[-- Attachment #2: Type: text/html, Size: 3665 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-format-outline-path fonts sizes in the minibuffer
  2020-08-31 14:16 ` org-format-outline-path fonts sizes in the minibuffer CRSHCMDR
@ 2020-09-04  8:05   ` Bastien
  2020-09-04  8:18     ` Carsten Dominik
  2020-09-04  9:15     ` TEC
  0 siblings, 2 replies; 5+ messages in thread
From: Bastien @ 2020-09-04  8:05 UTC (permalink / raw)
  To: CRSHCMDR; +Cc: emacs-orgmode

Hi,

thanks for reporting this. I think the echo area should display 
the outline path using Emacs default font, removing both height
and colors.  That's fixed in maint now as a3576543f.

If someone want to remove the height while preserving colors, 
let's consider this option too.

Thanks,

-- 
 Bastien


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-format-outline-path fonts sizes in the minibuffer
  2020-09-04  8:05   ` Bastien
@ 2020-09-04  8:18     ` Carsten Dominik
  2020-09-09  8:00       ` Bastien
  2020-09-04  9:15     ` TEC
  1 sibling, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2020-09-04  8:18 UTC (permalink / raw)
  To: Bastien; +Cc: org-mode list, CRSHCMDR

[-- Attachment #1: Type: text/plain, Size: 503 bytes --]

Dear Bastien,

yes, keeping the color would be good, this can make reading these strings
much easier.

Carsten

On Fri, Sep 4, 2020 at 10:06 AM Bastien <bzg@gnu.org> wrote:

> Hi,
>
> thanks for reporting this. I think the echo area should display
> the outline path using Emacs default font, removing both height
> and colors.  That's fixed in maint now as a3576543f.
>
> If someone want to remove the height while preserving colors,
> let's consider this option too.
>
> Thanks,
>
> --
>  Bastien
>
>

[-- Attachment #2: Type: text/html, Size: 895 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-format-outline-path fonts sizes in the minibuffer
  2020-09-04  8:05   ` Bastien
  2020-09-04  8:18     ` Carsten Dominik
@ 2020-09-04  9:15     ` TEC
  1 sibling, 0 replies; 5+ messages in thread
From: TEC @ 2020-09-04  9:15 UTC (permalink / raw)
  To: Bastien; +Cc: emacs-orgmode, CRSHCMDR


Bastien <bzg@gnu.org> writes:

> thanks for reporting this. I think the echo area should display
> the outline path using Emacs default font, removing both height
> and colors.  That's fixed in maint now as a3576543f.
>
> If someone want to remove the height while preserving colors,
> let's consider this option too.

Just adding 2c from me, I can't see why one /wouldn't/ want 
colour.
The sizing can be annoying because it causes the minibuffer to 
move (i.e.
change size). The colour doesn't, but /does/ help distinguish 
levels.

All the best,

Timothy.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-format-outline-path fonts sizes in the minibuffer
  2020-09-04  8:18     ` Carsten Dominik
@ 2020-09-09  8:00       ` Bastien
  0 siblings, 0 replies; 5+ messages in thread
From: Bastien @ 2020-09-09  8:00 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: org-mode list, CRSHCMDR

Hi Carsten,

Carsten Dominik <dominik@uva.nl> writes:

> yes, keeping the color would be good, this can make reading these
> strings much easier.

That's what is done, as of 7a12e1499, just committed in master.

Thanks for insisting on this!

-- 
 Bastien


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-09  8:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1f08be2e-0299-462b-9cfd-fcc0a447d7d8@Spark>
2020-08-31 14:16 ` org-format-outline-path fonts sizes in the minibuffer CRSHCMDR
2020-09-04  8:05   ` Bastien
2020-09-04  8:18     ` Carsten Dominik
2020-09-09  8:00       ` Bastien
2020-09-04  9:15     ` TEC

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).