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: Stefan Monnier
Subject: Re: Suppress user-prompting when calling commands in programs
Date: Fri, 13 Jun 2014 14:55:36 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> I tried convincing upstream before and never made it! And I actually
> understand the authors of code like that and even copied that technique
> sometimes, because it might be harder to write the interactive spec for
> both interactive and programmatical use than to write the function
> itself, and then there is no need for a wrapper command or interactive
> (lambda ...) expression when it comes to define a key for that command.

I don't know what complications you're referring to.

In 99% of the cases you can just turn

    (defun foo (&optional arg)
      (interactive "P")
      (let ((bar (org-icompleting-read ...)))))

into

    (defun foo (bar &optional arg)
      (interactive
       (list (org-icompleting-read ...) current-prefix-arg))

I'm not saying it's always perfect, but there's clearly some difference
between my experience and yours, so if you give some examples, it would help.


        Stefan


reply via email to

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