help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: clear-kill-ring function


From: Emanuel Berg
Subject: Re: clear-kill-ring function
Date: Wed, 28 Oct 2015 03:14:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Sharon Kimble <boudiccas@skimble.plus.com> writes:

> (defun qdot/clear-kill-ring (interactive)
>
> I'm not sure what you mean or how to show it.
> Is that what you meant?

You put (interactive) after the parameter list (the
argument names), which is empty in your case so should
be the empty list, ().

An interactive function is a "command", which means
you can invoke it from M-x and also bind it to a key.

There are situations where you can have the same
function behave differently when called from Elisp
(i.e., invoked from another piece of code) compared to
when it is used interactively (again, with M-x or
a keystroke bound to that function) - however, as for
me, I don't see a great value in this distinction and
has only rarely used it. Perhaps someone who disagrees
will explain why it is there and what benefits
it brings.

Note that you can invoke non-interactive functions
with `eval-expr' (or `M-:') so it is not like they are
inaccessible to the "interactive" user. (They will
execute noninteractively still, of course.)

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]