emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: mega@retes.hu (Gábor Melis)
To: emacs-orgmode@gnu.org
Subject: resetting the span in agenda (current git version)
Date: Sun, 13 Feb 2011 13:58:20 +0100	[thread overview]
Message-ID: <87pqqw6qhf.fsf@retes.hu> (raw)

On the current master branch, it seems to me that doing anything that
ends up calling org-agenda-redo resets the span (most often pressing g,
l, R for me). I papered over the damage with this for l and R, but it is
obviously not the right fix:

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index aea7291..34d71d1 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -6420,7 +6420,11 @@ agenda filter."
       (setq org-agenda-clockreport-mode 'with-filter)
     (setq org-agenda-clockreport-mode (not org-agenda-clockreport-mode)))
   (org-agenda-set-mode-name)
-  (org-agenda-redo)
+  (let* ((sd (org-agenda-compute-starting-span
+	      (org-today) (or org-agenda-current-span org-agenda-ndays org-agenda-span)))
+	 (org-agenda-overriding-arguments org-agenda-last-arguments))
+    (setf (nth 1 org-agenda-overriding-arguments) sd)
+    (org-agenda-redo))
   (message "Clocktable mode is %s"
 	   (if org-agenda-clockreport-mode "on" "off")))
 
@@ -6437,7 +6441,11 @@ With a double `C-u' prefix arg, show *only* log items, nothing else."
 	  (if special '(closed clock state)
 	    (not org-agenda-show-log))))
   (org-agenda-set-mode-name)
-  (org-agenda-redo)
+  (let* ((sd (org-agenda-compute-starting-span
+	      (org-today) (or org-agenda-current-span org-agenda-ndays org-agenda-span)))
+	 (org-agenda-overriding-arguments org-agenda-last-arguments))
+    (setf (nth 1 org-agenda-overriding-arguments) sd)
+    (org-agenda-redo))
   (message "Log mode is %s"
 	   (if org-agenda-show-log "on" "off")))

 
Cheers,
Gabor Melis

                 reply	other threads:[~2011-02-13 12:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=87pqqw6qhf.fsf@retes.hu \
    --to=mega@retes.hu \
    --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).