Gnus development mailing list
 help / color / mirror / Atom feed
From: Ralf Angeli <angeli@iwi.uni-sb.de>
Subject: Re: Article viewing and scroll-margin
Date: Fri, 15 Jul 2005 09:02:10 +0200	[thread overview]
Message-ID: <db7n1d$qgm$1@sea.gmane.org> (raw)
In-Reply-To: <b9ywtnsis4z.fsf@jpl.org>

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

* Katsumi Yamaoka (2005-07-15) writes:

>>>>>> In <vzwtns7k8g.fsf@arafel.viteno.net> Norbert Koch wrote:
>
>> Since the last update to No Gnus v0.4 I get the following error if I
>> want to see past the first page of an article:
>
>> Debugger entered--Lisp error: (void-variable scroll-margin)
>>   gnus-article-next-page(nil)
>>   gnus-summary-next-page(nil)
>>   call-interactively(gnus-summary-next-page)
>
>> This is on SXEmacs:
>> steve@sxemacs.org--2005/sxemacs--main--22.1.3--patch-9, built Mon Jul
>> 11 08:49:32 2005 on arafel.viteno.net
>
> And Emacs 21.4 complains that:
>
> Debugger entered--Lisp error: (void-function window-body-height)

The following patch should fix it.  Unless somebody encounters an
error with it, could someone please check it in?

Regarding the implementation: I could write a compatibility function
for `window-body-height' in order to make calculation of the correct
position for moving point work in Emacs 21 as well.  But as there
haven't been any problems with this version of Emacs when putting
point into the scroll margin, it is probably not worth it.


2005-07-15  Ralf Angeli  <angeli@iwi.uni-sb.de>

	* gnus-art.el (gnus-article-next-page, gnus-article-next-page-1)
	(gnus-article-prev-page): Make positioning of point compatible
	with Emacs 21 and XEmacs.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1903 bytes --]

--- gnus-art.el	15 Jul 2005 08:36:19 +0200	7.103
+++ gnus-art.el	15 Jul 2005 08:50:38 +0200	
@@ -5164,7 +5164,11 @@
 If end of article, return non-nil.  Otherwise return nil.
 Argument LINES specifies lines to be scrolled up."
   (interactive "p")
-  (move-to-window-line (max (- -1 scroll-margin) (- -1 (window-body-height))))
+  (move-to-window-line (if (and (boundp 'scroll-margin)
+				(fboundp 'window-body-height))
+			   (max (- -1 scroll-margin)
+				(- -1 (window-body-height)))
+			 -1))
   (if (save-excursion
 	(end-of-line)
 	(and (pos-visible-in-window-p)	;Not continuation line.
@@ -5193,13 +5197,19 @@
       (end-of-buffer
        ;; Long lines may cause an end-of-buffer error.
        (goto-char (point-max)))))
-  (move-to-window-line (min scroll-margin (window-body-height))))
+  (move-to-window-line (if (and (boundp 'scroll-margin)
+				(fboundp 'window-body-height))
+			   (min scroll-margin (window-body-height))
+			 0)))
 
 (defun gnus-article-prev-page (&optional lines)
   "Show previous page of current article.
 Argument LINES specifies lines to be scrolled down."
   (interactive "p")
-  (move-to-window-line (min scroll-margin (window-body-height)))
+  (move-to-window-line (if (and (boundp 'scroll-margin)
+				(fboundp 'window-body-height))
+			   (min scroll-margin (window-body-height))
+			 0))
   (if (and gnus-page-broken
 	   (bobp)
 	   (not (save-restriction (widen) (bobp)))) ;Real beginning-of-buffer?
@@ -5213,7 +5223,10 @@
 	      (scroll-down lines)
 	    (beginning-of-buffer
 	     (goto-char (point-min))))
-	(move-to-window-line (min scroll-margin (window-body-height)))))))
+	(move-to-window-line (if (and (boundp 'scroll-margin)
+				      (fboundp 'window-body-height))
+				 (min scroll-margin (window-body-height))
+			       0))))))
 
 (defun gnus-article-only-boring-p ()
   "Decide whether there is only boring text remaining in the article.

[-- Attachment #3: Type: text/plain, Size: 10 bytes --]


-- 
Ralf

  reply	other threads:[~2005-07-15  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-15  4:42 Norbert Koch
2005-07-15  4:56 ` Katsumi Yamaoka
2005-07-15  7:02   ` Ralf Angeli [this message]
2005-07-15 17:41     ` Ralf Angeli
2005-07-25  9:34       ` Katsumi Yamaoka
2005-07-26  2:45         ` Katsumi Yamaoka
2005-07-15  9:22   ` Katsumi Yamaoka
2005-07-15 10:38     ` Norbert Koch

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='db7n1d$qgm$1@sea.gmane.org' \
    --to=angeli@iwi.uni-sb.de \
    /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).