From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Add an optional HOLD argument to "n" Org macro Date: Wed, 14 Jun 2017 21:47:28 +0200 Message-ID: <8760fyic6n.fsf@nicolasgoaziou.fr> References: <2ee94a64a94b46259b0da6e7d34675c9@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87y3u7o3dj.fsf@t3610> <87pofjtk4b.fsf@t3610> <2069df8c23bc43f3b04b6e203b96be9d@HE1PR01MB1898.eurprd01.prod.exchangelabs.com> <87r2zvpyst.fsf@delle7240> <8760guib5i.fsf@nicolasgoaziou.fr> <87fuftb4lg.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53873) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dLEGM-0000Na-GJ for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 15:47:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dLEGJ-0008G8-Di for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 15:47:34 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:45941) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dLEGJ-0008Fy-7Z for emacs-orgmode@gnu.org; Wed, 14 Jun 2017 15:47:31 -0400 In-Reply-To: (Kaushal Modi's message of "Wed, 14 Jun 2017 18:33:50 +0000") 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: Kaushal Modi Cc: emacs-orgmode@gnu.org Kaushal Modi writes: > I was writing something along the lines of this when I needed to specify > the n macro to hold its previous value and not increment at all. [...] > I haven't yet created a proper formatted patch, because I don't know if > this is the best implementation. Would it be better to rename the RESET > option to something more generic, like ARG? That way, > > - If ARG is a "-" string, the counter value will be held and not > incremented. > - If ARG is a number represented as a string, it set the NAME counter to > that value (like now). > - Else if ARG is a non-empty string, it resets the NAME counter to 1 (like > now). I think it is better since resetting, setting and holding are mutually exclusive. With tests, please! :) Regards,