From 5b8ca5797329f519cdd969fb7fcf344af8fb46b5 Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Wed, 13 Jan 2021 19:52:28 -0600 Subject: add adaptive-wrap-prefix-mode to a hook --- config.org | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/config.org b/config.org index c2803b1..bb89424 100644 --- a/config.org +++ b/config.org @@ -1042,7 +1042,14 @@ from [[https://github.com/mpereira/.emacs.d#make-cursor-movement-an-order-of-mag #+begin_src emacs-lisp (straight-use-package 'adaptive-wrap) - (adaptive-wrap-prefix-mode +1) + + (when (fboundp 'adaptive-wrap-prefix-mode) + (defun acdw/activate-adaptive-wrap-prefix-mode () + "Toggle `visual-line-mode' and `adaptive-wrap-prefix-mode' simultaneously." + (adaptive-wrap-prefix-mode (if visual-line-mode + +1 + -1))) + (add-hook 'visual-line-mode-hook #'acdw/activate-adaptive-wrap-prefix-mode)) #+end_src *** Stay snappy with long-lined files -- cgit 1.4.1-21-gabe81