Fix up org-mode config

This commit is contained in:
Case Duckworth 2021-10-06 11:16:55 -05:00
parent 2409909392
commit 14e4e5d050
1 changed files with 30 additions and 17 deletions

47
init.el
View File

@ -1914,7 +1914,7 @@ browser defined in `browse-url-secondary-browser-function'."
org-clock-clocked-in-display 'mode-line
org-clock-frame-title-format (cons '(t org-mode-line-string)
(cons " --- " frame-title-format))
;;org-clock-string-limit 7 ; gives time and not title
org-clock-string-limit 25 ; gives enough information
org-clock-persist t
org-confirm-babel-evaluate nil
org-cycle-separator-lines 0
@ -1961,12 +1961,24 @@ browser defined in `browse-url-secondary-browser-function'."
(:unbind "C-j" ; org-return-and-maybe-indent
"M-j")
(:local-set unfill-fill-function #'org-fill-paragraph)
(:local-set unfill-fill-function #'org-fill-paragraph
wc-count-words-function
(lambda (start end) "Count words stupidly with a limit."
(acdw-org/count-words-stupidly start
end
999)))
(with-eval-after-load 'org-export
(:option (append org-export-filter-final-output-functions)
#'org-export-remove-zero-width-spaces))
(:local-hook before-save-hook
(defun org/before-save@fix-blank-lines ()
(acdw-org/fix-blank-lines t))
before-save-hook
(defun org/before-save@align-tags ()
(org-align-tags :all)))
(:hook ;; #'variable-pitch-mode
;; (defun org-mode@before-save@fill-buffer ()
@ -1978,22 +1990,23 @@ browser defined in `browse-url-secondary-browser-function'."
;; This is super ugly because I need to add a function to
;; `before-save-hook', but only in org-mode buffers. So I make a hook
;; to make a hook. I'm sure there's a better way to do this.
(defun org-mode@fix-blank-lines-on-save ()
(add-hook 'before-save-hook
(defun acdw-org/fix-blank-lines-in-buffer ()
(acdw-org/fix-blank-lines t))
0 :local))
;; (defun org-mode@fix-blank-lines-on-save ()
;; (add-hook 'before-save-hook
;; (defun acdw-org/fix-blank-lines-in-buffer ()
;; (acdw-org/fix-blank-lines t))
;; 0 :local))
(defun org-mode@wc-stupid ()
(unless (and wc-mode
(> 0 (+ (or wc-orig-words 0)
(or wc-words-delta 0)))))
(setq-local
wc-count-words-function
(lambda (start end) "Count words stupidly with a limit."
(acdw-org/count-words-stupidly start
end
999)))))
;; (defun org-mode@wc-stupid ()
;; (unless (and wc-mode
;; (> 0 (+ (or wc-orig-words 0)
;; (or wc-words-delta 0)))))
;; (setq-local
;; wc-count-words-function
;; (lambda (start end) "Count words stupidly with a limit."
;; (acdw-org/count-words-stupidly start
;; end
;; 999))))
)
(with-eval-after-load 'org
(org-clock-persistence-insinuate))