summaryrefslogtreecommitdiff
path: root/view-conf.el
diff options
context:
space:
mode:
Diffstat (limited to 'view-conf.el')
-rw-r--r--view-conf.el35
1 files changed, 33 insertions, 2 deletions
diff --git a/view-conf.el b/view-conf.el
index 7e00f5c..a2cecc2 100644
--- a/view-conf.el
+++ b/view-conf.el
@@ -286,6 +286,7 @@ options to choose from."
(define-key durand-focus-map (vector ?\s-v) #'view-mode)
(define-key durand-focus-map (vector ?\s-x) #'durand-focus)
+(define-key durand-focus-map (vector ?\M-\s-f) #'durand-focus-focus)
(define-key view-mode-map (vector ?f) #'durand-scroll-next-paragraph)
(define-key view-mode-map (vector ?b) #'durand-scroll-prev-paragraph)
@@ -296,11 +297,41 @@ options to choose from."
(durand-focus
(setq olivetti-body-width 65)
(olivetti-mode 1)
- (text-scale-increase 2)
- (variable-pitch-mode 1)
(cond (current-prefix-arg (view-mode 1))))
((setq olivetti-body-width 80)
(variable-pitch-mode -1)
(view-mode -1)
(olivetti-mode -1)
(text-scale-increase 0))))
+
+;;;###autoload
+(defun durand-focus-focus (&optional arg)
+ "Toggle the font size and `variable-pitch-mode'.
+ARG will be (prefix-numeric-value prefix-arg) in interactive
+uses.
+
+If ARG is non-zero and odd, toggle font-size.
+
+If ARG is non-zero and the second bit is non-zero, toggle
+`variable-pitch-mode'."
+ (interactive "p")
+ (setq arg (prefix-numeric-value arg))
+ (cond
+ ((= arg 0)
+ (cond
+ ((and text-scale-mode
+ (/= text-scale-mode-amount 0))
+ (text-scale-increase 0))
+ ((text-scale-increase 2)))
+ (variable-pitch-mode 'toggle))
+ (t
+ (cond
+ ((= (% arg 2) 1)
+ (cond
+ ((and text-scale-mode
+ (/= text-scale-mode-amount 0))
+ (text-scale-increase 0))
+ ((text-scale-increase 2)))))
+ (cond
+ ((= (logand arg 2) 2)
+ (variable-pitch-mode 'toggle))))))