From: "Drew Adams" <drew.adams@oracle.com>
To: "'Eli Zaretskii'" <eliz@gnu.org>, <help-gnu-emacs@gnu.org>
Subject: RE: Prefix-Arg (non-interactive!) in Info
Date: Fri, 13 Aug 2010 09:21:48 -0700 [thread overview]
Message-ID: <4F47505C2BAA45CC9C8AFE61D9F16B2A@us.oracle.com> (raw)
In-Reply-To: <837hjuv6jn.fsf@gnu.org>
> Let's try a different approach: which function would you like to call
> non-interactively, passing it some value of the prefix arg? (Please
> don't say "it's not important which function": my point is _precisely_
> that it _is_ important, because the answer to your question is
> specific to the function you want to invoke.)
>
> > What I did not find, was, how to pass this argument non
> > interactively - i.e. without `C-u' or M-4 - to a function.
>
> It depends on the function.
Eli's answers to you have been exactly correct. His point is that it is the
definition of the particular function that determines which argument is (or
uses) the prefix argument, and how. Any function can use the prefix argument
anyway it likes.
Consequently, if you want to pass a prefix arg to a function non-interactively
then you must know how that function definition handles the value you pass.
Does it look only at whether or not a raw prefix arg is present (nil vs
non-nil)? Does it look at the numeric value of the argument? Does it
distinguish a cons such as (4) from a numeric value such as 4? It is the
function that decides.
But perhaps you are writing your own function (that was not clear), and you want
to know how you can access the prefix argument and handle its possible values?
In any case, the relevant doc is node `Prefix Command Arguments' of the Elisp
manual. You can find it easily via `i prefix argument RET' (that is, using the
manual's index).
There you will find not only a complete description of the possible values but
also the variable `current-prefix-arg' and the function `prefix-numeric-value',
both of which can be useful in handling prefix-arg values.
next prev parent reply other threads:[~2010-08-13 16:21 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-13 14:37 Prefix-Arg (non-interactive!) in Info Memnon Anon
2010-08-13 15:17 ` Eli Zaretskii
2010-08-13 15:50 ` Memnon Anon
2010-08-13 16:09 ` Eli Zaretskii
2010-08-13 16:21 ` Drew Adams [this message]
2010-08-13 18:36 ` Memnon Anon
2010-08-13 20:33 ` Drew Adams
2010-08-13 17:04 ` Memnon Anon
2010-08-13 17:40 ` Andreas Röhler
2010-08-13 21:04 ` Memnon Anon
2010-08-13 19:33 ` Eli Zaretskii
2010-08-13 20:58 ` [Solved] (was: Prefix-Arg (non-interactive!) in Info) Memnon Anon
2010-08-14 8:05 ` Eli Zaretskii
2010-08-14 21:18 ` [Solved] Memnon Anon
2010-08-14 22:27 ` [Solved] Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F47505C2BAA45CC9C8AFE61D9F16B2A@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=eliz@gnu.org \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.