How to delete a function?
For what I do I tend to define a lot of functions that I use temporarily. Life span is usually about 1-2 weeks - and then I define a new set of functions.
I was not able to find where these definitions actually are, nor how to delete them just by supplying a function name (which would be useful).
functions
add a comment |
For what I do I tend to define a lot of functions that I use temporarily. Life span is usually about 1-2 weeks - and then I define a new set of functions.
I was not able to find where these definitions actually are, nor how to delete them just by supplying a function name (which would be useful).
functions
3
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your.emacs
).
– Barmar
2 days ago
1
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago
add a comment |
For what I do I tend to define a lot of functions that I use temporarily. Life span is usually about 1-2 weeks - and then I define a new set of functions.
I was not able to find where these definitions actually are, nor how to delete them just by supplying a function name (which would be useful).
functions
For what I do I tend to define a lot of functions that I use temporarily. Life span is usually about 1-2 weeks - and then I define a new set of functions.
I was not able to find where these definitions actually are, nor how to delete them just by supplying a function name (which would be useful).
functions
functions
edited 2 days ago
Drew
46.9k462104
46.9k462104
asked Dec 27 at 14:17
A_P
547
547
3
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your.emacs
).
– Barmar
2 days ago
1
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago
add a comment |
3
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your.emacs
).
– Barmar
2 days ago
1
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago
3
3
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your
.emacs
).– Barmar
2 days ago
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your
.emacs
).– Barmar
2 days ago
1
1
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago
add a comment |
2 Answers
2
active
oldest
votes
In addition to removing the function definition with fmakunbound
and variable binding with makunbound
, you can also remove the name itself with unintern
.
Note also that, unless you save your definitions in a file (e.g., init file) and load it, your functions and variables will be gone when you restart Emacs.
add a comment |
Functions are unbound with:
(fmakunbound 'NAME)
(The equivalent for variables is makunbound
.)
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "583"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f46786%2fhow-to-delete-a-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
In addition to removing the function definition with fmakunbound
and variable binding with makunbound
, you can also remove the name itself with unintern
.
Note also that, unless you save your definitions in a file (e.g., init file) and load it, your functions and variables will be gone when you restart Emacs.
add a comment |
In addition to removing the function definition with fmakunbound
and variable binding with makunbound
, you can also remove the name itself with unintern
.
Note also that, unless you save your definitions in a file (e.g., init file) and load it, your functions and variables will be gone when you restart Emacs.
add a comment |
In addition to removing the function definition with fmakunbound
and variable binding with makunbound
, you can also remove the name itself with unintern
.
Note also that, unless you save your definitions in a file (e.g., init file) and load it, your functions and variables will be gone when you restart Emacs.
In addition to removing the function definition with fmakunbound
and variable binding with makunbound
, you can also remove the name itself with unintern
.
Note also that, unless you save your definitions in a file (e.g., init file) and load it, your functions and variables will be gone when you restart Emacs.
edited 11 hours ago
answered 2 days ago
sds
3,756826
3,756826
add a comment |
add a comment |
Functions are unbound with:
(fmakunbound 'NAME)
(The equivalent for variables is makunbound
.)
add a comment |
Functions are unbound with:
(fmakunbound 'NAME)
(The equivalent for variables is makunbound
.)
add a comment |
Functions are unbound with:
(fmakunbound 'NAME)
(The equivalent for variables is makunbound
.)
Functions are unbound with:
(fmakunbound 'NAME)
(The equivalent for variables is makunbound
.)
answered 2 days ago
phils
25.9k23566
25.9k23566
add a comment |
add a comment |
Thanks for contributing an answer to Emacs Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2femacs.stackexchange.com%2fquestions%2f46786%2fhow-to-delete-a-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
Why bother? They'll go away if and when you next restart Emacs (unless you're saving them in your
.emacs
).– Barmar
2 days ago
1
@Barmar. See, I didn't know that. My question got edited multiple times. What I do is to define a keyboard macro, save it as a functions, and bind it to a shortcut. Once I am done with what I do, usually define so more and rebind. But the function is still there if I press M-x. Hence the question. PS. I don't know a lot of Emacs internals so it might seem like an obvious question for some.
– A_P
2 days ago