From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Charles C. Berry" Subject: Re: export code with backslashes Date: Wed, 18 Mar 2015 10:10:24 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:40070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYHUI-0001N2-4u for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 13:10:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YYHUE-0008OQ-Rv for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 13:10:34 -0400 Received: from iport-acv5-out.ucsd.edu ([132.239.0.10]:51935) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YYHUE-0008Mu-D7 for emacs-orgmode@gnu.org; Wed, 18 Mar 2015 13:10:30 -0400 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: hymie@lactose.homelinux.net Cc: emacs-orgmode@gnu.org On Wed, 18 Mar 2015, hymie@lactose.homelinux.net wrote: > "Charles C. Berry" writes: >> (defun org-export-ascii-filter-code (text back-end info) >> "Replace `\\n' with `\\' in ascii code." >> (if (eq back-end 'ascii) >> (replace-regexp-in-string >> "\n" "\\\n" >> (org-babel-chomp >> (org-export-string-as text 'ascii t)) >> nil t) >> text)) >> (add-to-list 'org-export-filter-code-functions >> 'org-export-ascii-filter-code) > > Just for the record..... > > I had an open running emacs. I changed my .emacs file, applied the change > with M-x load-file .emacs , and it worked perfectly. > > But today, I opened emacs fresh, and was greeted with an error > > Symbol's value as variable is void: org-export-filter-code-functions > > I got the same error when I tried to M-x load-file .emacs > > But > > After I did an ascii export (in which the backslashes do not appear), I could > then M-x load-file .emacs, no error, and the backslashes worked. > > I added > (require 'ox) > to my .emacs file, and that resolved the problem. > Use #+BEGIN_SRC emacs-lisp (eval-after-load 'ox '(add-to-list 'org-export-filter-code-functions 'org-export-ascii-filter-code)) #+END_SRC Chuck