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 12:37:28 +0000 Message-ID: References: <87pod4zs9i.fsf@nicolasgoaziou.fr> <87r2xkft0t.fsf@nicolasgoaziou.fr> <87iniwfrgg.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a11411230abc451055432324f" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVdNF-0005mz-DK for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 08:37:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVdNE-0001oL-EF for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 08:37:41 -0400 Received: from mail-lf0-x236.google.com ([2a00:1450:4010:c07::236]:34631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dVdNE-0001oF-5t for emacs-orgmode@gnu.org; Thu, 13 Jul 2017 08:37:40 -0400 Received: by mail-lf0-x236.google.com with SMTP id t72so35997186lff.1 for ; Thu, 13 Jul 2017 05:37:40 -0700 (PDT) In-Reply-To: <87iniwfrgg.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 --001a11411230abc451055432324f Content-Type: text/plain; charset="UTF-8" On Thu, Jul 13, 2017 at 8:32 AM Nicolas Goaziou wrote: > Kaushal Modi writes: > > > Correct. I was just extrapolating based on that, that people could be > > making similar uses in their configs and packages. > > > > A search like this ( > > > https://github.com/search?utf8=%E2%9C%93&q=%22org-set-tags+nil%22+language%3A%22Emacs+Lisp%22&type=Code > > ) > > shows that (org-set-tags nil t) is pretty viral in one org-settings.el > out > > there. > > Then what about something like this > > (defun org-set-tags (&optional align-all align-current) > "... > ... > ALIGN-CURRENT is obsolete and should not be used. When non-nil, > set ALIGN-ALL to `current'." > (let ((align-all (if (null align-current) align-all > (warn "Deprecated call to `org-set-tags', which > see") > 'current))) > ...)) > That will work. Good idea! I'll first patch maint, and then this in master. -- Kaushal Modi --001a11411230abc451055432324f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Thu, Jul 13= , 2017 at 8:32 AM Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
Kaushal Modi <kaushal.modi@gmail.com> writes:

> Correct. I was just extrapolating based on that, that people could be<= br> > making similar uses in their configs and packages.
>
> A search like this (
> https://github.com/search?utf8=3D%E2%9C%93&q=3D%2= 2org-set-tags+nil%22+language%3A%22Emacs+Lisp%22&type=3DCode
> )
> shows that (org-set-tags nil t) is pretty viral in one org-settings.el= out
> there.

Then what about something like this

=C2=A0 (defun org-set-tags (&optional align-all align-current)
=C2=A0 =C2=A0 "...
=C2=A0 ...
=C2=A0 ALIGN-CURRENT is obsolete and should not be used. When non-nil,
=C2=A0 set ALIGN-ALL to `current'."
=C2=A0 =C2=A0 (let ((align-all (if (null align-current) align-all
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0(warn "Deprecated call to `org-set-tags', which see"= ;)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0'current)))
=C2=A0 =C2=A0 =C2=A0...))

That will wor= k. Good idea!

I'll first patch maint, and then= this in master.=C2=A0
--

Kaushal Modi

--001a11411230abc451055432324f--