emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Display only latest sub notes in agenda


From: Sacha Chua
Subject: Re: [O] Display only latest sub notes in agenda
Date: Sun, 15 Jun 2014 15:54:58 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Steffen Heilmann <address@hidden> writes:

Hello, Steffen, all!

> I am looking for an easy way to see when I had the last interaction
> with everybody (preferably sorted by date). I want to use this to
> quickly see whom I have not contacted for some time and then can
> reach-out to them.

Something like this, maybe?

    (defun sacha/org-update-with-last-meeting ()
      (interactive)
      (goto-char (point-max))
      (let (last-meeting)
        (while (re-search-backward
                (concat "\\(" org-outline-regexp "\\)\\|\\("
                        org-maybe-keyword-time-regexp "\\)") nil t)
          (cond
           ((and (match-string 1)
                 (= (nth 1 (save-match-data (org-heading-components))) 1)
                 last-meeting)
            ;; heading
            (save-excursion (org-set-property "LASTMEETING" last-meeting))
            (setq last-meeting nil))
           ((and (match-string 2))
            (if (or (null last-meeting) (string< last-meeting (match-string 2)))
                (setq last-meeting (match-string 2))))))))

It turns:

    * John Smith
    ** DONE Conversation
    [2014-01-20]
    ** DONE E-mail
    [2014-01-15]
    * Jane Smith
    ** DONE Conversation
    [2014-01-07]

into:

    * John Smith
      :PROPERTIES:
      :LASTMEETING: [2014-01-20]
      :END:
    ** DONE E-mail
    [2014-01-15]
    ** DONE Conversation
    [2014-01-20]
    * Someone without a meeting
    * Jane Smith
      :PROPERTIES:
      :LASTMEETING: [2014-01-07]
      :END:
    ** DONE Conversation
    [2014-01-07]

You can then use something like:

#+COLUMNS: %25ITEM %LASTMEETING %TAGS %PRIORITY %TODO

#+BEGIN: columnview :maxlevel 1
| ITEM                        | LASTMEETING  | TAGS | PRIORITY | TODO |
|-----------------------------+--------------+------+----------+------|
| * John Smith                | [2014-01-20] |      |          |      |
| * Someone without a meeting |              |      |          |      |
| * Jane Smith                | <2014-01-07> |      |          |      |
#+END:

or even sort the entries by the LASTMEETING property (R will
reverse-sort by property).

Sacha




reply via email to

[Prev in Thread] Current Thread [Next in Thread]