From mboxrd@z Thu Jan 1 00:00:00 1970 From: Max Mikhanosha Subject: Re: Bug: startup: hidestars does not use the real window background color [7.8.11] Date: Fri, 28 Sep 2012 11:56:15 -0400 Message-ID: <87pq56ta3k.wl%max@openchat.com> References: <50459D55.4010504@kit.edu> <87627b630a.fsf@bzg.ath.cx> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THcvT-0002hR-2g for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 11:56:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1THcvI-0007l5-QK for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 11:56:26 -0400 Received: from openchat.com ([75.99.81.170]:36758 helo=momoland.openchat.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1THcvI-0007kF-MZ for emacs-orgmode@gnu.org; Fri, 28 Sep 2012 11:56:16 -0400 In-Reply-To: <87627b630a.fsf@bzg.ath.cx> 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Bastien Cc: emacs-orgmode@gnu.org, "Arne Babenhauserheide (IMK)" At Tue, 18 Sep 2012 12:25:04 +0200, Bastien wrote: >=20 > Hi Arne, >=20 > "Arne Babenhauserheide (IMK)" writes: >=20 > > Dear org Hackers, > > > > I use a custom color scheme in KDE with brown window background color, > > and when I activate #+STARTUP: hidestars, the first stars are white > > instead of brown. > > > > My color scheme is Antiford > > ? http://opendesktop.org/content/show.php/Antiford?content=3D142571 >=20 > This is now fixed: the `org-hide' face is a bit more clever when trying > the get the background color. Just updated org, and this fix a problem for me in multi-tty emacs. On the tty frames, the my default face background is "unspecified-bg", which leaves background color alone (ie its whatever default background xterm or other emulator uses) This allows to have different xterm's with similar but differently shaded backgrounds for different tasks, without changing background in Emacs. With this new fix, when org-mode file is visited on tty, it sets 'org-hide face foreground to "unspecified-bg" which makes all leading stars reverse color. Patch to fix this is pasted below. =46rom 1f0ef1241acd7c22fff275ae65a6bf2a9fd84f06 Mon Sep 17 00:00:00 2001 From: Max Mikhanosha Date: Fri, 28 Sep 2012 11:48:05 -0400 Subject: [PATCH] * lisp/org.el (org-mode): don't set org-hide foreground to "invisible-bg" (org-find-invisible-foreground): new function --- lisp/org.el | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index c47e2ad..7f09d15 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5144,14 +5144,7 @@ (define-derived-mode org-mode outline-mode "Org" (unless org-inhibit-startup-visibility-stuff (org-set-startup-visibility))) ;; Try to set org-hide correctly - (set-face-foreground - 'org-hide - (or (face-background 'default) - (face-background 'org-default) - (cdr (assoc 'background-color default-frame-alist)) - (cdr (assoc 'background-color initial-frame-alist)) - (cdr (assoc 'background-color window-system-default-frame-alist)) - (face-foreground 'org-hide)))) + (set-face-foreground 'org-hide (org-find-invisible-foreground))) =20 (when (fboundp 'abbrev-table-put) (abbrev-table-put org-mode-abbrev-table @@ -5159,6 +5152,19 @@ (define-derived-mode org-mode outline-mode "Org" =20 (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify) =20 + +(defun org-find-invisible-foreground () + (let ((candidates (remove + "unspecified-bg"=20 + (list=20 + (face-background 'default)=20 + (face-background 'org-default)=20 + (cdr (assoc 'background-color default-frame-alist))=20 + (cdr (assoc 'background-color initial-frame-alist))=20 + (cdr (assoc 'background-color window-system-default-frame-alist)) = + (face-foreground 'org-hide)))))=20 + (car (remove nil candidates)))) + (defun org-current-time () "Current time, possibly rounded to `org-time-stamp-rounding-minutes'." (if (> (car org-time-stamp-rounding-minutes) 1) --=20 1.7.11.rc0.100.g5498c5f