emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] Buffer local value lost when exporting? (was Evaluate all org ta


From: Kaushal Modi
Subject: Re: [O] Buffer local value lost when exporting? (was Evaluate all org tables in file before exporting)
Date: Fri, 13 May 2016 16:33:05 +0000

On Fri, May 13, 2016 at 12:25 PM Nicolas Goaziou <address@hidden> wrote:
For completeness, export process actually inherits some buffer local
values. See `org-export--generate-copy-script', in particular

  ;; Copy specific buffer local variables and variables set
  ;; through BIND keywords.
  ,@(let ((bound-variables (org-export--list-bound-variables))
          vars)
      (dolist (entry (buffer-local-variables (buffer-base-buffer)) vars)
        (when (consp entry)
          (let ((var (car entry))
                (val (cdr entry)))
            (and (not (memq var org-export-ignored-local-variables))
                 (or (memq var
                           '(default-directory
                              buffer-file-name
                              buffer-file-coding-system))
                     (assq var bound-variables)
                     (string-match "^\\(org-\\|orgtbl-\\)"
                                   (symbol-name var)))
                 ;; Skip unreadable values, as they cannot be
                 ;; sent to external process.
                 (or (not val) (ignore-errors (read (format "%S" val))))
                 (push `(set (make-local-variable (quote ,var))
                             (quote ,val))
                       vars))))))

So basically, it copies all Org related variables, default directory,
buffer-file-name buffer-file-coding-system and any variable defined as
a BIND keyword, provided their value is `read'-able (e.g., not a hash
table).

Thanks for that info guys!

It got it working after setting org-export-allow-bind-keywords to t BUT now I need to set the buffer local value twice: (1) Using the Local Variables footer style so that that local value is effective when before-save-hook is run (2) Using #+BIND so that that value is effective when  org-export-before-processing-hook is run.

Below is the MWE now:

=====
| N |
|---|
|   |
|   |
|   |
|   |
#+TBLFM: address@hidden

#+BIND: modi/org-table-enable-buffer-wide-recalculation nil
# Local Variables:
# modi/org-table-enable-buffer-wide-recalculation: nil
# End:
=====

--

--
Kaushal Modi


reply via email to

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