Gnus development mailing list
 help / color / mirror / Atom feed
From: Rajappa Iyer <rsi@lucent.com>
Subject: patch for pick-mode keymap to avoid shadowing
Date: 30 Jun 1998 10:50:05 -0400	[thread overview]
Message-ID: <199806301450.KAA10288@placebo.ho.lucent.com> (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.


             reply	other threads:[~1998-06-30 14:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-30 14:50 Rajappa Iyer [this message]
     [not found] ` <6f1zs6oq14.fsf@bavur.dna.lth.se>
1998-06-30 17:46   ` Rajappa Iyer
1998-06-30 20:27 Rajappa Iyer

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=199806301450.KAA10288@placebo.ho.lucent.com \
    --to=rsi@lucent.com \
    /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).