Steve Hafner <steve.b.haf...@gmail.com> writes: > On Tue, Jan 4, 2011 at 9:22 PM, Matt Lundin <m...@imapmail.org> wrote: >> Steve Hafner <steve.b.haf...@gmail.com> writes: >> >>> I've written a few elisp functions to edit entries, and I would like >>> to be able to execute them remotely from the agenda; but it seems no >>> hooks or other facilities exist to do so. Am I missing something? >>> >> >> (info "(org) Using the mapping API") >> >> http://orgmode.org/manual/Using-the-mapping-API.html >> >> Best, >> Matt >> > > OK, I'm able to run elisp commands remotely from an agenda buffer > using org-map-entries; but what I'd really like to do is specifically > target the current item, and I don't see what expression for MATCH > would only match the current item. By "current item" I mean the entry > corresponding to the line that point is on within the agenda buffer.
Ah. I see. I misread "remotely from agenda" as "not in the agenda". You can jump to the current entry in a number of ways. There is the function org-agenda-goto. Within the agenda, you can also get the markers for the current entry with: (org-get-at-bol 'org-marker) (org-get-at-bol 'org-hd-marker) You can use these markers (usually with save-excursion or save-window-excursion) to jump to the function and alter it. The code of org-agenda-todo provides a nice example of this. It would be nice if this functionality were abstracted a bit in org-agenda.el. Right now, each of the org-agenda editing commands (org-agenda-todo, org-agenda-set-tags, org-agenda-priority, org-agenda-add-note, etc.) reimplements the same behavior. Best, Matt _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode