Change news-group formatting once more -- this time to give the
authorChris Hanson <org/chris-hanson/cph>
Tue, 29 Dec 1998 02:35:29 +0000 (02:35 +0000)
committerChris Hanson <org/chris-hanson/cph>
Tue, 29 Dec 1998 02:35:29 +0000 (02:35 +0000)
author's name a constant amount of space and expand the subject to
fill any remaining space.

v7/src/edwin/edwin.pkg
v7/src/edwin/snr.scm

index 948e2444b50f24b16216d372434ca41f11f80723..212dd45eb038edf6475894e97074fcd6d67cad1d 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.226 1998/10/23 05:42:33 cph Exp $
+$Id: edwin.pkg,v 1.227 1998/12/29 02:35:29 cph Exp $
 
 Copyright (c) 1989-98 Massachusetts Institute of Technology
 
@@ -1740,7 +1740,7 @@ MIT in each case. |#
          edwin-variable$news-article-mode-hook
          edwin-variable$news-automatically-collapse-threads
          edwin-variable$news-common-mode-hook
-         edwin-variable$news-group-author-column
+         edwin-variable$news-group-author-columns
          edwin-variable$news-group-ignore-hidden-subjects
          edwin-variable$news-group-ignored-subject-retention
          edwin-variable$news-group-keep-ignored-headers
@@ -1749,7 +1749,6 @@ MIT in each case. |#
          edwin-variable$news-group-show-author-name
          edwin-variable$news-group-show-context-headers
          edwin-variable$news-group-show-seen-headers
-         edwin-variable$news-group-truncate-subject
          edwin-variable$news-hide-groups
          edwin-variable$news-initially-collapse-threads
          edwin-variable$news-join-threads-with-same-subject
index 584a7fb99e06f7287a0528cd2476fe61c5779d62..8dd6c82cd36d590b6a59f52cac39e5d0063a2e92 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: snr.scm,v 1.45 1998/12/25 05:50:00 cph Exp $
+;;;    $Id: snr.scm,v 1.46 1998/12/29 02:35:22 cph Exp $
 ;;;
 ;;;    Copyright (c) 1995-98 Massachusetts Institute of Technology
 ;;;
@@ -182,31 +182,10 @@ This is primarily used to enhance the context window."
   #t
   boolean?)
 \f
-(define-variable news-group-truncate-subject
-  "Maximum number of columns for the subject in a News-article header line.
-If zero, no truncation is performed.
-May also be a real number between 0 and 1 exclusive, in which case it
- specifies the number of columns as a fraction of the buffer width.
-See also news-group-author-column."
-  0.7
-  (lambda (object)
-    (or (exact-nonnegative-integer? object)
-       (and (real? object) (< 0 object 1)))))
-
-(define-variable news-group-minimum-truncated-subject
-  "Minimum number of columns that a subject can be truncated to.
-This prevents subject truncatation from eliminating a subject entirely.
-If zero, there is no limit on subject truncation.
-See also news-group-truncate-subject."
-  10
-  exact-nonnegative-integer?)
-
-(define-variable news-group-author-column
-  "Minimum column for the author's name in a News-article header line.
-This is added to the value of news-group-truncate-subject, then the
- resulting value is counted relative to the start of the subject.
+(define-variable news-group-author-columns
+  "Number of columns used to display the author in a News-article header line.
 This applies only to header lines that contain subjects."
-  5
+  15
   exact-nonnegative-integer?)
 
 (define-variable news-group-show-author-name
@@ -1339,26 +1318,25 @@ This shows News groups that have been created since the last time that
     (insert-char #\space mark)
     (insert-chars #\space indentation mark)
     (if subject
-       (let ((ngts
-              (let ((ngts (ref-variable news-group-truncate-subject mark)))
-                (if (exact-nonnegative-integer? ngts)
-                    ngts
-                    (let ((x-size (mark-x-size mark)))
-                      (min x-size
-                           (round->exact (* ngts x-size))))))))
+       (let ((subject-column (mark-column mark))
+             (subject/author-spacing 5)
+             (author-columns (ref-variable news-group-author-columns mark))
+             (x-size (mark-x-size mark)))
          (let ((subject-length
-                (max (ref-variable news-group-minimum-truncated-subject mark)
-                     (- ngts indentation)))
-               (author-column (ref-variable news-group-author-column mark))
-               (subject-column (mark-column mark)))
-           (insert-string (if (and (> ngts 0)
-                                   (> (string-length subject) subject-length))
+                (max (- (- x-size 1)
+                        (+ subject-column
+                           subject/author-spacing
+                           author-columns))
+                     10)))
+           (insert-string (if (> (string-length subject) subject-length)
                               (string-head subject subject-length)
                               subject)
                           mark)
            (if from
                (let ((delta
-                      (- (+ subject-column subject-length author-column)
+                      (- (+ subject-column
+                            subject-length
+                            subject/author-spacing)
                          (mark-column mark))))
                  (if (> delta 0)
                      (insert-chars #\space delta mark)))))))
@@ -1616,8 +1594,8 @@ thread contains both read and unread articles.  Similarly, an `I'
 indicates that all of the thread's articles have been ignored, and an
 `i' that only some of them have been ignored.
 
-The variables news-group-truncate-subject and news-group-author-column
-can be used to control the appearance of header lines.
+The variable news-group-author-columns can be used to control the
+appearance of header lines.
 
 When a News-group buffer is created, the hooks news-group-mode-hook
 and news-common-mode-hook are invoked.