From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marco Wahl Subject: Re: point moves and zoom level reverts when refreshing agenda Date: Tue, 29 May 2018 18:22:40 +0200 Message-ID: <84vab61lf3.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:43083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fNhOg-0006to-Lr for emacs-orgmode@gnu.org; Tue, 29 May 2018 12:22:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fNhOd-0006R3-Gj for emacs-orgmode@gnu.org; Tue, 29 May 2018 12:22:54 -0400 Received: from [195.159.176.226] (port=42951 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fNhOd-0006QZ-7O for emacs-orgmode@gnu.org; Tue, 29 May 2018 12:22:51 -0400 Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1fNhMT-0001G6-SY for emacs-orgmode@gnu.org; Tue, 29 May 2018 18:20:37 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: "Emacs-orgmode" To: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain 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 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-org-agenda-Keep-text-scale-at-agenda-redo.patch >From 7952540977a5281310edf190c81b8d811218d6ed Mon Sep 17 00:00:00 2001 From: Marco Wahl 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 --=-=-=--