Hi Samuel,

> recent maint, have not tried in -Q.

Me neither.  ;)

> summary: point moves and zoom level reverts when refreshing agenda
>
> 1]
>
> i find that,
>
> when i do an agenda agenda [daily/weekly] and i have point on a task,
>
> and i go do something in the task and nearby nodes, and a bunch of
> other things, and return to the agenda,
>
> and refresh agenda view [and also just in case any of the markers god
> out of date and could cause corruption if i operated on a task from
> the agenda],
>
> that point moves from the task.  i wonder if it makes sense to try to
> keep point on the task that it was on?

I also find the point movement erratic sometimes in the agenda.  IIUC
the line number gets stored for the agenda and after agenda-redo point
is set to that line number again.

I also thought a bit about a better behavior.  One could implement a
heuristic which trys to place point at a line which looks "very much"
like the line which contained point before the redo.  But I'm not sure
how crazy that is.

> 2] i also find that refreshing resets the zoom level created using
> text-scale-increase.  i wonder if this can also be preserved.  to me,
> refreshing refers to updating the contents of the agenda view, not
> things like text scale.

This is a wanted feature AFAICT.  I think the following patch is a
reliable way to achieve the preservation of text-scale for agenda-redo.


Ciao,
     Marco

>From 7952540977a5281310edf190c81b8d811218d6ed Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahls...@gmail.com>
Date: Tue, 29 May 2018 17:59:46 +0200
Subject: [PATCH] org-agenda: Keep text-scale at agenda-redo

* lisp/org-agenda.el (org-agenda-redo):  Save and restore `text-scale-mode-amount'.
---
 lisp/org-agenda.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 24b752498..8eab8fe43 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7318,7 +7318,9 @@ in the agenda."
 		   (cons (or cpa (car last-args)) (cdr last-args)))
 		  ((stringp last-args)
 		   last-args))))
-	 (series-redo-cmd (get-text-property p 'org-series-redo-cmd)))
+	 (series-redo-cmd (get-text-property p 'org-series-redo-cmd))
+	 (before-text-scale-mode-amount
+	  (when (boundp' text-scale-mode-amount) text-scale-mode-amount)))
     (put 'org-agenda-tag-filter :preset-filter nil)
     (put 'org-agenda-category-filter :preset-filter nil)
     (put 'org-agenda-regexp-filter :preset-filter nil)
@@ -7350,6 +7352,7 @@ in the agenda."
       (when re  (org-agenda-filter-apply re 'regexp)))
     (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter))
     (and cols (called-interactively-p 'any) (org-agenda-columns))
+    (and before-text-scale-mode-amount (text-scale-set before-text-scale-mode-amount))
     (org-goto-line line)
     (recenter window-line)))
 
-- 
2.17.0

Reply via email to