unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* recenter-top-bottom problems
@ 2009-06-01 19:45 tyler
  2009-06-01 20:02 ` tyler
  0 siblings, 1 reply; 4+ messages in thread
From: tyler @ 2009-06-01 19:45 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I'm trying to figure out why recenter-top-bottom (C-l) isn't working for
me. I find that sometimes it only centers, sometimes it only centers and
'bottoms', and sometimes it behaves as expected. I've done the following
experiment to try and sort this out:

emacs -Q

;; open up a large text file and C-v into the middle

C-l ; works as expected

(setq scroll-conservatively 100) ;; This is part of my .emacs, for
                                 ;; smooth scrolling

C-l ;; the 'top' part doesn't work anymore, only 'center' and 'bottom'!

;; Modify the code from recenter-top-bottom (from window.el) as follows:

;; ... begining of function here

    (let ((this-scroll-margin
	   (min (max 0 scroll-margin)
		(truncate (/ (window-body-height) 4.0)))))

      (message "%d" this-scroll-margin) ;; inserted new code

      (cond ((eq recenter-last-op 'middle)

;; end of function here

;; I evaluate my modified function

C-l ;; works again!


This is quite a puzzle to me. Can anyone confirm that C-l behaves the
same on their system? Any explanation for this behaviour?

Thanks,

Tyler

GNU Emacs 23.0.60.1 (i686-pc-linux-gnu, GTK+ Version 2.12.10) of
2008-07-11

-- 
What is wanted is not the will to believe, but the will to find out,
which is the exact opposite.           --Bertrand Russell





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

* Re: recenter-top-bottom problems
  2009-06-01 19:45 recenter-top-bottom problems tyler
@ 2009-06-01 20:02 ` tyler
  2009-06-01 20:28   ` Lennart Borgman
  0 siblings, 1 reply; 4+ messages in thread
From: tyler @ 2009-06-01 20:02 UTC (permalink / raw)
  To: help-gnu-emacs

tyler <tyler.smith@mail.mcgill.ca> writes:

> I'm trying to figure out why recenter-top-bottom (C-l) isn't working for
> me. I find that sometimes it only centers, sometimes it only centers and
> 'bottoms', and sometimes it behaves as expected. I've done the following
> experiment to try and sort this out:

Please ignore my previous message. I was working on source from two
different versions of Emacs. D'oh.

There's still the issue of scroll-conservatively not playing well with
recenter-top-bottom, but at least I understand all the code involved and
can cobble together a work around for my own use.

Sorry for the noise,

Tyler

-- 
Power corrupts. PowerPoint corrupts absolutely.
                                       --Edward Tufte

http://www.wired.com/wired/archive/11.09/ppt2.html





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

* Re: recenter-top-bottom problems
  2009-06-01 20:02 ` tyler
@ 2009-06-01 20:28   ` Lennart Borgman
  2009-06-01 20:33     ` tyler
  0 siblings, 1 reply; 4+ messages in thread
From: Lennart Borgman @ 2009-06-01 20:28 UTC (permalink / raw)
  To: tyler; +Cc: help-gnu-emacs

On Mon, Jun 1, 2009 at 10:02 PM, tyler <tyler.smith@mail.mcgill.ca> wrote:
> tyler <tyler.smith@mail.mcgill.ca> writes:
>
>> I'm trying to figure out why recenter-top-bottom (C-l) isn't working for
>> me. I find that sometimes it only centers, sometimes it only centers and
>> 'bottoms', and sometimes it behaves as expected. I've done the following
>> experiment to try and sort this out:
>
> Please ignore my previous message. I was working on source from two
> different versions of Emacs. D'oh.
>
> There's still the issue of scroll-conservatively not playing well with
> recenter-top-bottom, but at least I understand all the code involved and
> can cobble together a work around for my own use.

Wouldn't it be better to submit a bug report with a patch?

> Sorry for the noise,
>
> Tyler
>
> --
> Power corrupts. PowerPoint corrupts absolutely.
>                                       --Edward Tufte
>
> http://www.wired.com/wired/archive/11.09/ppt2.html
>
>
>
>




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

* Re: recenter-top-bottom problems
  2009-06-01 20:28   ` Lennart Borgman
@ 2009-06-01 20:33     ` tyler
  0 siblings, 0 replies; 4+ messages in thread
From: tyler @ 2009-06-01 20:33 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: help-gnu-emacs@gnu.org

Lennart Borgman writes:
 > >
 > > There's still the issue of scroll-conservatively not playing well with
 > > recenter-top-bottom, but at least I understand all the code involved and
 > > can cobble together a work around for my own use.
 > 
 > Wouldn't it be better to submit a bug report with a patch?
 > 

Not anymore, since in my continued muddling about I see that the latest
cvs version no longer has this problem.

Cheers,

Tyler

-- 
The contents of this email have been carefully examined by skilled
artisans to ensure that only the purest, archival-quality, virus-free
bits have been used in its construction.




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

end of thread, other threads:[~2009-06-01 20:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-01 19:45 recenter-top-bottom problems tyler
2009-06-01 20:02 ` tyler
2009-06-01 20:28   ` Lennart Borgman
2009-06-01 20:33     ` tyler

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 read-only IMAP folder(s) and NNTP newsgroup(s).