From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: hiding footnotes Date: Thu, 29 Nov 2012 00:00:15 -0500 Message-ID: <3483.1354165215@alphaville> References: <87sj7t4p0l.fsf@gmail.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42885) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdwEV-0001oe-7N for emacs-orgmode@gnu.org; Thu, 29 Nov 2012 00:00:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TdwEU-0005Tv-3I for emacs-orgmode@gnu.org; Thu, 29 Nov 2012 00:00:19 -0500 Received: from g4t0016.houston.hp.com ([15.201.24.19]:43692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TdwET-0005Tr-T9 for emacs-orgmode@gnu.org; Thu, 29 Nov 2012 00:00:18 -0500 In-Reply-To: Message from 42 147 of "Wed, 28 Nov 2012 22:24:39 EST." 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: 42 147 Cc: emacs-orgmode@gnu.org, Jambunathan K 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