unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* bug?  scroll-lock-mode and searching
@ 2008-03-28  7:16 Werner LEMBERG
  2008-03-28 22:19 ` Ralf Angeli
  0 siblings, 1 reply; 5+ messages in thread
From: Werner LEMBERG @ 2008-03-28  7:16 UTC (permalink / raw)
  To: emacs-devel

[GNU Emacs 23.0.50.2 (i686-pc-linux-gnu, GTK+ Version 2.10.6) of
 2008-01-31]

Searching with C-s while scroll-lock-mode is active doesn't center the
search results.  I consider this a bug.  In case you decide this is a
`feature' I strongly ask for an option to configure scroll-lock-mode
so that isearch always centers its results.


    Werner




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

* Re: bug?  scroll-lock-mode and searching
  2008-03-28  7:16 bug? scroll-lock-mode and searching Werner LEMBERG
@ 2008-03-28 22:19 ` Ralf Angeli
  2008-03-29  4:06   ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Angeli @ 2008-03-28 22:19 UTC (permalink / raw)
  To: Werner LEMBERG; +Cc: emacs-devel

* Werner LEMBERG (2008-03-28) writes:

> Searching with C-s while scroll-lock-mode is active doesn't center the
> search results.  I consider this a bug.  In case you decide this is a
> `feature' I strongly ask for an option to configure scroll-lock-mode
> so that isearch always centers its results.

I'd consider it neither a bug nor a feature.  Scroll Lock mode is simply
not aware of Isearch mode and it probably doesn't need to be because a
search is not an explicit scrolling command.

For me the current behavior is fine, but if other people think it would
be a good idea for Scroll Lock mode to center search results, I would
not mind adding an option for it.

The only problem is that I could not find an appropriate hook in Isearch
mode which provides a means to recenter the view.  One could perhaps
abuse `isearch-message-function' for that but I don't consider this a
good idea.  Another bad idea would be to advise `isearch-update' like
this:

(defadvice isearch-update (after scroll-lock-isearch-update activate)
  "Recenter view after `isearch-update'."
  (recenter '(4)))

-- 
Ralf




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

* Re: bug?  scroll-lock-mode and searching
  2008-03-28 22:19 ` Ralf Angeli
@ 2008-03-29  4:06   ` Stefan Monnier
  2008-03-30  5:49     ` Richard Stallman
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Monnier @ 2008-03-29  4:06 UTC (permalink / raw)
  To: Ralf Angeli; +Cc: emacs-devel

>> Searching with C-s while scroll-lock-mode is active doesn't center the
>> search results.  I consider this a bug.  In case you decide this is a
>> `feature' I strongly ask for an option to configure scroll-lock-mode
>> so that isearch always centers its results.

> I'd consider it neither a bug nor a feature.  Scroll Lock mode is simply
> not aware of Isearch mode and it probably doesn't need to be because a
> search is not an explicit scrolling command.

> For me the current behavior is fine, but if other people think it would
> be a good idea for Scroll Lock mode to center search results, I would
> not mind adding an option for it.

> The only problem is that I could not find an appropriate hook in Isearch
> mode which provides a means to recenter the view.  One could perhaps
> abuse `isearch-message-function' for that but I don't consider this a
> good idea.  Another bad idea would be to advise `isearch-update' like
> this:

> (defadvice isearch-update (after scroll-lock-isearch-update activate)
>   "Recenter view after `isearch-update'."
>   (recenter '(4)))

I think the right fix is to introduce a new hook `before-redisplay-hook'
and scroll-lock-mode should use it.


        Stefan




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

* Re: bug?  scroll-lock-mode and searching
  2008-03-29  4:06   ` Stefan Monnier
@ 2008-03-30  5:49     ` Richard Stallman
  2008-03-30  6:06       ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Stallman @ 2008-03-30  5:49 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: angeli, emacs-devel

    I think the right fix is to introduce a new hook `before-redisplay-hook'
    and scroll-lock-mode should use it.

My experience suggests to me that hooks to run before or after
whateveritis are not quite the right thing for any complex feature.
I think that if you study what this feature is trying to do,
you'll probably find a different design that suits it better.




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

* Re: bug?  scroll-lock-mode and searching
  2008-03-30  5:49     ` Richard Stallman
@ 2008-03-30  6:06       ` Stefan Monnier
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2008-03-30  6:06 UTC (permalink / raw)
  To: rms; +Cc: angeli, emacs-devel

>     I think the right fix is to introduce a new hook `before-redisplay-hook'
>     and scroll-lock-mode should use it.

> My experience suggests to me that hooks to run before or after
> whateveritis are not quite the right thing for any complex feature.

Indeed.  But, for example, fontification-functions is just the right
thing for lazy font-lock.

> I think that if you study what this feature is trying to do,
> you'll probably find a different design that suits it better.

Could be.  The way I see it "scroll-lock-mode" is basically a mode where
the buffer should always be scrolled such that the cursor is always
maintained at the same (vertical) screen position.  So it very much has
to do with redisplay and `before-redisplay-hook' might be just the
right thing.  Then again, it's not clear what `before-redisplay-hook'
really is, so it may very well be that it won't work.  Especially since
auto-scrolling in response to point-motion seems to be
wickedly complex.


        Stefan




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

end of thread, other threads:[~2008-03-30  6:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-28  7:16 bug? scroll-lock-mode and searching Werner LEMBERG
2008-03-28 22:19 ` Ralf Angeli
2008-03-29  4:06   ` Stefan Monnier
2008-03-30  5:49     ` Richard Stallman
2008-03-30  6:06       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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