From c224963085bb9f201282624cb53da879e4ae59ea Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Fri, 1 Dec 2023 16:02:28 +0100 Subject: `pp-buffer` on certain Org source code blocks. --- smart-documents.org | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/smart-documents.org b/smart-documents.org index b3a2f61..1d58598 100644 --- a/smart-documents.org +++ b/smart-documents.org @@ -1726,11 +1726,15 @@ PDF. The binding is defined in Section [[Export to PDF]]. *** Fix indentation #+BEGIN_SRC emacs-lisp :tangle yes - (defun sd-indent-buffer () + (defun sd-indent-buffer + () "Indent entire buffer." (interactive) (save-excursion - (indent-region (point-min) (point-max) nil))) + (indent-region + (point-min) + (point-max) + nil))) #+END_SRC *** Beautify @@ -1738,7 +1742,8 @@ PDF. The binding is defined in Section [[Export to PDF]]. **** All types of buffers #+BEGIN_SRC emacs-lisp :tangle yes - (defun sd-beautify-buffer () + (defun sd-beautify-buffer + () "Clean up buffer in the most general sense. This means performing the following actions: @@ -1753,10 +1758,10 @@ PDF. The binding is defined in Section [[Export to PDF]]. ((string-equal major-mode "org-mode") (sd-org-fix-headlines-spacing)) ((string-equal major-mode "python-mode") - (or (shell-command (concat "~/.local/bin/black " buffer-file-name)) - (message "Could not find black Python formatter."))))) - - + (or + (shell-command + (concat "~/.local/bin/black " buffer-file-name)) + (message "Could not find black Python formatter."))))) #+END_SRC **** TODO COMMENT For Org mode, specifically @@ -1777,7 +1782,7 @@ PDF. The binding is defined in Section [[Export to PDF]]. ** Smart quitting :PROPERTIES: -:test: t +:test: t :END: *** Window @@ -1794,10 +1799,15 @@ PDF. The binding is defined in Section [[Export to PDF]]. *** Frame #+BEGIN_SRC emacs-lisp :tangle yes - (defun sd-delete-frame-or-kill-emacs () - (interactive) + (defun sd-delete-frame-or-kill-emacs + () "Delete frame; if sole frame, kill Emacs." - (if (> (length (frame-list)) 1) + (interactive) + (if + (> + (length + (frame-list)) + 1) (delete-frame) (save-buffers-kill-terminal))) #+END_SRC -- cgit v1.2.3