aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olson2007-12-05 01:16:38 +0000
committerMichael Olson2007-12-05 01:16:38 +0000
commit3728bf0389987e4c4aee38b74eed470462e2a9be (patch)
treeb563e78386e0d41be66eb1526aa982d3dc1b5f78
parent79f10da0c30b6323105c78c7ffc230c495dd75a7 (diff)
downloademacs-3728bf0389987e4c4aee38b74eed470462e2a9be.tar.gz
emacs-3728bf0389987e4c4aee38b74eed470462e2a9be.zip
Merge remember-diary.el into remember.el
-rw-r--r--doc/misc/ChangeLog5
-rw-r--r--doc/misc/remember.texi2
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/textmodes/remember-diary.el94
-rw-r--r--lisp/textmodes/remember.el63
5 files changed, 82 insertions, 95 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 6bd7de9102c..02e39fe8171 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,8 @@
12007-12-05 Michael Olson <mwolson@gnu.org>
2
3 * remember.texi (Diary): Remove "require" line for remember-diary.el.
4 Update documentation for `remember-diary-file'.
5
12007-12-04 Michael Albinus <michael.albinus@gmx.de> 62007-12-04 Michael Albinus <michael.albinus@gmx.de>
2 7
3 * dbus.texi (Signals): Precise `dbus-register-signal'. 8 * dbus.texi (Signals): Precise `dbus-register-signal'.
diff --git a/doc/misc/remember.texi b/doc/misc/remember.texi
index 41d1777bf5a..d93774c5850 100644
--- a/doc/misc/remember.texi
+++ b/doc/misc/remember.texi
@@ -350,7 +350,6 @@ The text used to begin each remember item.
350@subheading Insinuation 350@subheading Insinuation
351 351
352@lisp 352@lisp
353(require 'remember-diary)
354(add-to-list 'remember-handler-functions 'remember-diary-extract-entries) 353(add-to-list 'remember-handler-functions 'remember-diary-extract-entries)
355@end lisp 354@end lisp
356 355
@@ -358,6 +357,7 @@ The text used to begin each remember item.
358 357
359@defopt remember-diary-file 358@defopt remember-diary-file
360File for extracted diary entries. 359File for extracted diary entries.
360If this is nil, then @code{diary-file} will be used instead."
361@end defopt 361@end defopt
362 362
363@node Mailbox, Org, Diary, Backends 363@node Mailbox, Org, Diary, Backends
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 47cd9fed94c..3318864873e 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
12007-12-05 Michael Olson <mwolson@gnu.org>
2
3 * textmodes/remember.el: Merge contents of remember-diary.el here,
4 updating header. Add autoload cookie so that byte-compilation
5 works without warning.
6 (remember-diary-file): Default to nil, since diary might not yet
7 be loaded at this point, which would deny us access to diary-file.
8 (remember-diary-extract-entries): If remember-diary-file is nil,
9 then use diary-file instead.
10
11 * textmodes/remember-diary.el: Remove, due to the issue of needing
12 the first 8 characters of a filename to be unique.
13
12007-12-04 Michael Albinus <michael.albinus@gmx.de> 142007-12-04 Michael Albinus <michael.albinus@gmx.de>
2 15
3 * net/dbus.el (dbus-hash-table=): New defun. 16 * net/dbus.el (dbus-hash-table=): New defun.
diff --git a/lisp/textmodes/remember-diary.el b/lisp/textmodes/remember-diary.el
deleted file mode 100644
index e35909fb589..00000000000
--- a/lisp/textmodes/remember-diary.el
+++ /dev/null
@@ -1,94 +0,0 @@
1;;; remember-diary --- extracting diary information from buffers
2
3;; Copyright (C) 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc.
4
5;; Author: Sacha Chua <sacha@free.net.ph>
6;; Created: 24 Mar 2004
7;; Keywords: data memory todo pim diary
8;; URL: http://gna.org/projects/remember-el/
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software; you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation; either version 3, or (at your option)
15;; any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs; see the file COPYING. If not, write to the
24;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
25;; Boston, MA 02110-1301, USA.
26
27;;; Commentary:
28
29;; This module recognizes entries of the form
30;;
31;; DIARY: ....
32;;
33;; and puts them in your ~/.diary (or remember-diary-file) together
34;; with an annotation. Planner-style dates (yyyy.mm.dd) are converted
35;; to yyyy-mm-dd so that diary can understand them.
36;;
37;; For example:
38;;
39;; DIARY: 2003.08.12 Sacha's birthday
40;;
41;; is stored as
42;;
43;; 2003.08.12 Sacha's birthday [[/home/sacha/notebook/emacs/emacs-wiki/remember-diary.el]]
44;;
45;; To use, add the following to your .emacs:
46;;
47;; (require 'remember-diary)
48;; ;; This should be before other entries that may return t
49;; (add-to-list 'remember-handler-functions 'remember-diary-extract-entries)
50;;
51
52(require 'remember)
53(require 'diary-lib)
54
55;;; Code:
56(defcustom remember-diary-file diary-file
57 "*File for extracted diary entries."
58 :type 'file
59 :group 'remember)
60
61(defun remember-diary-convert-entry (entry)
62 "Translate MSG to an entry readable by diary."
63 (save-match-data
64 (when remember-annotation
65 (setq entry (concat entry " " remember-annotation)))
66 (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry)
67 (replace-match
68 (if european-calendar-style
69 (concat (match-string 3 entry) "/"
70 (match-string 2 entry) "/"
71 (match-string 1 entry))
72 (concat (match-string 2 entry) "/"
73 (match-string 3 entry) "/"
74 (match-string 1 entry)))
75 t t entry)
76 entry)))
77
78;;;###autoload
79(defun remember-diary-extract-entries ()
80 "Extract diary entries from the region."
81 (save-excursion
82 (goto-char (point-min))
83 (let (list)
84 (while (re-search-forward "^DIARY:\\s-*\\(.+\\)" nil t)
85 (add-to-list 'list (remember-diary-convert-entry (match-string 1))))
86 (when list
87 (make-diary-entry (mapconcat 'identity list "\n")
88 nil remember-diary-file))
89 nil))) ;; Continue processing
90
91(provide 'remember-diary)
92
93;; arch-tag: bda8a3f8-9a9b-46aa-8493-d71d7f1e445d
94;;; remember-diary.el ends here
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index 7249f1d4c57..81be7ace146 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -153,6 +153,29 @@
153;; Faridu'd-Din `Attar wrote: "Be occupied as little as possible with 153;; Faridu'd-Din `Attar wrote: "Be occupied as little as possible with
154;; things of the outer world but much with things of the inner world; 154;; things of the outer world but much with things of the inner world;
155;; then right action will overcome inaction." 155;; then right action will overcome inaction."
156;;
157;; * Diary integration
158;;
159;; To use, add the following to your .emacs:
160;;
161;; ;; This should be before other entries that may return t
162;; (add-to-list 'remember-handler-functions 'remember-diary-extract-entries)
163;;
164;; This module recognizes entries of the form
165;;
166;; DIARY: ....
167;;
168;; and puts them in your ~/.diary (or remember-diary-file) together
169;; with an annotation. Dates in the form YYYY.MM.DD are converted to
170;; YYYY-MM-DD so that diary can understand them.
171;;
172;; For example:
173;;
174;; DIARY: 2003.08.12 Sacha's birthday
175;;
176;; is stored as
177;;
178;; 2003.08.12 Sacha's birthday
156 179
157;;; History: 180;;; History:
158 181
@@ -440,6 +463,46 @@ application."
440 (kill-buffer (current-buffer)) 463 (kill-buffer (current-buffer))
441 (jump-to-register remember-register))) 464 (jump-to-register remember-register)))
442 465
466;;; Diary integration
467
468(defcustom remember-diary-file nil
469 "*File for extracted diary entries.
470If this is nil, then `diary-file' will be used instead."
471 :type 'file
472 :group 'remember)
473
474(defun remember-diary-convert-entry (entry)
475 "Translate MSG to an entry readable by diary."
476 (save-match-data
477 (when remember-annotation
478 (setq entry (concat entry " " remember-annotation)))
479 (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry)
480 (replace-match
481 (if european-calendar-style
482 (concat (match-string 3 entry) "/"
483 (match-string 2 entry) "/"
484 (match-string 1 entry))
485 (concat (match-string 2 entry) "/"
486 (match-string 3 entry) "/"
487 (match-string 1 entry)))
488 t t entry)
489 entry)))
490
491(autoload 'make-diary-entry "diary-lib")
492
493;;;###autoload
494(defun remember-diary-extract-entries ()
495 "Extract diary entries from the region."
496 (save-excursion
497 (goto-char (point-min))
498 (let (list)
499 (while (re-search-forward "^DIARY:\\s-*\\(.+\\)" nil t)
500 (add-to-list 'list (remember-diary-convert-entry (match-string 1))))
501 (when list
502 (make-diary-entry (mapconcat 'identity list "\n")
503 nil (or remember-diary-file diary-file)))
504 nil))) ;; Continue processing
505
443;;; Internal Functions: 506;;; Internal Functions:
444 507
445(defvar remember-mode-map 508(defvar remember-mode-map