emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: Stuck projects view reverts to tag match on refresh [9.0.5]
@ 2017-04-18  6:22 Allen Li
  2017-04-18  8:33 ` Nicolas Goaziou
  0 siblings, 1 reply; 7+ messages in thread
From: Allen Li @ 2017-04-18  6:22 UTC (permalink / raw)
  To: emacs-orgmode


The stuck projects agenda view reverts to a tag match when it is
refreshed with r or g

Example of original view:

    List of stuck projects: 
      Refile:     Stuck                                            :refile::project:

After refreshing:

    Headlines with TAGS match: project
    Press ‘C-u r’ to search again with new search string
      Refile:     Stuck                                            :refile::project:
      Refile:     Unstuck                                          :refile::project:

Emacs  : GNU Emacs 25.1.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.22.7)
 of 2017-02-07
Package: Org mode version 9.0.5 (9.0.5-elpa @ ~/.emacs.d/elpa/org-20170210/)

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

* Re: Bug: Stuck projects view reverts to tag match on refresh [9.0.5]
  2017-04-18  6:22 Bug: Stuck projects view reverts to tag match on refresh [9.0.5] Allen Li
@ 2017-04-18  8:33 ` Nicolas Goaziou
  2017-04-19  8:40   ` Allen Li
  0 siblings, 1 reply; 7+ messages in thread
From: Nicolas Goaziou @ 2017-04-18  8:33 UTC (permalink / raw)
  To: Allen Li; +Cc: emacs-orgmode

Hello,

Allen Li <darkfeline@felesatra.moe> writes:

> The stuck projects agenda view reverts to a tag match when it is
> refreshed with r or g
>
> Example of original view:
>
>     List of stuck projects: 
>       Refile:     Stuck                                            :refile::project:
>
> After refreshing:
>
>     Headlines with TAGS match: project
>     Press ‘C-u r’ to search again with new search string
>       Refile:     Stuck                                            :refile::project:
>       Refile:     Unstuck                                          :refile::project:

I cannot reproduce it. Could you provide an ECM?

Regards,

-- 
Nicolas Goaziou

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

* Re: Bug: Stuck projects view reverts to tag match on refresh [9.0.5]
  2017-04-18  8:33 ` Nicolas Goaziou
@ 2017-04-19  8:40   ` Allen Li
  2017-04-20  5:52     ` [PATCH] org-agenda: Store stuck project redo command Allen Li
  0 siblings, 1 reply; 7+ messages in thread
From: Allen Li @ 2017-04-19  8:40 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode, Allen Li

On Tue, Apr 18, 2017 at 1:33 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr> wrote:
> I cannot reproduce it. Could you provide an ECM?

Create a file tmp.org with the contents:

* Stuck :project:
* Unstuck :project:
** TODO thing

1. emacs -q
2. Eval:

(setq org-agenda-files '("~/tmp.org")
      org-stuck-projects '("project" ("TODO") nil ""))

3. M-x org-agenda RET #

Buffer contents:

List of stuck projects:
  tmp:        Stuck                                                    :project:

4. r

Buffer contents:

Headlines with TAGS match: project
Press ‘C-u r’ to search again with new search string
  tmp:        Stuck                                                    :project:
  tmp:        Unstuck                                                  :project:
  tmp:        TODO thing                                              :project::

I realize that this is using the stock Org mode that ships with Emacs,
but it's the same behavior as org-20170210, which I believe is the
latest and this repro is easier.

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

* [PATCH] org-agenda: Store stuck project redo command
  2017-04-19  8:40   ` Allen Li
@ 2017-04-20  5:52     ` Allen Li
  2017-04-21  1:17       ` Samuel Wales
  2017-04-25 21:48       ` Nicolas Goaziou
  0 siblings, 2 replies; 7+ messages in thread
From: Allen Li @ 2017-04-20  5:52 UTC (permalink / raw)
  To: mail, emacs-orgmode


* lisp/org-agenda.el (org-agenda-list-stuck-projects): Store the redo
command in a text property so it is found correctly.

`org-agenda-redo' checks the `org-redo-cmd' text property, not
`org-agenda-redo-command'.

TINYCHANGE
---
 lisp/org-agenda.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index cf9351a9b..78c1a37f4 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4971,7 +4971,11 @@ of what a project is and how to check if it stuck, customize the variable
     (setq org-agenda-buffer-name (buffer-name))
     (with-current-buffer org-agenda-buffer-name
       (setq org-agenda-redo-command
-	    `(org-agenda-list-stuck-projects ,current-prefix-arg)))))
+	    `(org-agenda-list-stuck-projects ,current-prefix-arg))
+      (let ((inhibit-read-only t))
+        (add-text-properties
+         (point-min) (point-max)
+         `(org-redo-cmd ,org-agenda-redo-command))))))
 
 ;;; Diary integration
 
-- 
2.12.2

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

* Re: [PATCH] org-agenda: Store stuck project redo command
  2017-04-20  5:52     ` [PATCH] org-agenda: Store stuck project redo command Allen Li
@ 2017-04-21  1:17       ` Samuel Wales
  2017-04-21  1:20         ` Samuel Wales
  2017-04-25 21:48       ` Nicolas Goaziou
  1 sibling, 1 reply; 7+ messages in thread
From: Samuel Wales @ 2017-04-21  1:17 UTC (permalink / raw)
  To: Allen Li; +Cc: emacs-orgmode, mail

in case it isn't already considered, i think storing the conditions of
the original call applies to many agenda calls.  i run into this issue
with the following old code.  i set a restriction lock, and run
agenda, but g runs agenda without the restriction lock.

(defun alpha-org-agenda-subtree (&optional _arg)
  "Show agenda for all tasks in subtree.

===

You can get a fast sorted view with this command.  In this
example, the agenda will show tasks under my subtree.

  * top level 1 -- not shown
    * my subtree -- shown
      * TODO a
      * some other headline | (<- point is here)
        * TODO [#A] b
  * top level 2 -- not shown

If you sort by priority, b will sort above a.

===

This allows you to organize nodes hierarchically instead of
keeping things at the same level merely to allow sorting.
"
  (interactive "P")

  (org-agenda-set-restriction-lock 'subtree)
  (let ((org-agenda-sorting-strategy '(user-defined-up category-up))
        (org-agenda-text-search-extra-files)
        (org-agenda-show-inherited-tags))
    (org-tags-view nil "LEVEL>0")
    (setq-local org-agenda-sorting-strategy
                org-agenda-sorting-strategy)))

-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.

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

* Re: [PATCH] org-agenda: Store stuck project redo command
  2017-04-21  1:17       ` Samuel Wales
@ 2017-04-21  1:20         ` Samuel Wales
  0 siblings, 0 replies; 7+ messages in thread
From: Samuel Wales @ 2017-04-21  1:20 UTC (permalink / raw)
  To: Allen Li; +Cc: emacs-orgmode, mail

maybe i got that backward.

my note is: "fixme bug in org: either if you do g, it will ignore restriction
lock or you have to manually remove restriction lock.  the best
would be for g to preserve the restriction lock even though it
has been removed."

On 4/20/17, Samuel Wales <samologist@gmail.com> wrote:
> in case it isn't already considered, i think storing the conditions of
> the original call applies to many agenda calls.  i run into this issue
> with the following old code.  i set a restriction lock, and run
> agenda, but g runs agenda without the restriction lock.
>
> (defun alpha-org-agenda-subtree (&optional _arg)
>   "Show agenda for all tasks in subtree.
>
> ===
>
> You can get a fast sorted view with this command.  In this
> example, the agenda will show tasks under my subtree.
>
>   * top level 1 -- not shown
>     * my subtree -- shown
>       * TODO a
>       * some other headline | (<- point is here)
>         * TODO [#A] b
>   * top level 2 -- not shown
>
> If you sort by priority, b will sort above a.
>
> ===
>
> This allows you to organize nodes hierarchically instead of
> keeping things at the same level merely to allow sorting.
> "
>   (interactive "P")
>
>   (org-agenda-set-restriction-lock 'subtree)
>   (let ((org-agenda-sorting-strategy '(user-defined-up category-up))
>         (org-agenda-text-search-extra-files)
>         (org-agenda-show-inherited-tags))
>     (org-tags-view nil "LEVEL>0")
>     (setq-local org-agenda-sorting-strategy
>                 org-agenda-sorting-strategy)))
>
> --
> The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>
>
> The disease DOES progress. MANY people have died from it. And ANYBODY
> can get it at any time.
>
> "You’ve really gotta quit this and get moving, because this is murder
> by neglect." ---
> <http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.
>


-- 
The Kafka Pandemic: <http://thekafkapandemic.blogspot.com>

The disease DOES progress. MANY people have died from it. And ANYBODY
can get it at any time.

"You’ve really gotta quit this and get moving, because this is murder
by neglect." ---
<http://www.meaction.net/2017/02/03/pwme-people-with-me-are-being-murdered-by-neglect>.

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

* Re: [PATCH] org-agenda: Store stuck project redo command
  2017-04-20  5:52     ` [PATCH] org-agenda: Store stuck project redo command Allen Li
  2017-04-21  1:17       ` Samuel Wales
@ 2017-04-25 21:48       ` Nicolas Goaziou
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Goaziou @ 2017-04-25 21:48 UTC (permalink / raw)
  To: Allen Li; +Cc: emacs-orgmode

Hello,

Allen Li <darkfeline@felesatra.moe> writes:

> * lisp/org-agenda.el (org-agenda-list-stuck-projects): Store the redo
> command in a text property so it is found correctly.
>
> `org-agenda-redo' checks the `org-redo-cmd' text property, not
> `org-agenda-redo-command'.
>
> TINYCHANGE

Applied. Thank you.

Regards,

-- 
Nicolas Goaziou

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

end of thread, other threads:[~2017-04-25 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-18  6:22 Bug: Stuck projects view reverts to tag match on refresh [9.0.5] Allen Li
2017-04-18  8:33 ` Nicolas Goaziou
2017-04-19  8:40   ` Allen Li
2017-04-20  5:52     ` [PATCH] org-agenda: Store stuck project redo command Allen Li
2017-04-21  1:17       ` Samuel Wales
2017-04-21  1:20         ` Samuel Wales
2017-04-25 21:48       ` Nicolas Goaziou

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