diff options
| author | Glenn Morris | 2014-02-19 00:34:45 -0800 |
|---|---|---|
| committer | Glenn Morris | 2014-02-19 00:34:45 -0800 |
| commit | 95160c901a9bc780f30982002b9fcded5b436308 (patch) | |
| tree | 66a2cf9041f19d4e00e74b1e134d10baf90ffed3 | |
| parent | 6cdb34f31fcccb19e0a9e5f2853c1d5fffc87a11 (diff) | |
| download | emacs-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/ChangeLog | 6 | ||||
| -rw-r--r-- | doc/misc/remember.texi | 82 | ||||
| -rw-r--r-- | etc/NEWS | 10 | ||||
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/textmodes/remember.el | 59 |
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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-02-18 Glenn Morris <rgm@gnu.org> | 7 | 2014-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. | |||
| 96 | There are many different databases out there---and good ones---which | 96 | There are many different databases out there---and good ones---which |
| 97 | this mode is not trying to replace. Rather, it's how that data gets | 97 | this mode is not trying to replace. Rather, it's how that data gets |
| 98 | there that's the question. Most of the time, we just want to say | 98 | there 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 |
| 100 | cats tonight." That's the FACT@. How it's stored is really the | 100 | cats tonight.'' That's the FACT@. How it's stored is really the |
| 101 | computer's problem. But at this point in time, it's most definitely | 101 | computer's problem. But at this point in time, it's most definitely |
| 102 | also the user's problem, and sometimes so laboriously so that people | 102 | also the user's problem, and sometimes so laboriously so that people |
| 103 | just let data slip, rather than expend the effort to record it. | 103 | just 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 |
| 178 | Type @kbd{M-x remember}. The @samp{*Remember*} buffer should be | 178 | Type @kbd{M-x remember}. The @file{*Remember*} buffer should be |
| 179 | displayed. | 179 | displayed. |
| 180 | 180 | ||
| 181 | @item | 181 | @item |
| @@ -185,7 +185,7 @@ note. | |||
| 185 | 185 | ||
| 186 | @item | 186 | @item |
| 187 | Type @kbd{C-c C-c} (@code{remember-finalize}) to save the note and close | 187 | Type @kbd{C-c C-c} (@code{remember-finalize}) to save the note and close |
| 188 | the @samp{*Remember*} buffer. | 188 | the @file{*Remember*} buffer. |
| 189 | @end itemize | 189 | @end itemize |
| 190 | 190 | ||
| 191 | By default, @code{remember-finalize} saves the note in @file{~/emacs.d/notes}. | 191 | By 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 | |||
| 194 | to the end. | 194 | to the end. |
| 195 | 195 | ||
| 196 | To remember a region of text, use the universal prefix. @kbd{C-u M-x | 196 | To remember a region of text, use the universal prefix. @kbd{C-u M-x |
| 197 | remember} displays a @samp{*Remember*} buffer with the region as the | 197 | remember} displays a @file{*Remember*} buffer with the region as the |
| 198 | initial contents. | 198 | initial contents. |
| 199 | 199 | ||
| 200 | As a simple beginning, you can start by using the Text File backend, | 200 | As 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 | |||
| 203 | end of the file. Every so often, you can move the data that gets | 203 | end of the file. Every so often, you can move the data that gets |
| 204 | appended there into other files, or reorganize your document. | 204 | appended there into other files, or reorganize your document. |
| 205 | 205 | ||
| 206 | You can also store remembered data in other backends. | 206 | You can also store remembered data in other backends. @xref{Backends}. |
| 207 | (@pxref{Backends}) | ||
| 208 | 207 | ||
| 209 | Here is one way to map the remember functions in your @file{.emacs} to | 208 | Here is one way to map the remember functions in your init file to |
| 210 | very accessible keystrokes facilities using the mode: | 209 | very 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 | ||
| 220 | By default, remember uses the first annotation returned by | 216 | By 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, |
| 222 | set @code{remember-run-all-annotation-functions-flag} to non-nil. | 218 | set @code{remember-run-all-annotation-functions-flag} to a |
| 219 | non-@code{nil} value. | ||
| 223 | 220 | ||
| 224 | @defopt remember-run-all-annotation-functions-flag | 221 | @defopt remember-run-all-annotation-functions-flag |
| 225 | Non-nil means use all annotations returned by | 222 | Non-@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 | ||
| 238 | The @code{remember-notes} command creates a @dfn{notes} buffer that | ||
| 239 | visits the file specified by the option @code{remember-data-file}. | ||
| 240 | The option @code{remember-notes-buffer-name} specifies the name of the | ||
| 241 | buffer. 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 | ||
| 243 | and bury the buffer. The command @code{save-some-buffers} saves this | ||
| 244 | buffer 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 |
| 246 | Remember an arbitrary piece of data. With a prefix, it will use the | 254 | Remember an arbitrary piece of data. With a prefix, it will use the |
| 247 | region as @var{initial}. | 255 | region as @var{initial}. |
| 248 | @end defun | 256 | @end defun |
| 249 | 257 | ||
| 250 | @defun remember-region beg end | 258 | @defun remember-other-frame &optional initial |
| 259 | Like @code{remember}, but uses a new frame. | ||
| 260 | @end defun | ||
| 261 | |||
| 262 | @defun remember-region &optional beg end | ||
| 251 | If called from within the remember buffer, @var{beg} and @var{end} are | 263 | If called from within the remember buffer, @var{beg} and @var{end} are |
| 252 | ignored, and the entire buffer will be remembered. If called from any | 264 | ignored, and the entire buffer will be remembered. If called from any |
| 253 | other buffer, that region, plus any context information specific to | 265 | other buffer, that region, plus any context information specific to |
| @@ -263,13 +275,37 @@ for remembering things from Netscape or other X Windows applications. | |||
| 263 | Remember the contents of the current buffer. | 275 | Remember the contents of the current buffer. |
| 264 | @end defun | 276 | @end defun |
| 265 | 277 | ||
| 278 | @defun remember-destroy | ||
| 279 | Destroy the current remember buffer. | ||
| 280 | @end defun | ||
| 281 | |||
| 266 | @defun remember-mode | 282 | @defun remember-mode |
| 267 | This enters the major mode for output from @command{remember}. This | 283 | This enters the major mode for output from @code{remember}. This |
| 268 | buffer is used to collect data that you want remember. Just hit | 284 | buffer 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 |
| 270 | the data for latter retrieval, and possible indexing. | 286 | the data for latter retrieval, and possible indexing. |
| 271 | @end defun | 287 | @end defun |
| 272 | 288 | ||
| 289 | @defun remember-notes &optional switch-to | ||
| 290 | This returns the notes buffer, creating it if needed, and switches | ||
| 291 | to it if called interactively (or if @var{switch-to} is non-@code{nil}). | ||
| 292 | The notes buffer visits @code{remember-data-file}, and | ||
| 293 | is named @code{remember-notes-buffer-name}. It uses | ||
| 294 | @code{remember-notes-initial-major-mode} and @code{remember-notes-mode} | ||
| 295 | minor mode. | ||
| 296 | @end defun | ||
| 297 | |||
| 298 | @defun remember-notes-mode &optional arg | ||
| 299 | This is a minor mode for the notes buffer. It sets | ||
| 300 | @code{buffer-save-without-query} so that @code{save-some-buffers} will | ||
| 301 | save the notes buffer without asking. Use @kbd{C-c C-c} to | ||
| 302 | run the command @code{remember-notes-save-and-bury-buffer}. | ||
| 303 | @end defun | ||
| 304 | |||
| 305 | @defun remember-notes-save-and-bury-buffer | ||
| 306 | Save (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 |
| 281 | Remember the contents of the current buffer. | 317 | @itemx C-x C-s |
| 282 | 318 | Remember the contents of the current buffer (`remember-finalize'). | |
| 283 | @item C-c C-k (`remember-destroy') | ||
| 284 | Destroy the current *Remember* buffer. | ||
| 285 | 319 | ||
| 286 | @item C-x C-s (`remember-finalize') | 320 | @item C-c C-k |
| 287 | Remember the contents of the current buffer. | 321 | Destroy 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 |
| 361 | File for extracted diary entries. | 395 | File for extracted diary entries. |
| 362 | If this is nil, then @code{diary-file} will be used instead." | 396 | If 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 |
| @@ -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. |
| 718 | is preserved. In fact, it was designed as a replacement for *scratch* | 718 | You can use it as a more permanent *scratch* buffer. |
| 719 | buffer and can be used that way by setting `initial-buffer-choice' to | ||
| 720 | `remember-notes' and `remember-notes-buffer-name' to "*scratch*". | ||
| 721 | Without the second change, the *scratch* buffer will still be there | ||
| 722 | for 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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-02-18 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2014-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. |
| 607 | This sets `buffer-save-without-query' so that `save-some-buffers' will | ||
| 608 | save 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 | 621 | This buffer is for notes that you want to preserve across Emacs sessions. | |
| 617 | If a notes buffer created by a previous invocation of this | 622 | The notes are saved in `remember-data-file'. |
| 618 | function already exist, it will be returned. Otherwise a new | 623 | |
| 619 | buffer will be created whose content will be read from file | 624 | If a buffer is already visiting that file, just return it. |
| 620 | pointed by `remember-data-file'. If a buffer visiting this file | 625 | |
| 621 | already exist, that buffer will be used instead of creating a new | 626 | Otherwise, create the buffer, and rename it to `remember-notes-buffer-name', |
| 622 | one (see `find-file-noselect' function for more details). | 627 | unless a buffer of that name already exists. Set the major mode according |
| 623 | 628 | to `remember-notes-initial-major-mode', and enable `remember-notes-mode' | |
| 624 | Name of the created buffer is taken from `remember-notes-buffer-name' | 629 | minor mode. |
| 625 | variable and if a buffer with that name already exist (but was not | 630 | |
| 626 | created by this function), it will be first killed. | 631 | Use \\<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 | 633 | Interactively, or if SWITCH-TO is non-nil, switch to the buffer. |
| 629 | contains only one \\[save-and-bury-buffer] binding which saves and | 634 | Return the buffer. |
| 630 | buries the buffer. | 635 | |
| 631 | 636 | Set `initial-buffer-choice' to `remember-notes' to visit your notes buffer | |
| 632 | Function returns notes buffer. When called interactively, | 637 | when Emacs starts. Set `remember-notes-buffer-name' to \"*scratch*\" |
| 633 | switches to it as well. | 638 | to turn the *scratch* buffer into your notes buffer." |
| 634 | |||
| 635 | Notes buffer is meant for keeping random notes which you'd like to | ||
| 636 | preserve 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 |