Created
April 17, 2015 06:29
-
-
Save xuchunyang/eb9cf96cf11faa4793db to your computer and use it in GitHub Desktop.
elisp-advice-function.el
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; Advice Functions | |
(defun my-tracing-function (orig-fun &rest args) | |
"My tracing functions." | |
;; (message "Old buffer name" (buffer-name)) | |
(message "ace-window called with args %S" args) | |
(let ((res (apply orig-fun args))) | |
(message "ace-window returned %S" res) | |
res)) | |
;;; Higher | |
(advice-add 'ace-window :around #'my-tracing-function) | |
(advice-remove 'ace-window #'my-tracing-function) | |
;;; Lower | |
(add-function :around (symbol-function 'ace-window) #'my-tracing-function) | |
(remove-function (symbol-function 'ace-window) #'my-tracing-function) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment