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

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

[elpa] externals/olivetti 6a8f400 021/134: Added set-width interactive f


From: Stefan Monnier
Subject: [elpa] externals/olivetti 6a8f400 021/134: Added set-width interactive fun
Date: Thu, 25 Apr 2019 09:57:20 -0400 (EDT)

branch: externals/olivetti
commit 6a8f400c40a8cb87a0b44ee64ddab4d8f6c2c9d7
Author: Paul Rankin <address@hidden>
Commit: Paul Rankin <address@hidden>

    Added set-width interactive fun
---
 olivetti.el | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/olivetti.el b/olivetti.el
index 3fc93de..5ebdda4 100644
--- a/olivetti.el
+++ b/olivetti.el
@@ -151,6 +151,14 @@ mode line. Finally redraw the frame."
            (setq olivetti-body-width
                  (car (get 'olivetti-body-width 'standard-value)))))))
 
+(defun olivetti-set-width (n)
+  (interactive
+   (list (or current-prefix-arg
+             (read-number "Set text body width (integer or float): "
+                          olivetti-body-width))))
+  (setq olivetti-body-width (olivetti-safe-width n))
+  (olivetti-set-environment)
+  (message "Text body width set to %s" olivetti-body-width))
 
 (defun olivetti-set-environment ()
   "Set text body width to `olivetti-body-width' with relative margins."



reply via email to

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