[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ebdb 5b044ca 2/6: More complete support for Wanderlust
From: |
Eric Abrahamsen |
Subject: |
[elpa] externals/ebdb 5b044ca 2/6: More complete support for Wanderlust MUA |
Date: |
Sun, 8 Oct 2017 17:54:11 -0400 (EDT) |
branch: externals/ebdb
commit 5b044ca04193d3ed1021f94b4cfd386766893638
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>
More complete support for Wanderlust MUA
* ebdb-wl.el (ebdb-mua-prepare-article, ebdb-mua-article-body,
ebdb-mua-article-signature): Implement these methods.
(ebdb-wl-quit-window): New function added to `wl-summary-exit-hook',
for quitting the EBDB buffer when returning to the folder buffer.
* ebdb.org
* ebdb.texi
* ebdb.info: Mention support in docs.
---
ebdb-wl.el | 52 +++++++++++++++++++++++++++++++++++++++++----
ebdb.info | 72 +++++++++++++++++++++++++++++++-------------------------------
ebdb.org | 2 +-
ebdb.texi | 2 +-
4 files changed, 86 insertions(+), 42 deletions(-)
diff --git a/ebdb-wl.el b/ebdb-wl.el
index c29d5f8..1bd55f6 100644
--- a/ebdb-wl.el
+++ b/ebdb-wl.el
@@ -59,23 +59,67 @@
(wl-summary-message-number)))
(intern (downcase header)) 'string))
+(cl-defmethod ebdb-mua-prepare-article (&context (major-mode wl-summary-mode))
+ (wl-summary-set-message-buffer-or-redisplay))
+
(cl-defmethod ebdb-make-buffer-name (&context (major-mode mime-view-mode))
- (format "*%s-Wl" ebdb-buffer-name))
+ (format "*%s-Wl*" ebdb-buffer-name))
(cl-defmethod ebdb-make-buffer-name (&context (major-mode wl-summary-mode))
- (format "*%s-Wl" ebdb-buffer-name))
+ (format "*%s-Wl*" ebdb-buffer-name))
+
+(cl-defmethod ebdb-make-buffer-name (&context (major-mode wl-folder-mode))
+ (format "*%s-Wl*" ebdb-buffer-name))
(cl-defmethod ebdb-make-buffer-name (&context (major-mode wl-draft-mode))
- (format "*%s-Wl-Draft" ebdb-buffer-name))
+ (format "*%s-Wl-Draft*" ebdb-buffer-name))
(cl-defmethod ebdb-popup-window (&context (major-mode mime-view-mode))
(list (get-buffer-window) 0.3))
+(defsubst ebdb-wl-goto-signature (&optional beginning)
+ "Goto the signature in the current message buffer.
+Leaves point at the end (or, with non-nil BEGINNING, the
+beginning) of the signature separator."
+ (re-search-forward
+ (mapconcat
+ #'identity
+ (cons "\n==+\n" wl-highlight-signature-separator)
+ "\\|")
+ (point-max) t)
+ (when beginning
+ (goto-char (match-beginning 0)))
+ (point))
+
+(cl-defmethod ebdb-mua-article-body (&context (major-mode wl-summary-mode))
+ (with-current-buffer wl-message-buffer
+ (when (re-search-forward "^$" (point-max) t)
+ (buffer-substring-no-properties
+ (point)
+ (or (ebdb-wl-goto-signature t)
+ (point-max))))))
+
+(cl-defmethod ebdb-mua-article-signature (&context (major-mode
wl-summary-mode))
+ (with-current-buffer wl-message-buffer
+ (when (re-search-forward "^$" (point-max) t)
+ (or (and (ebdb-wl-goto-signature)
+ (buffer-substring-no-properties (point) (point-max)))
+ ""))))
+
+(defun ebdb-wl-quit-window ()
+ "Quit EBDB window when quitting WL summary buffer."
+ ;; This runs in a hook, which are run in no buffer: we need to be in
+ ;; a WL buffer in order to get back the correct EBDB buffer name.
+ (with-current-buffer wl-folder-buffer-name
+ (when-let* ((win (get-buffer-window (ebdb-make-buffer-name))))
+ (quit-window nil win))))
+
(defun ebdb-insinuate-wl ()
"Hook EBDB into Wanderlust."
(define-key wl-summary-mode-map ";" ebdb-mua-keymap)
(when ebdb-wl-use-ebdb-completion
- (define-key wl-draft-mode-map (kbd "TAB") #'ebdb-complete-mail)))
+ (define-key wl-draft-mode-map (kbd "TAB") #'ebdb-complete-mail))
+ (add-hook 'wl-summary-exit-hook #'ebdb-wl-quit-window))
(add-hook 'wl-folder-mode-hook #'ebdb-insinuate-wl)
diff --git a/ebdb.info b/ebdb.info
index 9090bc0..dbfa57d 100644
--- a/ebdb.info
+++ b/ebdb.info
@@ -548,7 +548,7 @@ mail, and Message for sending it, you’ll want two require
statements:
There are other packages that provide other MUA integration: these
are likewise activated simply by requiring the relevant library, named
“ebdb-<MUA>”. MUAs supported by EBDB include gnus, message, mh-e, mu4e,
-and rmail.
+wl, and rmail.
File: ebdb.info, Node: Display and Updating, Next: EBDB and MUA summary
buffers, Prev: Loading MUA Code, Up: MUA Interaction
@@ -2202,41 +2202,41 @@ Node: Tag field16411
Node: Mail folder field17055
Node: MUA Interaction17383
Node: Loading MUA Code17907
-Node: Display and Updating18616
-Node: Pop-up Buffers19382
-Node: Auto-Updating Records20220
-Node: Noticing and Automatic Rules22620
-Node: Interactive Commands23953
-Node: EBDB and MUA summary buffers26315
-Node: Sender name display26801
-Node: Summary buffer marks28028
-Node: EBDB Buffers29207
-Node: Searching30389
-Node: Changing Search Behavior32051
-Node: The Basics of ebdb-mode33298
-Node: Marking36899
-Node: Exporting/Formatting37323
-Node: Completion38272
-Node: Snarfing39470
-Node: Internationalization41471
-Node: Diary Integration44170
-Node: Mail Aliases45035
-Node: vCard Support45749
-Node: Org Integration46248
-Node: Citing Records48146
-Node: Hacking EBDB48904
-Node: Field Classes51223
-Node: Init and Delete Methods54207
-Node: The Labeled Field Class55714
-Node: The Singleton Field Class56568
-Node: Actions57006
-Node: Custom Field Searching57678
-Node: Fast Lookups60482
-Node: Formatting in the EBDB Buffer62292
-Node: Writing Internationalization Libraries64305
-Node: Writing Integration For New MUAs68656
-Node: Article snarfing72075
-Node: Index72793
+Node: Display and Updating18620
+Node: Pop-up Buffers19386
+Node: Auto-Updating Records20224
+Node: Noticing and Automatic Rules22624
+Node: Interactive Commands23957
+Node: EBDB and MUA summary buffers26319
+Node: Sender name display26805
+Node: Summary buffer marks28032
+Node: EBDB Buffers29211
+Node: Searching30393
+Node: Changing Search Behavior32055
+Node: The Basics of ebdb-mode33302
+Node: Marking36903
+Node: Exporting/Formatting37327
+Node: Completion38276
+Node: Snarfing39474
+Node: Internationalization41475
+Node: Diary Integration44174
+Node: Mail Aliases45039
+Node: vCard Support45753
+Node: Org Integration46252
+Node: Citing Records48150
+Node: Hacking EBDB48908
+Node: Field Classes51227
+Node: Init and Delete Methods54211
+Node: The Labeled Field Class55718
+Node: The Singleton Field Class56572
+Node: Actions57010
+Node: Custom Field Searching57682
+Node: Fast Lookups60486
+Node: Formatting in the EBDB Buffer62296
+Node: Writing Internationalization Libraries64309
+Node: Writing Integration For New MUAs68660
+Node: Article snarfing72079
+Node: Index72797
End Tag Table
diff --git a/ebdb.org b/ebdb.org
index 53e2f01..1bf3adb 100644
--- a/ebdb.org
+++ b/ebdb.org
@@ -384,7 +384,7 @@ mail, and Message for sending it, you'll want two require
statements:
There are other packages that provide other MUA integration: these are
likewise activated simply by requiring the relevant library, named
"ebdb-<MUA>". MUAs supported by EBDB include gnus, message, mh-e,
-mu4e, and rmail.
+mu4e, wl, and rmail.
** Display and Updating
#+CINDEX: MUA Display
diff --git a/ebdb.texi b/ebdb.texi
index 8a765be..41ee491 100644
--- a/ebdb.texi
+++ b/ebdb.texi
@@ -572,7 +572,7 @@ mail, and Message for sending it, you'll want two require
statements:
There are other packages that provide other MUA integration: these are
likewise activated simply by requiring the relevant library, named
``ebdb-<MUA>''. MUAs supported by EBDB include gnus, message, mh-e,
-mu4e, and rmail.
+mu4e, wl, and rmail.
@node Display and Updating
@section Display and Updating
- [elpa] externals/ebdb updated (91d73f8 -> b0029d3), Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 6267cf7 3/6: Refine passport field string output, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb ebfec5d 1/6: Add support for Wanderlust MUA, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 5b044ca 2/6: More complete support for Wanderlust MUA,
Eric Abrahamsen <=
- [elpa] externals/ebdb 067ab28 5/6: More autoloads and defvars for ebdb-wl, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb 894643d 4/6: Don't use either variant of when-let and if-let, Eric Abrahamsen, 2017/10/08
- [elpa] externals/ebdb b0029d3 6/6: Bump to version 0.3.4, Eric Abrahamsen, 2017/10/08