From a2b69c58f8d66d0d6cc58c74f32f1692bb5d9c0c Mon Sep 17 00:00:00 2001 From: Bastien Date: Sun, 2 Feb 2020 19:39:26 +0100 Subject: [PATCH] org-agenda.el: Add `org-agenda-end-of-line' * lisp/org-agenda.el (org-agenda-mode-map): Remap 'move-end-of-line to 'org-agenda-end-of-line. (org-agenda-end-of-line): New command. This fixes this bug: when moving to the end of line, if the next line is hidden, changing the timestamp of the current headline would not display the new time. This is also safer when archiving subtrees and when performing actions on agenda headlines in general. --- lisp/org-agenda.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index d2397ccb9..9f355f3d0 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -93,6 +93,8 @@ (defvar org-habit-show-all-today) (defvar org-habit-scheduled-past-days) +(org-remap org-agenda-mode-map 'move-end-of-line 'org-agenda-end-of-line) + ;; Defined somewhere in this file, but used before definition. (defvar org-agenda-buffer-name "*Org Agenda*") (defvar org-agenda-overriding-header nil) @@ -1156,6 +1158,11 @@ argument, a calendar-style date list like (month day year)." (string :tag "Format string") (function :tag "Function"))) +(defun org-agenda-end-of-line () + "Go to the end of visible line." + (interactive) + (goto-char (line-end-position))) + (defun org-agenda-format-date-aligned (date) "Format a DATE string for display in the daily/weekly agenda. This function makes sure that dates are aligned for easy reading."