From a69b0e1f7eb6b93688d48effb21760d656b4756a Mon Sep 17 00:00:00 2001 From: David Li Date: Sun, 4 Mar 2018 19:50:27 -0500 Subject: Use adaptive-wrap mode when available --- init.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/init.el b/init.el index 438abd4..947011e 100644 --- a/init.el +++ b/init.el @@ -258,6 +258,14 @@ This functions should be added to the hooks of major modes for programming." (setq org-latex-listings t) ;; (add-to-list 'org-latex-packages-alist '("" "listings")) +;; adaptive-wrap when available + +(when (fboundp 'adaptive-wrap-prefix-mode) + (defun my-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 'my-activate-adaptive-wrap-prefix-mode)) + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. -- cgit v1.2.3