Add `org-left-shift-block' to zero the indentation interactively

This commit is contained in:
Gerard Vermeulen 2024-01-15 10:59:51 +01:00
parent 55afe827ab
commit 000a131450

View File

@ -2486,7 +2486,15 @@ When called twice, replace the previously inserted \\(\\) by one $."
#+begin_src emacs-lisp -n
(with-eval-after-load 'emacs
(with-eval-after-load 'org-src
(setopt org-src-preserve-indentation t))
(setopt org-src-preserve-indentation t)
(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))))
(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))