From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Abrahamsen Subject: Re: Buffer-specific export filter? Date: Tue, 20 Aug 2013 21:56:49 +0800 Message-ID: <87y57w5uu6.fsf@ericabrahamsen.net> References: <8738q4si0o.wl%jamshark70@dewdrop-world.net> <20130820130202.GC19436@kuru.dyndns-at-home.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60040) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBmQH-0001N1-1m for emacs-orgmode@gnu.org; Tue, 20 Aug 2013 09:56:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBmQ9-0000Bw-Nh for emacs-orgmode@gnu.org; Tue, 20 Aug 2013 09:56:36 -0400 Received: from plane.gmane.org ([80.91.229.3]:55527) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBmQ9-0000Bd-HC for emacs-orgmode@gnu.org; Tue, 20 Aug 2013 09:56:29 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VBmQ2-0004Vx-5t for emacs-orgmode@gnu.org; Tue, 20 Aug 2013 15:56:22 +0200 Received: from 114.252.246.79 ([114.252.246.79]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Aug 2013 15:56:22 +0200 Received: from eric by 114.252.246.79 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 20 Aug 2013 15:56:22 +0200 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: emacs-orgmode@gnu.org Suvayu Ali writes: > On Tue, Aug 20, 2013 at 07:45:11PM +0800, James Harkins wrote: >> Is it possible to apply a specific filter during export for one org document, but not others? >> >> Basically, a buffer-specific export filter. >> >> It appears in the org manual that the hook needs to be added into >> e.g. org-export-filter-plain-text-functions, where it remains >> globally for the duration of the session. But I have a case here >> where I need a filter to work around a specific problem I'm having >> in one document, which isn't a problem in other documents, and I >> don't want the filter to interfere with the other documents. >> >> Possible? I don't see any mention of it in the manual. > > Some thoughts: > > 1. Is it possible to set filters as buffer local? Okay the help string > says: "This variable may be risky if used as a file-local variable.", > so I guess the answer is no. > > 2. Otherwise you could have used a lisp source block in the buffer. You > could still do that, just add a conditional that checks for the > buffer name. This way modifying a global filter would still affect > current buffer export. > > Hope this helps, Two related thoughts I've had: 1) at some point it might be nice to allow customization of the export options at the top of the export menu (what currently allows for Body only/Visible only/etc), so that you could add hooks or perhaps filters on a per-export basis. Also 2), it could be nice to show, in the export dispatcher, which export hooks are currently active. Filters, too, if that didn't turn out to be too much real estate...