emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
@ 2023-03-09 12:46 Tim Ruffing
  2023-03-10 11:48 ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Ruffing @ 2023-03-09 12:46 UTC (permalink / raw)
  To: emacs-orgmode

* org-agenda.el (org-prepare-agenda): Don't reset
`org-todo-keywords-for-agenda' when org-agenda-multi.

Fixes a bug with TODO keywords that came to light in org-modern,
see https://github.com/minad/org-modern/issues/26.

This is very similar to cd2d138883a55cad48394a3f473da8b973a99a5e,
which fixed the same for `org-done-keywords-for-agenda` (to fix
a similar styling issue).
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 7e54121dc..8e3cc693a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3956,7 +3956,6 @@ FILTER-ALIST is an alist of filters we need to
apply when
      (message "Sticky Agenda buffer, use `r' to refresh")
      (or org-agenda-multi (org-agenda-fit-window-to-buffer))
      (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
-      (setq org-todo-keywords-for-agenda nil)
       (if org-agenda-multi
      (progn
        (setq buffer-read-only nil)
@@ -3969,6 +3968,7 @@ FILTER-ALIST is an alist of filters we need to
apply when
            (make-string (window-max-chars-per-line) org-agenda-block-
separator))
              "\n"))
        (narrow-to-region (point) (point-max)))
+        (setq org-todo-keywords-for-agenda nil)
    (setq org-done-keywords-for-agenda nil)
    ;; Setting any org variables that are in org-agenda-local-vars
    ;; list need to be done after the prepare call
-- 
2.39.2


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

* Re: [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
  2023-03-09 12:46 [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi Tim Ruffing
@ 2023-03-10 11:48 ` Ihor Radchenko
  2023-03-10 12:08   ` Tim Ruffing
  2023-03-10 12:32   ` Max Nikulin
  0 siblings, 2 replies; 6+ messages in thread
From: Ihor Radchenko @ 2023-03-10 11:48 UTC (permalink / raw)
  To: Tim Ruffing; +Cc: emacs-orgmode

Tim Ruffing <crypto@timruffing.de> writes:

> * org-agenda.el (org-prepare-agenda): Don't reset
> `org-todo-keywords-for-agenda' when org-agenda-multi.
>
> Fixes a bug with TODO keywords that came to light in org-modern,
> see https://github.com/minad/org-modern/issues/26.
>
> This is very similar to cd2d138883a55cad48394a3f473da8b973a99a5e,
> which fixed the same for `org-done-keywords-for-agenda` (to fix
> a similar styling issue).

Thanks for the patch!
Unfortunately, it does not apply.
Could you re-send the patch as attachment?

In addition, may you add TINYCHANGE cookie to the commit message if you
don't have FSF assignment done (see
https://orgmode.org/worg/org-contribute.html#first-patch)? And, if you
can, write a test.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

* Re: [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
  2023-03-10 11:48 ` Ihor Radchenko
@ 2023-03-10 12:08   ` Tim Ruffing
  2023-03-10 12:32   ` Max Nikulin
  1 sibling, 0 replies; 6+ messages in thread
From: Tim Ruffing @ 2023-03-10 12:08 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

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

Attached with TINYCHECK.

Unfortunately I don't have the time to write a test right now because
I'll be traveling from tomorrow on. (You'd to wait for at least 6
weeks..)

Here's a sketch for a test case:
 * Show an agenda with that has org-agenda-multi
 * In the agenda buffer, assert that org-todo-keywords-for-agenda and
   (org-done-keywords-for-agenda) are not nil.

Best,
Tim


On Fri, 2023-03-10 at 11:48 +0000, Ihor Radchenko wrote:
> Tim Ruffing <crypto@timruffing.de> writes:
> 
> > * org-agenda.el (org-prepare-agenda): Don't reset
> > `org-todo-keywords-for-agenda' when org-agenda-multi.
> > 
> > Fixes a bug with TODO keywords that came to light in org-modern,
> > see https://github.com/minad/org-modern/issues/26.
> > 
> > This is very similar to cd2d138883a55cad48394a3f473da8b973a99a5e,
> > which fixed the same for `org-done-keywords-for-agenda` (to fix
> > a similar styling issue).
> 
> Thanks for the patch!
> Unfortunately, it does not apply.
> Could you re-send the patch as attachment?
> 
> In addition, may you add TINYCHANGE cookie to the commit message if
> you
> don't have FSF assignment done (see
> https://orgmode.org/worg/org-contribute.html#first-patch)? And, if
> you
> can, write a test.
> 

[-- Attachment #2: 0001-Don-t-reset-org-todo-keywords-for-agenda-when-org-ag.patch --]
[-- Type: text/x-patch, Size: 1651 bytes --]

From ec83e58d54345696b80d559145e480c2af07db6c Mon Sep 17 00:00:00 2001
From: Tim Ruffing <crypto@timruffing.de>
Date: Thu, 9 Mar 2023 13:38:28 +0100
Subject: [PATCH] Don't reset `org-todo-keywords-for-agenda' when
 org-agenda-multi

* org-agenda.el (org-prepare-agenda): Don't reset
`org-todo-keywords-for-agenda' when org-agenda-multi.

Fixes a bug with TODO keywords that came to light in org-modern,
see https://github.com/minad/org-modern/issues/26.

This is very similar to cd2d138883a55cad48394a3f473da8b973a99a5e,
which fixed the same for `org-done-keywords-for-agenda` (to fix
a similar styling issue).

TINYCHANGE
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 7e54121dc..8e3cc693a 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3956,7 +3956,6 @@ FILTER-ALIST is an alist of filters we need to apply when
 	  (message "Sticky Agenda buffer, use `r' to refresh")
 	  (or org-agenda-multi (org-agenda-fit-window-to-buffer))
 	  (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
-      (setq org-todo-keywords-for-agenda nil)
       (if org-agenda-multi
 	  (progn
 	    (setq buffer-read-only nil)
@@ -3969,6 +3968,7 @@ FILTER-ALIST is an alist of filters we need to apply when
 			(make-string (window-max-chars-per-line) org-agenda-block-separator))
 		      "\n"))
 	    (narrow-to-region (point) (point-max)))
+        (setq org-todo-keywords-for-agenda nil)
 	(setq org-done-keywords-for-agenda nil)
 	;; Setting any org variables that are in org-agenda-local-vars
 	;; list need to be done after the prepare call
-- 
2.39.2


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

* Re: [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
  2023-03-10 11:48 ` Ihor Radchenko
  2023-03-10 12:08   ` Tim Ruffing
@ 2023-03-10 12:32   ` Max Nikulin
  2023-03-10 14:16     ` Tim Ruffing
  1 sibling, 1 reply; 6+ messages in thread
From: Max Nikulin @ 2023-03-10 12:32 UTC (permalink / raw)
  To: Tim Ruffing; +Cc: emacs-orgmode

On 10/03/2023 18:48, Ihor Radchenko wrote:
> Tim Ruffing writes:
> 
>> * org-agenda.el (org-prepare-agenda): Don't reset
>> `org-todo-keywords-for-agenda' when org-agenda-multi.

> Unfortunately, it does not apply.

- @@ lines are wrapped by mail user agent
- tabs are converted to spaces

https://list.orgmode.org/orgmode/55a16edf3c8e04e9f1f7be7ab281ddacac81d9c1.camel@timruffing.de/raw

While some people find it convenient to send patches as messages (and 
some projects require such format), for others it is easier to add an 
attachment than setting up mail client to avoid unintended modifications 
of patches.


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

* Re: [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
  2023-03-10 12:32   ` Max Nikulin
@ 2023-03-10 14:16     ` Tim Ruffing
  2023-03-11 10:22       ` Ihor Radchenko
  0 siblings, 1 reply; 6+ messages in thread
From: Tim Ruffing @ 2023-03-10 14:16 UTC (permalink / raw)
  To: Max Nikulin; +Cc: emacs-orgmode

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

Yep, I had seen that whitespace is the issue in my initial email, but I
had not noticed that tabs are used. So here's a third attempt, sorry
for the hiccups.

Whitespace should be consistent now. :) And yes, attachments are much
better, but I wasn't sure about the policy here and I have not setup
git send-email properly...

Tim
 

On Fri, 2023-03-10 at 19:32 +0700, Max Nikulin wrote:
> On 10/03/2023 18:48, Ihor Radchenko wrote:
> > Tim Ruffing writes:
> > 
> > > * org-agenda.el (org-prepare-agenda): Don't reset
> > > `org-todo-keywords-for-agenda' when org-agenda-multi.
> 
> > Unfortunately, it does not apply.
> 
> - @@ lines are wrapped by mail user agent
> - tabs are converted to spaces
> 
> https://list.orgmode.org/orgmode/55a16edf3c8e04e9f1f7be7ab281ddacac81d9c1.camel@timruffing.de/raw
> 
> While some people find it convenient to send patches as messages (and
> some projects require such format), for others it is easier to add an
> attachment than setting up mail client to avoid unintended
> modifications 
> of patches.

[-- Attachment #2: 0001-Don-t-reset-org-todo-keywords-for-agenda-when-org-ag.patch --]
[-- Type: text/x-patch, Size: 1644 bytes --]

From fe9a35bf46e800325d6b8cc435524486ff15e509 Mon Sep 17 00:00:00 2001
From: Tim Ruffing <crypto@timruffing.de>
Date: Thu, 9 Mar 2023 13:38:28 +0100
Subject: [PATCH] Don't reset `org-todo-keywords-for-agenda' when
 org-agenda-multi

* org-agenda.el (org-prepare-agenda): Don't reset
`org-todo-keywords-for-agenda' when org-agenda-multi.

Fixes a bug with TODO keywords that came to light in org-modern,
see https://github.com/minad/org-modern/issues/26.

This is very similar to cd2d138883a55cad48394a3f473da8b973a99a5e,
which fixed the same for `org-done-keywords-for-agenda` (to fix
a similar styling issue).

TINYCHANGE
---
 lisp/org-agenda.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 7e54121dc..3da0967f0 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -3956,7 +3956,6 @@ FILTER-ALIST is an alist of filters we need to apply when
 	  (message "Sticky Agenda buffer, use `r' to refresh")
 	  (or org-agenda-multi (org-agenda-fit-window-to-buffer))
 	  (throw 'exit "Sticky Agenda buffer, use `r' to refresh"))
-      (setq org-todo-keywords-for-agenda nil)
       (if org-agenda-multi
 	  (progn
 	    (setq buffer-read-only nil)
@@ -3969,6 +3968,7 @@ FILTER-ALIST is an alist of filters we need to apply when
 			(make-string (window-max-chars-per-line) org-agenda-block-separator))
 		      "\n"))
 	    (narrow-to-region (point) (point-max)))
+	(setq org-todo-keywords-for-agenda nil)
 	(setq org-done-keywords-for-agenda nil)
 	;; Setting any org variables that are in org-agenda-local-vars
 	;; list need to be done after the prepare call
-- 
2.39.2


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

* Re: [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi
  2023-03-10 14:16     ` Tim Ruffing
@ 2023-03-11 10:22       ` Ihor Radchenko
  0 siblings, 0 replies; 6+ messages in thread
From: Ihor Radchenko @ 2023-03-11 10:22 UTC (permalink / raw)
  To: Tim Ruffing; +Cc: Max Nikulin, emacs-orgmode

Tim Ruffing <crypto@timruffing.de> writes:

> Yep, I had seen that whitespace is the issue in my initial email, but I
> had not noticed that tabs are used. So here's a third attempt, sorry
> for the hiccups.

Thanks!
Applied, onto main. I did not risk bugfix, because it is agenda, which
is a mess.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f5987b37d

You are also now listed as Org contributor.
https://git.sr.ht/~bzg/worg/commit/58891803

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


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

end of thread, other threads:[~2023-03-11 10:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09 12:46 [PATCH] Don't reset `org-todo-keywords-for-agenda' when org-agenda-multi Tim Ruffing
2023-03-10 11:48 ` Ihor Radchenko
2023-03-10 12:08   ` Tim Ruffing
2023-03-10 12:32   ` Max Nikulin
2023-03-10 14:16     ` Tim Ruffing
2023-03-11 10:22       ` Ihor Radchenko

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