From 043989e335e11614a3e747f5aa796c6cc46545fb Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Tue, 8 Jan 2008 01:33:08 +0000 Subject: [PATCH] Remember: If region is visible, use it as initial text. --- lisp/ChangeLog | 12 ++++++++++++ lisp/textmodes/remember.el | 10 ++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 4268917e0ab..7ce308b563b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,15 @@ +2008-01-08 Michael Olson + + * textmodes/remember.el (remember-region): Fix typo in docstring. + +2008-01-08 Lennart Borgman + + * textmodes/remember.el (remember): If there is a visible region + [that is, the mark is active and transient mark mode is enabled] + then use this region for the initial contents of the *Remember* + buffer. Use `region-beginning' and `region-end' instead of + `point' and `mark'. + 2008-01-07 Dan Nicolaescu * vc-hg.el (vc-hg-dir-state, vc-hg-dir-status): Pass the dir diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 81be7ace146..0790bee55ae 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -273,10 +273,12 @@ called." INITIAL is the text to initially place in the *Remember* buffer, or nil to bring up a blank *Remember* buffer. -With a prefix, use the region as INITIAL." +With a prefix or a visible region, use the region as INITIAL." (interactive - (list (when current-prefix-arg - (buffer-substring (point) (mark))))) + (list (when (or current-prefix-arg + (and mark-active + transient-mark-mode)) + (buffer-substring (region-beginning) (region-end))))) (funcall (if remember-in-new-frame #'frame-configuration-to-register #'window-configuration-to-register) remember-register) @@ -422,7 +424,7 @@ Subject: %s\n\n" (defun remember-region (&optional beg end) "Remember the data from BEG to END. It is called from within the *Remember* buffer to save the text -that was entered, +that was entered. If BEG and END are nil, the entire buffer will be remembered. -- 2.39.5