emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only'
@ 2017-01-19  7:49 Samuel Loury
  2017-05-30 17:00 ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Loury @ 2017-01-19  7:49 UTC (permalink / raw)
  To: org-mode list


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

Dear all,

I would like to propose a patch for `org-tags-view' to make it stop
setting globally `org--matcher-tags-todo-only'

Setting `org--matcher-tags-todo-only' has side effects on other
commands. For instance, the following clock table changes its behavior
whether `org--matcher-tags-todo-only' is nil or '(4)

--8<---------------cut here---------------start------------->8---
#+BEGIN: clocktable :tags "-perso" :fileskip0 :stepskip0 :link t :maxlevel 5 :emphasize t :link t :block today-1 :scope agenda :inherit-props t
--8<---------------cut here---------------end--------------->8---

I did not have time to investigate why the behavior of the clock table
is impacted by `org--matcher-tags-todo-only'. I quickly feel lost in
this code.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-Make-org-tags-view-stop-setting-globally-org-matcher.patch --]
[-- Type: text/x-diff, Size: 1182 bytes --]

From c5c763a9aca8cfd8a707b0d7e814bc37f5eeafa1 Mon Sep 17 00:00:00 2001
From: Samuel Loury <konubinixweb@gmail.com>
Date: Thu, 19 Jan 2017 08:39:50 +0100
Subject: [PATCH] Make `org-tags-view' stop setting globally
 `org--matcher-tags-todo-only'

`org--matcher-tags-todo-only' is used at several places in the
code.

The first call of `org-tags-view' that changes its value, like C-u
M-x org-tags-view has the side effect of making all other commands
that don't set this value explicitely rely on this value.

* lisp/org-agenda.el (org-tags-view): Add the declaration of
  `org--matcher-tags-todo-only' in the let form
---
 lisp/org-agenda.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 737e1841f..ac4bde389 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4681,6 +4681,7 @@ The prefix arg TODO-ONLY limits the search to TODO entries."
 	  org-tags-match-list-sublevels)
 	 (completion-ignore-case t)
 	 rtn rtnall files file pos matcher
+	 org--matcher-tags-todo-only
 	 buffer)
     (when (and (stringp match) (not (string-match "\\S-" match)))
       (setq match nil))
-- 
2.11.0


[-- Attachment #1.3: Type: text/plain, Size: 106 bytes --]


-- 
Konubinix
GPG Key    : 7439106A
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only'
  2017-01-19  7:49 [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only' Samuel Loury
@ 2017-05-30 17:00 ` Nicolas Goaziou
  2017-06-13 19:28   ` agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only') Christian Lynbech
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2017-05-30 17:00 UTC (permalink / raw)
  To: Samuel Loury; +Cc: org-mode list

Hello,

Samuel Loury <konubinix@gmail.com> writes:

> I would like to propose a patch for `org-tags-view' to make it stop
> setting globally `org--matcher-tags-todo-only'
>
> Setting `org--matcher-tags-todo-only' has side effects on other
> commands. For instance, the following clock table changes its behavior
> whether `org--matcher-tags-todo-only' is nil or '(4)
>
> #+BEGIN: clocktable :tags "-perso" :fileskip0 :stepskip0 :link t :maxlevel 5 :emphasize t :link t :block today-1 :scope agenda :inherit-props t
>
> I did not have time to investigate why the behavior of the clock table
> is impacted by `org--matcher-tags-todo-only'. I quickly feel lost in
> this code.
>
> From c5c763a9aca8cfd8a707b0d7e814bc37f5eeafa1 Mon Sep 17 00:00:00 2001
> From: Samuel Loury <konubinixweb@gmail.com>
> Date: Thu, 19 Jan 2017 08:39:50 +0100
> Subject: [PATCH] Make `org-tags-view' stop setting globally
>  `org--matcher-tags-todo-only'

Thank you. I eventually fixed it slightly differently.

Regards,

-- 
Nicolas Goaziou

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

* agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only')
  2017-05-30 17:00 ` Nicolas Goaziou
@ 2017-06-13 19:28   ` Christian Lynbech
  2017-06-13 21:32     ` Nicolas Goaziou
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Lynbech @ 2017-06-13 19:28 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode list

I assume the change is this one:

        commit 942b6267a09e167ad3a546e83205601aa5c0704e
        Author: Nicolas Goaziou <mail@nicolasgoaziou.fr>
        Date:   Tue Apr 18 11:55:27 2017 +0200

            org-agenda: `tags-todo' command type includes DONE keywords

I was rather fond of the old behaviour, which I used in the following
simple custom agenda:

        ("p" "Agenda and prioritized tasks"
         ((agenda "")
          (tags-todo "p")))

and which I include as part of my emacs start up.

Is there a way in the new system to make a custom agenda that will only
include todos in not-done states, without having to add those states
explicitly to the tags-todo search command?

                              -- Christian


-----------------------
On Tir, Maj 30 2017, Nicolas Goaziou wrote:

Hello,

Samuel Loury <konubinix@gmail.com> writes:

> I would like to propose a patch for `org-tags-view' to make it stop
> setting globally `org--matcher-tags-todo-only'
>
> Setting `org--matcher-tags-todo-only' has side effects on other
> commands. For instance, the following clock table changes its behavior
> whether `org--matcher-tags-todo-only' is nil or '(4)
>
> #+BEGIN: clocktable :tags "-perso" :fileskip0 :stepskip0 :link t
> :maxlevel 5 :emphasize t :link t :block today-1 :scope agenda
> :inherit-props t
>
> I did not have time to investigate why the behavior of the clock table
> is impacted by `org--matcher-tags-todo-only'. I quickly feel lost in
> this code.
>
> From c5c763a9aca8cfd8a707b0d7e814bc37f5eeafa1 Mon Sep 17 00:00:00 2001
> From: Samuel Loury <konubinixweb@gmail.com>
> Date: Thu, 19 Jan 2017 08:39:50 +0100
> Subject: [PATCH] Make `org-tags-view' stop setting globally
>  `org--matcher-tags-todo-only'

Thank you. I eventually fixed it slightly differently.

Regards,

-- 
Nicolas Goaziou



------------------------+-----------------------------------------------------
Christian Lynbech       | christian #\@ defun #\. dk
------------------------+-----------------------------------------------------
Hit the philistines three times over the head with the Elisp reference manual.
                                        - petonic@hal.com (Michael A. Petonic)

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

* Re: agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only')
  2017-06-13 19:28   ` agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only') Christian Lynbech
@ 2017-06-13 21:32     ` Nicolas Goaziou
  2017-06-14  6:30       ` Christian Lynbech
  0 siblings, 1 reply; 5+ messages in thread
From: Nicolas Goaziou @ 2017-06-13 21:32 UTC (permalink / raw)
  To: Christian Lynbech; +Cc: org-mode list

Hello,

Christian Lynbech <christian@defun.dk> writes:

> Is there a way in the new system to make a custom agenda that will only
> include todos in not-done states, without having to add those states
> explicitly to the tags-todo search command?

See (info "(org) Matching tags and properties"), last paragraph.

Regards,

-- 
Nicolas Goaziou

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

* Re: agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only')
  2017-06-13 21:32     ` Nicolas Goaziou
@ 2017-06-14  6:30       ` Christian Lynbech
  0 siblings, 0 replies; 5+ messages in thread
From: Christian Lynbech @ 2017-06-14  6:30 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: org-mode list

Excellent, it works to just add "/!" to the search string.

Thanks.

                              -- Christian

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

end of thread, other threads:[~2017-06-14  7:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-19  7:49 [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only' Samuel Loury
2017-05-30 17:00 ` Nicolas Goaziou
2017-06-13 19:28   ` agenda tags-todo (was Re: [PATCH] Make `org-tags-view' stop setting globally `org--matcher-tags-todo-only') Christian Lynbech
2017-06-13 21:32     ` Nicolas Goaziou
2017-06-14  6:30       ` Christian Lynbech

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