Skip to content

Instantly share code, notes, and snippets.

@masutaka
Created November 4, 2011 17:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save masutaka/1340000 to your computer and use it in GitHub Desktop.
Save masutaka/1340000 to your computer and use it in GitHub Desktop.
This is my note for buffer-local function
(defun foo ()
(interactive)
(message "this is a default message."))
(defadvice foo (around my-foo-wrapper)
(if (not (and (boundp 'use-my-foo) 'use-my-foo))
ad-do-it
(message "this is a special message.")))
(ad-activate 'foo)
;; in special buffer
(set (make-local-variable 'use-my-foo) t)
@masutaka
Copy link
Author

masutaka commented Nov 4, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment