From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sacha Chua Subject: Re: Display only latest sub notes in agenda Date: Sun, 15 Jun 2014 15:54:58 -0400 Message-ID: <87ha3mgd7x.fsf@sachachua.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwGWP-0004UZ-3U for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 15:55:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WwGWH-0002fA-Gm for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 15:55:21 -0400 Received: from plane.gmane.org ([80.91.229.3]:38755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WwGWH-0002f6-AU for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 15:55:13 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WwGWG-0008N4-6j for emacs-orgmode@gnu.org; Sun, 15 Jun 2014 21:55:12 +0200 Received: from 69-165-143-207.dsl.teksavvy.com ([69.165.143.207]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Jun 2014 21:55:12 +0200 Received: from sacha by 69-165-143-207.dsl.teksavvy.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 15 Jun 2014 21:55:12 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Steffen Heilmann 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