diff options
author | Bastien Guerry <bzg@altern.org> | 2013-04-08 21:01:08 +0200 |
---|---|---|
committer | Bastien Guerry <bzg@altern.org> | 2013-04-08 21:25:10 +0200 |
commit | c25566fec3cf88892a9fe707c4fb6e7143e233c4 (patch) | |
tree | bf53c171b11e110adaef16f1ebc3f1e98d8392c1 | |
parent | ee422561c8ea0286fbd2b1fe55f57aff0b41865f (diff) | |
download | org-mode-c25566fec3cf88892a9fe707c4fb6e7143e233c4.tar.gz |
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.
-rw-r--r-- | lisp/org-agenda.el | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 1afdf9f..3abfb6b 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." |