emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] export code with backslashes


From: Charles C. Berry
Subject: Re: [O] export code with backslashes
Date: Wed, 18 Mar 2015 10:10:24 -0700
User-agent: Alpine 2.00 (OSX 1167 2008-08-23)

On Wed, 18 Mar 2015, address@hidden 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 via email to

[Prev in Thread] Current Thread [Next in Thread]