[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] scratch/el-mock 10c9fac555 07/64: ad-safe-fset is obsolete (rep
From: |
Stefan Monnier |
Subject: |
[nongnu] scratch/el-mock 10c9fac555 07/64: ad-safe-fset is obsolete (replaced by fset) |
Date: |
Mon, 28 Aug 2023 23:01:38 -0400 (EDT) |
branch: scratch/el-mock
commit 10c9fac555075e389aeb7b38297c50d93540abfe
Author: Damien Cassou <damien.cassou@gmail.com>
Commit: Damien Cassou <damien.cassou@gmail.com>
ad-safe-fset is obsolete (replaced by fset)
`ad-safe-fset` has been removed from Emacs. Looking at the corresponding
patch, it looks like all references to this function now use `fset`
directly:
http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01170.html.
I launched the espuds tests on emacs snapshot with this change to
`el-mock` and all tests passed (except the one talked about in issue
#23).
---
el-mock.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/el-mock.el b/el-mock.el
index f4d7896982..2b70c88daa 100644
--- a/el-mock.el
+++ b/el-mock.el
@@ -93,7 +93,7 @@
(lambda ()
(when (fboundp funcsym)
(put funcsym 'mock-original-func (symbol-function funcsym)))
- (ad-safe-fset funcsym `(lambda (&rest x) ,value)))))
+ (fset funcsym `(lambda (&rest x) ,value)))))
(defun stub/teardown (funcsym)
(mock-suppress-redefinition-message
@@ -101,7 +101,7 @@
(let ((func (get funcsym 'mock-original-func)))
(if (not func)
(fmakunbound funcsym)
- (ad-safe-fset funcsym func)
+ (fset funcsym func)
;; may be unadviced
)))))
@@ -113,7 +113,7 @@
(when (fboundp funcsym)
(put funcsym 'mock-original-func (symbol-function funcsym)))
(put funcsym 'mock-call-count 0)
- (ad-safe-fset funcsym
+ (fset funcsym
`(lambda (&rest actual-args)
(incf (get ',funcsym 'mock-call-count))
(add-to-list 'mock-verify-list
@@ -126,7 +126,7 @@
(let ()
(when (fboundp funcsym)
(put funcsym 'mock-original-func (symbol-function funcsym)))
- (ad-safe-fset funcsym
+ (fset funcsym
`(lambda (&rest actual-args)
(signal 'mock-error '(called))))))))
- [nongnu] branch scratch/el-mock created (now 80ded09125), Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 3ab575c661 01/64: first commit, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock e5ff8a688a 02/64: Add el-mock.el, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock bdcebf9f72 03/64: Add README note., Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock a99d6514a0 04/64: Add @rejeep as maintainer., Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 10c9fac555 07/64: ad-safe-fset is obsolete (replaced by fset),
Stefan Monnier <=
- [nongnu] scratch/el-mock 3069931de7 12/64: v1.25.1, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 24337b85e8 28/64: Preserve ERT backtrace, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 8afde8b145 05/64: Change URL., Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock bd129d9a63 08/64: Merge branch 'ad-safe-fset-obsolete', Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 718e821e9c 09/64: Release v1.25.0., Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 6d040af21e 10/64: Skip empty messages, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock b61b8f76a1 14/64: Remove how to save note, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 5ee1a1a5de 15/64: Move tests from el-mock.el, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock e349674b8a 18/64: Add LICENSE file, Stefan Monnier, 2023/08/28
- [nongnu] scratch/el-mock 8e9f1fbfec 31/64: Fix tests for Emacs 25.1, Stefan Monnier, 2023/08/28