bbdb-user
[Top][All Lists]
Advanced

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

[BBDB] ChangeLog 2023-10-22 (support notmuch, increase version number)


From: Roland Winkler
Subject: [BBDB] ChangeLog 2023-10-22 (support notmuch, increase version number)
Date: Mon, 23 Oct 2023 09:10:02 -0500

I have installed a couple of patches for BBDB, most notably a patch by
Jao that adds support for the Notmuch mail user agent.

I am also attaching a yet uncommitted patch by Stefan (CC'ed) that
replaces the depreciated defadvice in the MH-E interface of BBDB with
advice-add.  Neither he nor I use MH-E.  So I'd appreciate if a brave
MH-E user wants to test the patch and let me know whether it works as
expected.

(Sam, your patch replacing mail-extract-address-components by
mail-header-parse-address is still missing.  I want to replace it by a
less invasive, more backward-compatible patch.)

diff --git a/lisp/bbdb-mhe.el b/lisp/bbdb-mhe.el
index e457a74e9d..2921d23d97 100644
--- a/lisp/bbdb-mhe.el
+++ b/lisp/bbdb-mhe.el
@@ -1,6 +1,6 @@
 ;;; bbdb-mhe.el --- BBDB interface to mh-e  -*- lexical-binding: t -*-
 
-;; Copyright (C) 2010-2022  Free Software Foundation, Inc.
+;; Copyright (C) 2010-2023  Free Software Foundation, Inc.
 
 ;; This file is part of the Insidious Big Brother Database (aka BBDB),
 
@@ -18,8 +18,8 @@
 ;; along with BBDB.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
-;;; This file contains the BBDB interface to mh-e.
-;;; See the BBDB info manual for documentation.
+;; This file contains the BBDB interface to mh-e.
+;; See the BBDB info manual for documentation.
 
 ;;; Code:
 
@@ -29,7 +29,6 @@
 (require 'mh-e)
 (if (fboundp 'mh-version)
     (require 'mh-comp))              ; For mh-e 4.x
-(require 'advice)
 
 ;; A simplified `mail-fetch-field'.  We could use instead (like rmail):
 ;; (mail-header (intern-soft (downcase header)) (mail-header-extract))
@@ -53,31 +52,33 @@ Returns the empty string if HEADER is not in the message."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Use BBDB for interactive spec of MH-E commands
 
-(defadvice mh-send (before mh-bbdb-send act)
+(advice-add 'mh-send              :before #'bbdb--mh-send)
+(advice-add 'mh-send-other-window :before #'bbdb--mh-send)
+(defun bbdb--mh-send (&rest _)
   (interactive
    (list (bbdb-completing-read-mails "To: ")
          (bbdb-completing-read-mails "Cc: ")
-         (read-string "Subject: "))))
+         (read-string "Subject: ")))
+  nil)
 
-(defadvice mh-send-other-window (before mh-bbdb-send-other act)
-  (interactive
-   (list (bbdb-completing-read-mails "To: ")
-         (bbdb-completing-read-mails "Cc: ")
-         (read-string "Subject: "))))
 
-(defadvice mh-forward (before mh-bbdb-forward act)
+(advice-add 'mh-forward :before #'bbdb--mh-forward)
+(defun bbdb--mh-forward (&rest _)
   (interactive
    (list (bbdb-completing-read-mails "To: ")
          (bbdb-completing-read-mails "Cc: ")
          (if current-prefix-arg
              (mh-read-seq-default "Forward" t)
-           (mh-get-msg-num t)))))
+           (mh-get-msg-num t))))
+  nil)
 
-(defadvice mh-redistribute (before mh-bbdb-redist act)
+(advice-add 'mh-redistribute :before #'bbdb--mh-redistribute)
+(defun bbdb--mh-redistribute (&rest _)
   (interactive
    (list (bbdb-completing-read-mails "Redist-To: ")
          (bbdb-completing-read-mails "Redist-Cc: ")
-         (mh-get-msg-num t))))
+         (mh-get-msg-num t)))
+  nil)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

reply via email to

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