* textmodes/remember.el (remember-handler-functions): Add an

option for a new handler `remember-store-in-files'.
(remember-data-directory, remember-directory-file-name-format):
New options.
(remember-store-in-files): New function to store remember notes
as separate files within a directory.
This commit is contained in:
Bastien Guerry 2013-04-24 16:35:59 +02:00
parent 4391916c58
commit 1ffefcf908
2 changed files with 32 additions and 1 deletions

View file

@ -1,3 +1,12 @@
2013-04-24 Reuben Thomas <rrt@sc3d.org>
* textmodes/remember.el (remember-handler-functions): Add an
option for a new handler `remember-store-in-files'.
(remember-data-directory, remember-directory-file-name-format):
New options.
(remember-store-in-files): New function to store remember notes
as separate files within a directory.
2013-04-24 Magnus Henoch <magnus.henoch@gmail.com>
* progmodes/compile.el (compilation-next-error-function):

View file

@ -216,10 +216,11 @@ All functions are run in the remember buffer."
Each function is called with the current buffer narrowed to what the
user wants remembered.
If any function returns non-nil, the data is assumed to have been
recorded somewhere by that function. "
recorded somewhere by that function."
:type 'hook
:options '(remember-store-in-mailbox
remember-append-to-file
remember-store-in-files
remember-diary-extract-entries
org-remember-handler)
:group 'remember)
@ -429,6 +430,27 @@ If you want to remember a region, supply a universal prefix to
(run-hook-with-args-until-success 'remember-handler-functions))
(remember-destroy))))
(defcustom remember-data-directory "~/remember"
"The directory in which to store remember data as files."
:type 'file
:group 'remember)
(defcustom remember-directory-file-name-format "%Y-%m-%d_%T-%z"
"Format string for the file name in which to store unprocessed data."
:type 'file
:group 'remember)
(defun remember-store-in-files ()
"Store remember data in a file in `remember-data-directory'.
The file is named after `remember-directory-file-name-format'."
(let ((name (format-time-string
remember-directory-file-name-format (current-time)))
(text (buffer-string)))
(with-temp-buffer
(insert text)
(write-file (convert-standard-filename
(format "%s/%s" remember-data-directory name))))))
;;;###autoload
(defun remember-clipboard ()
"Remember the contents of the current clipboard.