From mboxrd@z Thu Jan 1 00:00:00 1970 From: Viktor Rosenfeld Subject: Re: org-agenda-filter-by-tag-refine defaults to exclude Date: Sat, 30 Jan 2016 00:07:39 +0100 Message-ID: <3EB2B62E-9306-49BE-BF34-E7EAD1545F77@gmx.de> References: <29B5D2C5-E59B-4E8D-9669-67F24C0B7C60@gmx.de> <87a8obl3r7.fsf@kyleam.com> Mime-Version: 1.0 (Mac OS X Mail 9.2 \(3112\)) Content-Type: multipart/signed; boundary="Apple-Mail=_2293A3FC-D47D-4D40-9C1C-F21ED179FACF"; protocol="application/pgp-signature"; micalg=pgp-sha1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPI90-0002js-6w for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 18:07:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPI8w-0003FN-UP for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 18:07:58 -0500 Received: from mout.gmx.net ([212.227.17.20]:59600) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPI8w-0003FJ-Kj for emacs-orgmode@gnu.org; Fri, 29 Jan 2016 18:07:54 -0500 In-Reply-To: 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "emacs-orgmode@gnu.org" Cc: =?utf-8?Q?Gustav_Wikstr=C3=B6m?= , Kyle Meyer --Apple-Mail=_2293A3FC-D47D-4D40-9C1C-F21ED179FACF Content-Type: multipart/alternative; boundary="Apple-Mail=_43F03AF0-AFBE-40A1-8CCC-3B35DDB23D15" --Apple-Mail=_43F03AF0-AFBE-40A1-8CCC-3B35DDB23D15 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Gustav, currently, the remove functionality can also be accessed by C-u /. If we = want to provide a dedicated hotkey, then the following definition will = do it: (add-hook 'org-agenda-mode-hook (lambda() (local-set-key (kbd "\") '(lambda() (interactive) (org-agenda-filter-by-tag nil = nil 'exclude)))) 'append) I would prefer to remove this function because it doesn=E2=80=99t add = functionality. Keeping it around just adds another potential source of = bugs. Best, Viktor > Am 28.01.2016 um 09:27 schrieb Gustav Wikstr=C3=B6m : >=20 > Hi Kyle, Viktor and the group, >=20 > I'd say it's a naming-problem. What, really, is the purpose of the = function? Because applying the proposed change essentially makes the = function identical to the function it calls. Right? And that function is = still available for the user, so a "refinement" can be done without the = org-agenda-filter-by-tag-refine (bound to backslash (\) ) function. As = of now, using the function to exclude tags in the agenda provides a = direct access to that functionality, instead of calling = org-agenda-filter-by-tag (bound to slash (/) ) plus pushing the minus = key (-) to switch from filter to exclude. >=20 > If you want to make any change, I'd suggest to instead change the name = of org-agenda-filter-by-tag-refine to org-agenda-filter-by-tag-exclude = and to leave the code within the function as is (well.. maybe change = 'refine to 'exclude with the same argument as to the function name = change). >=20 > Best Regards > Gustav >=20 > -----Original Message----- > From: Kyle Meyer [mailto:kyle@kyleam.com] > Sent: Tuesday, January 12, 2016 07:19 > To: Viktor Rosenfeld > Cc: emacs-orgmode@gnu.org; Gustav Wikstr=C3=B6m > Subject: Re: org-agenda-filter-by-tag-refine defaults to exclude >=20 > Hi Viktor, >=20 > Viktor Rosenfeld writes: >=20 >> Hi, >>=20 >> I noticed that org-agenda-filter-by-tag-refine started to exclude >> selected tags by default recently because the 'refine in the call to >> org-agenda-filter-by-tag is interpreted as an exclude flag. >=20 > This seems to have been introduced by 6c6ae99 (org-agenda: Filtering = in the agenda on grouptags, 2015-01-24). >=20 >> The attached patch fixes this. >>=20 >> However, it seems that the function is superfluous because >> org-agenda-filter-by-tag can filter on multiple tags as well if = called >> multiple times (that used not to be the case earlier). So maybe it >> should be deprecated and removed? >=20 > I agree. Gustav, does that make sense given your changes in 6c6ae99? >=20 >> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index >> d91b64d..21928de 100644 >> --- a/lisp/org-agenda.el >> +++ b/lisp/org-agenda.el >> @@ -7580,7 +7580,7 @@ to switch between filtering and excluding." >> (defun org-agenda-filter-by-tag-refine (arg &optional char) >> "Refine the current filter. See `org-agenda-filter-by-tag'." >> (interactive "P") >> - (org-agenda-filter-by-tag arg char 'refine)) >> + (org-agenda-filter-by-tag arg char)) >=20 >> (defun org-agenda-filter-make-matcher (filter type &optional expand) >> "Create the form that tests a line for agenda filter. Optional >=20 >=20 > -- > Kyle --Apple-Mail=_43F03AF0-AFBE-40A1-8CCC-3B35DDB23D15 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 Hi Gustav,

currently, the remove functionality can also be accessed by = C-u /. If we want to provide a dedicated hotkey, then the following = definition will do it:

(add-hook 'org-agenda-mode-hook
          = (lambda() 
          =   (local-set-key (kbd "\") '(lambda()
                =                     =     (interactive) 
    =                     =                 = (org-agenda-filter-by-tag nil nil 'exclude))))
          'append)

I would prefer to remove = this function because it doesn=E2=80=99t add functionality. Keeping it = around just adds another potential source of bugs.

Best,
Viktor

Am = 28.01.2016 um 09:27 schrieb Gustav Wikstr=C3=B6m <gustav@whil.se>:
Hi = Kyle, Viktor and the group,

I'd say it's a = naming-problem. What, really, is the purpose of the function? Because = applying the proposed change essentially makes the function identical to = the function it calls. Right? And that function is still available for = the user, so a "refinement" can be done without the = org-agenda-filter-by-tag-refine (bound to backslash (\) ) function. As = of now, using the function to exclude tags in the agenda provides a = direct access to that functionality, instead of calling = org-agenda-filter-by-tag (bound to slash (/) ) plus pushing the minus = key (-) to switch from filter to exclude.

If = you want to make any change, I'd suggest to instead change the name of = org-agenda-filter-by-tag-refine to org-agenda-filter-by-tag-exclude and = to leave the code within the function as is (well.. maybe change 'refine = to 'exclude with the same argument as to the function name change).

Best Regards
Gustav

-----Original Message-----
From: = Kyle Meyer [mailto:kyle@kyleam.com]
Sent: Tuesday, = January 12, 2016 07:19
To: Viktor Rosenfeld <v.rosenfeld@gmx.de>
Cc: emacs-orgmode@gnu.org; Gustav Wikstr=C3=B6m <gustav@whil.se>
Subject: Re: org-agenda-filter-by-tag-refine defaults to = exclude

Hi Viktor,

Viktor Rosenfeld <v.rosenfeld@gmx.de> writes:

Hi,

I noticed that org-agenda-filter-by-tag-refine started to = exclude
selected tags by default recently because the = 'refine in the call to
org-agenda-filter-by-tag is = interpreted as an exclude flag.

This seems to have been introduced by 6c6ae99 (org-agenda: = Filtering in the agenda on grouptags, 2015-01-24).

The attached patch fixes = this.

However, it seems that the function = is superfluous because
org-agenda-filter-by-tag can = filter on multiple tags as well if called
multiple times = (that used not to be the case earlier).  So maybe it
should be deprecated and removed?

I agree.  Gustav, does that = make sense given your changes in 6c6ae99?

diff --git = a/lisp/org-agenda.el b/lisp/org-agenda.el index
d91b64d..21928de 100644
--- = a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7580,7 +7580,7 @@ to switch between filtering and = excluding."
(defun org-agenda-filter-by-tag-refine (arg = &optional char)
  "Refine the current = filter.  See `org-agenda-filter-by-tag'."
=   (interactive "P")
- =  (org-agenda-filter-by-tag arg char 'refine))
+ =  (org-agenda-filter-by-tag arg char))

(defun = org-agenda-filter-make-matcher (filter type &optional expand)
  "Create the form that tests a line for agenda = filter.  Optional


--
Kyle

= --Apple-Mail=_43F03AF0-AFBE-40A1-8CCC-3B35DDB23D15-- --Apple-Mail=_2293A3FC-D47D-4D40-9C1C-F21ED179FACF Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP using GPGMail -----BEGIN PGP SIGNATURE----- iD8DBQFWq/C9kWI06CMxQ0ARApQ1AJ41TesfSzEjLwuP98yRjY5dXc9jCACgrCci nNdpUsTDutJ9VMp4VnvK2HM= =qmOC -----END PGP SIGNATURE----- --Apple-Mail=_2293A3FC-D47D-4D40-9C1C-F21ED179FACF--