From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.bugs Subject: bug#20734: 25.0.50; "Args out of range" with help-window-select t Date: Fri, 05 Jun 2015 11:25:35 +0200 Message-ID: <867fritskw.fsf@members.fsf.org> References: <86vbf3tfwj.fsf@members.fsf.org> <83r3pqpsh0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1433496477 6642 80.91.229.3 (5 Jun 2015 09:27:57 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Jun 2015 09:27:57 +0000 (UTC) Cc: 20734@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Jun 05 11:27:44 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z0nuJ-0001YU-63 for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jun 2015 11:27:19 +0200 Original-Received: from localhost ([::1]:46123 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nuI-0000ZA-Mo for geb-bug-gnu-emacs@m.gmane.org; Fri, 05 Jun 2015 05:27:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37482) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nu9-0000NT-UE for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2015 05:27:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0nu4-0002ei-Mf for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2015 05:27:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59383) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0nu4-0002ec-JH for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2015 05:27:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z0nu4-0004WM-BM for bug-gnu-emacs@gnu.org; Fri, 05 Jun 2015 05:27:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nicolas Richard Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Jun 2015 09:27:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20734 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20734-submit@debbugs.gnu.org id=B20734.143349637417281 (code B ref 20734); Fri, 05 Jun 2015 09:27:04 +0000 Original-Received: (at 20734) by debbugs.gnu.org; 5 Jun 2015 09:26:14 +0000 Original-Received: from localhost ([127.0.0.1]:41118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0ntF-0004Uf-Op for submit@debbugs.gnu.org; Fri, 05 Jun 2015 05:26:14 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:25562) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z0ntC-0004US-Dz for 20734@debbugs.gnu.org; Fri, 05 Jun 2015 05:26:11 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuEEAMhqcVWkD3Xu/2dsb2JhbABbhEKsVwEBAQEBAQaZWwKCAQEBAQEBAYELhCMBAQMBJ1IFCwgDISUPAQRJExuICgjbawEBAQEGAQEBAQEdhhmFKoUGB4QtBZ91g3iCT4wGg1kkggkcgVQ8MYJHAQEB Original-Received: from wifi-nat238.ulb.ac.be (HELO Aurora) ([164.15.117.238]) by smtp.ulb.ac.be with ESMTP; 05 Jun 2015 11:25:37 +0200 In-Reply-To: <83r3pqpsh0.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 05 Jun 2015 09:41:31 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:103602 Archived-At: Eli Zaretskii writes: >> I understand that >> get_char_property_and_overlay >> (make_number (PT), Qdisplay, selected_window, >> &overlay)) >> should not refer to PT but to "PT in selected_window", but I don't know >> how to do that. > > Are you saying that adjust_point_for_property is called with the > current buffer different from what's recorded in selected_window's > buffer? Yes, that's what I was guessing anyway. > If so, please show the evidence: what is in current_buffer > and what is recorded as the selected window's buffer at that point. Let me try that. What I did : 1. run under gdb 2. follow the recipe up to the point where I type "C-h f if", but don't hit RET 3. then go to gdb window 4. hit C-z to put a breakpoint in adjust_point_for_property 5. continue 6. go back to emacs and hit RET Now back to gdb : (gdb) p XBUFFER(XWINDOW(selected_window)->contents)->name_ $1 = 143880388 (gdb) xpr Lisp_String $2 = (struct Lisp_String *) 0x89370c0 "*Help*" (gdb) p current_buffer->name_ $3 = 139646148 (gdb) xpr Lisp_String $4 = (struct Lisp_String *) 0x852d4c0 "*Messages*" (gdb) p PT $5 = 10067 (gdb) p Fwindow_point (selected_window) $6 = 6 > And please note that the conditions in the 'if' clause that determine > whether adjust_point_for_property is called freely manipulate values > of current_buffer and PT, so perhaps the solution is add there a > condition that selected_window's buffer and current_buffer are equal, > such that in the case in point adjust_point_for_property is not called > at all. In command_loop_1 ? I can more or less follow the code step by step, but I don't really understand it. The only thing I'm now almost 100% confident is that in this call (found in adjust_point_for_property) : get_char_property_and_overlay (make_number (PT), Qdisplay, selected_window, &overlay)) PT refers to current_buffer, which is different from the buffer in selected_window in the situation I encountered. > To answer your question directly, it should be possible to compute the > (Lisp integer) value of point in the selected window as either Thanks. This works for me, but is it TRT ? Commit 53fb39a08a6d18b67ea6073966874fa700d9f97f References: yf-master Author: Nicolas Richard AuthorDate: Fri Jun 5 11:18:19 2015 +0200 Commit: Nicolas Richard CommitDate: Fri Jun 5 11:20:08 2015 +0200 * src/keyboard.c (adjust_point_for_property): Use selected window (Bug#20590) 1 parent commit, 6 merged branches, 1 containing branch Parent | f10a924 (todo-show): Throw an error if buffer is empty but was modified. Merged | emacs-24 master run-2015-05-29_19-09 running yf-fix-query-replace-with-NULs yf-master Containing | yf-master Follows | emacs-24.5-rc3-fixed (4919) 1 file changed, 4 insertions(+), 2 deletions(-) src/keyboard.c | 6 ++++-- modified src/keyboard.c @@ -1702,8 +1702,10 @@ adjust_point_for_property (ptrdiff_t last_pt, bool modified) if (check_display && PT > BEGV && PT < ZV && !NILP (val = get_char_property_and_overlay - (make_number (PT), Qdisplay, selected_window, - &overlay)) + (make_number + (marker_position + (XWINDOW (selected_window)->pointm)), + Qdisplay, selected_window, &overlay)) && display_prop_intangible_p (val, overlay, PT, PT_BYTE) && (!OVERLAYP (overlay) ? get_property_and_range (PT, Qdisplay, &val, &beg, &end, Qnil) -- Nico.