[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 61ad720: packages/nadvice: Fix advice-remove behaviour
From: |
Thomas Fitzsimmons |
Subject: |
[elpa] master 61ad720: packages/nadvice: Fix advice-remove behaviour |
Date: |
Sat, 15 Sep 2018 19:36:23 -0400 (EDT) |
branch: master
commit 61ad7207d791f195a831ee5207902af9e4101463
Author: Thomas Fitzsimmons <address@hidden>
Commit: Thomas Fitzsimmons <address@hidden>
packages/nadvice: Fix advice-remove behaviour
* packages/nadvice/nadvice.el: Bump version to 0.3.
(advice-remove): Do not signal an error if the function already
has no advice.
---
packages/nadvice/nadvice.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/packages/nadvice/nadvice.el b/packages/nadvice/nadvice.el
index 853f748..b4eec86 100644
--- a/packages/nadvice/nadvice.el
+++ b/packages/nadvice/nadvice.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2018 Free Software Foundation, Inc.
;; Author: Stefan Monnier <address@hidden>
-;; Version: 0.2
+;; Version: 0.3
;; Keywords:
;; This program is free software; you can redistribute it and/or modify
@@ -77,8 +77,14 @@
;;;###autoload
(defun advice-remove (symbol function)
- (ad-remove-advice symbol 'around function)
- (ad-activate symbol))
+ ;; Just return nil if there is no advice, rather than signaling an
+ ;; error.
+ (condition-case nil
+ (ad-remove-advice symbol 'around function)
+ (error nil))
+ (condition-case nil
+ (ad-activate symbol)
+ (error nil)))
)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [elpa] master 61ad720: packages/nadvice: Fix advice-remove behaviour,
Thomas Fitzsimmons <=