summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <marius.peter@tutanota.com>2023-12-01 16:02:28 +0100
committerMarius Peter <marius.peter@tutanota.com>2023-12-01 16:02:28 +0100
commitc224963085bb9f201282624cb53da879e4ae59ea (patch)
treee77baac0f3311be23445f119680df9f0295ce0fe
parentb86dfc9d45b42808d413757f70b1195452beae11 (diff)
`pp-buffer` on certain Org source code blocks.
-rw-r--r--smart-documents.org32
1 files 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
Copyright 2019--2024 Marius PETER