Save reformatted tangled Python buffer and tell it the user
This commit is contained in:
parent
9fb6c6f0f3
commit
75e7f8b3f4
14
README.org
14
README.org
@ -2591,12 +2591,14 @@ Listing [[lst:configure-format-all]]:
|
||||
(when (fboundp 'format-all-ensure-formatter)
|
||||
(add-hook 'prog-mode-hook #'format-all-ensure-formatter))
|
||||
|
||||
(add-hook 'org-babel-post-tangle-hook
|
||||
(defun format-all-org-babel-post-tangle ()
|
||||
(when (derived-mode-p 'python-mode)
|
||||
(setq-local format-all-formatters '(("Python" black)))
|
||||
(message "Format whole `%s' buffer after tangling" major-mode)
|
||||
(format-all-buffer)))))
|
||||
(add-hook
|
||||
'org-babel-post-tangle-hook
|
||||
(defun format-all-org-babel-post-tangle ()
|
||||
(when (derived-mode-p 'python-mode)
|
||||
(setq-local format-all-formatters '(("Python" black)))
|
||||
(format-all-buffer)
|
||||
(save-buffer)
|
||||
(message "Saved reformatted tangled buffer `%s'" (buffer-file-name))))))
|
||||
#+end_src
|
||||
|
||||
** [[https://dept-info.labri.fr/~strandh/Teaching/PFS/Common/Strandh-Tutorial/Dir-symbolic.html][Common Lisp programming]]
|
||||
|
Loading…
x
Reference in New Issue
Block a user