+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):
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)
(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.