[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/nadvice 6d4e090 6/9: packages/nadvice: Fix advice-remov
From: |
Stefan Monnier |
Subject: |
[elpa] externals/nadvice 6d4e090 6/9: packages/nadvice: Fix advice-remove behaviour |
Date: |
Tue, 1 Dec 2020 16:29:05 -0500 (EST) |
branch: externals/nadvice
commit 6d4e090e7f569c66fa522d81e31c5065ef42b403
Author: Thomas Fitzsimmons <fitzsim@fitzsim.org>
Commit: Thomas Fitzsimmons <fitzsim@fitzsim.org>
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.
---
nadvice.el | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/nadvice.el b/nadvice.el
index 853f748..b4eec86 100644
--- a/nadvice.el
+++ b/nadvice.el
@@ -3,7 +3,7 @@
;; Copyright (C) 2018 Free Software Foundation, Inc.
;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
-;; 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)))
)
- [elpa] branch externals/nadvice created (now 2114e1c), Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice cc671ee 4/9: * nadvice.el: Fix typo, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 6d4e090 6/9: packages/nadvice: Fix advice-remove behaviour,
Stefan Monnier <=
- [elpa] externals/nadvice 2114e1c 9/9: * .gitignore: New file, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 2b0e882 1/9: * nadvice: New forward compatibility package, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 7233212 2/9: * nadvice.el: Fix copyright!, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice bc27bdd 3/9: * nadvice/nadvice.el (advice-add): Add support for :override, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 040b27d 5/9: * nadvice.el: ad-remove-advice is not autoloaded, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 1bfa920 7/9: * nadvice/nadvice.el: Silence fewer errors, Stefan Monnier, 2020/12/01
- [elpa] externals/nadvice 184fdad 8/9: * nadvice/nadvice.el (advice): Require during byte-compilation, Stefan Monnier, 2020/12/01