unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr
@ 2014-01-27 20:32 Tomi Ollila
  2014-01-28 21:28 ` Mark Walters
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Tomi Ollila @ 2014-01-27 20:32 UTC (permalink / raw)
  To: notmuch; +Cc: tomi.ollila

Imitated from "Enabling advice" in Emacs lisp manual...

ad-disable-advice by itself only changes the enable flag for a
piece of advice. To make the change take effect in the
advised definition, the advice needs to be activated again.
---
 emacs/notmuch-lib.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index e6e9f97..fa35fa9 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -531,7 +531,8 @@ the given type."
 (if (>= emacs-major-version 24)
     (defadvice mm-shr (before load-gnus-arts activate)
       (require 'gnus-art nil t)
-      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)))
+      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
+      (ad-activate 'mm-shr)))
 
 (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)
   "Use the mm-decode/mm-view functions to display a part in the
-- 
1.8.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr
  2014-01-27 20:32 [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr Tomi Ollila
@ 2014-01-28 21:28 ` Mark Walters
  2014-01-28 22:35 ` Austin Clements
  2014-02-02  2:32 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: Mark Walters @ 2014-01-28 21:28 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila


Hi

This LGTM (but untested)


Best wishes

Mark

On Mon, 27 Jan 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> Imitated from "Enabling advice" in Emacs lisp manual...
>
> ad-disable-advice by itself only changes the enable flag for a
> piece of advice. To make the change take effect in the
> advised definition, the advice needs to be activated again.
> ---
>  emacs/notmuch-lib.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index e6e9f97..fa35fa9 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -531,7 +531,8 @@ the given type."
>  (if (>= emacs-major-version 24)
>      (defadvice mm-shr (before load-gnus-arts activate)
>        (require 'gnus-art nil t)
> -      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)))
> +      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
> +      (ad-activate 'mm-shr)))
>  
>  (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)
>    "Use the mm-decode/mm-view functions to display a part in the
> -- 
> 1.8.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr
  2014-01-27 20:32 [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr Tomi Ollila
  2014-01-28 21:28 ` Mark Walters
@ 2014-01-28 22:35 ` Austin Clements
  2014-02-02  2:32 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: Austin Clements @ 2014-01-28 22:35 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

On Mon, 27 Jan 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:
> Imitated from "Enabling advice" in Emacs lisp manual...
>
> ad-disable-advice by itself only changes the enable flag for a
> piece of advice. To make the change take effect in the
> advised definition, the advice needs to be activated again.

Oops, looks like this was my fault.

This fix LGTM.

> ---
>  emacs/notmuch-lib.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
> index e6e9f97..fa35fa9 100644
> --- a/emacs/notmuch-lib.el
> +++ b/emacs/notmuch-lib.el
> @@ -531,7 +531,8 @@ the given type."
>  (if (>= emacs-major-version 24)
>      (defadvice mm-shr (before load-gnus-arts activate)
>        (require 'gnus-art nil t)
> -      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)))
> +      (ad-disable-advice 'mm-shr 'before 'load-gnus-arts)
> +      (ad-activate 'mm-shr)))
>  
>  (defun notmuch-mm-display-part-inline (msg part nth content-type process-crypto)
>    "Use the mm-decode/mm-view functions to display a part in the
> -- 
> 1.8.0
>
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr
  2014-01-27 20:32 [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr Tomi Ollila
  2014-01-28 21:28 ` Mark Walters
  2014-01-28 22:35 ` Austin Clements
@ 2014-02-02  2:32 ` David Bremner
  2 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2014-02-02  2:32 UTC (permalink / raw)
  To: Tomi Ollila, notmuch; +Cc: tomi.ollila

Tomi Ollila <tomi.ollila@iki.fi> writes:

> Imitated from "Enabling advice" in Emacs lisp manual...
>
> ad-disable-advice by itself only changes the enable flag for a
> piece of advice. To make the change take effect in the
> advised definition, the advice needs to be activated again.

pushed

d

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-02-02  2:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-01-27 20:32 [PATCH 1/1] emacs: ad-activate 'mm-shr after ad-disable-advice 'mm-shr Tomi Ollila
2014-01-28 21:28 ` Mark Walters
2014-01-28 22:35 ` Austin Clements
2014-02-02  2:32 ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).