Work around org-mode upstream local variables initialization changes
This commit is contained in:
parent
b11b36eec3
commit
05bb22987f
37
README.org
37
README.org
@ -2088,7 +2088,7 @@ Listing [[lst:org-ref-like-org-link-types]] defines =org-link= types for backwar
|
||||
compatibility with [[https://github.com/jkitchin/org-ref][org-ref]]. Listing [[lst:define-org-pdfview-link-type]] uses ideas
|
||||
from the definition of =docview-org-link= and =doi-org-link= types to define an
|
||||
=pdfview-org-link= type for use with [[https://github.com/vedang/pdf-tools][pdf-tools]]. Finally, listing
|
||||
[[lst:emacs-lisp-setup-patch-ol-info]] patches the function =org-info-export= and
|
||||
[[lst:patch-org-info-link-type]] patches the function =org-info-export= and
|
||||
listing [[lst:emacs-lisp-setup-buffer-local-ol-info]] sets the constants
|
||||
~org-info-emacs-documents~ and ~org-info-other-documents~ as buffer local
|
||||
variables in order to export the =info-org-link= types in this document to
|
||||
@ -2183,8 +2183,8 @@ variables in order to export the =info-org-link= types in this document to
|
||||
|
||||
#+caption[Patch =ol-info=]:
|
||||
#+caption: Patch =ol-info=.
|
||||
#+name: lst:emacs-lisp-setup-patch-ol-info
|
||||
#+begin_src emacs-lisp :exports code :silent
|
||||
#+name: lst:patch-org-info-link-type
|
||||
#+begin_src emacs-lisp :exports code :results silent
|
||||
(with-eval-after-load 'ol-info
|
||||
(defun org-info-export (path desc format)
|
||||
"Export an info link.
|
||||
@ -2292,25 +2292,12 @@ variables in order to export the =info-org-link= types in this document to
|
||||
(org-eval-named-blocks-with-infix "python-setup"))
|
||||
|
||||
;; Emacs looks for "Local variables:" after the last "newline-formfeed".
|
||||
(add-to-list 'safe-local-eval-forms '(org-eval-emacs-lisp-setup-blocks)))
|
||||
|
||||
(with-eval-after-load 'emacs
|
||||
(defun my-org-eval-blocks-named (infix)
|
||||
"Evaluate all source blocks having INFIX in their name."
|
||||
(when (eq major-mode 'org-mode)
|
||||
(let ((blocks
|
||||
(org-element-map
|
||||
(org-element-parse-buffer 'greater-element nil) 'src-block
|
||||
(lambda (block)
|
||||
(when-let ((name (org-element-property :name block)))
|
||||
(when (string-match-p infix name) block))))))
|
||||
(dolist (block blocks)
|
||||
(goto-char (org-element-property :begin block))
|
||||
(org-babel-execute-src-block)))))
|
||||
|
||||
;; Emacs looks for "Local variables:" after the last "newline-formfeed".
|
||||
(add-to-list 'safe-local-eval-forms
|
||||
'(apply 'my-org-eval-blocks-named '("emacs-lisp-setup"))))
|
||||
(add-to-list
|
||||
'safe-local-eval-forms
|
||||
'(add-hook 'org-mode-hook 'org-eval-emacs-lisp-setup-blocks nil 'local))
|
||||
(add-to-list
|
||||
'safe-local-eval-forms
|
||||
'(add-hook 'org-mode-hook 'org-eval-python-setup-blocks nil 'local)))
|
||||
#+end_src
|
||||
|
||||
*** [[info:org#LaTeX header and sectioning][Easy LaTeX preamble editing]]
|
||||
@ -2330,14 +2317,14 @@ exposing his idea:
|
||||
1. [[https://www.reddit.com/r/orgmode/comments/7u2n0h/tip_for_defining_latex_macros_for_use_in_both/][Export LaTeX macros to LaTeX and HTML/MathJax preambles (reddit)]],
|
||||
2. [[https://www.reddit.com/r/orgmode/comments/5bi6ku/tip_for_exporting_javascript_source_block_to/][Export JavaScript source blocks to script tags in HTML (reddit)]],
|
||||
3. [[https://emacs.stackexchange.com/questions/28301/export-javascript-source-block-to-script-tag-in-html-when-exporting-org-file-to][Export JavaScript source blocks to script tags in HTML (SX)]].
|
||||
Listing [[lst:emacs-lisp-setup-latex-header]] implements this way by means of two
|
||||
Listing [[lst:org-babel-latex-header-blocks]] implements this way by means of two
|
||||
new [[info:org#Editing Source Code][<LANGUAGE>-modes]]: =latex-header= and =latex-extra-header=.
|
||||
|
||||
#+caption[New =<LANGUAGE>-modes= to edit the LaTeX preamble easily]:
|
||||
#+caption: Add =latex-header= and =latex-extra-header= language modes to edit
|
||||
#+caption: LaTeX preamble =latex_header= and =latex_extra_header= export options
|
||||
#+caption: easily.
|
||||
#+name: lst:emacs-lisp-setup-latex-header
|
||||
#+name: lst:org-babel-latex-header-blocks
|
||||
#+begin_src emacs-lisp :exports code :silent
|
||||
(with-eval-after-load 'emacs
|
||||
(defun prefix-all-lines (prefix body)
|
||||
@ -4399,7 +4386,7 @@ Only the [[info:org#Top][Org]] source file shows the local variables footer.
|
||||
# Emacs looks for "Local variables:" after the last "newline-formfeed".
|
||||
|
||||
# Local Variables:
|
||||
# eval: (add-hook 'org-mode-hook 'org-eval-emacs-lisp-setup-blocks nil 'local)
|
||||
# compile-command: "latexmk -interaction=nonstopmode -lualatex -pvc -shell-escape README.tex"
|
||||
# eval: (org-eval-emacs-lisp-setup-blocks)
|
||||
# fill-column: 80
|
||||
# End:
|
||||
|
Loading…
Reference in New Issue
Block a user