[Top][All Lists]

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

Re: [PATCH] Make `smtpmail-try-auth-method' a generic function.

From: Cesar Crusius
Subject: Re: [PATCH] Make `smtpmail-try-auth-method' a generic function.
Date: Thu, 11 Jan 2018 13:36:22 -0800
User-agent: mu4e 0.9.18; emacs

On Thu 11 Jan 2018 at 19:33, Stefan Monnier wrote:

>> That will need an upcoming 'auth-source-xoauth2' package, as getting the
>> password involves doing some HTTP fetching. I have the code, just need
>> to find some time to add it to MELPA.
> BTW, your library can still work with Emacs-26 (and even Emacs-25) using
> a hack like:
>     (unless (cl-generic-p 'smtpmail-try-auth-method)
>       (let ((f (symbol-function 'smtpmail-try-auth-method)))
>         (fset 'smtpmail-try-auth-method nil)
>         (cl-generic-define-method 'smtpmail-try-auth-method nil
>                                   '(process mech user password)
>                                   nil f)))
> which turns the "regular function" smtpmail-try-auth-method into
> a "generic function".

Yes - and it can also work with Emacs-24 by advising the function
instead, which is probably what I'm going to do: if the cl-* functions
are there, and smtpmail is one, specialize it, otherwise advise it.

Cesar Crusius

Attachment: signature.asc
Description: PGP signature

reply via email to

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