Gnus development mailing list
 help / color / mirror / Atom feed
From: Katsumi Yamaoka <yamaoka@jpl.org>
To: ding@gnus.org
Subject: Re: Quoting the active region when doing `S W' ?
Date: Tue, 08 Jan 2008 20:55:46 +0900	[thread overview]
Message-ID: <b4mhchobkfx.fsf@jpl.org> (raw)
In-Reply-To: <m3sl1tm8y5.fsf@cam.ac.uk>

[-- Attachment #1: Type: text/plain, Size: 804 bytes --]

>>>>> Leo wrote:
> On 2007-12-10 00:50 +0000, Bastien wrote:
>> Does this have been taken care of?

> This feature is very useful; hope someone get around to do it.

`C-u R' in the article buffer runs wide reply (you can also use
a numeric prefix like `1' instead of `C-u'):

(info "(gnus)Article Keymap")
,----
| `R'
|      Send a reply to the current article and yank the current article
|      (`gnus-article-reply-with-original').  If given a prefix, make a
|      wide reply.  If the region is active, only yank the text in the
|      region.
`----

However, the prefix argument for the `R' command in the summary
buffer has a different meaning.  I'd like to suggest adding

`SW' (gnus-article-wide-reply-with-original)

and removing the prefix argument from `g-a-reply-with-original'.
Objections?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Patch for the Gnus trunk --]
[-- Type: text/x-patch, Size: 6547 bytes --]

--- lisp/gnus-art.el~	2007-12-19 08:40:24 +0000
+++ lisp/gnus-art.el	2008-01-08 11:51:49 +0000
@@ -4225,6 +4225,13 @@
 (substitute-key-definition
  'undefined 'gnus-article-read-summary-keys gnus-article-mode-map)
 
+(gnus-define-keys (gnus-article-send-map "S" gnus-article-mode-map)
+  "W" gnus-article-wide-reply-with-original)
+(if (featurep 'xemacs)
+    (set-keymap-default-binding gnus-article-send-map
+				'gnus-article-read-summary-send-keys)
+  (define-key gnus-article-send-map [t] 'gnus-article-read-summary-send-keys))
+
 (defun gnus-article-make-menu-bar ()
   (unless (boundp 'gnus-article-commands-menu)
     (gnus-summary-make-menu-bar))
@@ -6243,8 +6250,9 @@
     (save-excursion
       (set-buffer gnus-article-current-summary)
       (let (gnus-pick-mode)
-	(push (or key last-command-event) unread-command-events)
-	(setq keys (if (featurep 'xemacs)
+	(setq unread-command-events (nconc unread-command-events
+					   (list (or key last-command-event)))
+	      keys (if (featurep 'xemacs)
 		       (events-to-keys (read-key-sequence nil))
 		     (read-key-sequence nil)))))
 
@@ -6339,24 +6347,30 @@
 	      (signal (car err) (cdr err))
 	    (ding))))))))
 
+(defun gnus-article-read-summary-send-keys ()
+  (interactive)
+  (let ((unread-command-events (list (if (featurep 'xemacs)
+					 (character-to-event ?S)
+				       ?S))))
+    (gnus-article-read-summary-keys)))
+
 (defun gnus-article-describe-key (key)
   "Display documentation of the function invoked by KEY.  KEY is a string."
   (interactive "kDescribe key: ")
   (gnus-article-check-buffer)
-  (if (eq (key-binding key) 'gnus-article-read-summary-keys)
+  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
+				  gnus-article-read-summary-send-keys))
       (save-excursion
 	(set-buffer gnus-article-current-summary)
 	(let (gnus-pick-mode)
 	  (if (featurep 'xemacs)
-	      (progn
-		(push (elt key 0) unread-command-events)
-		(setq key (events-to-keys
-			   (read-key-sequence "Describe key: "))))
+	      (setq unread-command-events (append key nil)
+		    key (events-to-keys (read-key-sequence nil)))
 	    (setq unread-command-events
 		  (mapcar
 		   (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x))
 		   (string-to-list key)))
-	    (setq key (read-key-sequence "Describe key: "))))
+	    (setq key (read-key-sequence nil))))
 	(describe-key key))
     (describe-key key)))
 
@@ -6364,20 +6378,19 @@
   "Display documentation of the function invoked by KEY.  KEY is a string."
   (interactive "kDescribe key: \nP")
   (gnus-article-check-buffer)
-  (if (eq (key-binding key) 'gnus-article-read-summary-keys)
+  (if (memq (key-binding key t) '(gnus-article-read-summary-keys
+				  gnus-article-read-summary-send-keys))
       (save-excursion
 	(set-buffer gnus-article-current-summary)
 	(let (gnus-pick-mode)
 	  (if (featurep 'xemacs)
-	      (progn
-		(push (elt key 0) unread-command-events)
-		(setq key (events-to-keys
-			   (read-key-sequence "Describe key: "))))
+	      (setq unread-command-events (append key nil)
+		    key (events-to-keys (read-key-sequence nil)))
 	    (setq unread-command-events
 		  (mapcar
 		   (lambda (x) (if (>= x 128) (list 'meta (- x 128)) x))
 		   (string-to-list key)))
-	    (setq key (read-key-sequence "Describe key: "))))
+	    (setq key (read-key-sequence nil))))
 	(describe-key-briefly key insert))
     (describe-key-briefly key insert)))
 
@@ -6385,7 +6398,7 @@
   "Start composing a reply mail to the current message.
 The text in the region will be yanked.  If the region isn't active,
 the entire article will be yanked."
-  (interactive "P")
+  (interactive)
   (let ((article (cdr gnus-article-current))
 	contents)
     (if (not (gnus-region-active-p))
@@ -6400,6 +6413,13 @@
 	(gnus-summary-reply
 	 (list (list article contents)) wide)))))
 
+(defun gnus-article-wide-reply-with-original ()
+  "Start composing a wide reply mail to the current message.
+The text in the region will be yanked.  If the region isn't active,
+the entire article will be yanked."
+  (interactive)
+  (gnus-article-reply-with-original t))
+
 (defun gnus-article-followup-with-original ()
   "Compose a followup to the current article.
 The text in the region will be yanked.  If the region isn't active,
--- lisp/lpath.el~	2007-12-10 01:18:01 +0000
+++ lisp/lpath.el	2008-01-08 11:51:49 +0000
@@ -51,13 +51,15 @@
 		    show-trailing-whitespace temporary-file-directory
 		    timer-list tool-bar-mode transient-mark-mode)))
   (maybe-fbind '(bbdb-complete-name
-		 delete-annotation delete-extent device-connection dfw-device
-		 events-to-keys find-face font-lock-set-defaults frame-device
-		 get-char-table glyph-height glyph-width ldap-search-entries
+		 character-to-event delete-annotation delete-extent
+		 device-connection dfw-device events-to-keys find-face
+		 font-lock-set-defaults frame-device get-char-table
+		 glyph-height glyph-width ldap-search-entries
 		 mail-aliases-setup make-annotation make-event make-glyph
 		 map-extents message-xmas-redefine put-char-table
 		 run-mode-hooks set-extent-property set-itimer-function
-		 temp-directory valid-image-instantiator-format-p
+		 set-keymap-default-binding temp-directory
+		 valid-image-instantiator-format-p
 		 w3-coding-system-for-mime-charset w3-do-setup
 		 w3-prepare-buffer w3-region window-pixel-height
 		 window-pixel-width))
--- texi/gnus.texi~	2008-01-06 22:51:28 +0000
+++ texi/gnus.texi	2008-01-08 11:51:49 +0000
@@ -11900,17 +11900,22 @@
 @kindex R (Article)
 @findex gnus-article-reply-with-original
 Send a reply to the current article and yank the current article
-(@code{gnus-article-reply-with-original}).  If given a prefix, make a
-wide reply.  If the region is active, only yank the text in the
-region.
+(@code{gnus-article-reply-with-original}).  If the region is active,
+only yank the text in the region.
+
+@item S W
+@kindex S W (Article)
+@findex gnus-article-wide-reply-with-original
+Send a wide reply to the current article and yank the current article
+(@code{gnus-article-reply-with-original}).  If the region is active,
+only yank the text in the region.
 
 @item F
 @kindex F (Article)
 @findex gnus-article-followup-with-original
 Send a followup to the current article and yank the current article
-(@code{gnus-article-followup-with-original}).  If given a prefix, make
-a wide reply.  If the region is active, only yank the text in the
-region.
+(@code{gnus-article-followup-with-original}).  If the region is active,
+only yank the text in the region.
 
 
 @end table

  reply	other threads:[~2008-01-08 11:55 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-22 12:22 Bastien
2007-11-25 21:34 ` Bastien
2007-11-25 23:46   ` Leo
2007-11-26  0:36     ` Bastien
2007-11-26  8:12       ` Leo
2007-12-10  0:50     ` Bastien
2007-12-23 20:50       ` Leo
2008-01-08 11:55         ` Katsumi Yamaoka [this message]
2008-01-08 19:52           ` Leo
2008-01-08 22:51             ` Katsumi Yamaoka
2008-01-08 23:12               ` Leo
2008-01-09 22:30                 ` Katsumi Yamaoka
2008-01-14 23:40                   ` Leo
2008-01-15  0:12                     ` Katsumi Yamaoka
2008-01-15  0:23                       ` Leo
2008-01-15  1:15                         ` Katsumi Yamaoka
2008-01-15 18:50                           ` Leo
2008-01-20 14:59                           ` Leo
2008-01-09 23:05           ` Reiner Steib
2008-01-09 23:21             ` Katsumi Yamaoka
2008-01-10  8:08               ` Katsumi Yamaoka
2008-01-10 18:55               ` Reiner Steib
2008-01-11  6:48                 ` Katsumi Yamaoka
2008-01-11 17:43                   ` Reiner Steib
2008-01-15  0:14                     ` Katsumi Yamaoka
2008-01-31 11:56                       ` Katsumi Yamaoka
2008-01-16 22:34           ` Bastien
2008-01-16 23:09             ` Katsumi Yamaoka
2008-01-17 13:33               ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4mhchobkfx.fsf@jpl.org \
    --to=yamaoka@jpl.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).