emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug in Recent Agenda Mod
@ 2017-03-21  0:21 Ian Dunn
  2017-03-21  8:03 ` Marco Wahl
  2017-03-21 14:05 ` Matt Lundin
  0 siblings, 2 replies; 4+ messages in thread
From: Ian Dunn @ 2017-03-21  0:21 UTC (permalink / raw)
  To: emacs-orgmode


Commit d262ae53c966c7a745c0fa779149f9eb7486333d "org-agenda: Fix agenda standard name when going unsticky" sets org-agenda-buffer-name to "*Org Agenda*" if not in sticky.

However, org-agenda-redo sets org-agenda-sticky to nil before redoing the agenda command.

Steps to Reproduce:

1. Turn on org-agenda-sticky
2. Execute any agenda command that only involves org-agenda-list
   - Agenda is in buffer *Org Agenda(CMD)* (ex. *Org Agenda(d:)*)
3. Press 'g' (org-agenda-redo)
   - Agenda is now in *Org Agenda*

The included patch fixes this for sticky redo, and will have no effect for anything other than a sticky redo.

--
Ian Dunn

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index b618653d5..04e6685b5 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -4076,6 +4076,7 @@ items if they have an hour specification like [h]h:mm."
   (catch 'exit
     (setq org-agenda-buffer-name
 	  (or org-agenda-buffer-tmp-name
+	      (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
 	      (if org-agenda-sticky
 		  (cond ((and org-keys (stringp org-match))
 			 (format "*Org Agenda(%s:%s)*" org-keys org-match))

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

* Re: Bug in Recent Agenda Mod
  2017-03-21  0:21 Bug in Recent Agenda Mod Ian Dunn
@ 2017-03-21  8:03 ` Marco Wahl
  2017-03-21 20:13   ` Marco Wahl
  2017-03-21 14:05 ` Matt Lundin
  1 sibling, 1 reply; 4+ messages in thread
From: Marco Wahl @ 2017-03-21  8:03 UTC (permalink / raw)
  To: emacs-orgmode

Ian Dunn <dunni@gnu.org> writes:

> Commit d262ae53c966c7a745c0fa779149f9eb7486333d "org-agenda: Fix agenda standard name when going unsticky" sets org-agenda-buffer-name to "*Org Agenda*" if not in sticky.
>
> However, org-agenda-redo sets org-agenda-sticky to nil before redoing the agenda command.
>
> Steps to Reproduce:
>
> 1. Turn on org-agenda-sticky
> 2. Execute any agenda command that only involves org-agenda-list
>    - Agenda is in buffer *Org Agenda(CMD)* (ex. *Org Agenda(d:)*)
> 3. Press 'g' (org-agenda-redo)
>    - Agenda is now in *Org Agenda*
>
> The included patch fixes this for sticky redo, and will have no effect for anything other than a sticky redo.
>
> --
> Ian Dunn
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index b618653d5..04e6685b5 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -4076,6 +4076,7 @@ items if they have an hour specification like [h]h:mm."
>    (catch 'exit
>      (setq org-agenda-buffer-name
>  	  (or org-agenda-buffer-tmp-name
> +	      (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
>  	      (if org-agenda-sticky
>  		  (cond ((and org-keys (stringp org-match))
>  			 (format "*Org Agenda(%s:%s)*" org-keys org-match))

Good catch, good fix AFAICT.  Thanks.

May I add this line with a commit message referencing you as the
originator?  (I have not found you in the contributors list.)


Best regards,

             Marco

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

* Re: Bug in Recent Agenda Mod
  2017-03-21  0:21 Bug in Recent Agenda Mod Ian Dunn
  2017-03-21  8:03 ` Marco Wahl
@ 2017-03-21 14:05 ` Matt Lundin
  1 sibling, 0 replies; 4+ messages in thread
From: Matt Lundin @ 2017-03-21 14:05 UTC (permalink / raw)
  To: Ian Dunn; +Cc: emacs-orgmode

Ian Dunn <dunni@gnu.org> writes:

> Commit d262ae53c966c7a745c0fa779149f9eb7486333d "org-agenda: Fix
> agenda standard name when going unsticky" sets org-agenda-buffer-name
> to "*Org Agenda*" if not in sticky.
>
> However, org-agenda-redo sets org-agenda-sticky to nil before redoing the agenda command.
>
> Steps to Reproduce:
>
> 1. Turn on org-agenda-sticky
> 2. Execute any agenda command that only involves org-agenda-list
>    - Agenda is in buffer *Org Agenda(CMD)* (ex. *Org Agenda(d:)*)
> 3. Press 'g' (org-agenda-redo)
>    - Agenda is now in *Org Agenda*
>
> The included patch fixes this for sticky redo, and will have no effect
> for anything other than a sticky redo.
>
> --
> Ian Dunn
>
> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
> index b618653d5..04e6685b5 100644
> --- a/lisp/org-agenda.el
> +++ b/lisp/org-agenda.el
> @@ -4076,6 +4076,7 @@ items if they have an hour specification like [h]h:mm."
>    (catch 'exit
>      (setq org-agenda-buffer-name
>  	  (or org-agenda-buffer-tmp-name
> +	      (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
>  	      (if org-agenda-sticky
>  		  (cond ((and org-keys (stringp org-match))
>  			 (format "*Org Agenda(%s:%s)*" org-keys org-match))

Thanks so much for solving this. I was just trying to figure out why
refreshing my sticky agendas kept creating a new "*Org Agenda* buffer
and am glad I checked here first. I can confirm that this fix works.

Matt

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

* Re: Bug in Recent Agenda Mod
  2017-03-21  8:03 ` Marco Wahl
@ 2017-03-21 20:13   ` Marco Wahl
  0 siblings, 0 replies; 4+ messages in thread
From: Marco Wahl @ 2017-03-21 20:13 UTC (permalink / raw)
  To: emacs-orgmode

Marco Wahl <marcowahlsoft@gmail.com> writes:

> Ian Dunn <dunni@gnu.org> writes:
>
>> Commit d262ae53c966c7a745c0fa779149f9eb7486333d "org-agenda: Fix agenda standard name when going unsticky" sets org-agenda-buffer-name to "*Org Agenda*" if not in sticky.
>>
>> However, org-agenda-redo sets org-agenda-sticky to nil before redoing the agenda command.
>>
>> Steps to Reproduce:
>>
>> 1. Turn on org-agenda-sticky
>> 2. Execute any agenda command that only involves org-agenda-list
>>    - Agenda is in buffer *Org Agenda(CMD)* (ex. *Org Agenda(d:)*)
>> 3. Press 'g' (org-agenda-redo)
>>    - Agenda is now in *Org Agenda*
>>
>> The included patch fixes this for sticky redo, and will have no effect for anything other than a sticky redo.
>>
>> --
>> Ian Dunn
>>
>> diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
>> index b618653d5..04e6685b5 100644
>> --- a/lisp/org-agenda.el
>> +++ b/lisp/org-agenda.el
>> @@ -4076,6 +4076,7 @@ items if they have an hour specification like [h]h:mm."
>>    (catch 'exit
>>      (setq org-agenda-buffer-name
>>  	  (or org-agenda-buffer-tmp-name
>> +	      (and org-agenda-doing-sticky-redo org-agenda-buffer-name)
>>  	      (if org-agenda-sticky
>>  		  (cond ((and org-keys (stringp org-match))
>>  			 (format "*Org Agenda(%s:%s)*" org-keys org-match))
>
> Good catch, good fix AFAICT.  Thanks.
>
> May I add this line with a commit message referencing you as the
> originator?  (I have not found you in the contributors list.)

I just committed your fix.


Ciao

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

end of thread, other threads:[~2017-03-21 20:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21  0:21 Bug in Recent Agenda Mod Ian Dunn
2017-03-21  8:03 ` Marco Wahl
2017-03-21 20:13   ` Marco Wahl
2017-03-21 14:05 ` Matt Lundin

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