diff options
author | Case Duckworth | 2022-01-24 13:24:50 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-24 13:24:50 -0600 |
commit | dbc6934ae699f118472dfa6919972019be4a4eac (patch) | |
tree | 5fe4e18193f17746ab032c7ec72fa3e4f6fb583b | |
parent | Add jabber (diff) | |
download | emacs-dbc6934ae699f118472dfa6919972019be4a4eac.tar.gz emacs-dbc6934ae699f118472dfa6919972019be4a4eac.zip |
Add variable +org-before-save-prettify-buffer
-rw-r--r-- | lisp/+org.el | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lisp/+org.el b/lisp/+org.el index 57a4a16..5062a08 100644 --- a/lisp/+org.el +++ b/lisp/+org.el | |||
@@ -314,12 +314,18 @@ instead of the true count." | |||
314 | 314 | ||
315 | ;;; Hooks & Advice | 315 | ;;; Hooks & Advice |
316 | 316 | ||
317 | (defvar +org-before-save-prettify-buffer t | ||
318 | "Prettify org buffers before saving.") | ||
319 | |||
320 | (put '+org-before-save-prettify-buffer 'safe-local-variable #'booleanp) | ||
321 | |||
317 | (defun +org-before-save@prettify-buffer () | 322 | (defun +org-before-save@prettify-buffer () |
318 | (save-mark-and-excursion | 323 | (when +org-before-save-prettify-buffer |
319 | (mark-whole-buffer) | 324 | (save-mark-and-excursion |
320 | ;;(org-fill-paragraph nil t) | 325 | (mark-whole-buffer) |
321 | (+org-fix-blank-lines t) | 326 | ;;(org-fill-paragraph nil t) |
322 | (org-align-tags t))) | 327 | (+org-fix-blank-lines t) |
328 | (org-align-tags t)))) | ||
323 | 329 | ||
324 | (defun +org-delete-backward-char (N) | 330 | (defun +org-delete-backward-char (N) |
325 | "Keep tables aligned while deleting N characters backward. | 331 | "Keep tables aligned while deleting N characters backward. |