Gnus development mailing list
 help / color / mirror / Atom feed
* Article viewing and scroll-margin
@ 2005-07-15  4:42 Norbert Koch
  2005-07-15  4:56 ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Norbert Koch @ 2005-07-15  4:42 UTC (permalink / raw)


Hi!

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

norbert.



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

* Re: Article viewing and scroll-margin
  2005-07-15  4:42 Article viewing and scroll-margin Norbert Koch
@ 2005-07-15  4:56 ` Katsumi Yamaoka
  2005-07-15  7:02   ` Ralf Angeli
  2005-07-15  9:22   ` Katsumi Yamaoka
  0 siblings, 2 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-07-15  4:56 UTC (permalink / raw)


>>>>> 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)
  window-body-height()
  gnus-article-next-page(nil)
  gnus-summary-next-page(nil)
* call-interactively(gnus-summary-next-page)



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

* Re: Article viewing and scroll-margin
  2005-07-15  4:56 ` Katsumi Yamaoka
@ 2005-07-15  7:02   ` Ralf Angeli
  2005-07-15 17:41     ` Ralf Angeli
  2005-07-15  9:22   ` Katsumi Yamaoka
  1 sibling, 1 reply; 8+ messages in thread
From: Ralf Angeli @ 2005-07-15  7:02 UTC (permalink / raw)


[-- 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

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

* Re: Article viewing and scroll-margin
  2005-07-15  4:56 ` Katsumi Yamaoka
  2005-07-15  7:02   ` Ralf Angeli
@ 2005-07-15  9:22   ` Katsumi Yamaoka
  2005-07-15 10:38     ` Norbert Koch
  1 sibling, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-07-15  9:22 UTC (permalink / raw)


>>>>>> In <vzwtns7k8g.fsf@arafel.viteno.net> Norbert Koch wrote:

>> Debugger entered--Lisp error: (void-variable scroll-margin)

>>>>> In <b9ywtnsis4z.fsf@jpl.org> Katsumi Yamaoka wrote:

> Debugger entered--Lisp error: (void-function window-body-height)

I've fixed the problem in both the v5-10 branch and the trunk.



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

* Re: Article viewing and scroll-margin
  2005-07-15  9:22   ` Katsumi Yamaoka
@ 2005-07-15 10:38     ` Norbert Koch
  0 siblings, 0 replies; 8+ messages in thread
From: Norbert Koch @ 2005-07-15 10:38 UTC (permalink / raw)


* Katsumi Yamaoka <yamaoka@jpl.org>:

> I've fixed the problem in both the v5-10 branch and the trunk.

Thanks,
norbert.



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

* Re: Article viewing and scroll-margin
  2005-07-15  7:02   ` Ralf Angeli
@ 2005-07-15 17:41     ` Ralf Angeli
  2005-07-25  9:34       ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Ralf Angeli @ 2005-07-15 17:41 UTC (permalink / raw)


* Ralf Angeli (2005-07-15) writes:

> * Katsumi Yamaoka (2005-07-15) writes:
>
>> 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?

Uh, forget that.  Obviously Katsumi already fixed the bug while the
mail was traveling around the world and his patch is much nicer
anyway.  Thanks for fixing it.

-- 
Ralf



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

* Re: Article viewing and scroll-margin
  2005-07-15 17:41     ` Ralf Angeli
@ 2005-07-25  9:34       ` Katsumi Yamaoka
  2005-07-26  2:45         ` Katsumi Yamaoka
  0 siblings, 1 reply; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-07-25  9:34 UTC (permalink / raw)


I realized the point to fix the problem (the article buffer
didn't scroll if `scroll-margin' is specified) is the place of
the point just before redrawing the article buffer, and there
was useless things in the previous fix.  So, I've fixed them
again properly in the v5-10 branch and the trunk.



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

* Re: Article viewing and scroll-margin
  2005-07-25  9:34       ` Katsumi Yamaoka
@ 2005-07-26  2:45         ` Katsumi Yamaoka
  0 siblings, 0 replies; 8+ messages in thread
From: Katsumi Yamaoka @ 2005-07-26  2:45 UTC (permalink / raw)


>>>>> In <b9yoe8rdya1.fsf@jpl.org> Katsumi Yamaoka wrote:

> I realized the point to fix the problem (the article buffer
> didn't scroll if `scroll-margin' is specified) is the place of
> the point just before redrawing the article buffer, and there
> was useless things in the previous fix.  So, I've fixed them
> again properly in the v5-10 branch and the trunk.

I found another problem; setting 2 or greater to `scroll-margin'
hangs Emacs 21.x up.  You can reproduce it by typing the RET key
repeatedly in the summary buffer or evaluating the following:

(let ((buffer (get-buffer-create "*testing*")))
  (pop-to-buffer buffer)
  (set (make-local-variable 'scroll-margin) 2)
  (erase-buffer)
  (insert "Hello\nWorld\n")
  (sit-for 0)
  (scroll-up 1))

Fixed in the v5-10 branch and the trunk.



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

end of thread, other threads:[~2005-07-26  2:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-15  4:42 Article viewing and scroll-margin Norbert Koch
2005-07-15  4:56 ` Katsumi Yamaoka
2005-07-15  7:02   ` Ralf Angeli
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

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