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

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

Re: Suppress user-prompting when calling commands in programs


From: Eric Abrahamsen
Subject: Re: Suppress user-prompting when calling commands in programs
Date: Sat, 14 Jun 2014 11:33:08 +0800
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4.50 (gnu/linux)

Drew Adams <address@hidden> writes:


[...]


> What's wrong with them pushing the read into the interactive spec?
>
> (defun foo (&optional arg bar)
>   (interactive (list current-prefix-arg
>                      (org-icompleting-read ...))))
>   ...)

A quick side-question: Everyone here is using &optional for the prefix
arg name. I have several functions lying around that use the "P"
interactive spec but don't specify arg as &optional, and seem to work
fine. My understanding is that, if there is no prefix arg, arg will
simply be nil, as it should be.

Apart from style/code clarity, are there other reasons for specifying
&optional?

Thanks,
E




reply via email to

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