Gnus development mailing list
 help / color / mirror / Atom feed
* jump and select
@ 1998-02-28 21:19 Dan Christensen
  1998-03-01 12:57 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Christensen @ 1998-02-28 21:19 UTC (permalink / raw)


The following patch adds an optional argument to
gnus-group-jump-to-group which asks it to select the group it is
jumping to.  So if the user types `C-u j', he or she will be
prompted for a group-name which will then be selected.

1) Is this a good way to get this functionality?

2) If so, can this patch be applied?

Dan

*** gnus-group.el	Sat Feb 28 16:03:13 1998
--- gnus-group.el.orig	Sat Feb 28 15:58:30 1998
***************
*** 1619,1649 ****
  	    group)
  	;;(error nil)
  	(quit nil)))))
  
! (defun gnus-group-jump-to-group (group &optional select)
    "Jump to newsgroup GROUP."
    (interactive
     (list (completing-read
  	  "Group: " gnus-active-hashtb nil
  	  (gnus-read-active-file-p)
  	  nil
! 	  'gnus-group-history) 
! 	 current-prefix-arg))
  
    (when (equal group "")
      (error "Empty group name"))
  
!   (if select
!       (gnus-group-read-group t t group)
!     (unless (gnus-ephemeral-group-p group)
      ;; Either go to the line in the group buffer...
      (unless (gnus-group-goto-group group)
        ;; ... or insert the line.
        (gnus-group-update-group group)
        (gnus-group-goto-group group)))
    ;; Adjust cursor point.
!   (gnus-group-position-point)))
  
  (defun gnus-group-goto-group (group &optional far)
    "Goto to newsgroup GROUP.
  If FAR, it is likely that the group is not on the current line."
--- 1619,1646 ----
  	    group)
  	;;(error nil)
  	(quit nil)))))
  
! (defun gnus-group-jump-to-group (group)
    "Jump to newsgroup GROUP."
    (interactive
     (list (completing-read
  	  "Group: " gnus-active-hashtb nil
  	  (gnus-read-active-file-p)
  	  nil
! 	  'gnus-group-history)))
  
    (when (equal group "")
      (error "Empty group name"))
  
!   (unless (gnus-ephemeral-group-p group)
      ;; Either go to the line in the group buffer...
      (unless (gnus-group-goto-group group)
        ;; ... or insert the line.
        (gnus-group-update-group group)
        (gnus-group-goto-group group)))
    ;; Adjust cursor point.
!   (gnus-group-position-point))
  
  (defun gnus-group-goto-group (group &optional far)
    "Goto to newsgroup GROUP.
  If FAR, it is likely that the group is not on the current line."


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

* Re: jump and select
  1998-02-28 21:19 jump and select Dan Christensen
@ 1998-03-01 12:57 ` Lars Magne Ingebrigtsen
  1998-03-01 17:01   ` Dan Christensen
  0 siblings, 1 reply; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 1998-03-01 12:57 UTC (permalink / raw)


jdc@chow.mat.jhu.edu (Dan Christensen) writes:

> The following patch adds an optional argument to
> gnus-group-jump-to-group which asks it to select the group it is
> jumping to.  So if the user types `C-u j', he or she will be
> prompted for a group-name which will then be selected.
> 
> 1) Is this a good way to get this functionality?
> 
> 2) If so, can this patch be applied?

I don't really think this is something that will be used much.  `j
GROUP RET RET' is faster than `C-u j GROUP RET'.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen


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

* Re: jump and select
  1998-03-01 12:57 ` Lars Magne Ingebrigtsen
@ 1998-03-01 17:01   ` Dan Christensen
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Christensen @ 1998-03-01 17:01 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@gnus.org> writes:
> jdc@chow.mat.jhu.edu (Dan Christensen) writes:
> 
> > The following patch adds an optional argument to
> > gnus-group-jump-to-group which asks it to select the group it is
> > jumping to.  So if the user types `C-u j', he or she will be
> > prompted for a group-name which will then be selected.
> 
> I don't really think this is something that will be used much.  `j
> GROUP RET RET' is faster than `C-u j GROUP RET'.

Actually, I bind this functionality to the `J' key.  And what turns
out to be quite handy is to have this available in the Summary buffer
as well.  (To make binding easier, the implementation I gave should be
changed so that there is a function gnus-group-select-a-group, instead
of mixing it into gnus-group-jump-to-group.  See below.)

Since Gnus is designed for reading groups, I thought that a keystroke
devoted to selecting a group whose name is supplied by the user would
be useful.  But if you don't like it, I'll just put it in my .gnus.

Dan

(defun gnus-group-select-a-group (group &optional all)
  "Select newsgroup GROUP.
Interactively, query for group name with completion.
No article is selected automatically.
If ALL is non-nil, already read articles become readable.
If ALL is a number, fetch this number of articles."

  (interactive
   (list (completing-read
	  "Group: " gnus-active-hashtb nil
	  (gnus-read-active-file-p)
	  nil
	  'gnus-group-history)
	 current-prefix-arg))

  (when (equal group "")
    (error "Empty group name"))

  (gnus-group-read-group all t group))


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

end of thread, other threads:[~1998-03-01 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-02-28 21:19 jump and select Dan Christensen
1998-03-01 12:57 ` Lars Magne Ingebrigtsen
1998-03-01 17:01   ` Dan Christensen

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