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

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

[elpa] externals/ebdb f8d1802 2/2: Replace defadvice with advice-add


From: Eric Abrahamsen
Subject: [elpa] externals/ebdb f8d1802 2/2: Replace defadvice with advice-add
Date: Tue, 13 Jul 2021 16:40:12 -0400 (EDT)

branch: externals/ebdb
commit f8d1802eca9d970ebd3d4e73542fc75371a803f3
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Replace defadvice with advice-add
    
    * ebdb-mhe.el: Use newer advice convention.
---
 ebdb-mhe.el | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/ebdb-mhe.el b/ebdb-mhe.el
index aecc58e..9779061 100644
--- a/ebdb-mhe.el
+++ b/ebdb-mhe.el
@@ -107,31 +107,33 @@ Returns the empty string if HEADER is not in the message."
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Use EBDB for interactive spec of MH-E commands
 
-(defadvice mh-send (before mh-ebdb-send act)
+(advice-add 'mh-send :before #'ebdb--mh-send-completion)
+(defun ebdb--mh-send-completion (&rest _)
   (interactive
    (list (ebdb-completing-read-mails "To: ")
          (ebdb-completing-read-mails "Cc: ")
-         (read-string "Subject: "))))
+         (read-string "Subject: ")))
+  nil)
 
-(defadvice mh-send-other-window (before mh-ebdb-send-other act)
-  (interactive
-   (list (ebdb-completing-read-mails "To: ")
-         (ebdb-completing-read-mails "Cc: ")
-         (read-string "Subject: "))))
+(advice-add 'mh-send-other-window :before #'ebdb--mh-send-completion)
 
-(defadvice mh-forward (before mh-ebdb-forward act)
+(advice-add 'mh-forward :before #'ebdb--mh-forward-completion)
+(defun ebdb--mh-forward-completion (&rest _)
   (interactive
    (list (ebdb-completing-read-mails "To: ")
          (ebdb-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-ebdb-redist act)
+(advice-add 'mh-redistribute :before #'ebdb--mh-redistribute-completion)
+(defun ebdb--mh-redistribute-completion (&rest _)
   (interactive
    (list (ebdb-completing-read-mails "Redist-To: ")
          (ebdb-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]