[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] scratch/yasnippet 009322196c 6/9: * yasnippet-debug.el: Use `advi
From: |
Stefan Monnier |
Subject: |
[elpa] scratch/yasnippet 009322196c 6/9: * yasnippet-debug.el: Use `advice-add` i.s.o `defadvice`. |
Date: |
Tue, 17 Oct 2023 11:20:20 -0400 (EDT) |
branch: scratch/yasnippet
commit 009322196cfaaff55272bbd341c03f6c5facf83e
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
* yasnippet-debug.el: Use `advice-add` i.s.o `defadvice`.
Now that we use `add-function`, we may as well avoid using the deprecated
`defadvice`
(cl-flet): Remove confusing `cl-flet` fallback, always provided by `cl-lib`.
(yas--snippet-parse-create, yas--commit-snippet):
Use `advice-add` i.s.o `defadvice`.
---
yasnippet-debug.el | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/yasnippet-debug.el b/yasnippet-debug.el
index d33e8a5f6f..798c7ce263 100644
--- a/yasnippet-debug.el
+++ b/yasnippet-debug.el
@@ -1,6 +1,6 @@
;;; yasnippet-debug.el --- debug functions for yasnippet -*- lexical-binding:
t -*-
-;; Copyright (C) 2010, 2013-2014, 2017-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2010-2023 Free Software Foundation, Inc.
;; Author: João Távora
;; Keywords: emulations, convenience
@@ -40,9 +40,6 @@
;; Don't require '-L <path>' when debugging.
(expand-file-name "yasnippet" yas--loaddir)))
(require 'cl-lib)
-(eval-when-compile
- (unless (fboundp 'cl-flet)
- (defalias 'cl-flet 'flet)))
(require 'color nil t)
(require 'edebug)
(eval-when-compile
@@ -224,13 +221,15 @@
(setq yas-debug-undo value)
(yas--message 3 "debug undo %sabled" (if yas-debug-undo "en" "dis")))
-(defadvice yas--snippet-parse-create (before yas-debug-target-snippet
(snippet))
+(advice-add 'yas--snippet-parse-create :before #'yas-debug--target-snippet)
+(defun yas-debug--target-snippet (snippet)
(add-to-list 'yas-debug-target-snippets snippet))
-(defadvice yas--commit-snippet (after yas-debug-untarget-snippet (snippet))
+(advice-add 'yas--commit-snippet :after #'yas-debug--untarget-snippet)
+(defun yas-debug--untarget-snippet (snippet)
(setq yas-debug-target-snippets
(remq snippet yas-debug-target-snippets))
- (maphash (lambda (k color-ov)
+ (maphash (lambda (_k color-ov)
(delete-overlay (cdr color-ov)))
yas-debug-live-indicators)
(clrhash yas-debug-live-indicators))
- [elpa] branch scratch/yasnippet created (now 52a1c50319), Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 946b27ddca 1/9: * .gitignore: Add patterns for ELPA-generated files, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 009322196c 6/9: * yasnippet-debug.el: Use `advice-add` i.s.o `defadvice`.,
Stefan Monnier <=
- [elpa] scratch/yasnippet 043c52a5a9 7/9: * yasnippet.el (yas-minor-mode-map): Don't bind to `tab`, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 97002af846 4/9: * yasnippet.el: Use `lexical-binding`, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet e991530108 5/9: * yasnippet.el: Use `add-function` and remove left-over debug code, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 6e4de312cf 2/9: * doc/yas-doc-helper.el: Use `cl-lib` and `lexical-binding`, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet b09ab98419 3/9: * yasnippet-tests.el: Minor cosmetic changes, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 58c92ba393 8/9: * yasnippet.el: Cosmetic changes, Stefan Monnier, 2023/10/17
- [elpa] scratch/yasnippet 52a1c50319 9/9: * yasnippet.el (debug-ignored-errors): Don't modify it, Stefan Monnier, 2023/10/17