3

From Org Agenda view, I can do several things like reschedule, reprioritize, tag, etc.

How do I edit the headline itself from the org agenda view? Or it can not be done?

3
  • Well, the underlying .org file is a <Tab> org-agenda-goto or <Return> org-agenda-switch-to away, the former in the other window, the latter replaces the agenda view. You could do edits with B org-agenda-bulk-action and f but that sounds too far fetched orgmode.org/manual/Agenda-commands.html
    – p_wiersig
    Commented Nov 28, 2017 at 20:36
  • @p_wiersig I agree with TAB or RET. But there is a specific section on Remote Editing here So I thought out-of-the-box it would provide an option to edit the heading itself
    – deshmukh
    Commented Nov 29, 2017 at 11:34
  • I also want this. First: It fits great into my mental model with C-c C-x p editing properties (etc.) and using something like C-c C-x h to edit the heading itself. It is also really nice, if it works regardless(!) if you are in the agenda-view or in the org-file itself. On top, it is nice, if you don't have to move the point and if it can be done within the minibuffer. So I have a few reasons here to add. :-)
    – jonas
    Commented Oct 28 at 11:06

1 Answer 1

0

I wanted the same and I came to the following solution using the org-edit-headline function in org-mode.

What I did: I took the function that let's you edit the properties from the agenda view:

(defun org-agenda-set-property ()
  "Set a property for the current headline."
  (interactive)
  (org-agenda-check-no-diary)
  (org-agenda-maybe-loop
   #'org-agenda-set-property nil nil nil
   (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
            (org-agenda-error)))
      (buffer (marker-buffer hdmarker))
      (pos (marker-position hdmarker))
      (inhibit-read-only t)
      ) ;; newhead
     (org-with-remote-undo buffer
       (with-current-buffer buffer
     (widen)
     (goto-char pos)
     (org-fold-show-context 'agenda)
     (call-interactively 'org-set-property))))))

and replaced the last interactive call with org-edit-headline. That worked already. In a second step I removed the org-agenda-maybe-loop, because I will be editing headlines one by one:

  (defun org-agenda-edit-headline ()
    "Edit the headline for the current headline."
    (interactive)
    (org-agenda-check-no-diary)
    (let* ((hdmarker (or (org-get-at-bol 'org-hd-marker)
                         (org-agenda-error)))
           (buffer (marker-buffer hdmarker))
           (pos (marker-position hdmarker))
           (inhibit-read-only t)
           ) ;; newhead
      (org-with-remote-undo buffer
        (with-current-buffer buffer
          (widen)
          (goto-char pos)
          (org-fold-show-context 'agenda)
          (call-interactively 'org-edit-headline)))))

Please note, that I basically don't understand the function, but I'm happy that I was able to make it work.

I have it bound to C-c C-x h in org-agenda-mode-map.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.