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).
--
Kaushal Modi