Gnus development mailing list
 help / color / mirror / Atom feed
* « How many articles from ? » group width.
@ 2007-03-03 14:00 Michaël Cadilhac
  2007-03-03 15:02 ` Miles Bader
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2007-03-03 14:00 UTC (permalink / raw)
  To: ding


[-- Attachment #1.1: Type: text/plain, Size: 420 bytes --]

Hi!

There's  a little thing  that annoys  me from  time to  time :  I have
(quite) long group names, and when  the « How many articles » question
is  asked, the name  is truncated  to 35  chars, and  I don't  see the
entire group  name. It's no big deal  in normal use, it's  only a pain
when getting to the next group with `n n' while being in another group.

Well, what about the following to « fix » this :

[-- Attachment #1.2: gnus-sum.patch --]
[-- Type: text/x-patch, Size: 2796 bytes --]

Index: lisp/gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 7.179
diff -c -r7.179 gnus-sum.el
*** lisp/gnus-sum.el	24 Jan 2007 07:15:37 -0000	7.179
--- lisp/gnus-sum.el	3 Mar 2007 12:49:46 -0000
***************
*** 5630,5636 ****
  			    "How many articles from %s (%s %d): "
  			    (gnus-limit-string
  			     (gnus-group-decoded-name gnus-newsgroup-name)
! 			     35)
  			    (if initial "max" "default")
  			    number)
  			   (if initial
--- 5630,5638 ----
  			    "How many articles from %s (%s %d): "
  			    (gnus-limit-string
  			     (gnus-group-decoded-name gnus-newsgroup-name)
! 			     ;; Approximate a good length according to
! 			     ;; minibuffer width.
! 			     (max (- (window-width (minibuffer-window)) 44) 35))
  			    (if initial "max" "default")
  			    number)
  			   (if initial
***************
*** 8144,8150 ****
  	(message "No messages matched")
        (gnus-summary-limit articles))
      (gnus-summary-position-point)))
! 	  
  (defun gnus-summary-limit-to-replied (&optional unreplied)
    "Limit the summary buffer to replied articles.
  If UNREPLIED (the prefix), limit to unreplied articles."
--- 8146,8152 ----
  	(message "No messages matched")
        (gnus-summary-limit articles))
      (gnus-summary-position-point)))
! 
  (defun gnus-summary-limit-to-replied (&optional unreplied)
    "Limit the summary buffer to replied articles.
  If UNREPLIED (the prefix), limit to unreplied articles."
***************
*** 12240,12246 ****
  		       (format
  			"How many articles from %s (%s %d): "
  			(gnus-limit-string
! 			 (gnus-group-decoded-name gnus-newsgroup-name) 35)
  			(if initial "max" "default")
  			len)
  		       (if initial
--- 12242,12251 ----
  		       (format
  			"How many articles from %s (%s %d): "
  			(gnus-limit-string
! 			 (gnus-group-decoded-name gnus-newsgroup-name)
! 			 ;; Approximate a good length according to
! 			 ;; minibuffer width.
! 			 (max (- (window-width (minibuffer-window)) 44) 35))
  			(if initial "max" "default")
  			len)
  		       (if initial
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.1501
diff -C0 -r7.1501 ChangeLog
*** lisp/ChangeLog	1 Mar 2007 23:43:33 -0000	7.1501
--- lisp/ChangeLog	3 Mar 2007 12:49:52 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-03-03  Michaël Cadilhac  <michael.cadilhac@lrde.org>
+ 
+ 	* gnus-sum.el (gnus-articles-to-read): Limit the group name to a larger
+ 	width if the minibuffer allows it.
+ 	(gnus-summary-insert-old-articles): Ditto.
+ 

[-- Attachment #1.3: Type: text/plain, Size: 462 bytes --]


44 is len ("How many articles from " + " " + " (" + " " + "): ") + len
("default") + 7 (for the number and user input)

TIA!

-- 
 |      Michaël `Micha' Cadilhac     |    This .sig has been generated        |
 |         Epita/LRDE Promo 2007     |         by Outlook Express 98          |
 |  http://michael.cadilhac.name     |    and triple-checked on               |
 `--JID: michael.cadilhac@gmail.com--'         Windows Mail Vista.       -  --'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: « How many articles from ? » group width.
  2007-03-03 14:00 « How many articles from ? » group width Michaël Cadilhac
@ 2007-03-03 15:02 ` Miles Bader
  2007-05-08 13:27   ` Michaël Cadilhac
  0 siblings, 1 reply; 5+ messages in thread
From: Miles Bader @ 2007-03-03 15:02 UTC (permalink / raw)
  To: ding

michael@cadilhac.name (Michaël Cadilhac) writes:
> There's  a little thing  that annoys  me from  time to  time :  I have
> (quite) long group names, and when  the « How many articles » question
> is  asked, the name  is truncated  to 35  chars, and  I don't  see the
> entire group  name.

Why is it necessary to truncate it at all?  Emacs from version 21 on
will grow the minibuffer as necessary to show the whole prompt.

-Miles
-- 
Love is a snowmobile racing across the tundra.  Suddenly it flips over,
pinning you underneath.  At night the ice weasels come.  --Nietzsche




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

* Re: « How many articles from ? » group width.
  2007-03-03 15:02 ` Miles Bader
@ 2007-05-08 13:27   ` Michaël Cadilhac
  2007-05-09 23:41     ` Michaël Cadilhac
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2007-05-08 13:27 UTC (permalink / raw)
  To: Miles Bader; +Cc: ding


[-- Attachment #1.1: Type: text/plain, Size: 614 bytes --]

Miles Bader <miles@gnu.org> writes:

> michael@cadilhac.name (Michaël Cadilhac) writes:
>> There's  a little thing  that annoys  me from  time to  time :  I have
>> (quite) long group names, and when  the « How many articles » question
>> is  asked, the name  is truncated  to 35  chars, and  I don't  see the
>> entire group  name.
>
> Why is it necessary to truncate it at all?  Emacs from version 21 on
> will grow the minibuffer as necessary to show the whole prompt.

Right! And why not delete `gnus-limit-string' after that?
`truncate-s-t-width' seems to be in (X)Emacs for quite a long time.


[-- Attachment #1.2: gnus-sum-rs.patch --]
[-- Type: text/x-patch, Size: 1897 bytes --]

Index: lisp/gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 7.182
diff -c -r7.182 gnus-sum.el
*** lisp/gnus-sum.el	27 Apr 2007 08:39:17 -0000	7.182
--- lisp/gnus-sum.el	8 May 2007 13:17:41 -0000
***************
*** 5634,5642 ****
  			  (read-string
  			   (format
  			    "How many articles from %s (%s %d): "
! 			    (gnus-limit-string
! 			     (gnus-group-decoded-name gnus-newsgroup-name)
! 			     35)
  			    (if initial "max" "default")
  			    number)
  			   (if initial
--- 5634,5640 ----
  			  (read-string
  			   (format
  			    "How many articles from %s (%s %d): "
! 			    (gnus-group-decoded-name gnus-newsgroup-name)
  			    (if initial "max" "default")
  			    number)
  			   (if initial
***************
*** 12245,12252 ****
  		      (read-string
  		       (format
  			"How many articles from %s (%s %d): "
! 			(gnus-limit-string
! 			 (gnus-group-decoded-name gnus-newsgroup-name) 35)
  			(if initial "max" "default")
  			len)
  		       (if initial
--- 12243,12249 ----
  		      (read-string
  		       (format
  			"How many articles from %s (%s %d): "
! 			(gnus-group-decoded-name gnus-newsgroup-name)
  			(if initial "max" "default")
  			len)
  		       (if initial
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.1543
diff -C0 -r7.1543 ChangeLog
*** lisp/ChangeLog	3 May 2007 18:34:28 -0000	7.1543
--- lisp/ChangeLog	8 May 2007 13:17:47 -0000
***************
*** 0 ****
--- 1,6 ----
+ 2007-05-08  Michaël Cadilhac  <michael@cadilhac.name>
+ 
+ 	* gnus-sum.el (gnus-articles-to-read)
+ 	(gnus-summary-insert-old-articles): Don't truncate group name for
+ 	read-string.
+ 

[-- Attachment #1.3: gnus-sum-ts.patch --]
[-- Type: text/x-patch, Size: 2382 bytes --]

Index: lisp/gnus-util.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-util.el,v
retrieving revision 7.62
diff -c -r7.62 gnus-util.el
*** lisp/gnus-util.el	27 Apr 2007 08:39:17 -0000	7.62
--- lisp/gnus-util.el	8 May 2007 13:23:23 -0000
***************
*** 109,123 ****
  	 (set symbol nil))
       symbol))
  
- ;; Added by Geoffrey T. Dairiki <dairiki@u.washington.edu>.  A safe way
- ;; to limit the length of a string.  This function is necessary since
- ;; `(substr "abc" 0 30)' pukes with "Args out of range".
- ;; Fixme: Why not `truncate-string-to-width'?
- (defsubst gnus-limit-string (str width)
-   (if (> (length str) width)
-       (substring str 0 width)
-     str))
- 
  (defsubst gnus-goto-char (point)
    (and point (goto-char point)))
  
--- 109,114 ----
Index: lisp/gnus-sum.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v
retrieving revision 7.182
diff -c -r7.182 gnus-sum.el
*** lisp/gnus-sum.el	27 Apr 2007 08:39:17 -0000	7.182
--- lisp/gnus-sum.el	8 May 2007 13:21:58 -0000
***************
*** 1678,1685 ****
     ((eq gnus-summary-gather-subject-limit 'fuzzy)
      (gnus-simplify-subject-fuzzy subject))
     ((numberp gnus-summary-gather-subject-limit)
!     (gnus-limit-string (gnus-simplify-subject-re subject)
! 		       gnus-summary-gather-subject-limit))
     (t
      subject)))
  
--- 1678,1685 ----
     ((eq gnus-summary-gather-subject-limit 'fuzzy)
      (gnus-simplify-subject-fuzzy subject))
     ((numberp gnus-summary-gather-subject-limit)
!     (truncate-string-to-width (gnus-simplify-subject-re subject)
! 			      gnus-summary-gather-subject-limit))
     (t
      subject)))
  
Index: lisp/ChangeLog
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/ChangeLog,v
retrieving revision 7.1543
diff -C0 -r7.1543 ChangeLog
*** lisp/ChangeLog	3 May 2007 18:34:28 -0000	7.1543
--- lisp/ChangeLog	8 May 2007 13:22:03 -0000
***************
*** 0 ****
--- 1,7 ----
+ 2007-05-08  Michaël Cadilhac  <michael@cadilhac.name>
+ 
+ 	* gnus-util.el (gnus-limit-string): Delete this function.
+ 
+ 	* gnus-sum.el (gnus-simplify-subject-fully): Use
+ 	`truncate-string-to-width' instead.
+ 

[-- Attachment #1.4: Type: text/plain, Size: 327 bytes --]


-- 
 |   Michaël `Micha' Cadilhac       |  (\(\  This is the cute bunny virus,   |
 |   http://michael.cadilhac.name   |  (^.^)  please copy this into your     |
 |   JID/MSN:                       |  (")")  sig so it can spread.          |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: « How many articles from ? » group width.
  2007-05-08 13:27   ` Michaël Cadilhac
@ 2007-05-09 23:41     ` Michaël Cadilhac
  2007-05-12 15:11       ` Michaël Cadilhac
  0 siblings, 1 reply; 5+ messages in thread
From: Michaël Cadilhac @ 2007-05-09 23:41 UTC (permalink / raw)
  To: ding

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

michael@cadilhac.name (Michaël Cadilhac) writes:

> Miles Bader <miles@gnu.org> writes:
>
>> michael@cadilhac.name (Michaël Cadilhac) writes:
>>> There's  a little thing  that annoys  me from  time to  time :  I have
>>> (quite) long group names, and when  the « How many articles » question
>>> is  asked, the name  is truncated  to 35  chars, and  I don't  see the
>>> entire group  name.
>>
>> Why is it necessary to truncate it at all?  Emacs from version 21 on
>> will grow the minibuffer as necessary to show the whole prompt.
>
> Right! And why not delete `gnus-limit-string' after that?
> `truncate-s-t-width' seems to be in (X)Emacs for quite a long time.

If no one objects, I will install this later today.

-- 
 |   Michaël `Micha' Cadilhac       |    This .sig has been generated        |
 |   http://michael.cadilhac.name   |         by Outlook Express 98          |
 |   JID/MSN:                       |    and triple-checked on               |
 `----  michael.cadilhac@gmail.com  |         Windows Mail Vista.       -  --'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

* Re: « How many articles from ? » group width.
  2007-05-09 23:41     ` Michaël Cadilhac
@ 2007-05-12 15:11       ` Michaël Cadilhac
  0 siblings, 0 replies; 5+ messages in thread
From: Michaël Cadilhac @ 2007-05-12 15:11 UTC (permalink / raw)
  To: ding

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

Installed.

-- 
 |   Michaël `Micha' Cadilhac       |  Mieux vaut se taire                   |
 |   http://michael.cadilhac.name   |   Que de parler trop fort.             |
 |   JID/MSN:                       |           -- As de trèfle              |
 `----  michael.cadilhac@gmail.com  |                                   -  --'

[-- Attachment #2: Type: application/pgp-signature, Size: 188 bytes --]

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

end of thread, other threads:[~2007-05-12 15:11 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-03 14:00 « How many articles from ? » group width Michaël Cadilhac
2007-03-03 15:02 ` Miles Bader
2007-05-08 13:27   ` Michaël Cadilhac
2007-05-09 23:41     ` Michaël Cadilhac
2007-05-12 15:11       ` Michaël Cadilhac

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