emacs-devel
[Top][All Lists]
Advanced

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

Re: interactive?


From: alin.s
Subject: Re: interactive?
Date: Mon, 18 Jan 2010 06:03:52 -0800 (PST)


I see now. one can check whether an object is interactive using commandp.
For example, to check whether a lambda-expression is interactive, it does
exactly as we know: it checks the cadr after the argument list, and compare
with the symbol 'interactive, etc.

  /* Lists may represent commands.  */
  if (!CONSP (fun))
    return Qnil;
  funcar = XCAR (fun);
  if (EQ (funcar, Qlambda))
    return !NILP (Fassq (Qinteractive, Fcdr (XCDR (fun)))) ? Qt : if_prop;

And DEFUN(interactive) is Qnil means that if an object is defined
interactive, that means nothing unless checked using commandp.


This is what I did understand, thank you.






Andreas Schwab-2 wrote:
> 
> "alin.s" <address@hidden> writes:
> 
>> Where in the evaluator one makes the diff between interactive and
>> non-interactive?
> 
> commandp is a built-in function in `C source code'.
> 
> (commandp function &optional for-call-interactively)
> 
> Non-nil if function makes provisions for interactive calling.
> This means it contains a description for how to read arguments to give it.
> The value is nil for an invalid function or a symbol with no function
> definition.
> 
> Interactively callable functions include strings and vectors (treated
> as keyboard macros), lambda-expressions that contain a top-level call
> to `interactive', autoload definitions made by `autoload' with non-nil
> fourth argument, and some of the built-in functions of Lisp.
> 
> Also, a symbol satisfies `commandp' if its function definition does so.
> 
> If the optional argument for-call-interactively is non-nil,
> then strings and vectors are not accepted.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, address@hidden
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 
> 
> 
> 

-- 
View this message in context: 
http://old.nabble.com/interactive--tp27210523p27210930.html
Sent from the Emacs - Dev mailing list archive at Nabble.com.





reply via email to

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