In my .emacs
I have an expression of the form
(defadvice find-file ...)
...which modifies the behavior of the standard find-file
command.
There are times, however, when I want to bypass this customized behavior altogether, and run the original, unmodified, find-file
.
The only way I have found to do this is to comment-out the (defadvice find-file ...)
expression in my .emacs
file and start a fresh Emacs session. This is an extremely disruptive, not to mention heavy-handed, solution.
Is there a way to tell Emacs to run the original find-file
?
Alternatively, is there at least a way to rescind the defadvice
altogether for the remainder of the Emacs session?
EDIT:
An earlier attempt to try something like what PythonNut suggests in a comment failed because I could not figure out how to write a simple wrapper for find-file
. More specifically, I replaced the (defadvice find-file ...)
expression in my .emacs
file with
(defun my-find-file (&rest args)
(apply 'find-file args))
(global-set-key (kbd "C-x C-f") 'my-find-file)
(defadvice my-find-file ...)
...where the code shown as ...
in the new (defadvice my-find-file ...)
is identical to the ...
in the original (defadvice find-file ...)
.
If I start a new Emacs session with this new .emacs
file, and type C-x C-f
, I get the error message Wrong type argument: commandp, my-find-file
. It looks like my-find-file
is not an adequate wrapper for find-file
. (I posted a question specifically about this.)