emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Charles C. Berry" <ccberry@ucsd.edu>
To: hymie@lactose.homelinux.net
Cc: emacs-orgmode@gnu.org
Subject: Re: export code with backslashes
Date: Wed, 18 Mar 2015 10:10:24 -0700	[thread overview]
Message-ID: <alpine.OSX.2.00.1503181003420.545@charles-berrys-macbook.local> (raw)
In-Reply-To: <E1YYDiW-0005Bk-SG@lactose.homelinux.net>

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

      reply	other threads:[~2015-03-18 17:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-16 15:47 export code with backslashes hymie!
2015-03-16 22:28 ` Charles C. Berry
2015-03-16 23:11   ` hymie
2015-03-18 13:09   ` hymie
2015-03-18 17:10     ` Charles C. Berry [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.OSX.2.00.1503181003420.545@charles-berrys-macbook.local \
    --to=ccberry@ucsd.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=hymie@lactose.homelinux.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).