;; This buffer is for text that is not saved, and for Lisp evaluation. ;; To create a file, visit it with 'C-x C-f' and enter text in its buffer. (defun is-in-local-variable-alists (sym) "Check if symbol is in any local variable alist" (when (or (and (boundp 'connection-local-variables-alist) (assoc sym connection-local-variables-alist)) (and (boundp 'file-local-variables-alist) (assoc sym file-local-variables-alist)) (and (boundp 'dir-local-variables-alist) (assoc sym dir-local-variables-alist))) t)) (defun local-or-latex-class () (interactive) ;; ;; This would come from ox-latex ;; (let ((test '((org-latex-subtitle-format . "\\subtitle{%s}") (org-latex-subtitle-separate . t)))) (mapcar #'(lambda (element) (let* ((sym (car element)) (skip (is-in-local-variable-alists sym)) (sym-name (symbol-name sym)) (val (cdr element))) ;; (message "--> %s" element) ;; (if skip ;; (message "%s set as file-local" sym-name) ;; (progn ;; (message "Will set %s to %s" sym-name val) ;; (eval '(setq sym-name val)))))) (unless skip (eval '(setq sym-name val))))) test) (message "Is separate: %s" org-latex-subtitle-separate) (message "subtitle: %s" org-latex-subtitle-format)) )