From unknown Sun Jun 22 07:32:23 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#21730 <21730@debbugs.gnu.org> To: bug#21730 <21730@debbugs.gnu.org> Subject: Status: 25.0.50; Random errors in redisplay--pre-redisplay-functions Reply-To: bug#21730 <21730@debbugs.gnu.org> Date: Sun, 22 Jun 2025 14:32:23 +0000 retitle 21730 25.0.50; Random errors in redisplay--pre-redisplay-functions reassign 21730 emacs submitter 21730 Michael Welsh Duggan severity 21730 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 22 00:04:17 2015 Received: (at submit) by debbugs.gnu.org; 22 Oct 2015 04:04:17 +0000 Received: from localhost ([127.0.0.1]:60041 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zp76u-0007AZ-Dy for submit@debbugs.gnu.org; Thu, 22 Oct 2015 00:04:17 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59243) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zp76t-0007AR-4L for submit@debbugs.gnu.org; Thu, 22 Oct 2015 00:04:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zp76r-000747-HL for submit@debbugs.gnu.org; Thu, 22 Oct 2015 00:04:15 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:57499) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp76r-000741-EM for submit@debbugs.gnu.org; Thu, 22 Oct 2015 00:04:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp76p-0002D6-QB for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 00:04:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zp76l-00073C-4T for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 00:04:11 -0400 Received: from md5i.com ([75.151.244.229]:38144) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zp76k-00072u-S2 for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 00:04:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=TIt2ULEqYliwlx4a+/4aRlDpbnRAYAoi6KB9ZaABBGk=; b=n8FkWpthrAwJ+Kyy32Ec76xhKB m7inAoXBc4bn+GKbS2N5wE/APEiwnQTvKAK0H2hUAvuE4wdz05iyoHrb6SaGmvX7A6xkEoF0cfIPP ZsU59vsdEkvdErZlOV8r7Xu4V; Received: from md5i by md5i.com with local (Exim 4.86) (envelope-from ) id 1Zp76k-0004aZ-2a for bug-gnu-emacs@gnu.org; Thu, 22 Oct 2015 00:04:06 -0400 From: Michael Welsh Duggan To: bug-gnu-emacs@gnu.org Subject: 25.0.50; Random errors in redisplay--pre-redisplay-functions Date: Thu, 22 Oct 2015 00:04:06 -0400 Message-ID: <87io5zh7m1.fsf@md5i.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) I don't have a recipe for this. Every now again I get the following in my *Messages* buffer: redisplay--pre-redisplay-functions: (args-out-of-range 0) I turned on debug-on-error, and got the following backtrace: Debugger entered--Lisp error: (args-out-of-range 0) get-char-property(0 cursor-sensor-functions) cursor-sensor--detect(#) run-hook-with-args(cursor-sensor--detect #) redisplay--pre-redisplay-functions(t) apply(redisplay--pre-redisplay-functions t) #[128 "\300\301\"\210\300\302\"\207" [apply redisplay--pre-redisplay-functions ignore nil] 4 nil nil](t) redisplay_internal\ \(C\ function\)() This happens infrequently, about a couple of times a day. I cannot make this happen on demand, but I can add debugging code if led in the correct direction. In GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, X toolkit) of 2015-10-09 Repository revision: f7acc9ce65bc6c1080aa6c85618cf854ed0047ee Windowing system distributor 'The X.Org Foundation', version 11.0.11702000 System Description: Debian GNU/Linux unstable (sid) Configured using: 'configure --without-toolkit-scroll-bars --with-x-toolkit=lucid 'CFLAGS=-Og -ggdb3' --with-wide-int --with-gameuser=:staff' Configured features: XPM JPEG TIFF GIF PNG RSVG SOUND GPM DBUS GCONF GSETTINGS NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB LUCID X11 Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Dired by date Minor modes in effect: display-time-mode: t magit-auto-revert-mode: t shell-dirtrack-mode: t diff-auto-refine-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t Recent messages: Saving /home/md5i/.newsrc.eld... Saving file /home/md5i/.newsrc.eld... Wrote /home/md5i/.newsrc.eld Saving /home/md5i/.newsrc.eld...done Checking new news... Reading active file from ~/Mail via nnml...done nnimap read 0k from localhost Reading active file via nndraft...done Checking new news...done Scanning for dabbrevs...done Load-path shadows: /usr/share/emacs/site-lisp/rst hides /usr/local/share/emacs/25.0.50/lisp/textmodes/rst Features: (shadow emacsbug gnus-fun calc-alg calc-ext calc-menu calc calc-loaddefs calc-macs doc-view css-mode smie image-mode pcmpl-unix debug js nxml-uchnm rng-xsd xsd-regexp rng-cmpct rng-nxml rng-valid nxml-mode nxml-outln nxml-rap nxml-glyph conf-mode cus-edit cus-start cus-load tramp-cache rect python tramp-sh json dabbrev gud imenu man time-stamp whitespace tabify two-column iso-transl make-mode dired-aux vc-dispatcher vc-hg cc-mode cc-fonts cc-guess cc-menus cc-cmds misearch multi-isearch gnus-dup shr-color color url-util url-parse url-vars shr dom subr-x browse-url flow-fill jka-compr mm-archive qp sort gnus-cite mail-extr gnus-async gnus-bcklg gnus-ml disp-table gnus-topic cursor-sensor utf-7 nndraft nnmh epa-file network-stream nsm starttls nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime dig gnus-cache gnus-demon nntp gnutls nnir gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range gnus-win gnus gnus-ems nnheader flyspell ispell yaml-mode uptimes pp descr-text time sieve-manage rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util sgml-mode psvn wid-edit cl magit-key-mode magit view tramp tramp-compat auth-source eieio byte-opt bytecomp byte-compile cl-extra cconv eieio-core cl-macs gv gnus-util time-date password-cache tramp-loaddefs trampver shell pcomplete advice grep compile epa derived epg epg-config diff-mode autorevert filenotify git-rebase-mode thingatpt git-commit-mode server log-edit easy-mmode pcvs-util add-log mailcap message sendmail format-spec rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums mm-util help-fns help-mode mail-prsvr mailabbrev mail-utils gmm-utils mailheader lua-mode edmacro rx generated generic-x ediff-merg ediff-wind ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff debian-el debian-el-loaddefs dired-x easymenu dired cc-styles cc-align cc-engine cc-vars cc-defs ange-ftp comint ansi-color ring cl-seq kmacro cl-loaddefs pcase cl-lib mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list newcomment elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese charscript case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify dynamic-setting system-font-setting font-render-setting x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 885412 104614) (symbols 48 49376 228) (miscs 40 1199 2821) (strings 32 113818 15421) (string-bytes 1 3593164) (vectors 16 52064) (vector-slots 8 1440209 35827) (floats 8 761 638) (intervals 56 24560 199) (buffers 976 98) (heap 1024 103928 10949)) -- Michael Welsh Duggan (md5i@md5i.com) From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 22 10:40:45 2015 Received: (at 21730) by debbugs.gnu.org; 22 Oct 2015 14:40:46 +0000 Received: from localhost ([127.0.0.1]:32984 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpH2r-0006yI-JA for submit@debbugs.gnu.org; Thu, 22 Oct 2015 10:40:45 -0400 Received: from mtaout25.012.net.il ([80.179.55.181]:40895) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZpH2o-0006y8-26 for 21730@debbugs.gnu.org; Thu, 22 Oct 2015 10:40:43 -0400 Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NWM00700LOEDZ00@mtaout25.012.net.il> for 21730@debbugs.gnu.org; Thu, 22 Oct 2015 17:38:01 +0300 (IDT) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWM002QILZC4D60@mtaout25.012.net.il>; Thu, 22 Oct 2015 17:38:00 +0300 (IDT) Date: Thu, 22 Oct 2015 17:40:19 +0300 From: Eli Zaretskii Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions In-reply-to: <87io5zh7m1.fsf@md5i.com> X-012-Sender: halo1@inter.net.il To: Michael Welsh Duggan Message-id: <83vb9zt19o.fsf@gnu.org> References: <87io5zh7m1.fsf@md5i.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Welsh Duggan > Date: Thu, 22 Oct 2015 00:04:06 -0400 > > I don't have a recipe for this. Every now again I get the following in > my *Messages* buffer: > > redisplay--pre-redisplay-functions: (args-out-of-range 0) > > I turned on debug-on-error, and got the following backtrace: > > Debugger entered--Lisp error: (args-out-of-range 0) > get-char-property(0 cursor-sensor-functions) > cursor-sensor--detect(#) > run-hook-with-args(cursor-sensor--detect #) > redisplay--pre-redisplay-functions(t) > apply(redisplay--pre-redisplay-functions t) > #[128 "\300\301\"\210\300\302\"\207" [apply > redisplay--pre-redisplay-functions ignore nil] 4 nil nil](t) > redisplay_internal\ \(C\ function\)() > > This happens infrequently, about a couple of times a day. I cannot make > this happen on demand, but I can add debugging code if led in the > correct direction. Thanks for reporting this. I'll try to help, although Stefan might have better ideas. >From the backtrace it is obvious that the immediate reason for the problem is the call to 'get-char-property' with an invalid 1st argument of zero (it's a buffer position, so should be at least 1). Looking at 'cursor-sensor--detect', I see this: (defun cursor-sensor--detect (window) (unless cursor-sensor-inhibit (let* ((point (window-point window)) ;; It's often desirable to make the cursor-sensor-functions property ;; non-sticky on both ends, but that means get-pos-property might ;; never see it. (new (or (get-char-property point 'cursor-sensor-functions) (unless (bobp) (get-char-property (1- point) 'cursor-sensor-functions)))) So my guess is that the value of 'point' (the variable, not the function) is 1, i.e. beginning of buffer, and subtracting 1 from it produces that zero. Then the second call to 'get-char-property' barfs as expected. The code tries to protect itself against such a calamity by calling 'bobp', but that function looks at the buffer's value of point, which might be different from what 'window-point' returns. So my advice would be to replace the call to 'bobp' with an explicit test of the value of the local variable 'point', and see if that fixes the problem. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 27 00:19:18 2015 Received: (at 21730) by debbugs.gnu.org; 27 Oct 2015 04:19:18 +0000 Received: from localhost ([127.0.0.1]:39877 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZqvjB-00043N-QW for submit@debbugs.gnu.org; Tue, 27 Oct 2015 00:19:18 -0400 Received: from md5i.com ([75.151.244.229]:47434) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Zqvj9-00043B-Rq for 21730@debbugs.gnu.org; Tue, 27 Oct 2015 00:19:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:Cc:To:From; bh=hAusEUfLIB8ZtYsEHgZQb8M8fy7HgwEVxbwxdoXLWH4=; b=S4X1fk u2WN4NOdki6KdRjgOrIsbPkOvvqusnczRmGGCWz/E/O9qP8MEq9mGFaD1K+/Yq4dCnNhcU6XWwJmS DSwIt+nZEeoJKGLEZdChymUrl/iTualRibj/cAtJWmcez; Received: from md5i by md5i.com with local (Exim 4.86) (envelope-from ) id 1Zqvj7-0001YY-Ri; Tue, 27 Oct 2015 00:19:13 -0400 From: Michael Welsh Duggan To: Eli Zaretskii Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> Date: Tue, 27 Oct 2015 00:19:13 -0400 In-Reply-To: <83vb9zt19o.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Oct 2015 17:40:19 +0300") Message-ID: <87y4epeyf2.fsf@md5i.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 Cc: Michael Welsh Duggan , 21730@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Eli Zaretskii writes: >> From: Michael Welsh Duggan >> Date: Thu, 22 Oct 2015 00:04:06 -0400 >> >> I don't have a recipe for this. Every now again I get the following in >> my *Messages* buffer: >> >> redisplay--pre-redisplay-functions: (args-out-of-range 0) >> >> I turned on debug-on-error, and got the following backtrace: >> >> Debugger entered--Lisp error: (args-out-of-range 0) >> get-char-property(0 cursor-sensor-functions) >> cursor-sensor--detect(#) >> run-hook-with-args(cursor-sensor--detect #) >> redisplay--pre-redisplay-functions(t) >> apply(redisplay--pre-redisplay-functions t) >> #[128 "\300\301\"\210\300\302\"\207" [apply >> redisplay--pre-redisplay-functions ignore nil] 4 nil nil](t) >> redisplay_internal\ \(C\ function\)() >> >> This happens infrequently, about a couple of times a day. I cannot make >> this happen on demand, but I can add debugging code if led in the >> correct direction. > > Thanks for reporting this. I'll try to help, although Stefan might > have better ideas. > > From the backtrace it is obvious that the immediate reason for the > problem is the call to 'get-char-property' with an invalid 1st argument > of zero (it's a buffer position, so should be at least 1). > > Looking at 'cursor-sensor--detect', I see this: > > (defun cursor-sensor--detect (window) > (unless cursor-sensor-inhibit > (let* ((point (window-point window)) > ;; It's often desirable to make the cursor-sensor-functions property > ;; non-sticky on both ends, but that means get-pos-property might > ;; never see it. > (new (or (get-char-property point 'cursor-sensor-functions) > (unless (bobp) > (get-char-property (1- point) 'cursor-sensor-functions)))) > > So my guess is that the value of 'point' (the variable, not the > function) is 1, i.e. beginning of buffer, and subtracting 1 from it > produces that zero. Then the second call to 'get-char-property' barfs > as expected. > > The code tries to protect itself against such a calamity by calling > 'bobp', but that function looks at the buffer's value of point, which > might be different from what 'window-point' returns. > > So my advice would be to replace the call to 'bobp' with an explicit > test of the value of the local variable 'point', and see if that fixes > the problem. I've changed the (bobp) to (= point 1). I'll run it for a couple of weeks and report back. -- Michael Welsh Duggan (md5i@md5i.com) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 31 09:07:28 2015 Received: (at 21730) by debbugs.gnu.org; 31 Oct 2015 13:07:29 +0000 Received: from localhost ([127.0.0.1]:46773 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZsVsV-0003w1-RC for submit@debbugs.gnu.org; Sat, 31 Oct 2015 09:07:28 -0400 Received: from md5i.com ([75.151.244.229]:37432) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZsVsA-0003va-Js for 21730@debbugs.gnu.org; Sat, 31 Oct 2015 09:07:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=md5i.com; s=dkim; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References: Subject:To:From; bh=rUWgYAzjFOqYsANryIs3pNPe4NLCii9iNIkvNvFrM3k=; b=i5qlADLeh CKJEjOvi94c52Jsh19WPx+zbuQMMG+rwxvj3h5SIMypTs6NXrotU+jXVf62k900FR7zLUvLxPegt8 HsSlbPZCxOWqvENKP8DJ3RlEPYjkfsRG/J0JaKFC7H; Received: from md5i by md5i.com with local (Exim 4.86) (envelope-from ) id 1ZsVs9-0000cv-R4; Sat, 31 Oct 2015 09:07:05 -0400 From: Michael Welsh Duggan To: Eli Zaretskii , 21730@debbugs.gnu.org Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> Date: Sat, 31 Oct 2015 09:07:05 -0400 In-Reply-To: <87y4epeyf2.fsf@md5i.com> (Michael Welsh Duggan's message of "Tue, 27 Oct 2015 00:19:13 -0400") Message-ID: <87mvuzfapy.fsf@md5i.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 21730 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Michael Welsh Duggan writes: > Eli Zaretskii writes: > >> From the backtrace it is obvious that the immediate reason for the >> problem is the call to 'get-char-property' with an invalid 1st argument >> of zero (it's a buffer position, so should be at least 1). >> >> Looking at 'cursor-sensor--detect', I see this: >> >> (defun cursor-sensor--detect (window) >> (unless cursor-sensor-inhibit >> (let* ((point (window-point window)) >> ;; It's often desirable to make the cursor-sensor-functions property >> ;; non-sticky on both ends, but that means get-pos-property might >> ;; never see it. >> (new (or (get-char-property point 'cursor-sensor-functions) >> (unless (bobp) >> (get-char-property (1- point) 'cursor-sensor-functions)))) >> >> So my guess is that the value of 'point' (the variable, not the >> function) is 1, i.e. beginning of buffer, and subtracting 1 from it >> produces that zero. Then the second call to 'get-char-property' barfs >> as expected. >> >> The code tries to protect itself against such a calamity by calling >> 'bobp', but that function looks at the buffer's value of point, which >> might be different from what 'window-point' returns. >> >> So my advice would be to replace the call to 'bobp' with an explicit >> test of the value of the local variable 'point', and see if that fixes >> the problem. > > I've changed the (bobp) to (= point 1). I'll run it for a couple of > weeks and report back. This change seems to have done the trick. I have not encountered the error in several days. -- Michael Welsh Duggan (md5i@md5i.com) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 31 09:33:06 2015 Received: (at 21730-done) by debbugs.gnu.org; 31 Oct 2015 13:33:07 +0000 Received: from localhost ([127.0.0.1]:46781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZsWHJ-0004WO-16 for submit@debbugs.gnu.org; Sat, 31 Oct 2015 09:33:05 -0400 Received: from mtaout20.012.net.il ([80.179.55.166]:52121) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZsWH6-0004Vy-IR for 21730-done@debbugs.gnu.org; Sat, 31 Oct 2015 09:32:54 -0400 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0NX300C006V1NN00@a-mtaout20.012.net.il> for 21730-done@debbugs.gnu.org; Sat, 31 Oct 2015 15:32:51 +0200 (IST) Received: from HOME-C4E4A596F7 ([84.94.185.246]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NX300CIQ6YQI140@a-mtaout20.012.net.il>; Sat, 31 Oct 2015 15:32:51 +0200 (IST) Date: Sat, 31 Oct 2015 15:32:58 +0200 From: Eli Zaretskii Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions In-reply-to: <87mvuzfapy.fsf@md5i.com> X-012-Sender: halo1@inter.net.il To: Michael Welsh Duggan Message-id: <83ziyzxiwl.fsf@gnu.org> References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 21730-done Cc: 21730-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Eli Zaretskii List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > From: Michael Welsh Duggan > Date: Sat, 31 Oct 2015 09:07:05 -0400 > > > I've changed the (bobp) to (= point 1). I'll run it for a couple of > > weeks and report back. > > This change seems to have done the trick. I have not encountered the > error in several days. Thanks for testing. I pushed the change, and I'm arking this bug as done. From unknown Sun Jun 22 07:32:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 29 Nov 2015 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 12:58:23 2016 Received: (at control) by debbugs.gnu.org; 14 Sep 2016 16:58:23 +0000 Received: from localhost ([127.0.0.1]:59722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDVv-0001SI-5U for submit@debbugs.gnu.org; Wed, 14 Sep 2016 12:58:23 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:36267) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDVt-0001S5-MV for control@debbugs.gnu.org; Wed, 14 Sep 2016 12:58:21 -0400 Received: by mail-wm0-f42.google.com with SMTP id b187so56791513wme.1 for ; Wed, 14 Sep 2016 09:58:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=+4uciMWUbzujJvNG8iUdXU70V81US6ZUhc1yo+KjC84=; b=aI6O9B9CvZ2psEVV1YkFDZBvucNiD4d7iylD4/NV+stU2EmcoJal7PYXhJyJWA8CRt HsQ1ZyELWW17YzBDXbGUg1Y4zKut1HIHI7xAj7g+//+lYhGLEWkBUp2DgFgArjOtXeGC Bv4U5sKQ/Y26t94AOyI9NE8clehwZlgH5dhJAiDuluhkYZAMo5VIIE96/GDVKJf9N8uz HOkC9ziu+M9JN/v9P23c7EZwmElsrGfXGc9CiynRqLvoUlJXEIHiET2LdeAxbm8nTn/u b1dRfp/8eXqiC+xMRgKQB9atOvIQ9ovETpxc1yVh5a1COe723cQauArpMi8LGhTzvjDZ GS1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=+4uciMWUbzujJvNG8iUdXU70V81US6ZUhc1yo+KjC84=; b=aNQH48q1rgA4YQiHM0sL90LQU6lAEoEmVCnF3VpE20DZUuGBpRO5MI7kmJQXzIhUAq WMiE5gevXj4e5k7feE5pzjvJUVDvAr/jGYOwW//F6Ck1Jp4MegseNr8V1m+QU7mOTnGp PTWR54fuSVCUtS/HM5iuVO+rA0GRo+7LYb9I3QgURmVN412nzFwzyqd8zIEW8ufQrT6v gPnaNS/o6bSQAjzBo63PPF0EvjVuNCCnAZz18DjzEFsi/tdfKOM+9ioJOhgDsxSNEN+D sblPTjkaML5UV5utgRQXjuQavP1cuhAsqM9iVnkTzOLHQFkhfw3IYZ4ITN45EaiUHRax Cj9w== X-Gm-Message-State: AE9vXwPYiffsWkIAl+2xlT/Qrd4M+kBxbirm/EIyeD62BYukp0Q/f+mWAdYCM1HkABpSIkmaVR6PYVi9ejd1sg== X-Received: by 10.194.47.101 with SMTP id c5mr4203183wjn.67.1473872295843; Wed, 14 Sep 2016 09:58:15 -0700 (PDT) MIME-Version: 1.0 From: Philipp Stephani Date: Wed, 14 Sep 2016 16:58:05 +0000 Message-ID: Subject: unarchive 21730 To: control@debbugs.gnu.org Content-Type: multipart/alternative; boundary=047d7b86e992a36327053c7aa240 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --047d7b86e992a36327053c7aa240 Content-Type: text/plain; charset=UTF-8 unarchive 21730 --047d7b86e992a36327053c7aa240 Content-Type: text/html; charset=UTF-8
unarchive 21730

--047d7b86e992a36327053c7aa240-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 13:01:53 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 17:01:53 +0000 Received: from localhost ([127.0.0.1]:59727 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDZJ-0003A1-I4 for submit@debbugs.gnu.org; Wed, 14 Sep 2016 13:01:53 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:36113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDZG-00039i-Dz; Wed, 14 Sep 2016 13:01:52 -0400 Received: by mail-wm0-f51.google.com with SMTP id b187so56940280wme.1; Wed, 14 Sep 2016 10:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cpWkJ0OmqFsQML+a5Rsg87XLFHhWdMRKiZqQO54ihrc=; b=BtwkdufUAiRQyDNSmCBOnpgXov3/M4r8RG5mVUIabdBJvysR9sERILOqYJIPHl3LGr pT7YwKcTwszeR/5Aglar7PFEf2eOKGQvLJy1Mkc7Pv8RIQgK00ErMDJ9G8M9Js5byRAu nu5zWWRA/1yopgyfKFK+eHe29H9bxdDRGH3zt2El9QHCHat33ihB09634SLlzrqzTzqw 8Desrc8ZKvnUSrpn1w2GF8XcqzBj1r1heVcoCGIyO4x/D2Fw+0dtu10nST1AOLspMhKR fUfT6pTnDnONvB1SmnovvaF/xP/hfjidBPfj6yk+shnxJBgsErLfMP4aeVF/IFCwYPER sLAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cpWkJ0OmqFsQML+a5Rsg87XLFHhWdMRKiZqQO54ihrc=; b=hp2UEe37zmsQQSzfxA7PyA92ShHrSl6+a9lquhKiP9jQAPIkQqwY6NwtlmjMD7Yp2a n2dZs2hfrHehihpPZwEZYYn+lFy07bdez+/2/dYdbC3QvquJzlMiwdHxfw/eE/e10XHg ZE7Zb2QOJnIXLhC/Ptv5PjEd2fbgxV4Dniwo6+Hr28glupWtsGtz1oWTjp6rOpA1dy80 +PfslkPIM+PYjNOOAZrlKVJJ6hGqsS+zXz2N4PSq8dUYT02VfXPgCztrSTKLPOds1bGz ivg8TSMeYMt1hJTXod+MqEiFE0wO68Spy56SymaFgB+kgVMzQmXpT45tGxXLy6+4G3cx 7yCg== X-Gm-Message-State: AE9vXwOQOCBU2Pt9EITKpRA4/gImie/g+wKj1zedsT1fBLLB5rQujAwgEHqn634JrJG/o0vGRO4i/gaWhiNMBw== X-Received: by 10.28.232.71 with SMTP id f68mr11780233wmh.55.1473872504682; Wed, 14 Sep 2016 10:01:44 -0700 (PDT) MIME-Version: 1.0 References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> In-Reply-To: <83ziyzxiwl.fsf@gnu.org> From: Philipp Stephani Date: Wed, 14 Sep 2016 17:01:34 +0000 Message-ID: Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions To: Eli Zaretskii , 21730@debbugs.gnu.org, mwd@md5i.com Content-Type: multipart/alternative; boundary=001a1146a1521601ec053c7aafaa X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 Cc: 21730-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --001a1146a1521601ec053c7aafaa Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Eli Zaretskii schrieb am Sa., 31. Okt. 2015 um 14:34 Uhr: > > From: Michael Welsh Duggan > > Date: Sat, 31 Oct 2015 09:07:05 -0400 > > > > > I've changed the (bobp) to (=3D point 1). I'll run it for a couple o= f > > > weeks and report back. > > > > This change seems to have done the trick. I have not encountered the > > error in several days. > > Thanks for testing. I pushed the change, and I'm arking this bug as > done. > > > This change was reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601dd459. It also doesn't seem correct. cursor-sensor--detect is only used in pre-redisplay-functions, and the documentation of that variable says: "Hook run just before redisplay. It is called in each window that is to be redisplayed. It takes one argument, which is the window that will be redisplayed. When run, the =E2=80=98current-buffer=E2=80=99 is set to the buffer displayed in that window." That means that (bobp) is correct and (=3D point 1) cannot give a different result, unless narrowing is in effect (then only bobp is correct). Given that replacing (bobp) with (=3D point 1) does solve this bug, the documentation of pre-redisplay-functions must be incorrect, i.e. the current buffer is not the buffer of the window passed as argument. I think the only way how this can happen is that a previous entry in pre-redisplay-functions has changed the current buffer. Probably the implementation of redisplay--pre-redisplay-functions should be changed from (with-current-buffer (window-buffer win) (run-hook-with-args 'pre-redisplay-functions win)) to (run-hook-wrapped 'pre-redisplay-functions (lambda (func) (with-current-buffer (window-buffer win) (funcall func win) nil)) or so. So we might try the following: Replace redisplay--pre-redisplay-functions (and indeed, all hooks that document anything about the current buffer) as above. Then add (cl-assert (eq (current-buffer) (window-buffer window)) to cursor-sensor--detect and remove code such as (window-point window), because that must be equal to (point). WDYT? Or am I misunderstanding something? --001a1146a1521601ec053c7aafaa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Sa., 31. Okt. 2015 um 14:34=C2=A0Uhr:
> From: Michael Welsh Duggan <mwd@md5i.com>
> Date: Sat, 31 Oct 2015 09:07:05 -0400
>
> > I've changed the (bobp) to (=3D point 1).=C2=A0 I'll run = it for a couple of
> > weeks and report back.
>
> This change seems to have done the trick.=C2=A0 I have not encountered= the
> error in several days.

Thanks for testing.=C2=A0 I pushed the change, and I'm arking this bug = as
done.



This change was =C2=A0reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601= dd459.
It also doesn't seem correct. cursor-sensor--detect is= only used in pre-redisplay-functions, and the documentation of that variab= le says:
"Hook run just before redisplay.
It is ca= lled in each window that is to be redisplayed.=C2=A0 It takes one argument,=
which is the window that will be redisplayed.=C2=A0 When run, th= e =E2=80=98current-buffer=E2=80=99
is set to the buffer displayed= in that window."
That means that (bobp) is correct and (=3D= point 1) cannot give a different result, unless narrowing is in effect (th= en only bobp is correct).
Given that replacing (bobp) with (=3D p= oint 1) does solve this bug, the documentation of pre-redisplay-functions m= ust be incorrect, i.e. the current buffer is not the buffer of the window p= assed as argument. I think the only way how this can happen is that a previ= ous entry in pre-redisplay-functions has changed the current buffer. Probab= ly the implementation of redisplay--pre-redisplay-functions should be chang= ed from=C2=A0
(with-current-buffer (window-buffer win)
= =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (run-hook-with-args 'pre-redisplay-f= unctions win))
to
(run-hook-wrapped 'pre-redisplay-= functions
=C2=A0 (lambda (func) (with-current-buffer (window-buff= er win)
=C2=A0 =C2=A0 =C2=A0(funcall func win)
=C2=A0 = =C2=A0 =C2=A0nil))
or so.

So we might tr= y the following: Replace redisplay--pre-redisplay-functions (and indeed, al= l hooks that document anything about the current buffer) as above. Then add= (cl-assert (eq (current-buffer) (window-buffer window)) to cursor-sensor--= detect and remove =C2=A0code such as (window-point window), because that mu= st be equal to (point). WDYT? Or am I misunderstanding something?=C2=A0
--001a1146a1521601ec053c7aafaa-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 13:11:50 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 17:11:50 +0000 Received: from localhost ([127.0.0.1]:59737 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDiw-0003OX-89 for submit@debbugs.gnu.org; Wed, 14 Sep 2016 13:11:50 -0400 Received: from eggs.gnu.org ([208.118.235.92]:55265) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkDiu-0003O1-GE for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 13:11:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkDio-0000tV-HW for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 13:11:43 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkDij-0000rx-Fx; Wed, 14 Sep 2016 13:11:37 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3759 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bkDgP-0007DW-FY; Wed, 14 Sep 2016 13:09:14 -0400 Date: Wed, 14 Sep 2016 20:09:06 +0300 Message-Id: <834m5i8l3h.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Wed, 14 Sep 2016 16:54:23 +0000) Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.2 (-------) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.2 (-------) > From: Philipp Stephani > Date: Wed, 14 Sep 2016 16:54:23 +0000 > > Thanks for testing. I pushed the change, and I'm arking this bug as > done. > > This change was reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601dd459. Too bad people revert changes that fixed a bug without making sure they don't reintroduce the same bug again. Now Emacs 25.1 will be released with this bug. > Given that replacing (bobp) with (= point 1) does solve this bug, the documentation of pre-redisplay-functions > must be incorrect, i.e. the current buffer is not the buffer of the window passed as argument. I think the only > way how this can happen is that a previous entry in pre-redisplay-functions has changed the current buffer. > Probably the implementation of redisplay--pre-redisplay-functions should be changed from > (with-current-buffer (window-buffer win) > (run-hook-with-args 'pre-redisplay-functions win)) > to > (run-hook-wrapped 'pre-redisplay-functions > (lambda (func) (with-current-buffer (window-buffer win) > (funcall func win) > nil)) > or so. > > So we might try the following: Replace redisplay--pre-redisplay-functions (and indeed, all hooks that > document anything about the current buffer) as above. Then add (cl-assert (eq (current-buffer) > (window-buffer window)) to cursor-sensor--detect and remove code such as (window-point window), because > that must be equal to (point). WDYT? Or am I misunderstanding something? Since the problem that caused the patch to be reverted was with narrowing, why not simply use (= point (with-current-buffer (window-buffer window) (point-min))) instead of (= point 1) ? Anyway, my role in this bug was just to facilitate the debugging and push a commit, I didn't really look at the issue deeper than what you see in the discussion. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 14:43:32 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 18:43:32 +0000 Received: from localhost ([127.0.0.1]:59783 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkF9g-0005ZO-Jp for submit@debbugs.gnu.org; Wed, 14 Sep 2016 14:43:32 -0400 Received: from mail-wm0-f44.google.com ([74.125.82.44]:36206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkF9e-0005Z8-8I for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 14:43:30 -0400 Received: by mail-wm0-f44.google.com with SMTP id b187so60995548wme.1 for <21730@debbugs.gnu.org>; Wed, 14 Sep 2016 11:43:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t3bxt/GxJwNMys33r9UdskOUX7RInOb9qPrsuLsUrYQ=; b=xLCNa4iWCwZb8owK96SPRPA7WHVjJpiVy2OcXy9yMNlo9+T4aqalQ3xCOqDIcXL+Ye KXJ79vl820WxbhDi0MQ0PlHAnbf/pF18RQ9VaVkmwxv2/2s1m2aGM9Pm0zSt4Bp/nR9h grFeMagYw8oRI3FNsCZ+XZiC/cYvyUnLKZBRq/oXfguSwz4gruQJWnF6ANfxnkDitooc KGV663vZisSGvtUDGQE6J/Amgqz5YnDgmErse7qW6FQfrOjk1i8omgE9CvhD8B7hogy0 n0RZ/HEL0PVHVSUEKGPfvaHW5s8oa8PIGafbv+4lPYP4DNdy/Ix88QvX3xzpWEzNeRC/ P5LA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t3bxt/GxJwNMys33r9UdskOUX7RInOb9qPrsuLsUrYQ=; b=l37HMm8b16k1pZKSrlhvQ9zPx5TDPgboTVmsHZPaFRDAKoJui/MAeSvhM/G4dV1ST8 ywSYxsSueCY7T9VyFTV0fzatWHHXByYTJTlnlE7vzWOm07vHNB+bPfUPmAzWGeOnNaEu r5KPOaDMAJQZdMRS//bTRPugUOaePyYQEPoq97Ii7vfhqvVXy4hbDFikJWxOgmOK8aX1 xJODfwAnhz291ANe3RBWYlPLpbhCC5lfgrlsjOHPIxJcIAL0U403j2TtJl3+nYs7WJNa tSXvo1p25S6bEa+QHbEKy9YcfMWUh1xk+12tMuKUK9DyeB/Xw+fpITzaQYHMChTdCzuK 3gdQ== X-Gm-Message-State: AE9vXwOMmb688HdT3SrlSQJ2Evr85jBjXNFaqtIOMe4bF+X9tKlvVQQkxZUzb4EH1hDh33ItH3EfbW+2oWsxbg== X-Received: by 10.194.184.39 with SMTP id er7mr4110232wjc.159.1473878604384; Wed, 14 Sep 2016 11:43:24 -0700 (PDT) MIME-Version: 1.0 References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <834m5i8l3h.fsf@gnu.org> In-Reply-To: <834m5i8l3h.fsf@gnu.org> From: Philipp Stephani Date: Wed, 14 Sep 2016 18:43:13 +0000 Message-ID: Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions To: Eli Zaretskii Content-Type: multipart/alternative; boundary=047d7ba97a10a81433053c7c1a53 X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --047d7ba97a10a81433053c7c1a53 Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Mi., 14. Sep. 2016 um 19:11 Uhr: > > > Given that replacing (bobp) with (= point 1) does solve this bug, the > documentation of pre-redisplay-functions > > must be incorrect, i.e. the current buffer is not the buffer of the > window passed as argument. I think the only > > way how this can happen is that a previous entry in > pre-redisplay-functions has changed the current buffer. > > Probably the implementation of redisplay--pre-redisplay-functions should > be changed from > > (with-current-buffer (window-buffer win) > > (run-hook-with-args 'pre-redisplay-functions win)) > > to > > (run-hook-wrapped 'pre-redisplay-functions > > (lambda (func) (with-current-buffer (window-buffer win) > > (funcall func win) > > nil)) > > or so. > > > > So we might try the following: Replace > redisplay--pre-redisplay-functions (and indeed, all hooks that > > document anything about the current buffer) as above. Then add > (cl-assert (eq (current-buffer) > > (window-buffer window)) to cursor-sensor--detect and remove code such as > (window-point window), because > > that must be equal to (point). WDYT? Or am I misunderstanding something? > > Since the problem that caused the patch to be reverted was with > narrowing, why not simply use > > (= point (with-current-buffer (window-buffer window) (point-min))) > > instead of > > (= point 1) > > ? > > This has the same issues as described above. There's more code in cursor-sensor--detect that assumes (eq (current-buffer) (window-buffer window)), e.g. the form (get-char-property point 'cursor-sensor-functions). Therefore (= point (with-current-buffer (window-buffer window) (point-min))) must be the same as (bobp). Another mystery is the stack trace entry "run-hook-with-args(cursor-sensor--detect #)". How can cursor-sensor--detect be the first argument to run-hook-with-args? Shouldn't it always be pre-redisplay-functions? --047d7ba97a10a81433053c7c1a53 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Mi., 14. Sep. 2016 um 19:11=C2=A0Uhr:

> Given that replacing (bobp) with (=3D point 1) does solve this bug, th= e documentation of pre-redisplay-functions
> must be incorrect, i.e. the current buffer is not the buffer of the wi= ndow passed as argument. I think the only
> way how this can happen is that a previous entry in pre-redisplay-func= tions has changed the current buffer.
> Probably the implementation of redisplay--pre-redisplay-functions shou= ld be changed from
> (with-current-buffer (window-buffer win)
> (run-hook-with-args 'pre-redisplay-functions win))
> to
> (run-hook-wrapped 'pre-redisplay-functions
> (lambda (func) (with-current-buffer (window-buffer win)
> (funcall func win)
> nil))
> or so.
>
> So we might try the following: Replace redisplay--pre-redisplay-functi= ons (and indeed, all hooks that
> document anything about the current buffer) as above. Then add (cl-ass= ert (eq (current-buffer)
> (window-buffer window)) to cursor-sensor--detect and remove code such = as (window-point window), because
> that must be equal to (point). WDYT? Or am I misunderstanding somethin= g?

Since the problem that caused the patch to be reverted was with
narrowing, why not simply use

=C2=A0 (=3D point (with-current-buffer (window-buffer window) (point-min)))=

instead of

=C2=A0 (=3D point 1)

?


This has the same = issues as described above.=C2=A0 There's more code in cursor-sensor--de= tect that assumes (eq (current-buffer) (window-buffer window)), e.g. the fo= rm=C2=A0(get-char-property point 'cursor-sensor-functions). Therefore= =C2=A0(=3D point (with-current-buffer (window-buffer window) (point-min))) = must be the same as (bobp).
Another mystery is the stack trace en= try "run-hook-with-args(cursor-sensor--detect #<window 224 on *Grou= p*>)". How can cursor-sensor--detect be the first argument to run-h= ook-with-args? Shouldn't it always be pre-redisplay-functions?
--047d7ba97a10a81433053c7c1a53-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 15:12:16 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 19:12:16 +0000 Received: from localhost ([127.0.0.1]:59804 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFbU-0006Fm-1O for submit@debbugs.gnu.org; Wed, 14 Sep 2016 15:12:16 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:34610) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFbS-0006FY-0I for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:12:14 -0400 Received: by mail-wm0-f51.google.com with SMTP id l68so9131668wml.1 for <21730@debbugs.gnu.org>; Wed, 14 Sep 2016 12:12:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=/k+I6E05ha+G5rVXA5rKkVPcpF6O5liVmPV04ilihEI=; b=vK82fHUpcD3D6oMy8fFQ2L1Y/DxONJk0P3Xi7UIlVDQLSF8bqnkaz/J7nP16pp9c8Y n22x3aDKrk6JjDPv0btIj+cXualpkiZ//C/RUKuD8JfD19DDvVVVgkZmvdyQdfSff62L 0hVBiibtpI8e5KZP5yxIRdTyUdUuVbzEMDKr4HCIr66x7ppe988FHFD7AmH2XgbOqjg2 rBpOql3PLvgLzT7QvMaPOLcsnQxPvKtOS9yT4PBljf2aPbrlbz0ZdxvRTSWzPNlPRrhK pttSUclw73cgsSCgMPtnBIC93UOmMNjnb2ayu6Tqlq5JpQT5FYvmvlMNh73UGL003CWy L3zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=/k+I6E05ha+G5rVXA5rKkVPcpF6O5liVmPV04ilihEI=; b=i2J0yrgU9q+9xeYI/WnGD2cLiTl6PvYh2Ne2Jwa6b9+CLHhGld6eU+zxWIPC1+brnZ 84yRylDpVQ7c9xBTEr9lNVpO0wGJHhS0w9IIZirQEXrAMxkwMchvkRU/De3ghbt862e9 akC7HVRt/vUfT5jFS6i+mWxb8EgdBHtGF53jycdaiescIZpbEz5iMcScFcc3BIpOC6jM Qh6dB0xPBc0RlCKzMVXXmq7QtP4IQ+YMJVVJbBu5qlUalQDcRca36EWgRah9rVFpRDy/ Hp3laVoo49l6+ksbDxlQst8rjxOR1SweXk4NKwEFBt7qxRsmF3WTlmXCOkAgpqA+Flh/ CIJA== X-Gm-Message-State: AE9vXwPjVPdMxd7skFkSCOfq3ikOUahgWJyyKBRxpDzslsb2Bim9CHq31hR+mKv2cX9J9CzZ7rtC76rvI4ysfQ== X-Received: by 10.194.47.101 with SMTP id c5mr4795003wjn.67.1473880328286; Wed, 14 Sep 2016 12:12:08 -0700 (PDT) MIME-Version: 1.0 References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> In-Reply-To: From: Philipp Stephani Date: Wed, 14 Sep 2016 19:11:57 +0000 Message-ID: Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions To: Eli Zaretskii , 21730@debbugs.gnu.org, mwd@md5i.com Content-Type: multipart/mixed; boundary=047d7b86e99268d361053c7c81ef X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --047d7b86e99268d361053c7c81ef Content-Type: multipart/alternative; boundary=047d7b86e99268d35d053c7c81ed --047d7b86e99268d35d053c7c81ed Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Philipp Stephani schrieb am Mi., 14. Sep. 2016 um 18:54 Uhr: > Eli Zaretskii schrieb am Sa., 31. Okt. 2015 um 14:34 Uhr: > > > From: Michael Welsh Duggan > > Date: Sat, 31 Oct 2015 09:07:05 -0400 > > > > > I've changed the (bobp) to (=3D point 1). I'll run it for a couple o= f > > > weeks and report back. > > > > This change seems to have done the trick. I have not encountered the > > error in several days. > > Thanks for testing. I pushed the change, and I'm arking this bug as > done. > > > > This change was reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601dd459. > It also doesn't seem correct. cursor-sensor--detect is only used in > pre-redisplay-functions, and the documentation of that variable says: > "Hook run just before redisplay. > It is called in each window that is to be redisplayed. It takes one > argument, > which is the window that will be redisplayed. When run, the > =E2=80=98current-buffer=E2=80=99 > is set to the buffer displayed in that window." > That means that (bobp) is correct and (=3D point 1) cannot give a differe= nt > result, unless narrowing is in effect (then only bobp is correct). > Given that replacing (bobp) with (=3D point 1) does solve this bug, the > documentation of pre-redisplay-functions must be incorrect, i.e. the > current buffer is not the buffer of the window passed as argument. I thin= k > the only way how this can happen is that a previous entry in > pre-redisplay-functions has changed the current buffer. Probably the > implementation of redisplay--pre-redisplay-functions should be changed fr= om > (with-current-buffer (window-buffer win) > (run-hook-with-args 'pre-redisplay-functions win)) > to > (run-hook-wrapped 'pre-redisplay-functions > (lambda (func) (with-current-buffer (window-buffer win) > (funcall func win) > nil)) > or so. > I've attached a patch for this. --047d7b86e99268d35d053c7c81ed Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Philip= p Stephani <p.stephani2@gmail.c= om> schrieb am Mi., 14. Sep. 2016 um 18:54=C2=A0Uhr:
Eli Zaretskii = <e= liz@gnu.org> schrieb am Sa., 31. Okt. 2015 um 14:34=C2=A0Uhr:
> From: = Michael Welsh Duggan <mwd@md5i.com>
> Date: Sat, 31 Oct 2015 09:07:05 -0400
>
> > I've changed the (bobp) to (=3D point 1).=C2=A0 I'll run = it for a couple of
> > weeks and report back.
>
> This change seems to have done the trick.=C2=A0 I have not encountered= the
> error in several days.

Thanks for testing.=C2=A0 I pushed the change, and I'm arking this bug = as
done.



This change was =C2=A0= reverted in=C2=A076ef52267cf887e3e1aa6d25b3b16dd0601dd459.
It also doesn't seem correct. cursor-sensor--detect is o= nly used in pre-redisplay-functions, and the documentation of that variable= says:
"Hook run just before redisplay.<= /div>
It is called in each window that is to be red= isplayed.=C2=A0 It takes one argument,
which = is the window that will be redisplayed.=C2=A0 When run, the =E2=80=98curren= t-buffer=E2=80=99
is set to the buffer displa= yed in that window."
That means that (bo= bp) is correct and (=3D point 1) cannot give a different result, unless nar= rowing is in effect (then only bobp is correct).
Given that replacing (bobp) with (=3D point 1) does solve this bug, the= documentation of=C2=A0pre-redisplay-functions must be incorrect, i.e. the = current buffer is not the buffer of the window passed as argument. I think = the only way how this can happen is that a previous entry in pre-redisplay-= functions has changed the current buffer. Probably the implementation of re= display--pre-redisplay-functions should be changed from=C2=A0
(with-current-buffer (window-buff= er win)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (r= un-hook-with-args 'pre-redisplay-functions win))
to
(run-hook-wrapped 'pre-= redisplay-functions
=C2=A0 (lambda (func) (wi= th-current-buffer (window-buffer win)
=C2=A0 = =C2=A0 =C2=A0(funcall func win)
=C2=A0 =C2=A0= =C2=A0nil))
or so.

I've attached a patch for this.=C2=A0
--047d7b86e99268d35d053c7c81ed-- --047d7b86e99268d361053c7c81ef Content-Type: text/plain; charset=US-ASCII; name="0001-Restore-buffer-in-pre-redisplay-functions.txt" Content-Disposition: attachment; filename="0001-Restore-buffer-in-pre-redisplay-functions.txt" Content-Transfer-Encoding: base64 Content-ID: <1572a1c3b4858316fef1> X-Attachment-Id: 1572a1c3b4858316fef1 RnJvbSAzNjFhMDQ4OGE2N2ZmYzYwMWUyMDc2MjZiMjUzMjdiZjQ4NjhkMjRhIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBQaGlsaXBwIFN0ZXBoYW5pIDxwaHN0QGdvb2dsZS5jb20+CkRh dGU6IFdlZCwgMTQgU2VwIDIwMTYgMjE6MDg6MDcgKzAyMDAKU3ViamVjdDogW1BBVENIXSBSZXN0 b3JlIGJ1ZmZlciBpbiBgcHJlLXJlZGlzcGxheS1mdW5jdGlvbnMnCgpQcmV2aW91c2x5LCBhIGZ1 bmN0aW9uIGluIGBwcmUtcmVkaXNwbGF5LWZ1bmN0aW9ucycgY291bGQgY2hhbmdlIHRoZQpjdXJy ZW50IGJ1ZmZlciwgYnJlYWtpbmcgdGhlIGNvbnRyYWN0IG9mIGBwcmUtcmVkaXNwbGF5LWZ1bmN0 aW9ucycKdGhhdCB0aGUgY3VycmVudCBidWZmZXIgaXMgYWx3YXlzIHRoZSBidWZmZXIgZGlzcGxh eWVkIGluIHRoZSBhcmd1bWVudAp3aW5kb3cuCgoqIGxpc3Avc2ltcGxlLmVsIChyZWRpc3BsYXkt LXByZS1yZWRpc3BsYXktZnVuY3Rpb25zKTogRml4CmJlaGF2aW9yIHdoZW4gYSBmdW5jdGlvbiBp biBgcHJlLXJlZGlzcGxheS1mdW5jdGlvbnMnIGNoYW5nZXMgdGhlCmN1cnJlbnQgYnVmZmVyLgoK KiB0ZXN0L2xpc3Avc2ltcGxlLXRlc3RzLmVsCihwcmUtcmVkaXNwbGF5LWZ1bmN0aW9uLS1jdXJy ZW50LWJ1ZmZlcik6IFRlc3QgZm9yIGZpeGVkIGJlaGF2aW9yLgotLS0KIGxpc3Avc2ltcGxlLmVs ICAgICAgICAgICAgfCAxNiArKysrKysrKysrLS0tLS0tCiB0ZXN0L2xpc3Avc2ltcGxlLXRlc3Rz LmVsIHwgMjggKysrKysrKysrKysrKysrKysrKysrKysrKysrKwogMiBmaWxlcyBjaGFuZ2VkLCAz OCBpbnNlcnRpb25zKCspLCA2IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2xpc3Avc2ltcGxl LmVsIGIvbGlzcC9zaW1wbGUuZWwKaW5kZXggMDRhNTI1Yy4uOWE0NjkwZSAxMDA2NDQKLS0tIGEv bGlzcC9zaW1wbGUuZWwKKysrIGIvbGlzcC9zaW1wbGUuZWwKQEAgLTU0MjUsMTMgKzU0MjUsMTcg QEAgcHJlLXJlZGlzcGxheS1mdW5jdGlvbnMKIGlzIHNldCB0byB0aGUgYnVmZmVyIGRpc3BsYXll ZCBpbiB0aGF0IHdpbmRvdy4iKQogCiAoZGVmdW4gcmVkaXNwbGF5LS1wcmUtcmVkaXNwbGF5LWZ1 bmN0aW9ucyAod2luZG93cykKKyAgKGNvbmQKKyAgICgobnVsbCB3aW5kb3dzKSAoc2V0cSB3aW5k b3dzIChsaXN0IChzZWxlY3RlZC13aW5kb3cpKSkpCisgICAoKG5saXN0cCB3aW5kb3dzKSAoc2V0 cSB3aW5kb3dzICh3aW5kb3ctbGlzdC0xIG5pbCBuaWwgdCkpKSkKICAgKHdpdGgtZGVtb3RlZC1l cnJvcnMgInJlZGlzcGxheS0tcHJlLXJlZGlzcGxheS1mdW5jdGlvbnM6ICVTIgotICAgIChpZiAo bnVsbCB3aW5kb3dzKQotICAgICAgICAod2l0aC1jdXJyZW50LWJ1ZmZlciAod2luZG93LWJ1ZmZl ciAoc2VsZWN0ZWQtd2luZG93KSkKLSAgICAgICAgICAocnVuLWhvb2std2l0aC1hcmdzICdwcmUt cmVkaXNwbGF5LWZ1bmN0aW9ucyAoc2VsZWN0ZWQtd2luZG93KSkpCi0gICAgICAoZG9saXN0ICh3 aW4gKGlmIChsaXN0cCB3aW5kb3dzKSB3aW5kb3dzICh3aW5kb3ctbGlzdC0xIG5pbCBuaWwgdCkp KQotICAgICAgICAod2l0aC1jdXJyZW50LWJ1ZmZlciAod2luZG93LWJ1ZmZlciB3aW4pCi0gICAg ICAgICAgKHJ1bi1ob29rLXdpdGgtYXJncyAncHJlLXJlZGlzcGxheS1mdW5jdGlvbnMgd2luKSkp KSkpCisgICAgKGRvbGlzdCAod2luIHdpbmRvd3MpCisgICAgICAocnVuLWhvb2std3JhcHBlZAor ICAgICAgICdwcmUtcmVkaXNwbGF5LWZ1bmN0aW9ucworICAgICAgIChsYW1iZGEgKGZ1bmMpCisg ICAgICAgICAod2l0aC1jdXJyZW50LWJ1ZmZlciAod2luZG93LWJ1ZmZlciB3aW4pCisgICAgICAg ICAgIChmdW5jYWxsIGZ1bmMgd2luKSkKKyAgICAgICAgIG5pbCkpKSkpCiAKIChhZGQtZnVuY3Rp b24gOmJlZm9yZSBwcmUtcmVkaXNwbGF5LWZ1bmN0aW9uCiAgICAgICAgICAgICAgICMncmVkaXNw bGF5LS1wcmUtcmVkaXNwbGF5LWZ1bmN0aW9ucykKZGlmZiAtLWdpdCBhL3Rlc3QvbGlzcC9zaW1w bGUtdGVzdHMuZWwgYi90ZXN0L2xpc3Avc2ltcGxlLXRlc3RzLmVsCmluZGV4IGQwMjIyNDAuLmRh N2EwM2QgMTAwNjQ0Ci0tLSBhL3Rlc3QvbGlzcC9zaW1wbGUtdGVzdHMuZWwKKysrIGIvdGVzdC9s aXNwL3NpbXBsZS10ZXN0cy5lbApAQCAtMzc0LDUgKzM3NCwzMyBAQCBzaW1wbGUtdGVzdC11bmRv LXdpdGgtc3dpdGNoZWQtYnVmZmVyCiAgICAgICAgKHVuZG8pCiAgICAgICAgKHBvaW50KSkpKSkK IAorDAorOzs7IGBwcmUtcmVkaXNwbGF5LWZ1bmN0aW9uJworKGVydC1kZWZ0ZXN0IHByZS1yZWRp c3BsYXktZnVuY3Rpb24tLWN1cnJlbnQtYnVmZmVyICgpCisgICJWZXJpZnkgdGhhdCB0aGUgZnVu Y3Rpb25zIGluIGBwcmUtcmVkaXNwbGF5LWZ1bmN0aW9ucycgYXJlIGNhbGxlZCB3aXRoIHRoZSBj b3JyZWN0IGBjdXJyZW50LWJ1ZmZlcicuCitTZWUgQnVnIzIxNzMwLiIKKyAgKHdpdGgtdGVtcC1i dWZmZXIKKyAgICAobGV0ICgoYnVmZmVyLTEgKGN1cnJlbnQtYnVmZmVyKSkpCisgICAgICAod2l0 aC10ZW1wLWJ1ZmZlcgorICAgICAgICAobGV0ICgoYnVmZmVyLTIgKGN1cnJlbnQtYnVmZmVyKSkK KyAgICAgICAgICAgICAgKHByZS1yZWRpc3BsYXktZnVuY3Rpb25zIHByZS1yZWRpc3BsYXktZnVu Y3Rpb25zKQorICAgICAgICAgICAgICAoaG9vay0xLWNhbGxzIDApCisgICAgICAgICAgICAgICho b29rLTItY2FsbHMgMCkpCisgICAgICAgICAgKGFkZC1ob29rICdwcmUtcmVkaXNwbGF5LWZ1bmN0 aW9ucworICAgICAgICAgICAgICAgICAgICAobGFtYmRhICh3aW5kb3cpCisgICAgICAgICAgICAg ICAgICAgICAgKHNob3VsZCAoZXF1YWwgKGN1cnJlbnQtYnVmZmVyKSAod2luZG93LWJ1ZmZlciB3 aW5kb3cpKSkKKyAgICAgICAgICAgICAgICAgICAgICAoY2wtaW5jZiBob29rLTEtY2FsbHMpCisg ICAgICAgICAgICAgICAgICAgICAgKHNldC1idWZmZXIgYnVmZmVyLTEpKQorICAgICAgICAgICAg ICAgICAgICA6YXBwZW5kKQorICAgICAgICAgIChhZGQtaG9vayAncHJlLXJlZGlzcGxheS1mdW5j dGlvbnMKKyAgICAgICAgICAgICAgICAgICAgKGxhbWJkYSAod2luZG93KQorICAgICAgICAgICAg ICAgICAgICAgIChzaG91bGQgKGVxdWFsIChjdXJyZW50LWJ1ZmZlcikgKHdpbmRvdy1idWZmZXIg d2luZG93KSkpCisgICAgICAgICAgICAgICAgICAgICAgKGNsLWluY2YgaG9vay0yLWNhbGxzKSkK KyAgICAgICAgICAgICAgICAgICAgOmFwcGVuZCkKKyAgICAgICAgICAoZnVuY2FsbCBwcmUtcmVk aXNwbGF5LWZ1bmN0aW9uIG5pbCkKKyAgICAgICAgICAoc2hvdWxkIChlcXVhbCAoY3VycmVudC1i dWZmZXIpIGJ1ZmZlci0yKSkKKyAgICAgICAgICAoc2hvdWxkIChlcXVhbCBob29rLTEtY2FsbHMg MSkpCisgICAgICAgICAgKHNob3VsZCAoZXF1YWwgaG9vay0yLWNhbGxzIDEpKSkpKSkpCisKIChw cm92aWRlICdzaW1wbGUtdGVzdCkKIDs7OyBzaW1wbGUtdGVzdC5lbCBlbmRzIGhlcmUKLS0gCjIu OC4wLnJjMy4yMjYuZzM5ZDQwMjAKCg== --047d7b86e99268d361053c7c81ef-- From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 15:23:57 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 19:23:57 +0000 Received: from localhost ([127.0.0.1]:59808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFmn-0006Ws-AS for submit@debbugs.gnu.org; Wed, 14 Sep 2016 15:23:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:33931) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFmm-0006Wf-5F for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:23:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkFmg-0001dy-21 for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:23:50 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53534) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkFmb-0001Z0-Fm; Wed, 14 Sep 2016 15:23:45 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4326 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bkFmY-0002jg-Oy; Wed, 14 Sep 2016 15:23:44 -0400 Date: Wed, 14 Sep 2016 22:23:35 +0300 Message-Id: <83oa3q70aw.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Wed, 14 Sep 2016 18:43:13 +0000) Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <834m5i8l3h.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.2 (-------) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.2 (-------) > From: Philipp Stephani > Date: Wed, 14 Sep 2016 18:43:13 +0000 > Cc: 21730@debbugs.gnu.org, mwd@md5i.com > > Since the problem that caused the patch to be reverted was with > narrowing, why not simply use > > (= point (with-current-buffer (window-buffer window) (point-min))) > > instead of > > (= point 1) > > ? > > This has the same issues as described above. There's more code in cursor-sensor--detect that assumes (eq > (current-buffer) (window-buffer window)), e.g. the form (get-char-property point 'cursor-sensor-functions). > Therefore (= point (with-current-buffer (window-buffer window) (point-min))) must be the same as (bobp). > Another mystery is the stack trace entry "run-hook-with-args(cursor-sensor--detect # *Group*>)". How can cursor-sensor--detect be the first argument to run-hook-with-args? Shouldn't it always > be pre-redisplay-functions? If we want to dig deeper, I think we should first understand why bop doesn't work. Is it indeed because the window's buffer is not the current buffer when the hook is called? From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 15:26:14 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 19:26:15 +0000 Received: from localhost ([127.0.0.1]:59814 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFp0-0006aO-Od for submit@debbugs.gnu.org; Wed, 14 Sep 2016 15:26:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:34412) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkFoz-0006a9-ID for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:26:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkFot-000282-DY for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:26:08 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_40,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:53559) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkFoo-00027B-SF; Wed, 14 Sep 2016 15:26:02 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4327 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bkFok-00033Q-Se; Wed, 14 Sep 2016 15:26:01 -0400 Date: Wed, 14 Sep 2016 22:25:51 +0300 Message-Id: <83mvja7074.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Wed, 14 Sep 2016 19:11:57 +0000) Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.2 (-------) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.2 (-------) > From: Philipp Stephani > Date: Wed, 14 Sep 2016 19:11:57 +0000 > > (with-current-buffer (window-buffer win) > (run-hook-with-args 'pre-redisplay-functions win)) > to > (run-hook-wrapped 'pre-redisplay-functions > (lambda (func) (with-current-buffer (window-buffer win) > (funcall func win) > nil)) > or so. > > I've attached a patch for this. Thanks. But we are going to entertain such changes, I think we really should be sure the issue with the current buffer is the culprit. See my other message a few moments ago. From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 14 15:48:42 2016 Received: (at 21730) by debbugs.gnu.org; 14 Sep 2016 19:48:42 +0000 Received: from localhost ([127.0.0.1]:59818 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkGAj-00077U-Kz for submit@debbugs.gnu.org; Wed, 14 Sep 2016 15:48:42 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:38568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkGAi-00077F-2E for 21730@debbugs.gnu.org; Wed, 14 Sep 2016 15:48:40 -0400 Received: by mail-wm0-f47.google.com with SMTP id 1so51709018wmz.1 for <21730@debbugs.gnu.org>; Wed, 14 Sep 2016 12:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=21HC25XV92CcURkv3BAzSk93iARYP9Obp2+qdYIjhhk=; b=ZffTL6DPRJyMMr3Kq9uoBamxguZofdG4hYvPW5f9yUMvNBToFqrGqq+Jf0DYeor2ER su03fRd6QCjhoI1N7o6j2RT0DwJZm7a6ZEhpdhhxVUv1wT3FX5Z6tRXFeXZpfwejTxiU MnpSMJfPvNnNRnx4+0uHkQJj0iSzJBq9acpFzJBCNgL5jKt3yZmWQPQyrptXOU36L/fe Wg7iyaGD/XxGbdNCa/VooE9Hp9WMAwgcnjcIWD+pN6AJSrXM2Ty2wiP5zKS7vPX/gaqC BbTbmCTNbdXp3PrYegvbWg2RAkYoT+SECyP8xr4wBWBleaY0uVZbhtBF5UK+ye3EPVRU ozqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=21HC25XV92CcURkv3BAzSk93iARYP9Obp2+qdYIjhhk=; b=f9Pf/SpfY/XPNnwgLaxJyrzff24jvO6oi2sKAJSB3Qf4eYOSw/NZHAawW7AhCG4/H5 1cBi8N1bkVX9FqsCads7YN1RKxgf3hQw67xCtJItKOzyoPPLzjTz9OLjAfj5Ylp93gZ6 3nZ4Sm1DElzH/2fVvyZL7aNP1hW58C0yotXev51/UwJE4h0RuOcd3ExYwDyCP4oa50BA p+blP7LCr2xVSNbq3c9tLDYFJf1gj1fQIY9ojQ73q1U+7FdAyTjVnOS43BztXQgr2cNH bSkrnodGY0JyRu02oQm947VMFiCYrHllcHoe2NzPi49SJQTnOgJnth3sv2OAeVpxc1lt 1YaQ== X-Gm-Message-State: AE9vXwMToCiec2Qsx9DbhtxNph2p34pdAMLxWMjF4OG2deZo63gnFK4QV98SdcOSvR/Mwr2pJoBoyFG1XuO49A== X-Received: by 10.28.22.6 with SMTP id 6mr4882193wmw.55.1473882514361; Wed, 14 Sep 2016 12:48:34 -0700 (PDT) MIME-Version: 1.0 References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <834m5i8l3h.fsf@gnu.org> <83oa3q70aw.fsf@gnu.org> In-Reply-To: <83oa3q70aw.fsf@gnu.org> From: Philipp Stephani Date: Wed, 14 Sep 2016 19:48:23 +0000 Message-ID: Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions To: Eli Zaretskii Content-Type: multipart/alternative; boundary=001a114702a4b5a92d053c7d03ca X-Spam-Score: -0.5 (/) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) --001a114702a4b5a92d053c7d03ca Content-Type: text/plain; charset=UTF-8 Eli Zaretskii schrieb am Mi., 14. Sep. 2016 um 21:24 Uhr: > > From: Philipp Stephani > > Date: Wed, 14 Sep 2016 18:43:13 +0000 > > Cc: 21730@debbugs.gnu.org, mwd@md5i.com > > > > Since the problem that caused the patch to be reverted was with > > narrowing, why not simply use > > > > (= point (with-current-buffer (window-buffer window) (point-min))) > > > > instead of > > > > (= point 1) > > > > ? > > > > This has the same issues as described above. There's more code in > cursor-sensor--detect that assumes (eq > > (current-buffer) (window-buffer window)), e.g. the form > (get-char-property point 'cursor-sensor-functions). > > Therefore (= point (with-current-buffer (window-buffer window) > (point-min))) must be the same as (bobp). > > Another mystery is the stack trace entry > "run-hook-with-args(cursor-sensor--detect # > *Group*>)". How can cursor-sensor--detect be the first argument to > run-hook-with-args? Shouldn't it always > > be pre-redisplay-functions? > > If we want to dig deeper, I think we should first understand why bop > doesn't work. Is it indeed because the window's buffer is not the > current buffer when the hook is called? > Unfortunately the error doesn't trigger consistently. Maybe we are lucky and somebody manages to detect such an issue. I'd also suggest to add (cl-assert (eq (current-buffer) (window-buffer window))) to cursor-sensor--detect, because the function relies on this equality. --001a114702a4b5a92d053c7d03ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


Eli Za= retskii <eliz@gnu.org> schrieb am= Mi., 14. Sep. 2016 um 21:24=C2=A0Uhr:
> From: Philipp Stephani <p.stephani2@gmail.com>
> Date: Wed, 14 Sep 2016 18:43:13 +0000
> Cc: 21730@debbugs.gnu.org, mwd@md5i.com
>
>=C2=A0 Since the problem that caused the patch to be reverted was with<= br class=3D"gmail_msg"> >=C2=A0 narrowing, why not simply use
>
>=C2=A0 (=3D point (with-current-buffer (window-buffer window) (point-mi= n)))
>
>=C2=A0 instead of
>
>=C2=A0 (=3D point 1)
>
>=C2=A0 ?
>
> This has the same issues as described above. There's more code in = cursor-sensor--detect that assumes (eq
> (current-buffer) (window-buffer window)), e.g. the form (get-char-prop= erty point 'cursor-sensor-functions).
> Therefore (=3D point (with-current-buffer (window-buffer window) (poin= t-min))) must be the same as (bobp).
> Another mystery is the stack trace entry "run-hook-with-args(curs= or-sensor--detect #<window 224 on
> *Group*>)". How can cursor-sensor--detect be the first argumen= t to run-hook-with-args? Shouldn't it always
> be pre-redisplay-functions?

If we want to dig deeper, I think we should first understand why bop
doesn't work.=C2=A0 Is it indeed because the window's buffer is not= the
current buffer when the hook is called?

Unfortunately the error doesn't trigger consistent= ly. Maybe we are lucky and somebody manages to detect such an issue.
<= div>
I'd also suggest to add
(cl-assert (eq (cu= rrent-buffer) (window-buffer window)))=C2=A0
to cursor-sensor--de= tect, because the function relies on this equality.=C2=A0
--001a114702a4b5a92d053c7d03ca-- From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 15 10:22:46 2016 Received: (at 21730) by debbugs.gnu.org; 15 Sep 2016 14:22:46 +0000 Received: from localhost ([127.0.0.1]:60564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkXYn-0004aV-Lz for submit@debbugs.gnu.org; Thu, 15 Sep 2016 10:22:46 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54223) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bkXYi-0004aG-Du for 21730@debbugs.gnu.org; Thu, 15 Sep 2016 10:22:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bkXYZ-0001Ns-Cr for 21730@debbugs.gnu.org; Thu, 15 Sep 2016 10:22:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bkXYT-0001MU-L0; Thu, 15 Sep 2016 10:22:21 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:1173 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1bkXYP-0001qn-Rg; Thu, 15 Sep 2016 10:22:19 -0400 Date: Thu, 15 Sep 2016 17:22:22 +0300 Message-Id: <83lgyt6y5d.fsf@gnu.org> From: Eli Zaretskii To: Philipp Stephani In-reply-to: (message from Philipp Stephani on Wed, 14 Sep 2016 19:48:23 +0000) Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <834m5i8l3h.fsf@gnu.org> <83oa3q70aw.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.2 (-------) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.2 (-------) > From: Philipp Stephani > Date: Wed, 14 Sep 2016 19:48:23 +0000 > Cc: 21730@debbugs.gnu.org, mwd@md5i.com > > If we want to dig deeper, I think we should first understand why bop > doesn't work. Is it indeed because the window's buffer is not the > current buffer when the hook is called? > > Unfortunately the error doesn't trigger consistently. Maybe we are lucky and somebody manages to detect > such an issue. > > I'd also suggest to add > (cl-assert (eq (current-buffer) (window-buffer window))) > to cursor-sensor--detect, because the function relies on this equality. Michael, could you please look some more into this? I think we need to understand the reason why bobp doesn't work, although the hook was supposed to be called with the window's buffer the current buffer. TIA From unknown Sun Jun 22 07:32:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 14 Oct 2016 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 24 22:03:45 2017 Received: (at control) by debbugs.gnu.org; 25 Jul 2017 02:03:45 +0000 Received: from localhost ([127.0.0.1]:54874 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpCL-0000EU-DZ for submit@debbugs.gnu.org; Mon, 24 Jul 2017 22:03:45 -0400 Received: from kwanyin.sergiodj.net ([158.69.185.54]:58788) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpCJ-0000EM-3Y for control@debbugs.gnu.org; Mon, 24 Jul 2017 22:03:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sergiodj.net; s=20160602; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=R5DNRABGDJT1Mo8ReLu3+0+ZAEyZf2X1O22JIXdp5rU=; b=EY9HePRyt98NBTfUSv6aAsbpvG9IwcwOSrVZ7E0eObPFwaJTdro8ibJX2qLGRnz+9LaKzhqw83i49ODxcqnWSKOP1r2bmiY/IkIyG6Ry+1QSjSByiq654mNAqD0UZG8uzQ+1UktfUxBneR9gs5QA+xFtSjdiZHPAy1qk1sqXuHE=; From: Sergio Durigan Junior To: control@debbugs.gnu.org Subject: X-URL: http://blog.sergiodj.net Date: Mon, 24 Jul 2017 22:03:41 -0400 Message-ID: <877eyxtgqq.fsf@sergiodj.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 21730 -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 2.0 (++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: unarchive 21730 -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ [...] Content analysis details: (2.0 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_PASS SPF: sender matches SPF record 2.0 BLANK_SUBJECT Subject is present but empty 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid unarchive 21730 -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ From debbugs-submit-bounces@debbugs.gnu.org Mon Jul 24 22:07:01 2017 Received: (at 21730) by debbugs.gnu.org; 25 Jul 2017 02:07:01 +0000 Received: from localhost ([127.0.0.1]:54879 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpFU-0000JJ-SF for submit@debbugs.gnu.org; Mon, 24 Jul 2017 22:07:01 -0400 Received: from kwanyin.sergiodj.net ([158.69.185.54]:58796) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dZpFT-0000JB-0N for 21730@debbugs.gnu.org; Mon, 24 Jul 2017 22:06:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sergiodj.net; s=20160602; h=Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From; bh=IyzJuxuyCrQTEG4dBEimNVjn2ViSfXKS00nGfzYM1Kk=; b=P4OH2cBASZpbHkSy9mfMvesxQDVfZP6lJ9gKZr0eMDBbcyjOCEG0Tb5bOnvxQOB6Vz0VH54bbadsOX7Ipcr7gjRtqSgrV87Qsz4MtjOW4mJ4Wc5r/DEB4U1iraRn48YzUU8TwhPVB9V/chh9NQgckBb3VLZTlc9/88VtYCz7hbE=; From: Sergio Durigan Junior To: Eli Zaretskii Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions In-Reply-To: <83mvja7074.fsf@gnu.org> References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <83mvja7074.fsf@gnu.org> X-URL: http://blog.sergiodj.net Date: Mon, 24 Jul 2017 22:06:56 -0400 Message-ID: <87h8y1s20v.fsf@sergiodj.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com, Philipp Stephani X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Wednesday, September 14 2016, Eli Zaretskii wrote: [ Resending because I have now really unarchived the bug. Sorry about the dup. ] >> From: Philipp Stephani >> Date: Wed, 14 Sep 2016 19:11:57 +0000 >>=20 >> (with-current-buffer (window-buffer win) >> (run-hook-with-args 'pre-redisplay-functions win)) >> to >> (run-hook-wrapped 'pre-redisplay-functions >> (lambda (func) (with-current-buffer (window-buffer win) >> (funcall func win) >> nil)) >> or so. >>=20 >> I've attached a patch for this.=20 > > Thanks. But we are going to entertain such changes, I think we really > should be sure the issue with the current buffer is the culprit. See > my other message a few moments ago. It is pretty hard to diagnose and investigate this issue, but I think I've managed to progress a bit. The problem doesn't seem to be on bobp, and I happen to share Philipp's opinion that the real issue is the assumption that cursor-sensor--detect will be at the right buffer when it's not. Here, let me show you. On my machine, this error always happens when I'm running Gnus in one buffer (via emacsclient), and while I am visiting a file in another buffer, and in another window (i.e., another emacsclient). The backtrace I get is: Debugger entered--Lisp error: (args-out-of-range 0) get-char-property(0 cursor-sensor-functions) cursor-sensor--detect(#) ^^^^^^^^^^^^^^^^^^^^^^^^^ run-hook-with-args(cursor-sensor--detect #) redisplay--pre-redisplay-functions(t) apply(redisplay--pre-redisplay-functions t) [ lots of other functions not interesting for us ] I took the liberty to mark the interesting part above, which is the argument to cursor-sensor--detect. As you can notice, it's working on the *Group* window, from Gnus. Now, the interesting part that I noticed and was able to verify is that this only happens when (a) I am not working in that buffer, (b) the point is at (point-min) at that buffer, but (c) the point is not (point-min) at the buffer I'm currently in. In this case, Emacs does some wrong calculations with point and ends up with the value of 0, which makes sense if you consider that (window-point) of that window is 1, but (bobp) is not t (because, as I explained, I'm working in another buffer, and the value of point there is not 1). With all that said, I came to the conclusion that Phillip's rationale makes sense and therefore his patch seems to be the best shot we have at fixing this annoying bug. Thanks, =2D-=20 Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEI3pUsQKHKL8A7zH00Ot2KGX8XjYFAll2p8EACgkQ0Ot2KGX8 Xjb5xBAAl373LAUtKteA/HZn6KpWDK+vZqXq7gX4BDAwdrr4Ard0gA2xyIN1pb42 yFsE3Qs0Ek0Y9a0G3u+Gw48gaf5+piaTpqTlNI2r+TfKdbk6P13wCrXI59cKQYkR oKLceNDM4Fn4On5rLF33TQFvxd39qZ+wy9PBhjVISN7Qfrpm9zgqrfsYUfP2GS9D dv948yciOl6fr3/UZKZZsDGq1yTky8cThQegJHIkL0c7Rh1y1YVe39sTEDYuLOLQ Kc1NibfBmzQkIvMzYUsuJ0by7q9CGKPBz1y6ngoZHFm+GXIlwe5bT5otmMhQMjMF 3+aWjQ98p4djobgDV/6HhFM3VIZm05vdgZEJwNv51faNRLyZv2aPXdpetsPpGp6J 2iX5NFoudz+FRj7j/YiT4ICxdaRfhASEfe5QrlxA9jFhy47qMnw6vZWBR98mEKhq 4hemsWVPkfwdyVNr48mAlMdI73hAdI1awCtEJqcfow44QCy6TEusH2pc7RRr+uMt P2e3kMiayK4UGNcNAGH1etWhlCzL+tlfGE93yM75LI1Q5cYqEMAzSiwWmVxdh6BG 36K9vJnH8/UaSJDCUbxCmBpXWt986kVHUGKEpb9A8z36Mws+xf0GlKPw9bVGbuNf NZVkZjefR1sQ795ccnA6yg755culHHYsAZVA1t0z7nKlzl4cgPU= =yQhh -----END PGP SIGNATURE----- --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 25 10:22:07 2017 Received: (at 21730) by debbugs.gnu.org; 25 Jul 2017 14:22:07 +0000 Received: from localhost ([127.0.0.1]:55991 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da0is-0005rU-RR for submit@debbugs.gnu.org; Tue, 25 Jul 2017 10:22:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da0ir-0005qz-E2 for 21730@debbugs.gnu.org; Tue, 25 Jul 2017 10:22:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da0ig-0007hU-GX for 21730@debbugs.gnu.org; Tue, 25 Jul 2017 10:22:00 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:32824) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da0ic-0007fg-GR; Tue, 25 Jul 2017 10:21:50 -0400 Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:4368 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1da0ib-00029O-VS; Tue, 25 Jul 2017 10:21:50 -0400 Date: Tue, 25 Jul 2017 17:21:50 +0300 Message-Id: <83a83s7g1t.fsf@gnu.org> From: Eli Zaretskii To: Sergio Durigan Junior In-reply-to: <87h8y1s20v.fsf@sergiodj.net> (message from Sergio Durigan Junior on Mon, 24 Jul 2017 22:06:56 -0400) Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <83mvja7074.fsf@gnu.org> <87h8y1s20v.fsf@sergiodj.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -7.8 (-------) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com, p.stephani2@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: Eli Zaretskii Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -7.8 (-------) > From: Sergio Durigan Junior > Cc: Philipp Stephani , 21730@debbugs.gnu.org, mwd@md5i.com > Date: Mon, 24 Jul 2017 22:06:56 -0400 > > Debugger entered--Lisp error: (args-out-of-range 0) > get-char-property(0 cursor-sensor-functions) > cursor-sensor--detect(#) > ^^^^^^^^^^^^^^^^^^^^^^^^^ > run-hook-with-args(cursor-sensor--detect #) > redisplay--pre-redisplay-functions(t) > apply(redisplay--pre-redisplay-functions t) > [ lots of other functions not interesting for us ] > > I took the liberty to mark the interesting part above, which is the > argument to cursor-sensor--detect. As you can notice, it's working on > the *Group* window, from Gnus. Now, the interesting part that I noticed > and was able to verify is that this only happens when (a) I am not > working in that buffer, (b) the point is at (point-min) at that buffer, > but (c) the point is not (point-min) at the buffer I'm currently in. In > this case, Emacs does some wrong calculations with point and ends up > with the value of 0, which makes sense if you consider that > (window-point) of that window is 1, but (bobp) is not t (because, as I > explained, I'm working in another buffer, and the value of point there > is not 1). > > With all that said, I came to the conclusion that Phillip's rationale > makes sense and therefore his patch seems to be the best shot we have at > fixing this annoying bug. Thanks for following up. Phillip's hypothesis assumes that there's another function in pre-redisplay-function, which is called before cursor-sensor--detect and switches to another buffer, leaving us there. Do you indeed have other functions on that list? If so, what are they? I'm asking because I'd like to be sure we are on the right track with the root cause. From debbugs-submit-bounces@debbugs.gnu.org Tue Jul 25 19:15:54 2017 Received: (at 21730) by debbugs.gnu.org; 25 Jul 2017 23:15:54 +0000 Received: from localhost ([127.0.0.1]:56475 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da93S-0000TB-68 for submit@debbugs.gnu.org; Tue, 25 Jul 2017 19:15:54 -0400 Received: from kwanyin.sergiodj.net ([158.69.185.54]:60064) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1da93P-0000T0-Gg for 21730@debbugs.gnu.org; Tue, 25 Jul 2017 19:15:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sergiodj.net; s=20160602; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=aTpd4KukeLOAcyZzlr/gft1XMsR7GfCYBY94fzhgSDA=; b=bu3kTTNAXIwaGXr4OQRxNjz13/tubRcS50kI0rOxpRzn1KwMjNbB2n493YJK+7kLMEZcwj6xZYHFZ5hCHk0aKtFwzWPDFG7aVYeNg1VlYf+9a67buY+W1cdhDKlteJru9Gv47xuVEEtMRm3/DirGNxHtsNJvo/NvXw8Vi7urLzM=; From: Sergio Durigan Junior To: Eli Zaretskii Subject: Re: bug#21730: 25.0.50; Random errors in redisplay--pre-redisplay-functions References: <87io5zh7m1.fsf@md5i.com> <83vb9zt19o.fsf@gnu.org> <87y4epeyf2.fsf@md5i.com> <87mvuzfapy.fsf@md5i.com> <83ziyzxiwl.fsf@gnu.org> <83mvja7074.fsf@gnu.org> <87h8y1s20v.fsf@sergiodj.net> <83a83s7g1t.fsf@gnu.org> X-URL: http://blog.sergiodj.net Date: Tue, 25 Jul 2017 19:15:48 -0400 In-Reply-To: <83a83s7g1t.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 25 Jul 2017 17:21:50 +0300") Message-ID: <87lgncqfa3.fsf@sergiodj.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 21730 Cc: 21730@debbugs.gnu.org, mwd@md5i.com, p.stephani2@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) On Tuesday, July 25 2017, Eli Zaretskii wrote: >> From: Sergio Durigan Junior >> Cc: Philipp Stephani , 21730@debbugs.gnu.org, mwd@md5i.com >> Date: Mon, 24 Jul 2017 22:06:56 -0400 >> >> Debugger entered--Lisp error: (args-out-of-range 0) >> get-char-property(0 cursor-sensor-functions) >> cursor-sensor--detect(#) >> ^^^^^^^^^^^^^^^^^^^^^^^^^ >> run-hook-with-args(cursor-sensor--detect #) >> redisplay--pre-redisplay-functions(t) >> apply(redisplay--pre-redisplay-functions t) >> [ lots of other functions not interesting for us ] >> >> I took the liberty to mark the interesting part above, which is the >> argument to cursor-sensor--detect. As you can notice, it's working on >> the *Group* window, from Gnus. Now, the interesting part that I noticed >> and was able to verify is that this only happens when (a) I am not >> working in that buffer, (b) the point is at (point-min) at that buffer, >> but (c) the point is not (point-min) at the buffer I'm currently in. In >> this case, Emacs does some wrong calculations with point and ends up >> with the value of 0, which makes sense if you consider that >> (window-point) of that window is 1, but (bobp) is not t (because, as I >> explained, I'm working in another buffer, and the value of point there >> is not 1). >> >> With all that said, I came to the conclusion that Phillip's rationale >> makes sense and therefore his patch seems to be the best shot we have at >> fixing this annoying bug. > > Thanks for following up. > > Phillip's hypothesis assumes that there's another function in > pre-redisplay-function, which is called before cursor-sensor--detect > and switches to another buffer, leaving us there. Do you indeed have > other functions on that list? If so, what are they? You know, that's a good question. After looking into what I have here, I don't see any other function being called before pre-redisplay-functions. Everything seems fine and I see the call to with-current-buffer before calling run-hook-with-args, which means that, unless there is a bug somewhere, I don't see how the buffer could have changed. > I'm asking because I'd like to be sure we are on the right track with > the root cause. Sure thing. Well, if you ask me, I'm convinced that what I explained in my last message is what happens, but I still don't know *why* it happens. I'll see if I manage to investigate this a bit more. Thanks, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/ From unknown Sun Jun 22 07:32:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Wed, 23 Aug 2017 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator