aboutsummaryrefslogtreecommitdiff
path: root/Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise
diff options
context:
space:
mode:
Diffstat (limited to 'Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise')
-rw-r--r--Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise9
1 files changed, 9 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise b/Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise
new file mode 100644
index 0000000..2e74532
--- /dev/null
+++ b/Emacs/.config/emacs/.config/yasnippet/snippets/emacs-lisp-mode/advise
@@ -0,0 +1,9 @@
+# -*- mode: snippet -*-
+# name: advise function
+# key: adv
+# uuid: adv
+# --
+(defun ${3:adviser-name} (orig-fn &rest args)
+ ${4:}
+ (apply orig-fn args))
+(advice-add #'${1:function-name} ${2::around} #'${3:adviser-name}) \ No newline at end of file