From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kaushal Modi Subject: Re: [PATCH] Refactor org-set-tags arguments for clarity Date: Thu, 13 Jul 2017 10:18:25 +0000 Message-ID: References: <87pod4zs9i.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a1141123078a677055430418b" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59134) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVbDi-0005B2-NV for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 06:19:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVbDe-00084j-Nr for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 06:19:42 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:34696) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVbDe-00084J-Fd for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 06:19:38 -0400 Received: by mail-lf0-f43.google.com with SMTP id t72so34004022lff.1 for ; Thu, 13 Jul 2017 03:19:38 -0700 (PDT) In-Reply-To: <87pod4zs9i.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: emacs-org list --001a1141123078a677055430418b Content-Type: text/plain; charset="UTF-8" On Thu, Jul 13, 2017, 3:54 AM Nicolas Goaziou wrote: > Thank you. LGTM! > Thanks. Actually, I think ALIGN-ONLY-CURRENT could be merged with JUST-ALIGN, > which would have three cases (e.g., t, nil, `current'). Perhaps the > incompatibility it introduces is not acceptable though. > I was itching to do that. But there are dozens of (org-set-tags nil t) instances in the Org source itself. I though just created a wrapper in my personal config to do ALIGN-ONLY-CURRENT when prefix is C-u C-u. I can do the same in the source too, while keeping the argument order as it is. I can use current-prefix-arg to override the value of JUST-ALIGN to nil and ALIGN-ONLY-CURRENT to t internally for interactive use. The elisp use of this function will stay unchanged. I'll apply this piece just to the master if you like. While you're at it, what about throwing in some test in > "test-org/set-tags"? ;) > Will do. PS: Also, in addition, was thinking of calling JUST-ALIGN ALIGN-ALL instead. With: (defun org-set-tags (&optional ALIGN-ALL ALIGN-ONLY-CURRENT) .. it will be more apparent that they are mutually exclusive args. WDYT? -- Kaushal Modi --001a1141123078a677055430418b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jul 13, 2017, 3:54 AM N= icolas Goaziou <mail@nicolasgo= aziou.fr> wrote:
Thank you. LGTM!

Thanks.=C2=A0

Actually, I think ALIGN-ONLY-CURRENT could be merged with JUST-ALIGN,
which would have three cases (e.g., t, nil, `current'). Perhaps
=C2=A0= the
incompatibility it introduces is not acceptable though.

I was itching to do that. But there are dozens of (o= rg-set-tags nil t) instances in the Org source itself. I though just create= d a wrapper in my personal config to do ALIGN-ONLY-CURRENT when prefix is C= -u C-u.

I can do the same in the source too, while= keeping the argument order as it is. I can use current-prefix-arg to overr= ide the value of JUST-ALIGN to nil and ALIGN-ONLY-CURRENT to t internally f= or interactive use. The elisp use of this function will stay unchanged. I&#= 39;ll apply this piece just to the master if you like. =C2=A0
While yo= u're at it, what about throwing in some test in
"test-org/set-tags"? ;)

Will do.=C2=A0

PS: Also, in addition, was thinkin= g of calling JUST-ALIGN ALIGN-ALL instead.=C2=A0

W= ith:

=C2=A0 =C2=A0 (defun org-set-tags (&optio= nal ALIGN-ALL ALIGN-ONLY-CURRENT) ..

it will be mo= re apparent that they are mutually exclusive args.=C2=A0

WDYT?
--

Kaushal Modi

--001a1141123078a677055430418b--