From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>
Cc: 'Eli Zaretskii' <eliz@gnu.org>, emacs-devel@gnu.org, dmoncayo@gmail.com
Subject: RE: Should ending successful Isearch with C-g restore the relative window position?
Date: Wed, 16 Jan 2013 14:16:41 -0800 [thread overview]
Message-ID: <E19BF5E41A6846AA920C5B154728C791@us.oracle.com> (raw)
In-Reply-To: <87hamgker0.fsf_-_@mail.jurta.org>
> > That patch did not fix the problem when searching across Info nodes.
> > The attached patch does. AFAICT, it works generally.
>
> A more general approach would be to save the window start position
> on the stack and restore it in `isearch-cancel' like the patch
> below does.
AFAICT, your slightly more complicated code has the same effect as mine. Yes,
it adds `window-start' to the state struct, but I don't see any particular
advantage. Is there some case it handles better?
> `isearch-done' already does something like this by restoring
> the original window configuration with `set-window-configuration'
> from `isearch-window-configuration'. But it does this only
> on slow terminals where baud-rate is less than 1200.
That code was in fact my starting point, when looking at fixing this.
I almost filed an bug report (enhancement request), wondering whether we might
want the relative positions of point in each window to be saved as part of a
window configuration. (Still wondering whether that might be a good idea.)
> So perhaps this patch will also make `isearch-window-configuration' obsolete.
I don't see how. How is it relevant to what that code does? That code does not
save/restore `window-start' or the window-relative cursor position, and your
patch (like mine) does not save/restore the window config.
(But I wonder whether that code might be obsolete anyway, in the sense of not
being used at all anymore.)
> The remaining problem is how to take into account the case
> when `isearch-allow-scroll' is non-nil and the user scrolled the
> window-start to another position.
I don't understand the problem. With either my patch or yours, non-nil
`isearch-allow-scroll' seems to DTRT, AFAICT. You can scroll using `C-v', mouse
wheel, etc. during Isearch, and if you hit `C-g' to cancel searching then you
get back where you started, including cursor position relative to window. Works
everywhere I've tested, including across nodes in Info.
Can you give a recipe illustrating the problem you see?
> We should find the right place to update the window-start of the
> previous state on the search stack to be able to restore it later.
See above. I don't understand what the problem is. Seems to work OK as is.
next prev parent reply other threads:[~2013-01-16 22:16 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-14 22:29 Should ending successful Isearch with C-g restore the relative window position? Drew Adams
2013-01-14 23:07 ` Dani Moncayo
2013-01-14 23:17 ` Drew Adams
2013-01-15 3:49 ` Eli Zaretskii
2013-01-15 14:58 ` Drew Adams
2013-01-15 15:09 ` Alan Mackenzie
2013-01-15 16:22 ` Should ending successful Isearch with C-g restore the relativewindow position? Drew Adams
2013-01-15 16:36 ` Alan Mackenzie
2013-01-15 16:54 ` Should ending successful Isearch with C-g restore therelativewindow position? Drew Adams
2013-01-15 16:34 ` Should ending successful Isearch with C-g restore the relative window position? Eli Zaretskii
2013-01-15 16:58 ` Drew Adams
2013-01-15 17:10 ` Eli Zaretskii
2013-01-15 17:59 ` Drew Adams
2013-01-15 18:25 ` Eli Zaretskii
2013-01-15 22:04 ` Drew Adams
2013-01-16 16:55 ` Should ending successful Isearch with C-g restore therelative " Drew Adams
2013-01-16 21:29 ` Should ending successful Isearch with C-g restore the relative " Juri Linkov
2013-01-16 22:16 ` Drew Adams [this message]
2013-01-17 21:35 ` Juri Linkov
2013-01-15 9:52 ` Juri Linkov
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=E19BF5E41A6846AA920C5B154728C791@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=dmoncayo@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=juri@jurta.org \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.