From 5dafaa31e289501511ccfe30b2dcf4d864679e24 Mon Sep 17 00:00:00 2001 From: Gerard Vermeulen Date: Fri, 14 Jun 2024 22:29:19 +0200 Subject: [PATCH] Clean up "lst:setup-org-src" and hide the "Deprecated ..." section --- README.org | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) diff --git a/README.org b/README.org index 02b4f33..63e5324 100644 --- a/README.org +++ b/README.org @@ -2285,19 +2285,19 @@ region becomes the block BODY. Otherwise, insert an empty block." #+caption: Setup =org-src=. #+name: lst:setup-org-src #+begin_src emacs-lisp -n :results silent -(with-eval-after-load 'emacs - (with-eval-after-load 'org-src - ;; https://list.orgmode.org/c3cc4ff1fcfb3bc741df89a3f45be30e@posteo.net/ - (setopt org-src-preserve-indentation nil - org-edit-src-content-indentation 0) +(with-eval-after-load 'org-src + ;; https://list.orgmode.org/c3cc4ff1fcfb3bc741df89a3f45be30e@posteo.net/ + (setopt org-edit-src-content-indentation 0 + org-src-preserve-indentation nil + org-src-window-setup 'current-window) - (defun org-left-shift-block () - "Left-shift the block at point using `org-indent-block'." - (interactive) - (let ((org-adapt-indentation nil) - (org-edit-src-content-indentation 0) - (org-src-preserve-indentation nil)) - (org-indent-block)))) + (defun org-left-shift-block () + "Left-shift the block at point using `org-indent-block'." + (interactive) + (let ((org-adapt-indentation nil) + (org-edit-src-content-indentation 0) + (org-src-preserve-indentation nil)) + (org-indent-block))) (defun org-right-shift-block (&optional arg) "Right-shift the block at point 4 spaces. @@ -2314,9 +2314,6 @@ With prefix argument ARG, prompt for the number of spaces." (string-insert-rectangle (match-beginning 5) (point) (make-string spaces ?\s))))) - (declare-function org-babel-map-src-blocks "ext:ob-core" (file &rest body)) - (declare-function org-do-remove-indentation "ext:org-macs" (n skip-fl)) - (defun zero-all-org-src-blocks-indentation () "Remove the indentation of all `org-src-mode' blocks without `-i' switch." (interactive) @@ -3525,7 +3522,7 @@ handled by [[info:org#Noweb Reference Syntax][noweb (info)]]. <> #+end_src -*** [[info:org#LaTeX header and sectioning][Deprecated LaTeX preamble editing methods]] +*** [[info:org#LaTeX header and sectioning][Deprecated LaTeX preamble editing methods]] :noexport: :PROPERTIES: :CUSTOM_ID: sec:easy-latex-preamble-editing :END: @@ -3563,7 +3560,7 @@ in [[info:org#Export Settings][#+INCLUDE: ]] files. #+caption: LaTeX preamble =latex_header= and =latex_extra_header= export options #+caption: easily. #+name: lst:org-babel-latex-header-blocks -#+begin_src emacs-lisp -n :exports code :results silent +#+begin_src emacs-lisp -n :exports code :results silent :tangle no (with-eval-after-load 'emacs (defun prefix-all-lines (prefix body) (with-temp-buffer @@ -3590,8 +3587,6 @@ prefixes all lines with \"#+latex_header: \"." '((:exports . "results") (:results . "raw"))) (with-eval-after-load 'org-src - (setopt org-src-window-setup 'current-window) - (add-to-list 'org-src-lang-modes '("latex-header" . latex)) (add-to-list 'org-src-lang-modes '("latex-extra-header" . latex)))) #+end_src @@ -3599,7 +3594,7 @@ prefixes all lines with \"#+latex_header: \"." #+caption[Convert marked LaTeX export blocks to LaTeX header lines]: #+caption: Convert marked LaTeX export blocks to LaTeX header lines. #+name: lst:org-latex-header-blocks-filter -#+begin_src emacs-lisp -n :results silent +#+begin_src emacs-lisp -n :results silent :tangle no (with-eval-after-load 'ox (defun org-latex-header-blocks-filter (backend) "Convert marked LaTeX export blocks to \"#+latex_header: \" lines.