emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/ebdb 8f0251f 09/16: Give all MUAs their own version of


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb 8f0251f 09/16: Give all MUAs their own version of ebdb-default-window-size
Date: Sun, 16 Jun 2019 12:23:07 -0400 (EDT)

branch: externals/ebdb
commit 8f0251f79a59a2b0964345364fb88467ac33629f
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    Give all MUAs their own version of ebdb-default-window-size
    
    Related to bug#77 on Github.
    
    * ebdb-gnus.el (ebdb-gnus-window-size):
    * ebdb-message.el (ebdb-message-window-size):
    * ebdb-mhe.el (ebdb-mhe-window-size):
    * ebdb-mu4e.el (ebdb-mu4e-window-size):
    * ebdb-rmail.el (ebdb-rmail-window-size):
    * ebdb-wl.el (ebdb-wl-window-size): Add new options, all defaulting to
      ebdb-default-window-size.  Where necessary, add new defgroups, and
      ebdb-popup-window methods.  Change ebdb-wl customization group to
      ebdb-mua-wl, to match other groups.
    * ebdb.org (Pop-up Buffers): Document.
---
 ebdb-gnus.el    | 18 ++++++-----
 ebdb-message.el | 15 +++++++---
 ebdb-mhe.el     | 26 +++++++++++-----
 ebdb-mu4e.el    | 13 ++++++++
 ebdb-rmail.el   | 13 ++++++++
 ebdb-wl.el      | 10 +++++--
 ebdb.info       | 93 ++++++++++++++++++++++++++++++---------------------------
 ebdb.org        | 15 ++++++----
 ebdb.texi       | 15 ++++++----
 9 files changed, 144 insertions(+), 74 deletions(-)

diff --git a/ebdb-gnus.el b/ebdb-gnus.el
index 5e2fe66..51754e0 100644
--- a/ebdb-gnus.el
+++ b/ebdb-gnus.el
@@ -31,10 +31,16 @@
 (autoload 'message-make-domain "message")
 
 (defgroup ebdb-mua-gnus nil
-  "Gnus-specific EBDB customizations"
+  "Gnus-specific EBDB customizations."
   :group 'ebdb-mua)
 (put 'ebdb-mua-gnus 'custom-loads '(ebdb-gnus))
 
+(defcustom ebdb-gnus-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in Gnus.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 (defcustom ebdb-gnus-window-configuration
   `(article
     ,(cond
@@ -44,17 +50,16 @@
                  (tree 0.25)
                  (horizontal 1.0
                              (article 1.0)
-                             (ebdb-gnus 0.4))))
+                             (ebdb-gnus ebdb-gnus-window-size))))
       (t
        '(vertical 1.0
                  (summary 0.25 point)
                  (horizontal 1.0
                              (article 1.0)
-                             (ebdb-gnus 0.4))))))
+                             (ebdb-gnus ebdb-gnus-window-size))))))
   "Gnus window configuration to include EBDB.
 By default, this adds the *EBDB-Gnus* window to the right of the
 article buffer, taking up 40% of the horizontal space."
-  :group 'ebdb-mua-gnus
   :type 'list)
 
 (defcustom ebdb-gnus-post-style-function
@@ -68,7 +73,6 @@ nil to use Gnus defaults.
 
 See `ebdb-record-field' or `ebdb-record-current-fields' for
 likely ways to extract information about the record."
-  :group 'ebdb-mua-gnus
   :type 'function)
 
 (defgroup ebdb-mua-gnus-scoring nil
@@ -255,10 +259,10 @@ Note that `\( is the backquote, NOT the quote '\(."
           (unless (gnus-buffer-live-p gnus-article-buffer)
             (gnus-summary-show-article))
           (get-buffer-window gnus-article-buffer))))
-    (list win 0.3)))
+    (list win ebdb-gnus-window-size)))
 
 (cl-defmethod ebdb-popup-window (&context (major-mode gnus-article-mode))
-  (list (get-buffer-window) 0.3))
+  (list (get-buffer-window) ebdb-gnus-window-size))
 
 ;; 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 525cded..8abca8a 100644
--- a/ebdb-message.el
+++ b/ebdb-message.el
@@ -25,6 +25,7 @@
 
 
 (require 'ebdb-mua)
+(require 'ebdb-com)
 (require 'message)
 (require 'sendmail)
 
@@ -35,11 +36,17 @@
   :group 'ebdb-mua)
 (put 'ebdb-mua-message 'custom-loads '(ebdb-message))
 
+(defcustom ebdb-message-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in message-mode.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 (defcustom ebdb-message-reply-window-config
   '(reply
     (horizontal 1.0
                (message 1.0 point)
-               (ebdb-message 0.4)))
+               (ebdb-message ebdb-message-window-size)))
   "Message reply window configuration to show EBDB.
 See Gnus' manual for details."
   :group 'ebdb-mua-message
@@ -49,7 +56,7 @@ See Gnus' manual for details."
   '(reply-yank
      (horizontal 1.0
                 (message 1.0 point)
-                (ebdb-message 0.4)))
+                (ebdb-message ebdb-message-window-size)))
   "Message reply-yank window configuration to show EBDB.
 See Gnus' manual for details."
   :group 'ebdb-mua-message
@@ -85,10 +92,10 @@ See Gnus' manual for details."
   (message-field-value header))
 
 (cl-defmethod ebdb-popup-window (&context (major-mode message-mode))
-  (list (get-buffer-window) 0.4))
+  (list (get-buffer-window) ebdb-message-window-size))
 
 (cl-defmethod ebdb-popup-window (&context (major-mode mail-mode))
-  (list (get-buffer-window) 0.4))
+  (list (get-buffer-window) ebdb-message-window-size))
 
 (defun ebdb-message-complete-mail-cleanup (str _buffer pos &rest _)
   "Call `ebdb-complete-mail-cleanup' after capf completion."
diff --git a/ebdb-mhe.el b/ebdb-mhe.el
index 127eb71..0518b22 100644
--- a/ebdb-mhe.el
+++ b/ebdb-mhe.el
@@ -30,6 +30,16 @@
     (require 'mh-comp))              ; For mh-e 4.x
 (require 'advice)
 
+(defgroup ebdb-mua-mhe nil
+  "EBDB customizations for mhe."
+  :group 'ebdb-mua)
+
+(defcustom ebdb-mhe-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in mh-e.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 ;; A simplified `mail-fetch-field'.  We could use instead (like rmail):
 ;; (mail-header (intern-soft (downcase header)) (mail-header-extract))
 (defun ebdb/mh-header (header)
@@ -43,12 +53,11 @@ Returns the empty string if HEADER is not in the message."
     (cond ((not (re-search-forward header nil t)) "")
           ((looking-at "[\t ]*$") "")
           (t (re-search-forward "[ \t]*\\([^ \t\n].*\\)$" nil t)
-           (let ((start (match-beginning 1)))
-             (while (progn (forward-line 1)
-                           (looking-at "[ \t]")))
-             (backward-char 1)
-             (buffer-substring-no-properties start (point)))))))
-
+             (let ((start (match-beginning 1)))
+               (while (progn (forward-line 1)
+                             (looking-at "[ \t]")))
+               (backward-char 1)
+               (buffer-substring-no-properties start (point)))))))
 
 (cl-defmethod ebdb-make-buffer-name (&context (major-mode mhe-mode))
   "Produce a EBDB buffer name associated with mh-hmode."
@@ -62,8 +71,11 @@ Returns the empty string if HEADER is not in the message."
   "Produce a EBDB buffer name associated with mh-hmode."
   (format "*%s-MHE*" ebdb-buffer-name))
 
+(cl-defmethod ebdb-popup-buffer (&context (major-mode mhe-summary-mode))
+  (list (get-buffer-window) ebdb-mhe-window-size))
+
 (cl-defmethod ebdb-mua-message-header ((header string)
-                                  &context (major-mode mhe-mode))
+                                      &context (major-mode mhe-mode))
   (ebdb/mh-header header))
 
 (cl-defmethod ebdb-mua-message-header ((header string)
diff --git a/ebdb-mu4e.el b/ebdb-mu4e.el
index e7be16e..d08ab65 100644
--- a/ebdb-mu4e.el
+++ b/ebdb-mu4e.el
@@ -32,6 +32,16 @@
 (defvar mu4e-view-mode-map)
 (declare-function message-field-value "message")
 
+(defgroup ebdb-mua-mu4e nil
+  "Mu4e-specific EBDB customizations."
+  :group 'ebdb-mua)
+
+(defcustom ebdb-mu4e-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in mu4e.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 ;; Tackle `mu4e-headers-mode' later
 
 (cl-defmethod ebdb-mua-message-header ((header string)
@@ -43,6 +53,9 @@
   "Produce a EBDB buffer name associated with mu4e mode."
   (format "*%s-mu4e*" ebdb-buffer-name))
 
+(cl-defmethod ebdb-popup-window (&context (major-mode mu4e-view-mode))
+  (list (get-buffer-window) ebdb-mu4e-window-size))
+
 (defun ebdb-insinuate-mu4e ()
   "Hook EBDB into mu4e."
   ;; Tackle headers later
diff --git a/ebdb-rmail.el b/ebdb-rmail.el
index 25723db..927b2ef 100644
--- a/ebdb-rmail.el
+++ b/ebdb-rmail.el
@@ -29,6 +29,16 @@
 (require 'rmailsum)
 (require 'mailheader)
 
+(defgroup ebdb-mua-rmail nil
+  "EBDB customization for rmail."
+  :group 'ebdb-mua)
+
+(defcustom ebdb-rmail-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in rmail.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 (defun ebdb/rmail-new-flag ()
   "Returns t if the current message in buffer BUF is new."
   (rmail-message-labels-p rmail-current-message ", ?\\(unseen\\),"))
@@ -57,6 +67,9 @@
 (cl-defmethod ebdb-make-buffer-name (&context (major-mode rmail-summary-mode))
   (format "*%s-Rmail*" ebdb-buffer-name))
 
+(cl-defmethod ebdb-popup-buffer (&context (major-mode rmail-summary-mode))
+  (list (get-buffer-window) ebdb-rmail-window-size))
+
 (defun ebdb-insinuate-rmail ()
   "Hook EBDB into RMAIL."
   (define-key rmail-mode-map ";" ebdb-mua-keymap))
diff --git a/ebdb-wl.el b/ebdb-wl.el
index 6440f87..b5793d0 100644
--- a/ebdb-wl.el
+++ b/ebdb-wl.el
@@ -38,10 +38,16 @@
 (defvar wl-folder-buffer-name)
 (defvar wl-highlight-signature-separator)
 
-(defgroup ebdb-wl nil
+(defgroup ebdb-mua-wl nil
   "Options for EBDB's interaction with Wanderlust."
   :group 'ebdb-mua)
 
+(defcustom ebdb-wl-window-size ebdb-default-window-size
+  "Size of the EBDB buffer when popping up in Wanderlust.
+Size should be specified as a float between 0 and 1.  Defaults to
+the value of `ebdb-default-window-size'."
+  :type 'float)
+
 (cl-defmethod ebdb-mua-message-header ((header string)
                                       &context (major-mode mime-view-mode))
   "Extract a message header in Wanderlust."
@@ -68,7 +74,7 @@
   (format "*%s-Wl-Draft*" ebdb-buffer-name))
 
 (cl-defmethod ebdb-popup-window (&context (major-mode mime-view-mode))
-  (list (get-buffer-window) 0.3))
+  (list (get-buffer-window) ebdb-wl-window-size))
 
 (defsubst ebdb-wl-goto-signature (&optional beginning)
   "Goto the signature in the current message buffer.
diff --git a/ebdb.info b/ebdb.info
index 302c6bc..f6f9a3d 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -672,17 +672,21 @@ Windows::).
 
  -- User Option: ebdb-join-atomic-windows
      When non-nil (the default), EBDB buffers that are popped up within
-     existing atomic windows will become part of the atomic buffer.
+     existing atomic windows will become part of the atomic window.
      Otherwise they will be opened to one side of the atomic window.
 
  -- User Option: ebdb-default-window-size
      Set to a float between 0 and 1 to specify how much of an existing
      window the popped-up *EBDB* buffer should occupy.
 
-   At present, there are _no_ other user customization options
-controlling the layout of MUA pop-up buffers: each MUA creates the
-pop-up according to hard-coded rules.  This will likely change in the
-future: please complain to the author.
+   In addition, each MUA has its own customization option for
+controlling the window size of pop-up buffers.  Each option is named as
+‘ebdb-<MUA>-window-size’, and each defaults to
+‘ebdb-default-window-size’.
+
+   Beyond this, there are no other user customization options
+controlling the layout of MUA pop-up buffers.  Further customization
+will likely be added in the future: please complain to the author.
 
 
 File: ebdb.info,  Node: Auto-Updating Records,  Next: Noticing and Automatic 
Rules,  Prev: Pop-up Buffers,  Up: Display and Updating
@@ -2534,6 +2538,7 @@ File: ebdb.info,  Node: Index,  Prev: Hacking EBDB,  Up: 
Top
                                                               (line  13)
 * P:                                     The Basics of ebdb-mode.
                                                               (line  19)
+* Pop-up buffers:                        Pop-up Buffers.      (line   6)
 * q:                                     The Basics of ebdb-mode.
                                                               (line 124)
 * quit-window:                           The Basics of ebdb-mode.
@@ -2589,45 +2594,45 @@ Node: MUA Interaction20445
 Node: Loading MUA Code20998
 Node: Display and Updating21711
 Node: Pop-up Buffers22477
-Node: Auto-Updating Records24220
-Node: Noticing and Automatic Rules26620
-Node: Interactive Commands27953
-Node: EBDB and MUA summary buffers30428
-Node: Sender name display30946
-Node: Summary buffer marks32173
-Node: Mail Address Completion33352
-Node: A Note on Completion35861
-Node: Specific MUAs36484
-Node: Gnus36632
-Node: Posting Styles36854
-Node: EBDB Buffers38429
-Node: Searching39640
-Node: Changing Search Behavior41302
-Node: The Basics of ebdb-mode42549
-Node: Customizing Record Display46858
-Node: Marking51178
-Node: Exporting/Formatting51605
-Node: Completion52554
-Node: Snarfing53350
-Node: Internationalization55367
-Node: Diary Integration58068
-Node: Mail Aliases58933
-Node: vCard Support59647
-Node: Org Integration60146
-Node: Citing Records62044
-Node: Hacking EBDB62802
-Node: Field Classes65393
-Node: Init and Delete Methods68529
-Node: The Labeled Field Class70036
-Node: The Singleton Field Class70890
-Node: Actions71328
-Node: Custom Field Searching72000
-Node: Fast Lookups74867
-Node: Formatting in the EBDB Buffer76677
-Node: Writing Internationalization Libraries78753
-Node: Writing Integration For New MUAs83167
-Node: Article snarfing86615
-Node: Index87333
+Node: Auto-Updating Records24397
+Node: Noticing and Automatic Rules26797
+Node: Interactive Commands28130
+Node: EBDB and MUA summary buffers30605
+Node: Sender name display31123
+Node: Summary buffer marks32350
+Node: Mail Address Completion33529
+Node: A Note on Completion36038
+Node: Specific MUAs36661
+Node: Gnus36809
+Node: Posting Styles37031
+Node: EBDB Buffers38606
+Node: Searching39817
+Node: Changing Search Behavior41479
+Node: The Basics of ebdb-mode42726
+Node: Customizing Record Display47035
+Node: Marking51355
+Node: Exporting/Formatting51782
+Node: Completion52731
+Node: Snarfing53527
+Node: Internationalization55544
+Node: Diary Integration58245
+Node: Mail Aliases59110
+Node: vCard Support59824
+Node: Org Integration60323
+Node: Citing Records62221
+Node: Hacking EBDB62979
+Node: Field Classes65570
+Node: Init and Delete Methods68706
+Node: The Labeled Field Class70213
+Node: The Singleton Field Class71067
+Node: Actions71505
+Node: Custom Field Searching72177
+Node: Fast Lookups75044
+Node: Formatting in the EBDB Buffer76854
+Node: Writing Internationalization Libraries78930
+Node: Writing Integration For New MUAs83344
+Node: Article snarfing86792
+Node: Index87510
 
 End Tag Table
 
diff --git a/ebdb.org b/ebdb.org
index 818cebb..2acf332 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -455,6 +455,7 @@ the records referenced in that message. It can:
 Each of these functionalities is optional, and can be customized
 independently of the others.
 *** Pop-up Buffers
+#+CINDEX: Pop-up buffers
 Each MUA creates its own EBDB pop-up buffer, with a name like
 {{{buf(EBDB-Gnus)}}} or {{{buf(EBDB-Rmail)}}}.  MUAs will re-use their
 own buffers, and will not interfere with buffers the user has created
@@ -482,7 +483,7 @@ Windows,,,elisp}@@).
 #+ATTR_TEXINFO: :options ebdb-join-atomic-windows
 #+begin_defopt
 When non-nil (the default), EBDB buffers that are popped up within
-existing atomic windows will become part of the atomic buffer.
+existing atomic windows will become part of the atomic window.
 Otherwise they will be opened to one side of the atomic window.
 #+end_defopt
 
@@ -492,10 +493,14 @@ Set to a float between 0 and 1 to specify how much of an 
existing
 window the popped-up {{{buf(EBDB)}}} buffer should occupy.
 #+end_defopt
 
-At present, there are _no_ other user customization options
-controlling the layout of MUA pop-up buffers: each MUA creates the
-pop-up according to hard-coded rules.  This will likely change in the
-future: please complain to the author.
+In addition, each MUA has its own customization option for controlling
+the window size of pop-up buffers.  Each option is named as
+~ebdb-<MUA>-window-size~, and each defaults to
+~ebdb-default-window-size~.
+
+Beyond this, there are no other user customization options controlling
+the layout of MUA pop-up buffers.  Further customization will likely
+be added in the future: please complain to the author.
 *** Auto-Updating Records
 EBDB can automatically update the name and mail addresses of records
 based on information in an MUA message. The first and most important
diff --git a/ebdb.texi b/ebdb.texi
index b676273..0c35975 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -676,6 +676,7 @@ independently of the others.
 @node Pop-up Buffers
 @subsection Pop-up Buffers
 
+@cindex Pop-up buffers
 Each MUA creates its own EBDB pop-up buffer, with a name like
 *EBDB-Gnus* or *EBDB-Rmail*.  MUAs will re-use their
 own buffers, and will not interfere with buffers the user has created
@@ -700,7 +701,7 @@ Windows,,,elisp}).
 
 @defopt ebdb-join-atomic-windows
 When non-nil (the default), EBDB buffers that are popped up within
-existing atomic windows will become part of the atomic buffer.
+existing atomic windows will become part of the atomic window.
 Otherwise they will be opened to one side of the atomic window.
 @end defopt
 
@@ -709,10 +710,14 @@ Set to a float between 0 and 1 to specify how much of an 
existing
 window the popped-up *EBDB* buffer should occupy.
 @end defopt
 
-At present, there are _no_ other user customization options
-controlling the layout of MUA pop-up buffers: each MUA creates the
-pop-up according to hard-coded rules.  This will likely change in the
-future: please complain to the author.
+In addition, each MUA has its own customization option for controlling
+the window size of pop-up buffers.  Each option is named as
+@code{ebdb-<MUA>-window-size}, and each defaults to
+@code{ebdb-default-window-size}.
+
+Beyond this, there are no other user customization options controlling
+the layout of MUA pop-up buffers.  Further customization will likely
+be added in the future: please complain to the author.
 
 @node Auto-Updating Records
 @subsection Auto-Updating Records



reply via email to

[Prev in Thread] Current Thread [Next in Thread]