emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-agenda-filter-by-tag-refine defaults to exclude
@ 2016-01-05  7:42 Viktor Rosenfeld
  2016-01-12  6:18 ` Kyle Meyer
  0 siblings, 1 reply; 6+ messages in thread
From: Viktor Rosenfeld @ 2016-01-05  7:42 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1074 bytes --]

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. 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?

Best,
Viktor

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


[-- Attachment #1.2: Type: text/html, Size: 3127 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 155 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: org-agenda-filter-by-tag-refine defaults to exclude
  2016-01-05  7:42 org-agenda-filter-by-tag-refine defaults to exclude Viktor Rosenfeld
@ 2016-01-12  6:18 ` Kyle Meyer
  2016-01-28  8:27   ` Gustav Wikström
  0 siblings, 1 reply; 6+ messages in thread
From: Kyle Meyer @ 2016-01-12  6:18 UTC (permalink / raw)
  To: Viktor Rosenfeld; +Cc: Gustav Wikström, emacs-orgmode

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-agenda-filter-by-tag-refine defaults to exclude
  2016-01-12  6:18 ` Kyle Meyer
@ 2016-01-28  8:27   ` Gustav Wikström
  2016-01-29 23:07     ` Viktor Rosenfeld
  2016-01-30  0:57     ` Kyle Meyer
  0 siblings, 2 replies; 6+ messages in thread
From: Gustav Wikström @ 2016-01-28  8:27 UTC (permalink / raw)
  To: Kyle Meyer, Viktor Rosenfeld; +Cc: emacs-orgmode@gnu.org

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öm <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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-agenda-filter-by-tag-refine defaults to exclude
  2016-01-28  8:27   ` Gustav Wikström
@ 2016-01-29 23:07     ` Viktor Rosenfeld
  2016-01-31 18:50       ` Gustav Wikström
  2016-01-30  0:57     ` Kyle Meyer
  1 sibling, 1 reply; 6+ messages in thread
From: Viktor Rosenfeld @ 2016-01-29 23:07 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org; +Cc: Gustav Wikström, Kyle Meyer


[-- Attachment #1.1: Type: text/plain, Size: 3347 bytes --]

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’t add functionality. Keeping it around just adds another potential source of bugs.

Best,
Viktor

> Am 28.01.2016 um 09:27 schrieb Gustav Wikström <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öm <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


[-- Attachment #1.2: Type: text/html, Size: 5777 bytes --]

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 155 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-agenda-filter-by-tag-refine defaults to exclude
  2016-01-28  8:27   ` Gustav Wikström
  2016-01-29 23:07     ` Viktor Rosenfeld
@ 2016-01-30  0:57     ` Kyle Meyer
  1 sibling, 0 replies; 6+ messages in thread
From: Kyle Meyer @ 2016-01-30  0:57 UTC (permalink / raw)
  To: Gustav Wikström; +Cc: Viktor Rosenfeld, emacs-orgmode@gnu.org

Hi Gustav,

Gustav Wikström <gustav@whil.se> writes:

[...]

> If you want to make any change,

Given that, as of 6c6ae99, the function's behavior doesn't match its
name or its previous behavior, I don't think leaving it unchanged is a
good option.

> 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).

Like Viktor, I'm in favor of just removing it, because both its old and
new behavior are easily accomplished with the current
org-agenda-filter-by-tag.

This already made it into a release (v8.3), so in maint I plan to remove
the refine (now exclude) argument from org-agenda-filter-by-tag-refine's
call to org-agenda-filter-by-tag.  I think that gets the function as
close as we can to the old behavior without making any major changes.
In master, I'll just remove org-agenda-filter-by-tag-refine.

I'll make those changes in a few days unless someone objects.

--
Kyle

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: org-agenda-filter-by-tag-refine defaults to exclude
  2016-01-29 23:07     ` Viktor Rosenfeld
@ 2016-01-31 18:50       ` Gustav Wikström
  0 siblings, 0 replies; 6+ messages in thread
From: Gustav Wikström @ 2016-01-31 18:50 UTC (permalink / raw)
  To: Viktor Rosenfeld, emacs-orgmode@gnu.org; +Cc: Kyle Meyer

[-- Attachment #1: Type: text/plain, Size: 3890 bytes --]

Hi Viktor, Kyle

Fair enough. I’m not attached to the refine-function at all. If you like to have it removed, then remove it, unless others are of different opinion ofc. The functionality is fairly complex, so removing the keybinding might make it seem less complicated.

/G

From: Viktor Rosenfeld [mailto:v.rosenfeld@gmx.de]
Sent: Saturday, January 30, 2016 00:08
To: emacs-orgmode@gnu.org
Cc: Gustav Wikström <gustav@whil.se>; Kyle Meyer <kyle@kyleam.com>
Subject: Re: org-agenda-filter-by-tag-refine defaults to exclude

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’t add functionality. Keeping it around just adds another potential source of bugs.

Best,
Viktor

Am 28.01.2016 um 09:27 schrieb Gustav Wikström <gustav@whil.se<mailto: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<mailto:v.rosenfeld@gmx.de>>
Cc: emacs-orgmode@gnu.org<mailto:emacs-orgmode@gnu.org>; Gustav Wikström <gustav@whil.se<mailto:gustav@whil.se>>
Subject: Re: org-agenda-filter-by-tag-refine defaults to exclude

Hi Viktor,

Viktor Rosenfeld <v.rosenfeld@gmx.de<mailto: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


[-- Attachment #2: Type: text/html, Size: 9752 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-01-31 19:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-05  7:42 org-agenda-filter-by-tag-refine defaults to exclude Viktor Rosenfeld
2016-01-12  6:18 ` Kyle Meyer
2016-01-28  8:27   ` Gustav Wikström
2016-01-29 23:07     ` Viktor Rosenfeld
2016-01-31 18:50       ` Gustav Wikström
2016-01-30  0:57     ` Kyle Meyer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).