From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: org-hide in terminal Date: Wed, 31 May 2017 21:42:25 +0200 Message-ID: References: <4e037c49-8204-ce99-9791-7ec0233658a7@schauderbasis.de> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dG9Vl-0005dH-Lz for emacs-orgmode@gnu.org; Wed, 31 May 2017 15:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dG9Vk-0006Sc-9e for emacs-orgmode@gnu.org; Wed, 31 May 2017 15:42:29 -0400 Received: from mail-qk0-x22f.google.com ([2607:f8b0:400d:c09::22f]:35177) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dG9Vk-0006RT-4R for emacs-orgmode@gnu.org; Wed, 31 May 2017 15:42:28 -0400 Received: by mail-qk0-x22f.google.com with SMTP id 19so20508647qke.2 for ; Wed, 31 May 2017 12:42:26 -0700 (PDT) In-Reply-To: <4e037c49-8204-ce99-9791-7ec0233658a7@schauderbasis.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" 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 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