[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb d9fc7e0 1/2: Don't add Gnus window configurations
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb d9fc7e0 1/2: Don't add Gnus window configurations if ebdb-mua-pop-up is nil |
Date: |
Sat, 19 Jan 2019 11:25:47 -0500 (EST) |
branch: externals/ebdb
commit d9fc7e0f2a754e577fde13a289b27f3c609c18c4
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
Don't add Gnus window configurations if ebdb-mua-pop-up is nil
Otherwise, Gnus will still open an empty window, even if EBDB doesn't
think it's popping up.
* ebdb-gnus.el (ebdb-after-load-hook):
* ebdb-message.el (ebdb-after-load-hook): Move the config into the
ebdb-after-load-hook.
---
ebdb-gnus.el | 11 +++++++----
ebdb-message.el | 20 ++++++++++++--------
2 files changed, 19 insertions(+), 12 deletions(-)
diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index c034143..5e2fe66 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -233,10 +233,13 @@ Note that `\( is the backquote, NOT the quote '\(."
(format "*%s-Gnus*" ebdb-buffer-name))
;; Tell Gnus how to display the *EBDB-Gnus* buffer.
-(with-eval-after-load "gnus-win"
- (add-to-list 'gnus-window-to-buffer
- `(ebdb-gnus . ,(ebdb-gnus-buffer-name)))
- (gnus-add-configuration ebdb-gnus-window-configuration))
+(add-hook 'ebdb-after-load-hook
+ (lambda ()
+ (with-eval-after-load "gnus-win"
+ (when ebdb-mua-pop-up
+ (add-to-list 'gnus-window-to-buffer
+ `(ebdb-gnus . ,(ebdb-gnus-buffer-name)))
+ (gnus-add-configuration ebdb-gnus-window-configuration)))))
(cl-defmethod ebdb-make-buffer-name (&context (major-mode gnus-summary-mode))
"Produce a EBDB buffer name associated with Gnus."
diff --git a/ebdb-message.el b/ebdb-message.el
index cdc3c8e..1cbecd5 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -120,16 +120,20 @@ See Gnus' manual for details."
;; *EBDB-Message* buffer after the message-mode buffer is created.
;; The gnus window configuration stanza makes sure it's displayed
;; after the message buffer is set up.
-(with-eval-after-load 'gnus-win
- (add-to-list 'gnus-window-to-buffer
- `(ebdb-message . ,(ebdb-message-buffer-name)))
- (add-hook 'message-header-setup-hook 'ebdb-mua-auto-update)
+(add-hook 'ebdb-after-load-hook
+ (lambda ()
+ (with-eval-after-load "gnus-win"
+ (add-hook 'message-header-setup-hook 'ebdb-mua-auto-update)
- (gnus-add-configuration
- ebdb-message-reply-window-config)
+ (when ebdb-mua-pop-up
+ (add-to-list 'gnus-window-to-buffer
+ `(ebdb-message . ,(ebdb-message-buffer-name)))
- (gnus-add-configuration
- ebdb-message-reply-yank-window-config))
+ (gnus-add-configuration
+ ebdb-message-reply-window-config)
+
+ (gnus-add-configuration
+ ebdb-message-reply-yank-window-config)))))
(provide 'ebdb-message)
;;; ebdb-message.el ends here