From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kyle Meyer Subject: Re: [PATCH v2] org-sort: Read compare-func in interactive calls Date: Sun, 14 May 2017 09:45:08 -0400 Message-ID: <87fug7r1qz.fsf@kyleam.com> References: <871srz5mbr.fsf@kyleam.com> <20170509194750.8974-1-kyle@kyleam.com> <87tw4r12ww.fsf@nicolasgoaziou.fr> <8737cax2tm.fsf@kyleam.com> <87h90q1rf6.fsf@nicolasgoaziou.fr> <87lgq0retg.fsf@kyleam.com> <87shk7zw08.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9tpi-00049V-CH for emacs-orgmode@gnu.org; Sun, 14 May 2017 09:45:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9tpe-0005Ce-FV for emacs-orgmode@gnu.org; Sun, 14 May 2017 09:45:14 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:53617 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d9tpe-0005C7-9t for emacs-orgmode@gnu.org; Sun, 14 May 2017 09:45:10 -0400 In-Reply-To: <87shk7zw08.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: Nicolas Goaziou Cc: Zhitao Gong , emacs-orgmode@gnu.org Nicolas Goaziou writes: > Kyle Meyer writes: > >> I think (interactive "p"), or (interactive "P\np"), would be undesirable >> because we'd be 1) changing the call signatures in a way that's not >> backward compatible and 2) positioning an argument that shouldn't >> concern most users toward the front of the argument list. > > I don't understand this. Why would using (interactive "p") instead of > (interactive "P") would be incompatible? I misunderstood, thinking you wanted to add an additional argument rather than using (interactive "p") for WITH-CASE. > AFAIU, the only difference is how the argument value is treated within > the callee. Won't using a numeric prefix argument change the behavior for both interactive and Lisp calls? As examples, * M-1 M-x org-sort-list is currently interpreted as a non-nil value for WITH-CASE. Instead, it would be indistinguishable from M-x org-sort-list. * A Lisp caller can currently set WITH-CASE to any non-nil value. Using (interactive "p") for WITH-CASE, how do we distinguish a numeric argument passed for WITH-CASE from an interactive call? Using an additional argument whose only purpose is to serve as a interactive flag, which is what called-interactively-p's docstring suggests, avoids these issues. -- Kyle