all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] org-agenda: make log and clockreport modes local
@ 2018-02-22  2:42 Nicolas Dudebout
  2018-02-22 13:39 ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Dudebout @ 2018-02-22  2:42 UTC (permalink / raw)
  To: emacs-orgmode


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

`org-agenda-show-log' indicates if the the current agenda buffer has
log-mode enabled.  When building a new agenda buffer, it gets its
value from `org-agenda-start-with-log-mode'.  It is is semantically a
buffer local variable: when creating a new agenda buffer you expect it
to be set to the value in `org-agenda-start-with-log-mode'.  However,
2e9c2d71 while fixing an issue with sticky agendas rendered the
variable `org-agenda-log-mode' effectively global: toggling log mode
in a given agenda buffer modifies the global default for all agenda
buffers.  The same reasoning holds for clockreport mode.

This change ensures that a log or clockreport mode change made in one
agenda buffer does not propagate to other agenda buffers, existing or
new.  The change is however preserved on org-agenda-redo in the
initial agenda buffer, whether using sticky agendas or not.

Nicolas

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

[-- Attachment #2: 0001-org-agenda-make-log-and-clockreport-modes-local.patch --]
[-- Type: application/octet-stream, Size: 3248 bytes --]

From 73615019adc5f55215cd0cedde72aea97624ece4 Mon Sep 17 00:00:00 2001
From: Nicolas Dudebout <nicolas.dudebout@gmail.com>
Date: Wed, 21 Feb 2018 20:43:24 -0500
Subject: [PATCH] org-agenda: make log and clockreport modes local

* lisp/org-agenda.el (org-agenda-mode): Only set `org-agenda-show-log'
  and `org-agenda-clock-report-mode' to their default values when
  constructing an agenda buffer, and not when redoing it.
* lisp/org-agenda.el (org-agenda-log-mode,
  org-agenda-clockreport-mode): Do not set the global default value
  `org-agenda-start-with-log-mode' (respectively
  `org-agenda-start-with-clockreport-mode') with the current value of
  `org-agenda-log-mode' (respectively `org-agenda-clockreport-mode'),
  which, with sticky agendas is even buffer local.

`org-agenda-show-log' indicates if the the current agenda buffer has
log-mode enabled.  When building a new agenda buffer, it gets its
value from `org-agenda-start-with-log-mode'.  It is is semantically a
buffer local variable: when creating a new agenda buffer you expect it
to be set to the value in `org-agenda-start-with-log-mode'.  However,
2e9c2d71 while fixing an issue with sticky agendas rendered the
variable `org-agenda-log-mode' effectively global: toggling log mode
in a given agenda buffer modifies the global default for all agenda
buffers.  The same reasoning holds for clockreport mode.

This change ensures that a log or clockreport mode change made in one
agenda buffer does not propagate to other agenda buffers, existing or
new.  The change is however preserved on org-agenda-redo in the
initial agenda buffer, whether using sticky agendas or not.
---
 lisp/org-agenda.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 67f590731..81c37f6ba 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -2230,9 +2230,9 @@ The following commands are available:
 	    nil t)
   (unless org-agenda-keep-modes
     (setq org-agenda-follow-mode org-agenda-start-with-follow-mode
-	  org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode))
-  (setq org-agenda-show-log org-agenda-start-with-log-mode)
-  (setq org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode)
+	  org-agenda-entry-text-mode org-agenda-start-with-entry-text-mode
+	  org-agenda-show-log org-agenda-start-with-log-mode
+	  org-agenda-clockreport-mode org-agenda-start-with-clockreport-mode))
   (add-to-invisibility-spec '(org-filtered))
   (add-to-invisibility-spec '(org-link))
   (easy-menu-change
@@ -8204,7 +8204,6 @@ so that the date SD will be in that range."
   (interactive)
   (org-agenda-check-type t 'agenda)
   (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode))
-  (setq org-agenda-start-with-clockreport-mode org-agenda-clockreport-mode)
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Clocktable mode is %s"
@@ -8228,7 +8227,6 @@ log items, nothing else."
 	      nil 'clockcheck))
 	 (special '(closed clock state))
 	 (t (not org-agenda-show-log))))
-  (setq org-agenda-start-with-log-mode org-agenda-show-log)
   (org-agenda-set-mode-name)
   (org-agenda-redo)
   (message "Log mode is %s" (if org-agenda-show-log "on" "off")))
-- 
2.16.1


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

* Re: [PATCH] org-agenda: make log and clockreport modes local
  2018-02-22  2:42 [PATCH] org-agenda: make log and clockreport modes local Nicolas Dudebout
@ 2018-02-22 13:39 ` Nicolas Goaziou
  2018-02-22 14:20   ` Nicolas Dudebout
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Goaziou @ 2018-02-22 13:39 UTC (permalink / raw)
  To: Nicolas Dudebout; +Cc: emacs-orgmode

Hello,

Nicolas Dudebout <nicolas.dudebout@gmail.com> writes:

> `org-agenda-show-log' indicates if the the current agenda buffer has
> log-mode enabled.  When building a new agenda buffer, it gets its
> value from `org-agenda-start-with-log-mode'.  It is is semantically a
> buffer local variable: when creating a new agenda buffer you expect it
> to be set to the value in `org-agenda-start-with-log-mode'.  However,
> 2e9c2d71 while fixing an issue with sticky agendas rendered the
> variable `org-agenda-log-mode' effectively global: toggling log mode
> in a given agenda buffer modifies the global default for all agenda
> buffers.  The same reasoning holds for clockreport mode.
>
> This change ensures that a log or clockreport mode change made in one
> agenda buffer does not propagate to other agenda buffers, existing or
> new.  The change is however preserved on org-agenda-redo in the
> initial agenda buffer, whether using sticky agendas or not.

Applied. Thank you.

I don't know if you signed FSF papers already. Therefore, I added
TINYCHANGE at the end of the commit message.

Regards,

-- 
Nicolas Goaziou

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

* Re: [PATCH] org-agenda: make log and clockreport modes local
  2018-02-22 13:39 ` Nicolas Goaziou
@ 2018-02-22 14:20   ` Nicolas Dudebout
  2018-02-22 20:41     ` Nicolas Goaziou
  0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Dudebout @ 2018-02-22 14:20 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: emacs-orgmode

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

Thank you.

I signed FSF papers in November 2015 for use-package's inclusion to emacs.

On Thu, Feb 22, 2018 at 8:39 AM, Nicolas Goaziou <mail@nicolasgoaziou.fr>
wrote:

> Hello,
>
> Nicolas Dudebout <nicolas.dudebout@gmail.com> writes:
>
> > `org-agenda-show-log' indicates if the the current agenda buffer has
> > log-mode enabled.  When building a new agenda buffer, it gets its
> > value from `org-agenda-start-with-log-mode'.  It is is semantically a
> > buffer local variable: when creating a new agenda buffer you expect it
> > to be set to the value in `org-agenda-start-with-log-mode'.  However,
> > 2e9c2d71 while fixing an issue with sticky agendas rendered the
> > variable `org-agenda-log-mode' effectively global: toggling log mode
> > in a given agenda buffer modifies the global default for all agenda
> > buffers.  The same reasoning holds for clockreport mode.
> >
> > This change ensures that a log or clockreport mode change made in one
> > agenda buffer does not propagate to other agenda buffers, existing or
> > new.  The change is however preserved on org-agenda-redo in the
> > initial agenda buffer, whether using sticky agendas or not.
>
> Applied. Thank you.
>
> I don't know if you signed FSF papers already. Therefore, I added
> TINYCHANGE at the end of the commit message.
>
> Regards,
>
> --
> Nicolas Goaziou
>

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

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

* Re: [PATCH] org-agenda: make log and clockreport modes local
  2018-02-22 14:20   ` Nicolas Dudebout
@ 2018-02-22 20:41     ` Nicolas Goaziou
  0 siblings, 0 replies; 4+ messages in thread
From: Nicolas Goaziou @ 2018-02-22 20:41 UTC (permalink / raw)
  To: Nicolas Dudebout; +Cc: emacs-orgmode

Nicolas Dudebout <nicolas.dudebout@gmail.com> writes:

> I signed FSF papers in November 2015 for use-package's inclusion to
> emacs.

OK. I updated our list of contributors accordingly.

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

end of thread, other threads:[~2018-02-22 20:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-22  2:42 [PATCH] org-agenda: make log and clockreport modes local Nicolas Dudebout
2018-02-22 13:39 ` Nicolas Goaziou
2018-02-22 14:20   ` Nicolas Dudebout
2018-02-22 20:41     ` Nicolas Goaziou

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.