From c25566fec3cf88892a9fe707c4fb6e7143e233c4 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Mon, 8 Apr 2013 21:01:08 +0200 Subject: [PATCH] org-agenda.el (org-agenda-goto-date): Put the cursor on the agenda line with the selected date * org-agenda.el (org-agenda-goto-date): Put the cursor on the agenda line with the selected date. --- lisp/org-agenda.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 1afdf9f3a..3abfb6b03 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -7723,6 +7723,7 @@ Negative selection means regexp must not match for selection of an entry." (let* ((org-read-date-prefer-future (eval org-agenda-jump-prefer-future)) (date (org-read-date)) + (day (time-to-days (org-time-string-to-time date))) (org-agenda-sticky-orig org-agenda-sticky) (org-agenda-buffer-tmp-name (buffer-name)) (args (get-text-property (min (1- (point-max)) (point)) 'org-last-args)) @@ -7734,12 +7735,16 @@ Negative selection means regexp must not match for selection of an entry." (inhibit-read-only t) org-agenda-sticky) (if (not (org-agenda-check-type t 'agenda)) - (error "Not available in non-agenda blocks") + (error "Not available in non-agenda views") (add-text-properties (point-min) (point-max) `(org-redo-cmd ,newcmd org-last-args ,newargs)) (org-agenda-redo) - (setq org-agenda-sticky org-agenda-sticky-orig - org-agenda-this-buffer-is-sticky org-agenda-sticky)))) + (goto-char (point-min)) + (while (not (or (= (or (get-text-property (point) 'day) 0) day) + (save-excursion (move-beginning-of-line 2) (eobp)))) + (move-beginning-of-line 2)) + (setq org-agenda-sticky org-agenda-sticky-orig + org-agenda-this-buffer-is-sticky org-agenda-sticky)))) (defun org-agenda-goto-today () "Go to today." -- 2.11.4.GIT