From: "Drew Adams" <drew.adams@oracle.com>
To: "'Juri Linkov'" <juri@jurta.org>, "'martin rudalics'" <rudalics@gmx.at>
Cc: 12253@debbugs.gnu.org
Subject: bug#12253: Restore window start position
Date: Fri, 18 Jan 2013 14:42:22 -0800 [thread overview]
Message-ID: <F004277948C24BF09C55749DFDBE40FF@us.oracle.com> (raw)
In-Reply-To: <FAD5C9CE56B7466884A68C3BF3DAC5C0@us.oracle.com>
[-- Attachment #1: Type: text/plain, Size: 284 bytes --]
> The attached patch seems to fix the Isearch problem
> generally, restoring the
> original position of point within the window.
Oops. I sent the wrong patch somehow, as should have been obvious if anyone
looked at it. Here is the correct patch, which fixes this Isearch problem.
[-- Attachment #2: isearch-2013-01-16.patch --]
[-- Type: application/octet-stream, Size: 2061 bytes --]
diff -c isearch.el isearch-patched-2013-01-16.el
*** isearch.el Wed Jan 16 08:49:58 2013
--- isearch-patched-2013-01-16.el Wed Jan 16 08:51:10 2013
***************
*** 605,610 ****
--- 605,612 ----
(defvar isearch-opoint 0)
;; The window configuration active at the beginning of the search.
(defvar isearch-window-configuration nil)
+ ;; The line number of point before searching, relative to the line number of `window-start'.
+ (defvar isearch-win-pt-line nil)
;; Flag to indicate a yank occurred, so don't move the cursor.
(defvar isearch-yank-flag nil)
***************
*** 827,832 ****
--- 829,836 ----
isearch-start-hscroll (window-hscroll)
isearch-opoint (point)
+ isearch-win-pt-line (- (line-number-at-pos)
+ (line-number-at-pos (window-start)))
search-ring-yank-pointer nil
isearch-opened-overlays nil
isearch-input-method-function input-method-function
***************
*** 1307,1314 ****
;; For defined push-state function, restore the first state.
;; This calls pop-state function and restores original point.
(let ((isearch-cmds (last isearch-cmds)))
! (isearch--set-state (car isearch-cmds)))
! (goto-char isearch-opoint))
(isearch-done t) ; Exit isearch..
(isearch-clean-overlays)
(signal 'quit nil)) ; ..and pass on quit signal.
--- 1311,1320 ----
;; For defined push-state function, restore the first state.
;; This calls pop-state function and restores original point.
(let ((isearch-cmds (last isearch-cmds)))
! (isearch--set-state (car isearch-cmds))
! (when isearch-win-pt-line (recenter isearch-win-pt-line)))
! (goto-char isearch-opoint)
! (when isearch-win-pt-line (recenter isearch-win-pt-line)))
(isearch-done t) ; Exit isearch..
(isearch-clean-overlays)
(signal 'quit nil)) ; ..and pass on quit signal.
Diff finished. Wed Jan 16 15:52:01 2013
next prev parent reply other threads:[~2013-01-18 22:42 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-21 22:17 bug#12253: Restore window start position Juri Linkov
2012-08-22 7:08 ` martin rudalics
2012-08-22 23:38 ` Juri Linkov
2012-08-23 8:48 ` martin rudalics
2012-08-23 22:00 ` Juri Linkov
2012-08-24 9:45 ` martin rudalics
2012-08-25 0:29 ` Juri Linkov
2012-08-25 13:40 ` martin rudalics
2012-08-25 19:29 ` Juri Linkov
2012-08-28 8:53 ` Juri Linkov
2013-01-16 16:57 ` Drew Adams
2013-01-18 22:42 ` Drew Adams [this message]
2013-01-19 10:17 ` Juri Linkov
2013-01-19 15:03 ` Drew Adams
2013-03-29 16:56 ` Drew Adams
2021-05-11 14:33 ` Drew Adams
2021-05-11 17:53 ` Juri Linkov
2021-05-11 18:46 ` bug#12253: [External] : " Drew Adams
2021-05-11 19:29 ` Juri Linkov
2021-05-11 20:18 ` Drew Adams
2021-05-12 8:47 ` martin rudalics
2024-01-10 11:31 ` Stefan Kangas
2024-01-10 17:16 ` 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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F004277948C24BF09C55749DFDBE40FF@us.oracle.com \
--to=drew.adams@oracle.com \
--cc=12253@debbugs.gnu.org \
--cc=juri@jurta.org \
--cc=rudalics@gmx.at \
/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 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).