From mboxrd@z Thu Jan 1 00:00:00 1970 From: 42 147 Subject: Re: hiding footnotes Date: Tue, 26 Feb 2013 13:19:10 -0500 Message-ID: References: <87sj7t4p0l.fsf@gmail.com> <3483.1354165215@alphaville> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b6dc9aaa63da604d6a4b1a7 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36648) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAP7T-0005ow-Ns for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 13:19:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UAP7P-0006LX-1i for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 13:19:15 -0500 Received: from mail-ve0-f181.google.com ([209.85.128.181]:52181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UAP7O-0006Kf-SA for emacs-orgmode@gnu.org; Tue, 26 Feb 2013 13:19:10 -0500 Received: by mail-ve0-f181.google.com with SMTP id d10so4041373vea.12 for ; Tue, 26 Feb 2013 10:19:10 -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: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org --047d7b6dc9aaa63da604d6a4b1a7 Content-Type: text/plain; charset=ISO-8859-1 Oops, wrong thread. 2013/2/26 42 147 > Set it to 20, thanks. > > Hopefully I never need to hit the 26 limit. > > > 2012/11/29 Nick Dokos > >> 42 147 wrote: >> >> > Very nice. >> > >> > However, I'd like to write a function that toggles the color value >> (without >> > recourse to the customize menu), since it would be useful to highlight >> the >> > footnotes from time to time. >> > >> >> Anything that can be done interactively can also be done >> programatically. You know what face you are dealing with, you can get >> its foreground color with face-foreground, and you can set it with >> set-face-attribute. A crude implementation to show the basic outline: >> >> --8<---------------cut here---------------start------------->8--- >> (setq org-footnote-fg-color (face-foreground 'org-footnote)) >> >> (setq org-text-fg-color (face-foreground 'default)) >> >> (defun my-toggle-footnote-fg-color () >> "Toggle the org-footnote face foreground color." >> (interactive) >> (let ((fg (face-foreground 'org-footnote))) >> (if (string-equal fg org-footnote-fg-color) >> (set-face-attribute 'org-footnote nil :foreground >> org-text-fg-color) >> (set-face-attribute 'org-footnote nil :foreground >> org-footnote-fg-color)))) >> --8<---------------cut here---------------end--------------->8--- >> >> The difficulties start (but do not end) with footnotes in all sorts of >> weird places (e.g. headlines) with all sorts of different >> fontifications. You'd want to blend the footnote with its immediate >> surroundings. >> >> Taking care of such situations (and various others that the above code >> mishandles) is left as an exercise... >> >> Nick >> > > --047d7b6dc9aaa63da604d6a4b1a7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Oops, wrong thread.

2013/2/26 42 147 <ae= uster@gmail.com>
Set it to 20, thanks.

Hopefully I never need to hit the 26 limit.


201= 2/11/29 Nick Dokos <nicholas.dokos@hp.com>
42 147 <aeuster@gmail.com> wrote:

> Very nice.
>
> However, I'd like to write a function that toggles the color value= (without
> recourse to the customize menu), since it would be useful to highlight= the
> footnotes from time to time.
>

Anything that can be done interactively can also be done
programatically. You know what face you are dealing with, you can get
its foreground color with face-foreground, and you can set it with
set-face-attribute. A crude implementation to show the basic outline:

--8<---------------cut here---------------start------------->8---
(setq org-footnote-fg-color (face-foreground 'org-footnote))

(setq org-text-fg-color (face-foreground 'default))

(defun my-toggle-footnote-fg-color ()
=A0 "Toggle the org-footnote face foreground color."
=A0 (interactive)
=A0 (let ((fg (face-foreground 'org-footnote)))
=A0 =A0 (if (string-equal fg org-footnote-fg-color)
=A0 =A0 =A0 =A0 (set-face-attribute 'org-footnote nil :foreground org-t= ext-fg-color)
=A0 =A0 =A0 (set-face-attribute 'org-footnote nil :foreground org-footn= ote-fg-color))))
--8<---------------cut here---------------end--------------->8---

The difficulties start (but do not end) with footnotes in all sorts of
weird places (e.g. headlines) with all sorts of different
fontifications. You'd want to blend the footnote with its immediate
surroundings.

Taking care of such situations (and various others that the above code
mishandles) is left as an exercise...

Nick


--047d7b6dc9aaa63da604d6a4b1a7--