From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: dynamically set face [was: semi-visible stars?] Date: Thu, 1 Dec 2016 13:58:19 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1141cb54a0846005429d67b5 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cCWYq-0004d4-1u for emacs-orgmode@gnu.org; Thu, 01 Dec 2016 13:58:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cCWYo-0000SH-FW for emacs-orgmode@gnu.org; Thu, 01 Dec 2016 13:58:24 -0500 Received: from mail-io0-x235.google.com ([2607:f8b0:4001:c06::235]:35525) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cCWYo-0000R7-3Q for emacs-orgmode@gnu.org; Thu, 01 Dec 2016 13:58:22 -0500 Received: by mail-io0-x235.google.com with SMTP id a124so440367325ioe.2 for ; Thu, 01 Dec 2016 10:58:21 -0800 (PST) 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: Org Mode --001a1141cb54a0846005429d67b5 Content-Type: text/plain; charset=UTF-8 On Thu, Dec 1, 2016 at 10:22 AM, Matt Price wrote: > > > On Wed, Nov 30, 2016 at 3:41 PM, Matt Price wrote: > >> I have been fooling around a little bit with color-themes and also the >> new emacs 24+ custom themes, and find that (perhaps because of using >> desktop-mode) there are certain traces of the theming that get left behind >> in the display even when I've restarted Emacs after trying hard to erase >> them. >> >> One of these is the frequent appearance of pale stars even when >> org-indent-mode is turned on. See the attached screenshot for details. >> The initial stars in a lower-level headline are visible, as are leading >> stars in front of the indented text. I find this quite distracting! Does >> anyone know what might be causing this, how I can get rid of them, and also >> how I would in general go about figuring out how to identify the cause of >> similar appearance-related issues in Emacs? >> > > I just navigated to org-faces.el and executed M-C-x on this defface: > > (defface org-hide > '((((background light)) (:foreground "white")) > (((background dark)) (:foreground "black"))) > "Face used to hide leading stars in headlines. > The foreground color of this face should be equal to the background > color of the frame." > :group 'org-faces) > > problem solved. Sorry for the noise. > > OK, not solved, exactly. I have (setq color-theme-is-global t) in order to differentiate between different frames (one for mail, one for code, one for org). When I switch between the mail frame (using the 'wheat' theme) and the org frame (which uses a default theme), the color of org-hide seems to get set to the light golden brown color that 'wheat' ueses as its background color. Here's the extremely short definition of the wheat color-theme: (defun color-theme-wheat () "Default colors on a wheat background. Calls the standard color theme function `color-theme-standard' in order to reset all faces." (interactive) (color-theme-standard) (let ((color-theme-is-cumulative t)) (color-theme-install '(color-theme-wheat ((background-color . "Wheat")))))) I'm not sure why this messes up the other frames, but clearly it does. I'm thinking that if I can dynamically set the :foreground color to *whatever the background color is in the frame*, that might fix the issue. So I tried this: (defface org-hide '((((background light)) (:foreground (format (face-attribute 'default :background)) )) (((background dark)) (:foreground (format (face-attribute 'default :background))))) "Face used to hide leading stars in headlines. The foreground color of this face should be equal to the background color of the frame." :group 'org-faces) but I get this error: set-face-attribute: Wrong type argument: stringp, (format (face-attribute (quote default) :background)) Obviously my understanding of lisp types is a little weak, but (type-of (format (face-attribute 'default :background))) returns "string". So what's wrong here? And am I going about this the right way? Thank you! m > >> Thank you! >> >> Matt >> >> > --001a1141cb54a0846005429d67b5 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Dec 1, 2016 at 10:22 AM, Matt Price <moptop99@gmail.com&g= t; wrote:


<= span class=3D"gmail-">On Wed, Nov 30, 2016 at 3:41 PM, Matt Price <moptop= 99@gmail.com> wrote:
I have been fooling around a l= ittle bit with color-themes and also the new emacs 24+ custom themes, and f= ind that (perhaps because of using desktop-mode) there are certain traces o= f the theming that get left behind in the display even when I've restar= ted Emacs after trying hard to erase them.=C2=A0

One of these= is the frequent appearance of pale stars even when org-indent-mode is turn= ed on.=C2=A0 See the attached screenshot for details.=C2=A0 The initial sta= rs in a lower-level headline are visible, as are leading stars in front of = the indented text.=C2=A0 I find this quite distracting! Does anyone know wh= at might be causing this, how I can get rid of them, and also how I would i= n general go about figuring out how to identify the cause of similar appear= ance-related issues in Emacs?

I just navigated to org-faces.el and executed M-C-x on this= defface:

(defface org-hide
=C2=A0 '((((background light)) (:= foreground "white"))
=C2=A0=C2=A0=C2=A0 (((background dark)) (= :foreground "black")))
=C2=A0 "Face used to hide leading = stars in headlines.
The foreground color of this face should be equal to= the background
color of the frame."
=C2=A0 :group 'org-face= s)

problem solved.=C2=A0 Sorry for the noise.=C2=A0
<= br>
OK, not solved, exactly. I hav= e (setq color-theme-is-global t) in order to differentiate between differen= t frames (one for mail, one for code, one for org).=C2=A0 When I switch bet= ween the mail frame (using the 'wheat' theme) and the org frame (wh= ich uses a default theme), the color of org-hide seems to get set to the li= ght golden brown color that 'wheat' ueses as its background color.= =C2=A0 Here's the extremely short definition of the wheat color-theme:<= br>
(defun color-theme-wheat ()
=C2=A0 "Default colors on a whea= t background.
Calls the standard color theme function `color-theme-stand= ard' in order
to reset all faces."
=C2=A0 (interactive)
= =C2=A0 (color-theme-standard)
=C2=A0 (let ((color-theme-is-cumulative t)= )
=C2=A0=C2=A0=C2=A0 (color-theme-install
=C2=A0=C2=A0=C2=A0=C2=A0 &#= 39;(color-theme-wheat
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ((background-= color . "Wheat"))))))

I'm not sure why this= messes up the other frames, but clearly it does.=C2=A0 I'm thinking th= at if I can dynamically set the :foreground color to *whatever the backgrou= nd color is in the frame*, that might fix the issue.=C2=A0 So I tried this:=


(defface org-hide
=C2=A0 '((((background ligh= t)) (:foreground (format (face-attribute 'default :background)) ))
= =C2=A0=C2=A0=C2=A0 (((background dark)) (:foreground (format (face-attribut= e 'default :background)))))
=C2=A0 "Face used to hide leading s= tars in headlines.
The foreground color of this face should be equal to = the background
color of the frame."
=C2=A0 :group 'org-faces= )

but I get this error:

set-face-attribute: Wrong = type argument: stringp, (format (face-attribute (quote default) :background= ))

Obviously my understanding of lisp types is a little w= eak, but (type-of (format (face-attribute 'default :background))) retu= rns "string".=C2=A0 So what's wrong here? And am I going abou= t this the right way?

Thank you!
m

<= /div>
=C2=A0
<= /div>

Thank you!

Matt


--001a1141cb54a0846005429d67b5--