emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Bug: startup: hidestars does not use the real window background


From: Max Mikhanosha
Subject: Re: [O] Bug: startup: hidestars does not use the real window background color [7.8.11]
Date: Fri, 28 Sep 2012 11:56:15 -0400
User-agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.6 Emacs/23.3.50 (x86_64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Tue, 18 Sep 2012 12:25:04 +0200,
Bastien wrote:
> 
> Hi Arne,
> 
> "Arne Babenhauserheide (IMK)" <address@hidden> writes:
> 
> > 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=142571
> 
> 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.


From 1f0ef1241acd7c22fff275ae65a6bf2a9fd84f06 Mon Sep 17 00:00:00 2001
From: Max Mikhanosha <address@hidden>
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)))
 
 (when (fboundp 'abbrev-table-put)
   (abbrev-table-put org-mode-abbrev-table
@@ -5159,6 +5152,19 @@ (define-derived-mode org-mode outline-mode "Org"
 
 (put 'org-mode 'flyspell-mode-predicate 'org-mode-flyspell-verify)
 
+
+(defun org-find-invisible-foreground ()
+  (let ((candidates (remove
+                    "unspecified-bg" 
+                    (list 
+                     (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))))) 
+    (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)
-- 
1.7.11.rc0.100.g5498c5f




reply via email to

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