From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Suppress user-prompting when calling commands in programs Date: Fri, 13 Jun 2014 14:55:36 -0400 Organization: A noiseless patient Spider Message-ID: References: <87r42skjd8.fsf@gmail.com> <877g4k7ux4.fsf@geodiff-mac3.ulb.ac.be> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1402686032 3516 80.91.229.3 (13 Jun 2014 19:00:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 13 Jun 2014 19:00:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jun 13 21:00:24 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WvWi7-00072M-M6 for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 21:00:23 +0200 Original-Received: from localhost ([::1]:60919 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvWi7-0003fm-72 for geh-help-gnu-emacs@m.gmane.org; Fri, 13 Jun 2014 15:00:23 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 26 Injection-Info: mx05.eternal-september.org; posting-host="bd19462299dd32dcc7fc179ab8a1ae48"; logging-data="10010"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+dnlM+uEY/RMyUEyT93WSo" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:J+KoDKvSigs5XhFhTVUbIRmR0kM= sha1:3AcKTeQddKEva1WDV0Eg44GLBVc= Original-Xref: usenet.stanford.edu gnu.emacs.help:205950 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98220 Archived-At: > 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