Commit a73fae1f authored by Glenn Morris's avatar Glenn Morris

Some remember doc

* doc/misc/remember.texi (copying): Bump remember mode version.
(Installation): Remove unnecessary chapter.
(Quick Start): No need to explicitly load remember.el.
(Separate Text Files): New section.

* lisp/textmodes/remember.el (remember-data-directory)
(remember-directory-file-name-format, remember-store-in-files)
(remember-notes-initial-major-mode, remember-notes-bury-on-kill)
(remember-notes-save-and-bury-buffer)
(remember-notes--kill-buffer-query): Doc fixes.

* etc/NEWS: Related edit.
parent 1825653e
2014-02-18 Glenn Morris <rgm@gnu.org>
* remember.texi (copying): Bump remember mode version.
(Installation): Remove unnecessary chapter.
(Quick Start): No need to explicitly load remember.el.
(Separate Text Files): New section.
2014-02-17 Glenn Morris <rgm@gnu.org> 2014-02-17 Glenn Morris <rgm@gnu.org>
* eieio.texi (Class Values, CLOS compatibility): * eieio.texi (Class Values, CLOS compatibility):
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
@c %**end of header @c %**end of header
@copying @copying
This manual is for Remember Mode, version 1.9 This manual is for Remember Mode, version 2.0
Copyright @copyright{} 2001, 2004--2005, 2007--2014 Copyright @copyright{} 2001, 2004--2005, 2007--2014
Free Software Foundation, Inc. Free Software Foundation, Inc.
...@@ -54,7 +54,6 @@ modify this GNU manual.'' ...@@ -54,7 +54,6 @@ modify this GNU manual.''
@menu @menu
* Preface:: About the documentation. * Preface:: About the documentation.
* Introduction:: What is Remember Mode? * Introduction:: What is Remember Mode?
* Installation:: How to install Remember.
* Implementation:: How Remember came into existence. * Implementation:: How Remember came into existence.
* Quick Start:: Get started using Remember. * Quick Start:: Get started using Remember.
* Function Reference:: Interactive functions in remember.el. * Function Reference:: Interactive functions in remember.el.
...@@ -69,6 +68,7 @@ modify this GNU manual.'' ...@@ -69,6 +68,7 @@ modify this GNU manual.''
Backends Backends
* Text File:: Saving to a text file. * Text File:: Saving to a text file.
* Separate Text Files:: Saving to separate text files.
* Diary:: Saving to a Diary file. * Diary:: Saving to a Diary file.
* Mailbox:: Saving to a mailbox. * Mailbox:: Saving to a mailbox.
* Org:: Saving to an Org Mode file. * Org:: Saving to an Org Mode file.
...@@ -128,18 +128,6 @@ in order to record them---it would map much more closely to how the mind ...@@ -128,18 +128,6 @@ in order to record them---it would map much more closely to how the mind
manual-ness which computers from the very beginning have been championed manual-ness which computers from the very beginning have been championed
as being able to reduce. as being able to reduce.
@node Installation
@chapter Installation
Installing Remember Mode is as simple as adding the following lines to
your Emacs configuration file (usually @file{~/.emacs.d/init.el} or
@file{~/.emacs}).
@lisp
(add-to-list 'load-path "/path/to/remember")
(require 'remember)
@end lisp
@node Implementation @node Implementation
@chapter Implementation @chapter Implementation
...@@ -187,14 +175,11 @@ feedback will help to make this as intuitive a tool as possible. ...@@ -187,14 +175,11 @@ feedback will help to make this as intuitive a tool as possible.
@itemize @itemize
@item @item
Load @file{remember.el}. Type @kbd{M-x remember}. The @samp{*Remember*} buffer should be
@item
Type @kbd{M-x remember}. The @samp{*Remember*} buffer should be
displayed. displayed.
@item @item
Type in what you want to remember. The first line will be treated as Type in what you want to remember. The first line will be treated as
the headline, and the rest of the buffer will contain the body of the the headline, and the rest of the buffer will contain the body of the
note. note.
...@@ -204,18 +189,18 @@ the @samp{*Remember*} buffer. ...@@ -204,18 +189,18 @@ the @samp{*Remember*} buffer.
@end itemize @end itemize
By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}. By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}.
You can edit it now to see the remembered and timestamped note. You You can edit it now to see the remembered and timestamped note. You
can edit this file however you want. New entries will always be added can edit this file however you want. New entries will always be added
to the end. to the end.
To remember a region of text, use the universal prefix. @kbd{C-u M-x To remember a region of text, use the universal prefix. @kbd{C-u M-x
remember} displays a @samp{*Remember*} buffer with the region as the remember} displays a @samp{*Remember*} buffer with the region as the
initial contents. initial contents.
As a simple beginning, you can start by using the Text File backend, As a simple beginning, you can start by using the Text File backend,
keeping your @file{~/.emacs.d/notes} file in outline-mode format, with a final keeping your @file{~/.emacs.d/notes} file in outline-mode format, with a final
entry called @samp{* Raw data}. Remembered data will be added to the entry called @samp{* Raw data}. Remembered data will be added to the
end of the file. Every so often, you can move the data that gets end of the file. Every so often, you can move the data that gets
appended there into other files, or reorganize your document. appended there into other files, or reorganize your document.
You can also store remembered data in other backends. You can also store remembered data in other backends.
...@@ -233,7 +218,7 @@ very accessible keystrokes facilities using the mode: ...@@ -233,7 +218,7 @@ very accessible keystrokes facilities using the mode:
@end lisp @end lisp
By default, remember uses the first annotation returned by By default, remember uses the first annotation returned by
@code{remember-annotation-functions}. To include all of the annotations, @code{remember-annotation-functions}. To include all of the annotations,
set @code{remember-run-all-annotation-functions-flag} to non-nil. set @code{remember-run-all-annotation-functions-flag} to non-nil.
@defopt remember-run-all-annotation-functions-flag @defopt remember-run-all-annotation-functions-flag
...@@ -242,7 +227,7 @@ Non-nil means use all annotations returned by ...@@ -242,7 +227,7 @@ Non-nil means use all annotations returned by
@end defopt @end defopt
You can write custom functions that use a different set of You can write custom functions that use a different set of
remember-annotation-functions. For example: remember-annotation-functions. For example:
@lisp @lisp
(defun my/remember-with-filename () (defun my/remember-with-filename ()
...@@ -258,7 +243,7 @@ remember-annotation-functions. For example: ...@@ -258,7 +243,7 @@ remember-annotation-functions. For example:
@file{remember.el} defines the following interactive functions: @file{remember.el} defines the following interactive functions:
@defun remember initial @defun remember initial
Remember an arbitrary piece of data. With a prefix, it will use the Remember an arbitrary piece of data. With a prefix, it will use the
region as @var{initial}. region as @var{initial}.
@end defun @end defun
...@@ -310,6 +295,7 @@ You can save remembered notes to a variety of backends. ...@@ -310,6 +295,7 @@ You can save remembered notes to a variety of backends.
@menu @menu
* Text File:: Saving to a text file. * Text File:: Saving to a text file.
* Separate Text Files:: Saving to separate text files.
* Diary:: Saving to a Diary file. * Diary:: Saving to a Diary file.
* Mailbox:: Saving to a mailbox. * Mailbox:: Saving to a mailbox.
* Org:: Saving to an Org Mode file. * Org:: Saving to an Org Mode file.
...@@ -335,6 +321,30 @@ The file in which to store unprocessed data. ...@@ -335,6 +321,30 @@ The file in which to store unprocessed data.
The text used to begin each remember item. The text used to begin each remember item.
@end defopt @end defopt
@node Separate Text Files
@section Saving to Separate Text Files
@cindex text files, saving to separate
@subheading Insinuation
@lisp
(setq remember-handler-functions '(remember-store-in-files))
@end lisp
@subheading Options
@defopt remember-data-directory
The directory in which to store remember data as files.
@end defopt
@defopt remember-directory-file-name-format
A format string to use for naming files in the remember directory.
File names are formed by calling @code{format-time-string} at the time
of saving, using this format string.
@end defopt
@node Diary @node Diary
@section Saving to a Diary file @section Saving to a Diary file
@cindex diary, integration @cindex diary, integration
......
...@@ -28,6 +28,7 @@ otherwise leave it unmarked. ...@@ -28,6 +28,7 @@ otherwise leave it unmarked.
This happens by default if a suitable support library is found at This happens by default if a suitable support library is found at
build time, like libacl on GNU/Linux. To prevent this, use the build time, like libacl on GNU/Linux. To prevent this, use the
configure option `--disable-acl'. configure option `--disable-acl'.
FIXME? Should be --without-acl?
** Emacs can now be compiled with file notification support. ** Emacs can now be compiled with file notification support.
This happens by default if a suitable system library is found at This happens by default if a suitable system library is found at
...@@ -720,11 +721,11 @@ buffer and can be used that way by setting `initial-buffer-choice' to ...@@ -720,11 +721,11 @@ buffer and can be used that way by setting `initial-buffer-choice' to
Without the second change, the *scratch* buffer will still be there Without the second change, the *scratch* buffer will still be there
for notes that do not need to be preserved. for notes that do not need to be preserved.
*** The Remember package can now store notes in separates files. +++
You can use the new function `remember-store-in-files' within the *** Remember can now store notes in separate files.
`remember-handler-functions' option. See `remember-data-directory' To use this, add `remember-store-in-files' to the `remember-handler-functions'
and `remember-directory-file-name-format' for new options related to option. The files are saved in `remember-data-directory' using
this function. names specified by `remember-directory-file-name-format'.
** Rmail ** Rmail
......
2014-02-18 Glenn Morris <rgm@gnu.org> 2014-02-18 Glenn Morris <rgm@gnu.org>
* textmodes/remember.el (remember-data-directory)
(remember-directory-file-name-format, remember-store-in-files)
(remember-notes-initial-major-mode, remember-notes-bury-on-kill)
(remember-notes-save-and-bury-buffer)
(remember-notes--kill-buffer-query): Doc fixes.
* desktop.el (desktop-save-mode, desktop-auto-save-timeout): Doc fixes. * desktop.el (desktop-save-mode, desktop-auto-save-timeout): Doc fixes.
2014-02-17 Alan Mackenzie <acm@muc.de> 2014-02-17 Alan Mackenzie <acm@muc.de>
......
...@@ -442,21 +442,24 @@ If you want to remember a region, supply a universal prefix to ...@@ -442,21 +442,24 @@ If you want to remember a region, supply a universal prefix to
(remember-destroy)))) (remember-destroy))))
(defcustom remember-data-directory "~/remember" (defcustom remember-data-directory "~/remember"
"The directory in which to store remember data as files." "The directory in which to store remember data as files.
Used by `remember-store-in-files'."
:type 'directory :type 'directory
:version "24.4" :version "24.4"
:group 'remember) :group 'remember)
(defcustom remember-directory-file-name-format "%Y-%m-%d_%T-%z" (defcustom remember-directory-file-name-format "%Y-%m-%d_%T-%z"
"Format string for the file name in which to store unprocessed data." "Format string for the file name in which to store unprocessed data.
This is passed to `format-time-string'.
Used by `remember-store-in-files'."
:type 'string :type 'string
:version "24.4" :version "24.4"
:group 'remember) :group 'remember)
(defun remember-store-in-files () (defun remember-store-in-files ()
"Store remember data in a file in `remember-data-directory'. "Store remember data in a file in `remember-data-directory'.
The file is named after `remember-directory-file-name-format' fed through The file is named by calling `format-time-string' using
`format-time-string'." `remember-directory-file-name-format' as the format string."
(let ((name (format-time-string (let ((name (format-time-string
remember-directory-file-name-format (current-time))) remember-directory-file-name-format (current-time)))
(text (buffer-string))) (text (buffer-string)))
...@@ -572,20 +575,19 @@ purpose of storing notes." ...@@ -572,20 +575,19 @@ purpose of storing notes."
:version "24.4") :version "24.4")
(defcustom remember-notes-initial-major-mode nil (defcustom remember-notes-initial-major-mode nil
"Major mode to set to notes buffer when it's created. "Major mode to use in the notes buffer when it's created.
If set to nil will use the same mode as `initial-major-mode'." If this is nil, use `initial-major-mode'."
:type '(choice (const :tag "Same as `initial-major-mode'" nil) :type '(choice (const :tag "Use `initial-major-mode'" nil)
(function :tag "Major mode" text-mode)) (function :tag "Major mode" text-mode))
:version "24.4") :version "24.4")
(defcustom remember-notes-bury-on-kill t (defcustom remember-notes-bury-on-kill t
"Whether to bury notes buffer instead of killing." "Non-nil means `kill-buffer' will bury the notes buffer instead of killing."
:type 'boolean :type 'boolean
:version "24.4") :version "24.4")
(defun remember-notes-save-and-bury-buffer () (defun remember-notes-save-and-bury-buffer ()
"Saves and buries current buffer. "Save (if it is modified) and bury the current buffer."
Buffer is saved only if `buffer-modified-p' returns non-nil."
(interactive) (interactive)
(when (buffer-modified-p) (when (buffer-modified-p)
(save-buffer)) (save-buffer))
...@@ -648,10 +650,16 @@ preserve across Emacs restarts. The notes will be stored in the ...@@ -648,10 +650,16 @@ preserve across Emacs restarts. The notes will be stored in the
buf)) buf))
(defun remember-notes--kill-buffer-query () (defun remember-notes--kill-buffer-query ()
"Function that `remember-notes-mode' adds to `kill-buffer-query-functions'.
Save the current buffer if modified. If `remember-notes-bury-on-kill'
is non-nil, bury it and return nil; otherwise return t."
(when (buffer-modified-p) (when (buffer-modified-p)
(save-buffer)) (save-buffer))
(if remember-notes-bury-on-kill (if remember-notes-bury-on-kill
(bury-buffer) (progn
;; bury-buffer always returns nil, but let's be explicit.
(bury-buffer)
nil)
t)) t))
;;; remember.el ends here ;;; remember.el ends here
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment