Add +org-wrap-on-hyphens
This commit is contained in:
parent
02b8882f54
commit
2cc59cf768
10
init.el
10
init.el
|
@ -629,14 +629,10 @@
|
|||
#'turn-off-auto-fill
|
||||
#'org-indent-mode
|
||||
#'prettify-symbols-mode
|
||||
;; TODO: This is only the beginning of a larger idea: I really want the
|
||||
;; "buffer stats" section of the mode-line to change depending on the
|
||||
;; mode. So like, org-mode would be a word count (maybe other text
|
||||
;; modes?), lui-modes could be .... something? etc.
|
||||
(defun turn-off-column-number-mode () (setq-local column-number-mode nil)))
|
||||
(:local-set prettify-symbols-alist '(("DEADLINE:" . ?→)✓
|
||||
#'+org-wrap-on-hyphens)
|
||||
(:local-set prettify-symbols-alist '(("DEADLINE:" . ?→)
|
||||
("SCHEDULED:" . ?↷)
|
||||
("CLOSED:" ?✓))
|
||||
("CLOSED:" . ?✓))
|
||||
;;+modeline-position-function #'+org-count-words-stupidly
|
||||
)
|
||||
(:local-hook user-save-hook #'+org-before-save@prettify-buffer)
|
||||
|
|
14
lisp/+org.el
14
lisp/+org.el
|
@ -649,5 +649,19 @@ and POST-PROCESS are passed to `org-export-to-file'."
|
|||
(while (re-search-forward "\n\u000c\n" to t)
|
||||
(org-flag-region (match-beginning 0) (match-end 0) t 'visible)))))
|
||||
|
||||
;;; Emacs 28+: wrap on hyphens
|
||||
;; https://emacs.stackexchange.com/a/71342/37239
|
||||
|
||||
(defcustom +org-category-table (let ((table (copy-category-table)))
|
||||
(modify-category-entry ?- ?| table)
|
||||
table)
|
||||
"Character category table for `org-mode'."
|
||||
:type 'sexp)
|
||||
|
||||
(defun +org-wrap-on-hyphens ()
|
||||
"Soft-wrap `org-mode' buffers on spaces and hyphens."
|
||||
(set-category-table +org-category-table)
|
||||
(setq-local word-wrap-by-category t))
|
||||
|
||||
(provide '+org)
|
||||
;;; +org.el ends here
|
||||
|
|
Loading…
Reference in New Issue