From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Brand Subject: Re: hidestarsfile: "hidestars" for file Date: Thu, 16 Feb 2012 18:53:08 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:55055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry5W7-0002Oh-41 for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 12:53:21 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ry5W1-0006IK-D9 for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 12:53:15 -0500 Received: from mail-we0-f169.google.com ([74.125.82.169]:63513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ry5W1-0006IG-8l for emacs-orgmode@gnu.org; Thu, 16 Feb 2012 12:53:09 -0500 Received: by wera13 with SMTP id a13so1866571wer.0 for ; Thu, 16 Feb 2012 09:53:08 -0800 (PST) In-Reply-To: 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: Org Mode Hi all For the case that anyone should be interested in this, still only a monolog: On Thu, Feb 9, 2012 at 19:57, Michael Brand wrote: > Now I see that for testing how a hidestarsfile looks like in a file > viewer or simple editor, preferred over switching the major mode is: > Just stay in Org mode and with org-hide-leading-stars still enabled > from before, temporarily change only the look: > > #+BEGIN_SRC emacs-lisp > (visible-mode 1) > (my-disable-font-lock-except-org-hide) > #+END_SRC > > I have not yet much of an idea how to do this: Disable font lock for > all faces except the face org-hide. What possibilities are there? After an adventurous, instructive and funny "proof of concept" to backup, overwrite with the face "default" and restore again one of the Org faces (extensible to all) with the help of "copy-face", "symbol-name" and "intern" I decided to study font-lock and now am starting to use this simple possibility to disable all faces except org-hide: #+BEGIN_SRC emacs-lisp (defun my-org-lookout-face-defaults () "Reset font lock of faces back to `org-set-font-lock-defaults'. Derived from `font-lock-add-keywords'." (interactive) (if (eq major-mode 'org-mode) (progn (setq font-lock-keywords (font-lock-compile-keywords org-font-lock-keywords)) (font-lock-fontify-buffer)) (message "ERR: not in Org mode") (ding))) (defun my-org-lookout-face-hide () "Leave `org-hide' for leading stars and disable all other faces. Derived from `font-lock-add-keywords' and `org-set-font-lock-defaults'. Does not adapt font-lock-defaults and sets font-lock-keywords directly" (interactive) (if (eq major-mode 'org-mode) (progn (setq font-lock-keywords (font-lock-compile-keywords '(("^\\(\\**\\)\\(\\* \\)\\(.*\\)" (1 (if org-hide-leading-stars 'org-hide 'org-default)))))) (font-lock-fontify-buffer)) (message "ERR: not in Org mode") (ding))) #+END_SRC Michael