🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.gnus
Article #832

Re: 2 gnus questions

#832
From: David C Lawrence
Date: Fri, 02 Jun 1989 02:14
124 lines
5940 bytes
1) Try C-u G in the *Subject* buffer.

2) The articles with the page breaks/form feeds are not really all
that strange.  It is a long-standing tradition for news readers to
note that an article has a C-l so that the reader can pause there
(presumably keeping spoilers or lengthy articles at bay).  I rather
suspect you knew that, but suggesting it not narrow-to-page just isn't
appropriate given the history.

If you were to use the following mode-line stuff, only some of which
Masonobu has incorporated so far, you would get better behaviour (in
my opinion) regarding the mode-line percentages.  Even when narrowed
to page, it will tell you how much of the article has been displayed
before the end of the current page.  That is, in a standard sized
window with an article ~35 lines long, it will say ~50% while looking
at the first page.  There are some holes that make things so that the
modeline is not updated under certain circumstances, but it is correct
in most standard newsreading circumstances.  (Examples of where it can
go wrong: say you did a follow-up.  Now your window sizes have changed
but the function which sets the percentage hasn't been called so it is
inaccurate.)

--cut--
;;; From gnus-etc.el -- suggestions to tale@pawl.rpi.edu
;;; mode-line stuff
(defun gnus-Article-set-percent (&optional new-article)
  "Set gnus-Article-head-to-window-bottom as a string which represents the
percentage of total Article lines that are before the bottom of the window.
Also forces mode-line update.  Optional NEW-ARTICLE is necessary when a new
article is selected."
  (save-excursion
    (save-restriction
      (setq gnus-Article-head-to-window-bottom
            (if new-article
                (progn
                  (vertical-motion (- (screen-height)
                                      gnus-subject-lines-height 3))
                  ;; The next bit is in case the last real line is
                  ;; (will be) visible on the screen.
                  (move-to-column (- (screen-width) 3))
                  (if (not (eobp)) (forward-char 1))
                  ;; Might only be at end-of-page
                  (widen)
                  (if (eobp) "All"
                    (concat (/ (* 100 (count-lines (point-min) (point)))
                               (count-lines (point-min) (point-max))) "%")))
              (move-to-window-line (- (window-height) 2))
              ;; Same deal as above
              (move-to-column (- (window-width) 3))
              (if (not (eobp)) (forward-char 1))
              ;; Might only be at end-of-page
              (widen)
              (if (eobp) "Bot"
                (concat (/ (* 100 (count-lines (point-min) (point)))
                           (count-lines (point-min) (point-max))) "%"))))))
  (set-buffer-modified-p t))

(defun gnus-Article-set-mode-line ()
  "Set Article mode line string."
  (setq mode-line-buffer-identification
        (list 17
              (format "GNUS: %s  %s"
                      gnus-newsgroup-name
                      (let ((unmarked (length (gnus-set-difference
                                               gnus-newsgroup-unreads
                                               gnus-newsgroup-marked))))
                        (if (zerop unmarked) "      "
                          (concat unmarked " more"))))))
  ;; Even if we did this when narrowing to page, do it again as a
  ;; new article.
  (gnus-Article-set-percent 1)
  (set-buffer-modified-p t))

(defun gnus-Article-next-page (lines)
  "Show next page of current article.
If end of article, return non-nil. Otherwise return nil.
Argument LINES specifies lines to be scrolled up."
  (interactive "P")
  (move-to-window-line -1)
  (if (eobp)
      (if (or (not gnus-break-pages)
              (string-match "All\\|Bot" gnus-Article-head-to-window-bottom)
              (save-restriction (widen) (eobp))) ;Real end-of-buffer?
          t
        (gnus-narrow-to-page 1)         ;Go to next page.
        nil)
    (if (string-match "All\\|Bot" gnus-Article-head-to-window-bottom) t
      (scroll-up lines)
      (gnus-Article-set-percent)
      nil)))

(defun gnus-Article-prev-page (lines)
  "Show previous page of current article.
Argument LINES specifies lines to be scrolled down."
  (interactive "P")
  (move-to-window-line 0)
  (if (and gnus-break-pages
           (bobp)
           (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
      (progn
        (gnus-narrow-to-page -1) ;Go to previous page.
        (goto-char (point-max))
        (recenter -1))
    (scroll-down lines)
    (gnus-Article-set-percent)))

(or (fboundp 'original-gnus-narrow-to-page)
    (fset 'original-gnus-narrow-to-page
          (symbol-function 'gnus-narrow-to-page)))

(defun gnus-narrow-to-page (&optional arg)
  "Make text outside current page invisible except for page delimiter.
A numeric arg specifies to move forward or backward by that many pages,
thus showing a page other than the one point was originally in.
NOTE: This function has been modified to also update the Article buffer
mode-line after narrowing."
  (interactive "P")
  (setq arg (if arg (prefix-numeric-value arg) 0))
  (original-gnus-narrow-to-page arg)
  (gnus-Article-set-percent))

Dave
--
 (setq mail '("tale@pawl.rpi.edu" "tale@itsgw.rpi.edu" "tale@rpitsmts.bitnet"))
Technical Details
Message-ID: <TALE.89Jun1221419@imagine.pawl.rpi.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!rpi!rpi.edu!tale
References: <RUSTY.89Jun1174137@garnet.berkeley.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!rpi!rpi.edu!tale
From: tale@pawl.rpi.edu (David C Lawrence)
Newsgroups: gnu.emacs.gnus
Subject: Re: 2 gnus questions
Message-ID: <TALE.89Jun1221419@imagine.pawl.rpi.edu>
Date: 2 Jun 89 02:14:19 GMT
References: <RUSTY.89Jun1174137@garnet.berkeley.edu>
Sender: usenet@rpi.edu
Reply-To: tale@pawl.rpi.edu
Distribution: gnu
Lines: 124
In-reply-to: rusty@garnet.berkeley.edu's message of 2 Jun 89 00:41:37 GMT