[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 7921f6a 11/16: Have ebdb-pop-up-window better hono
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 7921f6a 11/16: Have ebdb-pop-up-window better honor ebdb-default-window-size |
Date: |
Sun, 16 Jun 2019 12:23:08 -0400 (EDT) |
branch: externals/ebdb
commit 7921f6a35b5bdd5ce80ef9ad263083ef8599b67c
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Have ebdb-pop-up-window better honor ebdb-default-window-size
* ebdb-com.el (ebdb-pop-up-window): There was still a hard-coded 0.5
in here. Check ebdb-default-window-size for all its potential
values.
(ebdb-popup-window): Fix docstring to mention that the return spec
can also include a direction symbol.
---
ebdb-com.el | 34 ++++++++++++++++++++--------------
1 file changed, 20 insertions(+), 14 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 826c745..37e6d89 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -800,15 +800,19 @@ buffer."
(cl-defgeneric ebdb-popup-window (major-mode)
"Return a spec for how to pop up a window on an *EBDB* buffer.
This generic function dispatches on the current value of
-major-mode. The return value should be a two-element list
-of (window split), in which WINDOW is the window to split, and
-SPLIT is either an integer, specifying number of rows/columns, or
-a float specifying what percentage of window real estate the
-pop-up should occupy. SPLIT can also be nil, in which case the
-window will probably take up half the available space.
-
-Alternately, the return value can be nil, which means continue
-using the current window.")
+major-mode. The return value should be a three-element list
+of (window split direction), in which WINDOW is the window to
+split, SPLIT is either an integer, specifying number of
+rows/columns, or a float specifying what percentage of window
+real estate the pop-up should occupy, and DIRECTION is one of the
+symbols `left', `right', `above' or `below'. SPLIT can be nil,
+in which case the value of `ebdb-default-window-size' will be
+used. DIRECTION can also be nil, in which case the direction
+will either be `right' or `below', depending on the height and
+width of the window to be split.
+
+Alternately, the entire return value can be nil, which means
+continue using the current window.")
(cl-defmethod ebdb-popup-window (&context (major-mode ebdb-mode))
"When popping up from an existing *EBDB* buffer, just reuse the window.
@@ -1172,11 +1176,13 @@ popped up from."
nil)
((integerp (cadr pop))
(cadr pop))
- (t
- (let ((ratio (- 1 (or (cadr pop) 0.5)))
- (dimension (max (window-total-width split-window)
- (window-total-height
split-window))))
- (round (* dimension ratio)))))))
+ ((or (floatp (cadr pop)) (floatp ebdb-default-window-size))
+ (let ((flt (or (cadr pop) ebdb-default-window-size)))
+ (round (* (max (window-total-width split-window)
+ (window-total-height split-window))
+ (- 1 flt)))))
+ ((integerp ebdb-default-window-size)
+ ebdb-default-window-size))))
(cond (buffer-window
;; It's already visible, re-use it.
- [elpa] externals/ebdb 4a5ac62 05/16: Fix some plist-get calls to use tags, not symbols, (continued)
- [elpa] externals/ebdb 4a5ac62 05/16: Fix some plist-get calls to use tags, not symbols, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 688917f 04/16: Use previous object as default when editing anniversary field, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 16185b5 07/16: Fix docstring of ebdb-popup-window, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 2568b9a 10/16: Fix dumb bug in gnus and message window config, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 7a6794b 08/16: Further error with slots as keyword vs symbol, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 838103e 01/16: New option ebdb-default-window-size to control popup sizes, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 48a311a 14/16: Fix bug in popup buffer window splitting, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 1bcfaa1 12/16: Remove EBDB-Message buffer after killing or postponing message, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb e98b18a 06/16: New command ebdb-create-record-and-role, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 22895a4 16/16: Bump version to 0.6.9, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 7921f6a 11/16: Have ebdb-pop-up-window better honor ebdb-default-window-size,
Eric Abrahamsen <=
- [elpa] externals/ebdb 4e1ea30 15/16: Fix to "Remove EBDB-Message buffer after killing..." etc, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb b3dfcb8 13/16: New command ebdb-format-these-records, Eric Abrahamsen, 2019/06/16
- [elpa] externals/ebdb 8f0251f 09/16: Give all MUAs their own version of ebdb-default-window-size, Eric Abrahamsen, 2019/06/16