>>>> "Vin" == Vin Shelton <acs(a)xemacs.org>
writes:
Vin> I'm trying to code an interactive function which I want to run under
Vin> both XEmacs and FSFmacs. I want this function to maintain the region,
Vin> so under XEmacs, I would use:
Vin> (interactive "_")
Vin> "_" is not a valid argument for (interactive) in FSFmacs, however,
so
Vin> how can I write this function?
Hi Vin,
following can be found in emacs-20.6\src\callint.c.
Another reason to use XEmacs? :-)
Hope this helps,
Adrian
/* This comment supplies the doc string for interactive,
for make-docfile to see. We cannot put this in the real DEFUN
due to limits in the Unix cpp.
DEFUN ("interactive", Ffoo, Sfoo, 0, 0, 0,
"Specify a way of parsing arguments for interactive use of a function.\n\
For example, write\n\
(defun foo (arg) \"Doc string\" (interactive \"p\") ...use
arg...)\n\
to make ARG be the prefix argument when `foo' is called as a command.\n\
The \"call\" to `interactive' is actually a declaration rather than a
function;\n\
it tells `call-interactively' how to read arguments\n\
to pass to the function.\n\
When actually called, `interactive' just returns nil.\n\
\n\
The argument of `interactive' is usually a string containing a code letter\n\
followed by a prompt. (Some code letters do not use I/O to get\n\
the argument and do not need prompts.) To prompt for multiple arguments,\n\
give a code letter, its prompt, a newline, and another code letter, etc.\n\
Prompts are passed to format, and may use % escapes to print the\n\
arguments that have already been read.\n\
If the argument is not a string, it is evaluated to get a list of\n\
arguments to pass to the function.\n\
Just `(interactive)' means pass no args when calling interactively.\n\
\nCode letters available are:\n\
a -- Function name: symbol with a function definition.\n\
b -- Name of existing buffer.\n\
B -- Name of buffer, possibly nonexistent.\n\
c -- Character (no input method is used).\n\
C -- Command name: symbol with interactive function definition.\n\
d -- Value of point as number. Does not do I/O.\n\
D -- Directory name.\n\
e -- Parametrized event (i.e., one that's a list) that invoked this command.\n\
If used more than once, the Nth `e' returns the Nth parameterized event.\n\
This skips events that are integers or symbols.\n\
f -- Existing file name.\n\
F -- Possibly nonexistent file name.\n\
i -- Ignored, i.e. always nil. Does not do I/O.\n\
k -- Key sequence (downcase the last event if needed to get a definition).\n\
K -- Key sequence to be redefined (do not downcase the last event).\n\
m -- Value of mark as number. Does not do I/O.\n\
M -- Any string. Inherits the current input method.\n\
n -- Number read using minibuffer.\n\
N -- Raw prefix arg, or if none, do like code `n'.\n\
p -- Prefix arg converted to number. Does not do I/O.\n\
P -- Prefix arg in raw form. Does not do I/O.\n\
r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.\n\
s -- Any string. Does not inherit the current input method.\n\
S -- Any symbol.\n\
v -- Variable name: symbol that is user-variable-p.\n\
x -- Lisp expression read but not evaluated.\n\
X -- Lisp expression read and evaluated.\n\
z -- Coding system.\n\
Z -- Coding system, nil if no prefix arg.\n\
In addition, if the string begins with `*'\n\
then an error is signaled if the buffer is read-only.\n\
This happens before reading any arguments.\n\
If the string begins with `@', then Emacs searches the key sequence\n\
which invoked the command for its first mouse click (or any other\n\
event which specifies a window), and selects that window before\n\
reading any arguments. You may use both `@' and `*'; they are\n\
processed in the order that they appear." */
/* ARGSUSED */
DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0,
0 /* See immediately above */)
(args)
Lisp_Object args;
{
return Qnil;
}
Vin> Thanks,
Vin> vin
Vin> --
Vin> In a minute there is time
Vin> For decisions and revisions which a minute will reverse. T.S. Eliot
Vin> [URL:
http://www.cs.amherst.edu/~ccm/prufrock.html]