aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2014-02-19 00:34:45 -0800
committerGlenn Morris2014-02-19 00:34:45 -0800
commit95160c901a9bc780f30982002b9fcded5b436308 (patch)
tree66a2cf9041f19d4e00e74b1e134d10baf90ffed3
parent6cdb34f31fcccb19e0a9e5f2853c1d5fffc87a11 (diff)
downloademacs-95160c901a9bc780f30982002b9fcded5b436308.tar.gz
emacs-95160c901a9bc780f30982002b9fcded5b436308.zip
Some remember doc
* doc/misc/remember.texi: Copyedits. (Quick Start): No need for manual autoloads. Mention remember-notes. (Function Reference): Update arguments. Add new commands. * lisp/textmodes/remember.el: Set maintainer to emacs-devel according to remember.texi. Move provide statement to end. (remember-mode-map, remember-notes-mode-map, remember-notes-mode) (remember-notes): Doc fixes.
-rw-r--r--doc/misc/ChangeLog6
-rw-r--r--doc/misc/remember.texi82
-rw-r--r--etc/NEWS10
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/textmodes/remember.el59
5 files changed, 104 insertions, 59 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index ca17200c650..0bd139c8017 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,9 @@
12014-02-19 Glenn Morris <rgm@gnu.org>
2
3 * remember.texi: Copyedits.
4 (Quick Start): No need for manual autoloads. Mention remember-notes.
5 (Function Reference): Update arguments. Add new commands.
6
12014-02-18 Glenn Morris <rgm@gnu.org> 72014-02-18 Glenn Morris <rgm@gnu.org>
2 8
3 * remember.texi (copying): Bump remember mode version. 9 * remember.texi (copying): Bump remember mode version.
diff --git a/doc/misc/remember.texi b/doc/misc/remember.texi
index e1c99f1382e..2607d2ce37f 100644
--- a/doc/misc/remember.texi
+++ b/doc/misc/remember.texi
@@ -96,8 +96,8 @@ to remember what our conscious mind may not currently have access to.
96There are many different databases out there---and good ones---which 96There are many different databases out there---and good ones---which
97this mode is not trying to replace. Rather, it's how that data gets 97this mode is not trying to replace. Rather, it's how that data gets
98there that's the question. Most of the time, we just want to say 98there that's the question. Most of the time, we just want to say
99"Remember so-and-so's phone number, or that I have to buy dinner for the 99``Remember so-and-so's phone number, or that I have to buy dinner for the
100cats tonight." That's the FACT@. How it's stored is really the 100cats tonight.'' That's the FACT@. How it's stored is really the
101computer's problem. But at this point in time, it's most definitely 101computer's problem. But at this point in time, it's most definitely
102also the user's problem, and sometimes so laboriously so that people 102also the user's problem, and sometimes so laboriously so that people
103just let data slip, rather than expend the effort to record it. 103just let data slip, rather than expend the effort to record it.
@@ -175,7 +175,7 @@ feedback will help to make this as intuitive a tool as possible.
175@itemize 175@itemize
176 176
177@item 177@item
178Type @kbd{M-x remember}. The @samp{*Remember*} buffer should be 178Type @kbd{M-x remember}. The @file{*Remember*} buffer should be
179displayed. 179displayed.
180 180
181@item 181@item
@@ -185,7 +185,7 @@ note.
185 185
186@item 186@item
187Type @kbd{C-c C-c} (@code{remember-finalize}) to save the note and close 187Type @kbd{C-c C-c} (@code{remember-finalize}) to save the note and close
188the @samp{*Remember*} buffer. 188the @file{*Remember*} buffer.
189@end itemize 189@end itemize
190 190
191By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}. 191By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}.
@@ -194,7 +194,7 @@ can edit this file however you want. New entries will always be added
194to the end. 194to the end.
195 195
196To remember a region of text, use the universal prefix. @kbd{C-u M-x 196To remember a region of text, use the universal prefix. @kbd{C-u M-x
197remember} displays a @samp{*Remember*} buffer with the region as the 197remember} displays a @file{*Remember*} buffer with the region as the
198initial contents. 198initial contents.
199 199
200As a simple beginning, you can start by using the Text File backend, 200As a simple beginning, you can start by using the Text File backend,
@@ -203,26 +203,23 @@ entry called @samp{* Raw data}. Remembered data will be added to the
203end of the file. Every so often, you can move the data that gets 203end of the file. Every so often, you can move the data that gets
204appended there into other files, or reorganize your document. 204appended there into other files, or reorganize your document.
205 205
206You can also store remembered data in other backends. 206You can also store remembered data in other backends. @xref{Backends}.
207(@pxref{Backends})
208 207
209Here is one way to map the remember functions in your @file{.emacs} to 208Here is one way to map the remember functions in your init file to
210very accessible keystrokes facilities using the mode: 209very accessible keystrokes facilities using the mode:
211 210
212@lisp 211@lisp
213(autoload 'remember ``remember'' nil t)
214(autoload 'remember-region ``remember'' nil t)
215
216(define-key global-map (kbd "<f9> r") 'remember) 212(define-key global-map (kbd "<f9> r") 'remember)
217(define-key global-map (kbd "<f9> R") 'remember-region) 213(define-key global-map (kbd "<f9> R") 'remember-region)
218@end lisp 214@end lisp
219 215
220By default, remember uses the first annotation returned by 216By default, remember uses the first annotation returned by
221@code{remember-annotation-functions}. To include all of the annotations, 217@code{remember-annotation-functions}. To include all of the annotations,
222set @code{remember-run-all-annotation-functions-flag} to non-nil. 218set @code{remember-run-all-annotation-functions-flag} to a
219non-@code{nil} value.
223 220
224@defopt remember-run-all-annotation-functions-flag 221@defopt remember-run-all-annotation-functions-flag
225Non-nil means use all annotations returned by 222Non-@code{nil} means use all annotations returned by
226@code{remember-annotation-functions}. 223@code{remember-annotation-functions}.
227@end defopt 224@end defopt
228 225
@@ -237,17 +234,32 @@ remember-annotation-functions. For example:
237 (call-interactively 'remember))) 234 (call-interactively 'remember)))
238@end lisp 235@end lisp
239 236
237@cindex notes
238The @code{remember-notes} command creates a @dfn{notes} buffer that
239visits the file specified by the option @code{remember-data-file}.
240The option @code{remember-notes-buffer-name} specifies the name of the
241buffer. The buffer uses @code{remember-notes-initial-major-mode} and
242@code{remember-notes-mode} minor mode. Use @kbd{C-c C-c} to save
243and bury the buffer. The command @code{save-some-buffers} saves this
244buffer without asking. This function is a suitable setting for
245@code{initial-buffer-choice}.
246
247
240@node Function Reference 248@node Function Reference
241@chapter Function Reference 249@chapter Function Reference
242 250
243@file{remember.el} defines the following interactive functions: 251@file{remember.el} defines the following interactive functions:
244 252
245@defun remember initial 253@defun remember &optional initial
246Remember an arbitrary piece of data. With a prefix, it will use the 254Remember an arbitrary piece of data. With a prefix, it will use the
247region as @var{initial}. 255region as @var{initial}.
248@end defun 256@end defun
249 257
250@defun remember-region beg end 258@defun remember-other-frame &optional initial
259Like @code{remember}, but uses a new frame.
260@end defun
261
262@defun remember-region &optional beg end
251If called from within the remember buffer, @var{beg} and @var{end} are 263If called from within the remember buffer, @var{beg} and @var{end} are
252ignored, and the entire buffer will be remembered. If called from any 264ignored, and the entire buffer will be remembered. If called from any
253other buffer, that region, plus any context information specific to 265other buffer, that region, plus any context information specific to
@@ -263,13 +275,37 @@ for remembering things from Netscape or other X Windows applications.
263Remember the contents of the current buffer. 275Remember the contents of the current buffer.
264@end defun 276@end defun
265 277
278@defun remember-destroy
279Destroy the current remember buffer.
280@end defun
281
266@defun remember-mode 282@defun remember-mode
267This enters the major mode for output from @command{remember}. This 283This enters the major mode for output from @code{remember}. This
268buffer is used to collect data that you want remember. Just hit 284buffer is used to collect data that you want remember. Just hit
269@kbd{C-c C-c} when you're done entering, and it will go ahead and file 285@kbd{C-c C-c} when you're done entering, and it will go ahead and file
270the data for latter retrieval, and possible indexing. 286the data for latter retrieval, and possible indexing.
271@end defun 287@end defun
272 288
289@defun remember-notes &optional switch-to
290This returns the notes buffer, creating it if needed, and switches
291to it if called interactively (or if @var{switch-to} is non-@code{nil}).
292The notes buffer visits @code{remember-data-file}, and
293is named @code{remember-notes-buffer-name}. It uses
294@code{remember-notes-initial-major-mode} and @code{remember-notes-mode}
295minor mode.
296@end defun
297
298@defun remember-notes-mode &optional arg
299This is a minor mode for the notes buffer. It sets
300@code{buffer-save-without-query} so that @code{save-some-buffers} will
301save the notes buffer without asking. Use @kbd{C-c C-c} to
302run the command @code{remember-notes-save-and-bury-buffer}.
303@end defun
304
305@defun remember-notes-save-and-bury-buffer
306Save (if it is modified) and bury the current buffer.
307@end defun
308
273@node Keystrokes 309@node Keystrokes
274@chapter Keystroke Reference 310@chapter Keystroke Reference
275 311
@@ -277,14 +313,12 @@ the data for latter retrieval, and possible indexing.
277 313
278@table @kbd 314@table @kbd
279 315
280@item C-c C-c (`remember-finalize') 316@item C-c C-c
281Remember the contents of the current buffer. 317@itemx C-x C-s
282 318Remember the contents of the current buffer (`remember-finalize').
283@item C-c C-k (`remember-destroy')
284Destroy the current *Remember* buffer.
285 319
286@item C-x C-s (`remember-finalize') 320@item C-c C-k
287Remember the contents of the current buffer. 321Destroy the current @file{*Remember*} buffer (`remember-destroy').
288 322
289@end table 323@end table
290 324
@@ -359,7 +393,7 @@ of saving, using this format string.
359 393
360@defopt remember-diary-file 394@defopt remember-diary-file
361File for extracted diary entries. 395File for extracted diary entries.
362If this is nil, then @code{diary-file} will be used instead." 396If this is @code{nil}, then @code{diary-file} will be used instead.
363@end defopt 397@end defopt
364 398
365@node Mailbox 399@node Mailbox
diff --git a/etc/NEWS b/etc/NEWS
index 679b9d4871f..bfe3ef6aae3 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -713,13 +713,9 @@ along with the non-SMIE indentation code.
713 713
714** Remember 714** Remember
715 715
716*** The new command `remember-notes' creates a buffer that is saved on 716+++
717`kill-emacs'. You can think of it as a *scratch* buffer whose content 717*** The new command `remember-notes' creates a buffer that is saved on exit.
718is preserved. In fact, it was designed as a replacement for *scratch* 718You can use it as a more permanent *scratch* buffer.
719buffer and can be used that way by setting `initial-buffer-choice' to
720`remember-notes' and `remember-notes-buffer-name' to "*scratch*".
721Without the second change, the *scratch* buffer will still be there
722for notes that do not need to be preserved.
723 719
724+++ 720+++
725*** Remember can now store notes in separate files. 721*** Remember can now store notes in separate files.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b47c19be1f9..4827fedace1 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12014-02-19 Glenn Morris <rgm@gnu.org>
2
3 * textmodes/remember.el: Move provide statement to end.
4 (remember-mode-map, remember-notes-mode-map, remember-notes-mode)
5 (remember-notes): Doc fixes.
6
12014-02-18 Stefan Monnier <monnier@iro.umontreal.ca> 72014-02-18 Stefan Monnier <monnier@iro.umontreal.ca>
2 8
3 * delsel.el (delete-char): Restore incorrectly erased property 9 * delsel.el (delete-char): Restore incorrectly erased property
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el
index a9eb7ad4ec8..089f5b2d889 100644
--- a/lisp/textmodes/remember.el
+++ b/lisp/textmodes/remember.el
@@ -3,6 +3,7 @@
3;; Copyright (C) 1999-2001, 2003-2014 Free Software Foundation, Inc. 3;; Copyright (C) 1999-2001, 2003-2014 Free Software Foundation, Inc.
4 4
5;; Author: John Wiegley <johnw@gnu.org> 5;; Author: John Wiegley <johnw@gnu.org>
6;; Maintainer: emacs-devel@gnu.org
6;; Created: 29 Mar 1999 7;; Created: 29 Mar 1999
7;; Version: 2.0 8;; Version: 2.0
8;; Keywords: data memory todo pim 9;; Keywords: data memory todo pim
@@ -178,8 +179,6 @@
178 179
179;;; Code: 180;;; Code:
180 181
181(provide 'remember)
182
183(defconst remember-version "2.0" 182(defconst remember-version "2.0"
184 "This version of remember.") 183 "This version of remember.")
185 184
@@ -230,6 +229,8 @@ recorded somewhere by that function."
230 :type 'boolean 229 :type 'boolean
231 :group 'remember) 230 :group 'remember)
232 231
232;; See below for more user variables.
233
233;;; Internal Variables: 234;;; Internal Variables:
234 235
235(defvar remember-buffer "*Remember*" 236(defvar remember-buffer "*Remember*"
@@ -553,7 +554,7 @@ If this is nil, then `diary-file' will be used instead."
553 (define-key map "\C-c\C-c" 'remember-finalize) 554 (define-key map "\C-c\C-c" 'remember-finalize)
554 (define-key map "\C-c\C-k" 'remember-destroy) 555 (define-key map "\C-c\C-k" 'remember-destroy)
555 map) 556 map)
556 "Keymap used in Remember mode.") 557 "Keymap used in `remember-mode'.")
557 558
558(define-derived-mode remember-mode indented-text-mode "Remember" 559(define-derived-mode remember-mode indented-text-mode "Remember"
559 "Major mode for output from \\[remember]. 560 "Major mode for output from \\[remember].
@@ -599,10 +600,14 @@ If this is nil, use `initial-major-mode'."
599 (let ((map (make-sparse-keymap))) 600 (let ((map (make-sparse-keymap)))
600 (define-key map "\C-c\C-c" 'remember-notes-save-and-bury-buffer) 601 (define-key map "\C-c\C-c" 'remember-notes-save-and-bury-buffer)
601 map) 602 map)
602 "Keymap used in remember-notes mode.") 603 "Keymap used in `remember-notes-mode'.")
603 604
604(define-minor-mode remember-notes-mode 605(define-minor-mode remember-notes-mode
605 "Minor mode for the `remember-notes' buffer." 606 "Minor mode for the `remember-notes' buffer.
607This sets `buffer-save-without-query' so that `save-some-buffers' will
608save the notes buffer without asking.
609
610\\{remember-notes-mode-map}"
606 nil nil nil 611 nil nil nil
607 (cond 612 (cond
608 (remember-notes-mode 613 (remember-notes-mode
@@ -612,29 +617,25 @@ If this is nil, use `initial-major-mode'."
612 617
613;;;###autoload 618;;;###autoload
614(defun remember-notes (&optional switch-to) 619(defun remember-notes (&optional switch-to)
615 "Creates notes buffer and switches to it if called interactively. 620 "Return the notes buffer, creating it if needed, and maybe switch to it.
616 621This buffer is for notes that you want to preserve across Emacs sessions.
617If a notes buffer created by a previous invocation of this 622The notes are saved in `remember-data-file'.
618function already exist, it will be returned. Otherwise a new 623
619buffer will be created whose content will be read from file 624If a buffer is already visiting that file, just return it.
620pointed by `remember-data-file'. If a buffer visiting this file 625
621already exist, that buffer will be used instead of creating a new 626Otherwise, create the buffer, and rename it to `remember-notes-buffer-name',
622one (see `find-file-noselect' function for more details). 627unless a buffer of that name already exists. Set the major mode according
623 628to `remember-notes-initial-major-mode', and enable `remember-notes-mode'
624Name of the created buffer is taken from `remember-notes-buffer-name' 629minor mode.
625variable and if a buffer with that name already exist (but was not 630
626created by this function), it will be first killed. 631Use \\<remember-notes-mode-map>\\[remember-notes-save-and-bury-buffer] to save and bury the notes buffer.
627\\<remember-notes-mode-map> 632
628`remember-notes-mode' is active in the notes buffer which by default 633Interactively, or if SWITCH-TO is non-nil, switch to the buffer.
629contains only one \\[save-and-bury-buffer] binding which saves and 634Return the buffer.
630buries the buffer. 635
631 636Set `initial-buffer-choice' to `remember-notes' to visit your notes buffer
632Function returns notes buffer. When called interactively, 637when Emacs starts. Set `remember-notes-buffer-name' to \"*scratch*\"
633switches to it as well. 638to turn the *scratch* buffer into your notes buffer."
634
635Notes buffer is meant for keeping random notes which you'd like to
636preserve across Emacs restarts. The notes will be stored in the
637`remember-data-file'."
638 (interactive "p") 639 (interactive "p")
639 (let ((buf (or (find-buffer-visiting remember-data-file) 640 (let ((buf (or (find-buffer-visiting remember-data-file)
640 (with-current-buffer (find-file-noselect remember-data-file) 641 (with-current-buffer (find-file-noselect remember-data-file)
@@ -662,4 +663,6 @@ is non-nil, bury it and return nil; otherwise return t."
662 nil) 663 nil)
663 t)) 664 t))
664 665
666(provide 'remember)
667
665;;; remember.el ends here 668;;; remember.el ends here