From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alan E. Davis" Subject: Re: How to add entries to an org file, not diary Date: Tue, 10 Nov 2009 15:51:52 +1000 Message-ID: <7bef1f890911092151j2cca33b9ve8e6f6e65cb6bc78@mail.gmail.com> References: <31568.1257520584@maps> <4af8c885.1608c00a.50e5.0a86@mx.google.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1642820298==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N7jeN-0001E5-DG for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 00:52:19 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N7jeI-0001Dd-Co for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 00:52:18 -0500 Received: from [199.232.76.173] (port=58042 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N7jeI-0001DS-24 for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 00:52:14 -0500 Received: from mail-iw0-f174.google.com ([209.85.223.174]:40322) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N7jeH-0000ID-Hd for emacs-orgmode@gnu.org; Tue, 10 Nov 2009 00:52:13 -0500 Received: by iwn4 with SMTP id 4so2836349iwn.14 for ; Mon, 09 Nov 2009 21:52:12 -0800 (PST) In-Reply-To: <4af8c885.1608c00a.50e5.0a86@mx.google.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Org Mode Cc: Bernt Hansen , Matt Lundin , Stephen Eglen , Carsten Dominik --===============1642820298== Content-Type: multipart/alternative; boundary=001636c5971b582a4e0477fde97d --001636c5971b582a4e0477fde97d Content-Type: text/plain; charset=ISO-8859-1 > > At Mon, 9 Nov 2009 22:09:23 +0100, > Carsten Dominik wrote: > > > Right now I have implemented > > > > i d for day entries, > > i b for blocks, > > i a for anniversaries (which will be collected under a special > > heading "Anniversaries" in your `diary.org' > > i j To jump to the cursor date in the date tree > > > > What else would be useful? > Thank you for this: I don't remember how this came to pass. I think after writing email to Ed Reingold, author of the various emacs calendar tools, and eventually, this came about. I've thought ever since, that it needed polishing, but I used it innumerable times over the years. Perhaps this would be useful for what you are implementing, or something like it. I'd like to have it. This was certainly done up by Ed Reingold originally, but I've lost track (it was in the pre-org-mode time). The polishing part comes from the inconvenience of typing individually the numbers of days ahead of time one wanted to be reminded. I don't know how to make it better. Maybe org-agenda already does this pretty well. Out of laziness, I used to type something like this, for numbers of days to remind: "30 27 25 22 20 17 14 12 9 7 5 4 3 2 1". Possibly a hard-coded sequence would be just as good, and it could skip weekends, or other inconvenient days, be sure to hit fridays, or whatever. Possibly this is all redundant in the context of org-mode. I guess it is, but I'll send it along anyway. Anyway, here it is. I have it bound to "i e" in the calendar map. ;;;;;;;;;;;;;;;Begin "diary-insert-event-with-reminder";;;;;;;;;;;;;;;;;;;;;;;8<;;;;;;;;;;;;;; ;; Trivially, this function is covered by the GPL. It "borrows liberally" (TM) ;; from the diary-lib package of Ed Reingold. ;; Alan Davis 15 May 1998. Saipan, NMI. ;; ;; When invoked, this function prompts for a string of numbers ;; representing the number of days in advance you would like to be ;; reminded. Enter a sequence of numbers, like '1 2 3 4 7 8 20'. ;; Subsequently, the function will query for a description of the event. ;; You may optionally type a description of the event; whether or not ;; you do not do so, after you type , will find yourself in ;; your .diary file at the newly inserted line. ;; ;; You may wish to place the following line in your .emacs: ;; (require 'diary-insert-event-with-reminder) (defun diary-insert-event-with-reminder (daylist event arg) "Insert a unique event, on a single date as given by point. A prefix arg will make the entry nonmarking. When invoked, this function will interactively ask for the number of days in advance that you'd like to be reminded, and a name for the event." (interactive "sDays in advance to remind: \nsWhat's the event? \nP") (require 'diary-lib) (let* ((calendar-date-display-form (if european-calendar-style '(day " " month " " year) '(month " " day " " year)))) (make-diary-entry (format "%s(diary-remind '(diary-date %s) '(%s)) %s" sexp-diary-entry-symbol (calendar-date-string (calendar-cursor-to-date t) nil t) daylist event) arg))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;END;;;;;;;;;;;;;;;;>8;;;;;;;;;;;;;;;;;;;;;;;;;;;;; To bind to keys "ie" in calendar-mode-map: (setq calendar-load-hook '(lambda () ;; Keybinding (define-key calendar-mode-map "ie" 'diary-insert-event-with-reminder) )) ;;;;;;;;;;;;;;; I haven't gotten my feet wet with this new implementation, but will be doing so, I'm not sure how this would fit in with what you have implemented. Alan Davis --001636c5971b582a4e0477fde97d Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
At Mon, 9 Nov 2009 22:09:23 +0100,
Carsten Dominik <carsten.dominik@gmail.com> wrote:

> Right now I have implemented
>
> i d =A0 for day entries,
> i b =A0 for blocks,
> i a =A0 for anniversaries (which will be collected under a special
> =A0 =A0 =A0 =A0heading "Anniversaries" in your `diary.org'
> i j =A0 To jump to the cursor date in the date tree
>
> What else would be useful?
=A0
Thank you for this:

I don't remember how this came t= o pass.=A0 I think after writing email to Ed Reingold, author of the variou= s emacs calendar tools, and eventually, this came about.=A0 I've though= t ever since, that it needed polishing, but I used it innumerable times ove= r the years.=A0 Perhaps this would be useful for what you are implementing,= or something like it.=A0 I'd like to have it.=A0 This was certainly=A0= done up by Ed Reingold originally, but I've lost track (it was in the = pre-org-mode time).

The polishing part comes from the inconvenience of typing individually = the numbers of days ahead of time one wanted to be reminded.=A0 I don't= know how to make it better.=A0 Maybe org-agenda already does this pretty w= ell.=A0 Out of laziness, I used to type something like this, for numbers of= days to remind: "30 27 25 22 20 17 14 12 9 7 5 4 3 2 1".=A0 Poss= ibly a hard-coded sequence would be just as good, and it could skip weekend= s, or other inconvenient days, be sure to hit fridays, or whatever.

Possibly this is all redundant in the context of org-mode.=A0 I guess i= t is, but I'll send it along anyway.

Anyway, here it is.=A0 I ha= ve it bound to "i e" in the calendar map.


;;;;;;;;;;;;= ;;;Begin "diary-insert-event-with-reminder";;;;;;;;;;;;;;;;;;;;;;= ;8<;;;;;;;;;;;;;;
;; Trivially, this function is covered by the GPL.=A0 It "borrows libe= rally" (TM)
;; from the diary-lib package of Ed Reingold.=A0
;;= Alan Davis=A0=A0 15 May 1998.=A0 Saipan, NMI.
;;
;; When=A0 invoked= ,=A0 this function prompts for=A0 a string of numbers
;; representing the number of days in advance you would like to be
;; r= eminded.=A0 Enter a sequence of numbers, like '1 2 3 4 7 8 20'. ;; Subsequently, the function will query for a description of the event.= =A0
;; You may optionally type a description of the event; whether or not
;= ; you do not do so, after you type <ENTER>,=A0 will find yourself in<= br>;; your .diary file at the newly inserted line.
;;
;; You may wis= h to place the following line in your .emacs:
;;=A0 (require 'diary-insert-event-with-reminder)

(defun diary-i= nsert-event-with-reminder (daylist event arg)
=A0 "Insert a unique = event, on a single date as given by point.=A0 A
prefix arg will make the= entry nonmarking.=A0 When invoked, this
function will interactively ask for the number of days in advance that
y= ou'd like to be reminded, and a name for the event."
=A0 (inter= active "sDays in advance to remind: \nsWhat's the event? \nP"= )
=A0 (require 'diary-lib)
=A0 (let* ((calendar-date-display-form
= =A0=A0=A0 =A0 (if european-calendar-style
=A0=A0=A0 =A0=A0=A0=A0=A0 '= ;(day " " month " " year)
=A0=A0=A0 =A0=A0=A0 '(= month " " day " " year))))
=A0=A0=A0 (make-diary-entry
=A0=A0=A0=A0 (format "%s(diary-remind &= #39;(diary-date %s) '(%s)) %s"
=A0=A0=A0 =A0=A0=A0=A0 sexp-diar= y-entry-symbol
=A0=A0=A0 =A0=A0=A0=A0 (calendar-date-string (calendar-cu= rsor-to-date t) nil t) daylist event)
=A0=A0=A0=A0 arg)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;END;;;;;;;;;;;;;;;;>8;= ;;;;;;;;;;;;;;;;;;;;;;;;;;;;

To bind to keys "ie" in calen= dar-mode-map:

(setq calendar-load-hook
=A0=A0=A0 =A0'(lambda = ()
=A0=A0=A0 =A0=A0=A0 ;; Keybinding
=A0=A0=A0 =A0=A0=A0 (define-key calendar-mode-map
=A0=A0=A0 =A0=A0=A0=A0= =A0 "ie"
=A0=A0=A0 =A0=A0=A0=A0=A0 'diary-insert-event-wit= h-reminder)
))
;;;;;;;;;;;;;;;

I haven't gotten my feet we= t with this new implementation, but will be doing so,=A0 I'm not sure h= ow this would fit in with what you have implemented.

Alan Davis


--001636c5971b582a4e0477fde97d-- --===============1642820298== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Remember: use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1642820298==--