emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/olivetti 947b1c0 044/134: Custom option to recall visua


From: Stefan Monnier
Subject: [elpa] externals/olivetti 947b1c0 044/134: Custom option to recall visual-line-mode entry state
Date: Thu, 25 Apr 2019 09:57:25 -0400 (EDT)

branch: externals/olivetti
commit 947b1c0498c3a1e265991bf228f3b1bb66addeee
Author: Paul Rankin <address@hidden>
Commit: Paul Rankin <address@hidden>

    Custom option to recall visual-line-mode entry state
---
 olivetti.el | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/olivetti.el b/olivetti.el
index 3fa4856..32828b3 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -114,6 +114,13 @@ This option does not affect file contents."
 (defcustom olivetti-hide-mode-line nil
   "Hide the mode line.
 Can cause display issues in console mode."
+(defcustom olivetti-recall-visual-line-mode-entry-state
+  t
+  "Recall the state of `visual-line-mode' upon exiting.
+
+When non-nil, if `visual-line-mode' is inactive upon activating
+`olivetti-mode', then `visual-line-mode' will be deactivated upon
+exiting. The reverse is not true."
   :type 'boolean
   :group 'olivetti)
 
@@ -276,6 +283,9 @@ hidden."
                  'olivetti-set-environment t)
     (remove-hook 'text-scale-mode-hook
                  'olivetti-set-environment t)))
+    (if (and olivetti-recall-visual-line-mode-entry-state
+             (null olivetti--visual-line-mode))
+        (visual-line-mode 0))
 
 (provide 'olivetti)
 ;;; olivetti.el ends here



reply via email to

[Prev in Thread] Current Thread [Next in Thread]