Browse Source

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.
Bastien 6 months ago
parent
commit
a2b69c58f8
1 changed files with 7 additions and 0 deletions
  1. 7 0
      lisp/org-agenda.el

+ 7 - 0
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."