Gnus development mailing list
 help / color / mirror / Atom feed
* patch for pick-mode keymap to avoid shadowing
@ 1998-06-30 14:50 Rajappa Iyer
       [not found] ` <6f1zs6oq14.fsf@bavur.dna.lth.se>
  0 siblings, 1 reply; 3+ messages in thread
From: Rajappa Iyer @ 1998-06-30 14:50 UTC (permalink / raw)


Hello,

I've made some changes to the pick-mode keymap so that it avoids
shadowing the normal summary mode keymaps while still retaining some
useful thread selection functions as single keystrokes.  With these
changes, the pick-mode behavior is as follows:

1. "." now marks a thread if gnus-thread-hide-subtree is t and it is
   hit at the first article of the thread.  Otherwise it marks the
   individual article.

2. "u" now unmarks a thread if gnus-thread-hide-subtree is t and it is 
   hit at the first article of the marked thread.  Otherwise it
   unmarks the individual article.

The following functions which were previously available as a single
keystroke are now no-longer available as single keystroke.

"t" gnus-uu-mark-thread (partially collapsed into ".", also available
	as T #)
"T" gnus-uu-unmark-thread (partially collapsed into "u", also
	available as T M-# or M P T)
"U" gnus-summary-unmark-all-processable
"v" gnus-uu-mark-over (use M P v)
"r" gnus-uu-mark-region (use M P r)
"R" gnus-uu-unmark-region (use M P g)
"e" gnus-uu-mark-by-regexp (use M P R)
"E" gnus-uu-mark-by-regexp (use M P G)
"b" gnus-uu-mark-buffer (use M P b)
"B" gnus-uu-unmark-buffer
"X" gnus-pick-start-reading (use "\r")

The patch for the same is enclosed.  Please test and send me comments.
If no one has any problems with it, I'll clean up the patch
(currently, there is some unnecessary code duplication) and send it to
Lars for inclusion.

Thanks,
Rajappa

== snip, snip ==
diff -ur gnus-5.6.22/lisp/gnus-salt.el gnus/lisp/gnus-salt.el
--- gnus-5.6.22/lisp/gnus-salt.el	Mon Jun 29 16:51:20 1998
+++ gnus/lisp/gnus-salt.el	Tue Jun 30 10:12:17 1998
@@ -73,21 +73,23 @@
 
   (gnus-define-keys gnus-pick-mode-map
     " " gnus-pick-next-page
-    "u" gnus-summary-unmark-as-processable
-    "." gnus-pick-article
+    "u" gnus-pick-unmark-article-or-thread
+;    "u" gnus-summary-unmark-as-processable
+    "." gnus-pick-article-or-thread
+;    "." gnus-pick-article
     gnus-down-mouse-2 gnus-pick-mouse-pick-region
     "\r" gnus-pick-start-reading
-    "t" gnus-uu-mark-thread
-    "T" gnus-uu-unmark-thread
-    "U" gnus-summary-unmark-all-processable
-    "v" gnus-uu-mark-over
-    "r" gnus-uu-mark-region
-    "R" gnus-uu-unmark-region
-    "e" gnus-uu-mark-by-regexp
-    "E" gnus-uu-mark-by-regexp
-    "b" gnus-uu-mark-buffer
-    "B" gnus-uu-unmark-buffer
-    "X" gnus-pick-start-reading
+;    "t" gnus-uu-mark-thread
+;    "T" gnus-uu-unmark-thread
+;    "U" gnus-summary-unmark-all-processable
+;    "v" gnus-uu-mark-over
+;    "r" gnus-uu-mark-region
+;    "R" gnus-uu-unmark-region
+;    "e" gnus-uu-mark-by-regexp
+;    "E" gnus-uu-mark-by-regexp
+;    "b" gnus-uu-mark-buffer
+;    "B" gnus-uu-unmark-buffer
+;    "X" gnus-pick-start-reading
     ))
 
 (defun gnus-pick-make-menu-bar ()
@@ -172,6 +174,24 @@
 	    (gnus-summary-next-group)))
       (error "No articles have been picked"))))
 
+(defun gnus-pick-article-or-thread (&optional arg)
+  "If gnus-thread-hide-subtree is t, then pick the thread on the current line.
+Otherwise pick the article on the current line.
+If ARG, pick the article/thread on that line instead."
+  (interactive "P")
+  (when arg
+    (let (pos)
+      (save-excursion
+	(goto-char (point-min))
+	(when (zerop (forward-line (1- (prefix-numeric-value arg))))
+	  (setq pos (point))))
+      (if (not pos)
+	  (gnus-error 2 "No such line: %s" arg)
+	(goto-char pos))))
+  (if gnus-thread-hide-subtree
+      (gnus-uu-mark-thread)
+    (gnus-summary-mark-as-processable 1)))
+		  
 (defun gnus-pick-article (&optional arg)
   "Pick the article on the current line.
 If ARG, pick the article on that line instead."
@@ -187,6 +207,24 @@
 	(goto-char pos))))
   (gnus-summary-mark-as-processable 1))
 
+(defun gnus-pick-unmark-article-or-thread (&optional arg)
+  "If gnus-thread-hide-subtree is t, then unmark the thread on current line.
+Otherwise unmark the article on current line.
+If ARG, unmark thread/article on that line instead."
+  (interactive "P")
+  (when arg
+    (let (pos)
+      (save-excursion
+	(goto-char (point-min))
+	(when (zerop (forward-line (1- (prefix-numeric-value arg))))
+	  (setq pos (point))))
+      (if (not pos)
+	  (gnus-error 2 "No such line: %s" arg)
+	(goto-char pos))))
+  (if gnus-thread-hide-subtree
+      (gnus-uu-unmark-thread)
+    (gnus-summary-unmark-as-processable 1)))
+  
 (defun gnus-pick-mouse-pick (e)
   (interactive "e")
   (mouse-set-point e)

-- 
Rajappa Iyer <rsi@lucent.com>		#include <std_disclaimer.h>
	We're too busy mopping the floor to turn off the faucet.


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: patch for pick-mode keymap to avoid shadowing
       [not found] ` <6f1zs6oq14.fsf@bavur.dna.lth.se>
@ 1998-06-30 17:46   ` Rajappa Iyer
  0 siblings, 0 replies; 3+ messages in thread
From: Rajappa Iyer @ 1998-06-30 17:46 UTC (permalink / raw)


Kurt Swanson <ksw@dna.lth.se> writes:

> > The patch for the same is enclosed.  Please test and send me comments.
> > If no one has any problems with it, I'll clean up the patch
> > (currently, there is some unnecessary code duplication) and send it to
> > Lars for inclusion.
> 
> Fine with me.  Note though that the suggested patch elucidates the
> existing need to add gnus-uu-unmark-thread to the autoload def's for
> "gnus-uu" in gnus.el.

Yes, it does.  I'll add that to the autoload def's.

Thanks,
Rajappa
-- 
Rajappa Iyer <rsi@lucent.com>		#include <std_disclaimer.h>
	We're too busy mopping the floor to turn off the faucet.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* patch for pick-mode keymap to avoid shadowing.
@ 1998-06-30 20:27 Rajappa Iyer
  0 siblings, 0 replies; 3+ messages in thread
From: Rajappa Iyer @ 1998-06-30 20:27 UTC (permalink / raw)
  Cc: bugs

OK,

Here's the cleaned up patch for the pick-mode keymap.  I've added
gnus-uu-unmark-thread to the autoload defs for gnus-uu and updated
gnus.texi as well. 

Thanks,
Rajappa
== snip, snip ==
diff -ur gnus-5.6.22/lisp/gnus-salt.el gnus/lisp/gnus-salt.el
--- gnus-5.6.22/lisp/gnus-salt.el	Mon Jun 29 16:51:20 1998
+++ gnus/lisp/gnus-salt.el	Tue Jun 30 14:14:55 1998
@@ -73,21 +73,10 @@
 
   (gnus-define-keys gnus-pick-mode-map
     " " gnus-pick-next-page
-    "u" gnus-summary-unmark-as-processable
-    "." gnus-pick-article
+    "u" gnus-pick-unmark-article-or-thread
+    "." gnus-pick-article-or-thread
     gnus-down-mouse-2 gnus-pick-mouse-pick-region
     "\r" gnus-pick-start-reading
-    "t" gnus-uu-mark-thread
-    "T" gnus-uu-unmark-thread
-    "U" gnus-summary-unmark-all-processable
-    "v" gnus-uu-mark-over
-    "r" gnus-uu-mark-region
-    "R" gnus-uu-unmark-region
-    "e" gnus-uu-mark-by-regexp
-    "E" gnus-uu-mark-by-regexp
-    "b" gnus-uu-mark-buffer
-    "B" gnus-uu-unmark-buffer
-    "X" gnus-pick-start-reading
     ))
 
 (defun gnus-pick-make-menu-bar ()
@@ -172,21 +161,48 @@
 	    (gnus-summary-next-group)))
       (error "No articles have been picked"))))
 
+(defun gnus-pick-goto-article (arg)
+  "Go to the article number indicated by ARG.  If ARG is an invalid
+article number, then stay on current line."
+  (let (pos)
+    (save-excursion
+      (goto-char (point-min))
+      (when (zerop (forward-line (1- (prefix-numeric-value arg))))
+	(setq pos (point))))
+    (if (not pos)
+	(gnus-error 2 "No such line: %s" arg)
+      (goto-char pos))))
+    
 (defun gnus-pick-article (&optional arg)
-  "Pick the article on the current line.
+    "Pick the article on the current line.
 If ARG, pick the article on that line instead."
   (interactive "P")
   (when arg
-    (let (pos)
-      (save-excursion
-	(goto-char (point-min))
-	(when (zerop (forward-line (1- (prefix-numeric-value arg))))
-	  (setq pos (point))))
-      (if (not pos)
-	  (gnus-error 2 "No such line: %s" arg)
-	(goto-char pos))))
+    (gnus-pick-goto-article arg))
   (gnus-summary-mark-as-processable 1))
 
+(defun gnus-pick-article-or-thread (&optional arg)
+  "If gnus-thread-hide-subtree is t, then pick the thread on the current line.
+Otherwise pick the article on the current line.
+If ARG, pick the article/thread on that line instead."
+  (interactive "P")
+  (when arg
+    (gnus-pick-goto-article arg))
+  (if gnus-thread-hide-subtree
+      (gnus-uu-mark-thread)
+    (gnus-summary-mark-as-processable 1)))
+		  
+(defun gnus-pick-unmark-article-or-thread (&optional arg)
+  "If gnus-thread-hide-subtree is t, then unmark the thread on current line.
+Otherwise unmark the article on current line.
+If ARG, unmark thread/article on that line instead."
+  (interactive "P")
+  (when arg
+    (gnus-pick-goto-article arg))
+  (if gnus-thread-hide-subtree
+      (gnus-uu-unmark-thread)
+    (gnus-summary-unmark-as-processable 1)))
+  
 (defun gnus-pick-mouse-pick (e)
   (interactive "e")
   (mouse-set-point e)
diff -ur gnus-5.6.22/lisp/gnus.el gnus/lisp/gnus.el
--- gnus-5.6.22/lisp/gnus.el	Mon Jun 29 16:51:21 1998
+++ gnus/lisp/gnus.el	Tue Jun 30 14:01:38 1998
@@ -1624,7 +1624,8 @@
       gnus-uu-decode-uu-and-save-view gnus-uu-decode-unshar-view
       gnus-uu-decode-unshar-and-save-view gnus-uu-decode-save-view
       gnus-uu-decode-binhex-view)
-     ("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh)
+     ("gnus-uu" gnus-uu-delete-work-dir gnus-quote-arg-for-sh-or-csh
+      gnus-uu-unmark-thread)
      ("gnus-msg" (gnus-summary-send-map keymap)
       gnus-article-mail gnus-copy-article-buffer gnus-extended-version)
      ("gnus-msg" :interactive t
diff -ur gnus-5.6.22/texi/gnus.texi gnus/texi/gnus.texi
--- gnus-5.6.22/texi/gnus.texi	Mon Jun 29 16:51:23 1998
+++ gnus/texi/gnus.texi	Tue Jun 30 16:02:17 1998
@@ -6862,10 +6862,13 @@
 @table @kbd
 @item .
 @kindex . (Pick)
-@findex gnus-summary-mark-as-processable
-Pick the article on the current line
-(@code{gnus-summary-mark-as-processable}).  If given a numerical prefix,
-go to that article and pick it.  (The line number is normally displayed
+@findex gnus-pick-article-or-thread
+Pick the article or thread on the current line
+(@code{gnus-pick-article-or-thread}).  If the variable
+@code{gnus-thread-hide-subtree} is true, then this key selects the
+entire thread when used at the first article of the thread.  Otherwise,
+it selects just the article. If given a numerical prefix, go to that
+thread or article and pick it.  (The line number is normally displayed
 at the beginning of the summary pick lines.)
 
 @item SPACE
@@ -6876,53 +6879,13 @@
 
 @item u
 @kindex u (Pick)
-@findex gnus-summary-unmark-as-processable
-Unpick the article (@code{gnus-summary-unmark-as-processable}).
-
-@item U
-@kindex U (Pick)
-@findex gnus-summary-unmark-all-processable
-Unpick all articles (@code{gnus-summary-unmark-all-processable}).
-
-@item t
-@kindex t (Pick)
-@findex gnus-uu-mark-thread
-Pick the thread (@code{gnus-uu-mark-thread}).
-
-@item T
-@kindex T (Pick)
-@findex gnus-uu-unmark-thread
-Unpick the thread (@code{gnus-uu-unmark-thread}).
-
-@item r
-@kindex r (Pick)
-@findex gnus-uu-mark-region
-Pick the region (@code{gnus-uu-mark-region}).
-
-@item R
-@kindex R (Pick)
-@findex gnus-uu-unmark-region
-Unpick the region (@code{gnus-uu-unmark-region}).
-
-@item e
-@kindex e (Pick)
-@findex gnus-uu-mark-by-regexp
-Pick articles that match a regexp (@code{gnus-uu-mark-by-regexp}).
-
-@item E
-@kindex E (Pick)
-@findex gnus-uu-unmark-by-regexp
-Unpick articles that match a regexp (@code{gnus-uu-unmark-by-regexp}).
-
-@item b
-@kindex b (Pick)
-@findex gnus-uu-mark-buffer
-Pick the buffer (@code{gnus-uu-mark-buffer}).
-
-@item B
-@kindex B (Pick)
-@findex gnus-uu-unmark-buffer
-Unpick the buffer (@code{gnus-uu-unmark-buffer}).
+@findex gnus-pick-unmark-article-or-thread.
+Unpick the thread or article
+(@code{gnus-pick-unmark-article-or-thread}).  If the variable
+@code{gnus-thread-hide-subtree} is true, then this key unpicks the
+thread if used at the first article of the thread.  Otherwise it unpicks 
+just the article.  You can give this key a numerical prefix to unpick
+the thread or article at that line.
 
 @item RET
 @kindex RET (Pick)
@@ -6934,6 +6897,11 @@
 will still be visible when you are reading.
 
 @end table
+
+All the normal summary mode commands are still available in the
+pick-mode, with the exception of @kbd{u}.  However @kbd{!} is available
+which is mapped to the same function
+@code{gnus-summary-tick-article-forward}.
 
 If this sounds like a good idea to you, you could say:


-- 
Rajappa Iyer <rsi@lucent.com>		#include <std_disclaimer.h>
	We're too busy mopping the floor to turn off the faucet.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1998-06-30 20:27 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-06-30 14:50 patch for pick-mode keymap to avoid shadowing Rajappa Iyer
     [not found] ` <6f1zs6oq14.fsf@bavur.dna.lth.se>
1998-06-30 17:46   ` Rajappa Iyer
1998-06-30 20:27 Rajappa Iyer

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).