From ecdc4d14c8ee63fbc8c2b8975a494b5afc9f6ea7 Mon Sep 17 00:00:00 2001 From: Max Mikhanosha Date: Fri, 28 Sep 2012 11:48:05 -0400 Subject: [PATCH] org.el: Don't set org-hide foreground to "invisible-bg" * org.el (org-mode): Don't set org-hide's 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 89897a84b..532d5d68a 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -5129,14 +5129,7 @@ The following commands are available: (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 @@ -5144,6 +5137,19 @@ The following commands are available: (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)