From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-sort: Read compare-func in interactive calls Date: Thu, 11 May 2017 23:47:43 +0200 Message-ID: <87tw4r12ww.fsf@nicolasgoaziou.fr> References: <871srz5mbr.fsf@kyleam.com> <20170509194750.8974-1-kyle@kyleam.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46224) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d8vw9-0003Na-Oj for emacs-orgmode@gnu.org; Thu, 11 May 2017 17:47:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d8vw4-00006i-Lc for emacs-orgmode@gnu.org; Thu, 11 May 2017 17:47:53 -0400 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:40919) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1d8vw4-00006X-FO for emacs-orgmode@gnu.org; Thu, 11 May 2017 17:47:48 -0400 In-Reply-To: <20170509194750.8974-1-kyle@kyleam.com> (Kyle Meyer's message of "Tue, 9 May 2017 15:47:50 -0400") 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: Kyle Meyer Cc: Zhitao Gong , emacs-orgmode@gnu.org Hello, Kyle Meyer writes: > * lisp/org-macs.el (org-read-function): New function. > * lisp/org.el (org-sort-entries): > * lisp/org-table.el (org-table-sort-lines): > * lisp/org-list.el (org-sort-list): Read COMPARE-FUNC when called > interactively rather than being restricted to the default behavior of > sort-subr's PREDICATE parameter. Guard prompts for GETKEY-FUNC and > COMPARE-FUNCTION with called-interactively-p, like > org-table-sort-lines already did for GETKEY-FUNC. Thank you. I have but one comment. > + (sort-func > + (cond > + ((= dcst ?a) #'string<) > + ((= dcst ?f) > + (or compare-func > + (and (called-interactively-p 'any) The above should be avoided. See `called-interactively-p' docstring. The same applies in other places. Regards, -- Nicolas Goaziou