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

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

[elpa] externals/olivetti bd672e5 052/134: Make it easier to adjust oliv


From: Stefan Monnier
Subject: [elpa] externals/olivetti bd672e5 052/134: Make it easier to adjust olivetti-body-width
Date: Thu, 25 Apr 2019 09:57:27 -0400 (EDT)

branch: externals/olivetti
commit bd672e512f57962e59ff3d9fd2687e118b56ca54
Author: Lars Tveito <address@hidden>
Commit: Lars Tveito <address@hidden>

    Make it easier to adjust olivetti-body-width
    
    When invoking `olivetti-expand` let `[` and `]` be used to make further
    adjustments (not unlike `text-scale-mode`).
---
 olivetti.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/olivetti.el b/olivetti.el
index 809073b..e79f955 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -253,7 +253,11 @@ If prefixed with ARG, incrementally decrease."
                    (+ olivetti-body-width (* 0.01 p))))))
     (setq olivetti-body-width (olivetti-safe-width n)))
   (olivetti-set-environment)
-  (message "Text body width set to %s" olivetti-body-width))
+  (message "Text body width set to %s" olivetti-body-width)
+  (set-temporary-overlay-map
+   (let ((map (make-sparse-keymap)))
+     (define-key map "]" 'olivetti-expand)
+     (define-key map "[" 'olivetti-shrink) map)))
 
 (defun olivetti-shrink (&optional arg)
   "incrementally decrease the value of `olivetti-body-width'.



reply via email to

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