emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] org-hide in terminal


From: Michael Brand
Subject: Re: [O] org-hide in terminal
Date: Wed, 31 May 2017 21:42:25 +0200

Hi Johannes

In a terminal with at least 16 colors the terminal color white (ID 7)
which is used for the face org-hide is darker than the terminal color
bright white (ID 15). Bright white is usually the same as the light
background. Use M-x list-colors-display in a terminal Emacs and look
at the first eight and the next eight colors, the bright variants of
the previous eight. For more about terminal colors see for example
http://en.wikipedia.org/wiki/ANSI_escape_code#Colors

To improve the situation of hiding the leading stars at least for
Emacs in a terminal with otherwise default color settings and with a
light background I started to use

  ;; For for example 256-color terminal and light background. The
  ;; Emacs color brightwhite is only defined on a terminal Emacs.
  (when (and (eq 'light (frame-parameter nil 'background-mode))
             (color-defined-p "brightwhite"))
    (set-face-foreground 'org-hide "brightwhite"))

On macOS Terminal.app it does not work as good as on other operating
systems and terminals because there even bright white is darker than
the light background. Also take into account that on Terminal.app the
256 color IDs are mapped to only 16 instead of the usual 256 different
RGB values.

Michael



On Sat, Feb 11, 2017 at 3:12 PM, Johannes <address@hidden> wrote:

> Hello,
>
> With "org-hide-leading-stars" set to t orgmode tries to hide stars by
> using the "org-hide" face. This is documented with: "The foreground
> color of this face should be equal to the background
> color of the frame." and in the org manual in section Clean-view we find
> "Because Org makes the font color same as the background color to hide
> to stars, sometimes org-hide face may need tweaking to get the effect
> right. For some black and white combinations, grey90 on a white
> background might mask the stars better". As far as I can tell (which
> might be wront) it just assumes default colors "white" or "black", which
> might not be accurate.
>
> I think this is a bad solution for the following reasons.
>
> - It doesn't work well if emacs runs in a terminal (often the stars just
> get a grey background)
> - It shows the stars when we mark them (this might or might not be a
> good thing)
> - People who use the same config in multiple environments (other
> terminals and colors) will have to write some if-else code to get this
> right.
> - People who change their terminal colors get problems.
>
>
> Possible solutions I can think of are:
> a) Somhow make the existion solution work for terminals. I thought I
> could simply set org-hides forground to the backgrounf-value of the face
> "default", but somehow it didn't work out and I ended up with some sort
> of grey (which is not my background).
> b) emacs could have a text property, similar to "invisible", which hides
> text but still lets it occupy the space. I don't know how it work
> internaly, though. This is probably the best solution if the problem of
> hiding text occurs more often. I was told this was already discussed on
> emcas-devel, but I couldn't find it there.
> c) hide the leading stars behind spaces. I have a working prototype
> which works quite well. It uses "org-bullets" and "compose-region". It
> is not 100% clean though, since there still is a character which might
> be visible when using some minor mode.
>
> I am very new to emacs-lsip (and mailing lists) so I hope this is how it
> is done.
> Johannes Lippmann



reply via email to

[Prev in Thread] Current Thread [Next in Thread]