[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return v
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return value of ebdb-popup-window |
Date: |
Mon, 14 Aug 2017 11:46:19 -0400 (EDT) |
branch: externals/ebdb
commit ed3e270b504be534c117096d4560745970764fd8
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Reverse order of args in return value of ebdb-popup-window
* ebdb-com.el (ebdb-popup-window): Should now return a three-element
list where the horiz/vert argument is last. This is because that
argument is almost always nil (meaning split based on the dimensions
of the window in question) so we might as well leave it off.
(ebdb-pop-up-window): Read arg correctly, and also fix a logic bug
where the window would never have been split vertically.
---
ebdb-com.el | 29 +++++++++++++++++------------
ebdb-gnus.el | 2 +-
ebdb-message.el | 4 ++--
ebdb-mua.el | 15 ++++++++-------
4 files changed, 28 insertions(+), 22 deletions(-)
diff --git a/ebdb-com.el b/ebdb-com.el
index 4ff2fbc..ea34427 100644
--- a/ebdb-com.el
+++ b/ebdb-com.el
@@ -647,9 +647,9 @@ buffer."
"Display RECORDS using FMT.
If APPEND is non-nil append RECORDS to the already displayed
records. Otherwise RECORDS overwrite the displayed records.
-SELECT and POP have the same meaning as in `ebdb-pop-up-window'.
-BUF indicates which *EBDB* buffer to use, or nil to generate a
-buffer name based on the current major mode."
+SELECT and POP are passed directly to `ebdb-pop-up-window'. BUF
+indicates which *EBDB* buffer to use, or nil to generate a buffer
+name based on the current major mode."
;; All functions that call `ebdb-display-records' set the "fmt"
;; argument, but that's not guaranteed.
@@ -946,19 +946,21 @@ displayed records."
(defun ebdb-pop-up-window (buf &optional select pop)
"Display *EBDB* buffer BUF by popping up a new window.
-POP is typically a three-element list of (window horiz-p split),
-where WINDOW is the window to be split, HORIZ-P says whether to
-split it vertically or horizontally, and SPLIT says to split it
-by how much. If HORIZ-P is nil, split the longest way. If SPLIT
-is nil, split 0.5.
+POP is typically a three-element list of (window split
+horiz/vert), where WINDOW is the window to be split, SPLIT says
+to split it by how much, and HORIZ/VERT says whether to split it
+vertically or horizontally. If HORIZ/VERT is nil, split the
+longest way. If SPLIT is nil, split 0.5.
If the whole POP argument is nil, just re-use the current
buffer."
(let* ((split-window (car-safe pop))
(buffer-window (get-buffer-window buf t))
- (horiz-p (or (cadr pop)
- (> (window-total-width split-window)
- (window-total-height split-window))))
+ (horiz/vert (or (cadr pop)
+ (if (> (window-total-width split-window)
+ (window-total-height split-window))
+ 'horiz
+ 'vert)))
(size (cond ((null pop)
nil)
((integerp (caddr pop)))
@@ -979,7 +981,10 @@ buffer."
(setq buffer-window (get-buffer-window buf t)))
(t
;; Otherwise split.
- (setq buffer-window (split-window split-window size (if horiz-p
'right 'below)))
+ (setq buffer-window (split-window split-window size
+ (if (eql horiz/vert 'vert)
+ 'below
+ 'right)))
(set-window-buffer buffer-window buf)))
(display-buffer-record-window 'window buffer-window buf)
(when select
diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index 939a0ec..cf5389c 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -422,7 +422,7 @@ Note that `\( is the backquote, NOT the quote '\(."
(list win nil 0.3)))
(cl-defmethod ebdb-popup-window (&context (major-mode gnus-article-mode))
- (list (get-buffer-window) nil 0.3))
+ (list (get-buffer-window) 0.3))
;; It seems that `gnus-fetch-field' fetches decoded content of
;; `gnus-visible-headers', ignoring `gnus-ignored-headers'.
diff --git a/ebdb-message.el b/ebdb-message.el
index 150a855..94019d9 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -60,10 +60,10 @@
(message-field-value header))
(cl-defmethod ebdb-popup-window (&context (major-mode message-mode))
- (list (get-buffer-window) nil 0.4))
+ (list (get-buffer-window) 0.4))
(cl-defmethod ebdb-popup-window (&context (major-mode mail-mode))
- (list (get-buffer-window) nil 0.4))
+ (list (get-buffer-window) 0.4))
(defun ebdb-insinuate-message ()
(when ebdb-complete-mail
diff --git a/ebdb-mua.el b/ebdb-mua.el
index 356995e..93de2c1 100644
--- a/ebdb-mua.el
+++ b/ebdb-mua.el
@@ -1094,11 +1094,13 @@ Dispatches on the value of major-mode."
This generic function dispatches on the current value of
major-mode. The return value should be a three-element list
-of (window horiz-p split), in which WINDOW is the window to
-split, HORIZ-P is t if the window should be split horizontally,
-else vertically, 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.
+of (window split horiz/vert), 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 HORIZ-P is 'horiz if
+the window should be split horizontally, 'vert for vertically,
+and nil to split depending on the dimensions of the current
+window.
Alternately, the return value can be nil, which means continue
using the current window.")
@@ -1111,8 +1113,7 @@ Ie, don't pop up at all."
(cl-defmethod ebdb-popup-window ()
"When popping up from a random window, use half the window."
- (let ((horiz-p (> (window-total-width) (window-total-height))))
- (list (get-buffer-window) horiz-p 0.5)))
+ (list (get-buffer-window) 0.5))
;;;###autoload
(defun ebdb-mua-update-records (&optional header-class all)
- [elpa] externals/ebdb 86b386d 141/350: Compiler-inspired fixes, (continued)
- [elpa] externals/ebdb 86b386d 141/350: Compiler-inspired fixes, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 05f67d6 081/350: Fix merging procedure, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1ded570 086/350: Note new database-related commands in manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ef673e2 094/350: Improve organization searching, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb bc71bda 099/350: Many fixes to migration routine, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 548e05d 106/350: Tweaks to MUA interactive commands, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb dd83c7e 115/350: Short-circuit ebdb-info, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a0eada8 128/350: Change some of the EBDB buffer formatting defaults, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 20906ae 131/350: ebdb-prompt-for-record should load if necessary, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 1bc78ab 133/350: Add helm-ebdb file, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb ed3e270 119/350: Reverse order of args in return value of ebdb-popup-window,
Eric Abrahamsen <=
- [elpa] externals/ebdb ed6e228 136/350: Make ebdb-annotate-message more class agnostic, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb aa2d973 147/350: Allow optional records argument to ebdb-initialize, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 42f6dce 130/350: Add "Hacking EBDB" section to manual, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 5dda311 118/350: Force mode line update after renaming EBDB buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb a94483d 122/350: Refinements to snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb d9b4865 146/350: More tweaks to snarfing process, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb b635b4e 155/350: First stab at article snarfing, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 6c267e9 159/350: Fix pop-up mouse menus in EBDB buffers, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb 55b3f82 160/350: Fixup with fix popup menus, Eric Abrahamsen, 2017/08/14
- [elpa] externals/ebdb abdb8cd 158/350: Update copyright years to 2017, Eric Abrahamsen, 2017/08/14