emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-hide in terminal
@ 2017-02-11 14:12 Johannes
  2017-05-31 19:42 ` Michael Brand
  0 siblings, 1 reply; 2+ messages in thread
From: Johannes @ 2017-02-11 14:12 UTC (permalink / raw)
  To: emacs-orgmode

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

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

* Re: org-hide in terminal
  2017-02-11 14:12 org-hide in terminal Johannes
@ 2017-05-31 19:42 ` Michael Brand
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Brand @ 2017-05-31 19:42 UTC (permalink / raw)
  To: Johannes; +Cc: Org Mode

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 <code@schauderbasis.de> 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

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

end of thread, other threads:[~2017-05-31 19:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-11 14:12 org-hide in terminal Johannes
2017-05-31 19:42 ` Michael Brand

Code repositories for project(s) associated with this public 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).