emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marco Wahl <marcowahlsoft@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: point moves and zoom level reverts when refreshing agenda
Date: Tue, 29 May 2018 18:22:40 +0200	[thread overview]
Message-ID: <84vab61lf3.fsf@gmail.com> (raw)
In-Reply-To: CAJcAo8vFByyp3yQHSzNtEHzUMNO4WuW6McV==+=1mu7Pq=M6dg@mail.gmail.com

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

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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-agenda-Keep-text-scale-at-agenda-redo.patch --]
[-- Type: text/x-patch, Size: 1452 bytes --]

From 7952540977a5281310edf190c81b8d811218d6ed Mon Sep 17 00:00:00 2001
From: Marco Wahl <marcowahlsoft@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


  parent reply	other threads:[~2018-05-29 16:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-27 21:19 point moves and zoom level reverts when refreshing agenda Samuel Wales
2018-05-27 21:24 ` Samuel Wales
2018-05-29 16:22 ` Marco Wahl [this message]
2018-06-05 14:18   ` Marco Wahl
2018-06-05 19:00     ` Samuel Wales
2018-06-05 20:35       ` Marco Wahl
2018-06-19 18:22         ` Nicolas Goaziou
2018-06-24  8:15           ` Marco Wahl
2018-06-24 21:10             ` Samuel Wales

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84vab61lf3.fsf@gmail.com \
    --to=marcowahlsoft@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).