[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 5de9a5d 24/26: Fix darkroom-tentative-mode when switching
From: |
João Távora |
Subject: |
[elpa] master 5de9a5d 24/26: Fix darkroom-tentative-mode when switching window's buffer |
Date: |
Fri, 19 Dec 2014 19:07:32 +0000 |
branch: master
commit 5de9a5de7b7aafe16fdb3a59ed723a19eb9afe85
Author: Joao Tavora <address@hidden>
Commit: Joao Tavora <address@hidden>
Fix darkroom-tentative-mode when switching window's buffer
* darkroom.el (darkroom--enter-or-leave): Call `darkroom-enter'
with non-nil JUST-MARGINS.
(darkroom--enter): Add JUST-MARGINS.
---
darkroom.el | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)
diff --git a/darkroom.el b/darkroom.el
index cc98951..1129c53 100644
--- a/darkroom.el
+++ b/darkroom.el
@@ -279,16 +279,18 @@ Alist of (VARIABLE . BEFORE-VALUE)")
;; (defvar darkroom--saved-text-scale-mode-amount nil
;; "Text scale before `darkroom-mode' is turned on.")
-(defun darkroom--enter ()
- "Save current state and enter darkroom for the current buffer."
- (setq darkroom--saved-state
- (mapcar #'(lambda (sym)
- (cons sym (buffer-local-value sym (current-buffer))))
- darkroom--saved-variables))
- (setq mode-line-format nil
- header-line-format nil
- fringes-outside-margins darkroom-fringes-outside-margins)
- (text-scale-increase darkroom-text-scale-increase)
+(defun darkroom--enter (&optional just-margins)
+ "Save current state and enter darkroom for the current buffer.
+With optional JUST-MARGINS, just set the margins."
+ (unless just-margins
+ (setq darkroom--saved-state
+ (mapcar #'(lambda (sym)
+ (cons sym (buffer-local-value sym (current-buffer))))
+ darkroom--saved-variables))
+ (setq mode-line-format nil
+ header-line-format nil
+ fringes-outside-margins darkroom-fringes-outside-margins)
+ (text-scale-increase darkroom-text-scale-increase))
(mapc #'(lambda (w)
(with-selected-window w
(darkroom--set-margins)))
@@ -309,8 +311,7 @@ Alist of (VARIABLE . BEFORE-VALUE)")
(defun darkroom--enter-or-leave ()
"Enter or leave darkroom according to window configuration."
(cond ((= (count-windows) 1)
- (unless darkroom--saved-state
- (darkroom--enter)))
+ (darkroom--enter darkroom--saved-state))
(darkroom--saved-state
(darkroom--leave))
(t
- [elpa] master 90f5299 14/26: Prefix internal symbols with "darkroom--", (continued)
- [elpa] master 90f5299 14/26: Prefix internal symbols with "darkroom--", João Távora, 2014/12/19
- [elpa] master 8b0daf6 12/26: Add (still non-functioning) `darkroom-compute-margins', João Távora, 2014/12/19
- [elpa] master 13717fb 17/26: Attempt a clearer design of modes, João Távora, 2014/12/19
- [elpa] master 20d5539 21/26: load cl-lib, João Távora, 2014/12/19
- [elpa] master 4bf9c10 19/26: Fix `darkroom-tentative-mode', João Távora, 2014/12/19
- [elpa] master 1e68955 16/26: Corrections after another review iteration with Rasmus, João Távora, 2014/12/19
- [elpa] master 15e976b 22/26: Merge pull request #1 from syohex/require-cl-lib, João Távora, 2014/12/19
- [elpa] master 9674d79 20/26: Fix automatic margin calculation, João Távora, 2014/12/19
- [elpa] master 2887b5e 18/26: Redesign setting of margins, which now works per-window, João Távora, 2014/12/19
- [elpa] master 96e61a9 26/26: Add packages/darkroom by merging its upstream subtree, João Távora, 2014/12/19
- [elpa] master 5de9a5d 24/26: Fix darkroom-tentative-mode when switching window's buffer,
João Távora <=
- [elpa] master 654e5fd 23/26: Fix margin calculation yet again., João Távora, 2014/12/19
- [elpa] master 7a8b5b6 25/26: Prepare for inclusion in GNU ELPA, João Távora, 2014/12/19