From unknown Mon Aug 18 14:25:34 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#18011 <18011@debbugs.gnu.org> To: bug#18011 <18011@debbugs.gnu.org> Subject: Status: 24.4.50; REGRESSION, `help-echo' function value now needs `save-excursion' Reply-To: bug#18011 <18011@debbugs.gnu.org> Date: Mon, 18 Aug 2025 21:25:34 +0000 retitle 18011 24.4.50; REGRESSION, `help-echo' function value now needs `sa= ve-excursion' reassign 18011 emacs submitter 18011 Drew Adams severity 18011 normal tag 18011 notabug wontfix thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 13 19:12:08 2014 Received: (at submit) by debbugs.gnu.org; 13 Jul 2014 23:12:08 +0000 Received: from localhost ([127.0.0.1]:53965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6SwB-0000Xn-8Q for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:12:07 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56051) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6Sw8-0000XE-Fc for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:12:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6Svs-0003p3-O9 for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:11:59 -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.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:51796) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6Svs-0003ox-LE for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:11:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57487) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6Svj-0006gE-HB for bug-gnu-emacs@gnu.org; Sun, 13 Jul 2014 19:11:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X6Sva-0003gT-Pw for bug-gnu-emacs@gnu.org; Sun, 13 Jul 2014 19:11:39 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:50661) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X6Sva-0003ft-JO for bug-gnu-emacs@gnu.org; Sun, 13 Jul 2014 19:11:30 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s6DNBSEt025889 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sun, 13 Jul 2014 23:11:29 GMT Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6DNBR5h028458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Sun, 13 Jul 2014 23:11:28 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6DNBRH9007098 for ; Sun, 13 Jul 2014 23:11:27 GMT MIME-Version: 1.0 Message-ID: Date: Sun, 13 Jul 2014 16:11:24 -0700 (PDT) From: Drew Adams To: bug-gnu-emacs@gnu.org Subject: 24.4.50; REGRESSION, `help-echo' function value now needs `save-excursion' X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.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.0 (----) 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.0 (----) I have some code that uses a function value for `help-echo' in Dired buffers. It works fine in Emacs 24.3 and prior. In later builds it has this problem: When you press mouse-1 and hold it down on a date field in Dired, point is not set there as it should be. Instead, the text cursor moves with the mouse after you do that. The oldest post-24.3 build I have is this one, and it exhibits the problem (as do recent builds): In GNU Emacs 24.3.50.1 (i386-mingw-nt6.1.7601) of 2013-05-14 on ODIEONE Bzr revision: 112586 juri@jurta.org-20130514233814-nnkh1ymiqgoq2fk6 Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --with-gcc (4.7) --no-opt --enable-checking --cflags -IC:/Devel/emacs/build/include --ldflags -LC:/Devel/emacs/build/lib' Recipe to repro the problem from emacs -Q: 1. Evaluate this code: (defun my-help (window buffer pos) (with-current-buffer buffer (goto-char pos))) (defun dired-insert-set-properties (beg end) (save-excursion (goto-char beg) (while (< (point) end) (ignore-errors =09(if (not (dired-move-to-filename)) =09 (unless (or (looking-at-p "^$") =09=09=09(looking-at-p dired-subdir-regexp)) =09 (put-text-property (line-beginning-position) =09=09=09=09 (1+ (line-end-position)) =09=09=09=09 'invisible 'dired-hide-details-information)) =09 (put-text-property (+ (line-beginning-position) 1) (1- (point)) =09=09=09 'invisible 'dired-hide-details-detail) =09 (add-text-properties ; @@@@@@@ =09 (line-beginning-position) (line-end-position) =09 '(mouse-face highlight help-echo my-help)) =09 ;; (add-text-properties =09 ;; (point) =09 ;; (progn =09 ;; (dired-move-to-end-of-filename) =09 ;; (point)) =09 ;; '(mouse-face =09 ;; highlight =09 ;; dired-filename t =09 ;; ;; help-echo "mouse-2: visit this file in other window")) =09 (when (< (+ (point) 4) (line-end-position)) =09 (put-text-property (+ (point) 4) (line-end-position) =09=09=09 'invisible 'dired-hide-details-link)))) (forward-line 1)))) 2. Then press & hold mouse-1 on a date field in Dired. Release mouse-1 and move the mouse. You can see that point was not set: the text cursor follows the mouse. The change above to the original `dired-insert-set-properties' is just to substitute the `add-text-properties' sexp indicated by `@@@@@@@' for the one that is commented out. The two differences are these: 1. `mouse-face' is put on the whole line, not just the file-name part. 2. The value of `help-echo' is a function, `my-help', and that function uses `goto-char'. I've fixed my code by wrapping the `goto-char' in `save-excursion'. But I suspect that that workaround papers over a bug (regression). Why should a `help-echo' function need to `save-excursion'? Note that if the mouse-face is not placed over the place where you click (in the test, it is on the whole line, and you click on the date field) then there is no problem. HTH. Close the bug if you don't care about this - I have my fix. In GNU Emacs 24.4.50.1 (i686-pc-mingw32) of 2014-06-28 on ODIEONE Bzr revision: 117431 rgm@gnu.org-20140628015517-eku6hj8mpgcvfnso Windowing system distributor `Microsoft Corp.', version 6.1.7601 Configured using: `configure --prefix=3D/c/Devel/emacs/snapshot/trunk --enable-checking=3Dyes,glyphs 'CFLAGS=3D-O0 -g3' LDFLAGS=3D-Lc:/Devel/emacs/lib 'CPPFLAGS=3D-DGC_MCHECK=3D1 -Ic:/Devel/emacs/include'' From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 13 19:41:40 2014 Received: (at control) by debbugs.gnu.org; 13 Jul 2014 23:41:40 +0000 Received: from localhost ([127.0.0.1]:53981 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6TOm-0001Hy-AM for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:41:40 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57946 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6TOh-0001Hk-5b for control@debbugs.gnu.org; Sun, 13 Jul 2014 19:41:35 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1X6TOg-0004Rf-UH for control@debbugs.gnu.org; Sun, 13 Jul 2014 19:41:34 -0400 Date: Sun, 13 Jul 2014 19:41:34 -0400 Message-Id: Subject: control message for bug 18011 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control 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: -5.0 (-----) tag 18011 notabug wontfix From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 13 19:41:22 2014 Received: (at 18011-done) by debbugs.gnu.org; 13 Jul 2014 23:41:22 +0000 Received: from localhost ([127.0.0.1]:53978 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6TOT-0001HQ-Bc for submit@debbugs.gnu.org; Sun, 13 Jul 2014 19:41:21 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:57925 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6TOQ-0001HH-NW for 18011-done@debbugs.gnu.org; Sun, 13 Jul 2014 19:41:19 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1X6TOP-0004Ja-SW; Sun, 13 Jul 2014 19:41:17 -0400 From: Glenn Morris To: 18011-done@debbugs.gnu.org Subject: Re: bug#18011: 24.4.50; REGRESSION, `help-echo' function value now needs `save-excursion' References: X-Spook: codes White Water Leuken-Baden Ruby Ridge arrangements X-Ran: lRFu2E2ed2a1v$|?"922yO>kducHS#3;3[bgDhNdRXaoLf5sVl (Drew Adams's message of "Sun, 13 Jul 2014 16:11:24 -0700 (PDT)") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: 18011-done 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: -5.0 (-----) Drew Adams wrote: > Why should a `help-echo' function need to `save-excursion'? I can't think why it should NOT need to, if it moves point; nor can I find any Emacs release where it does not need to. I tested back to 22.3 with (put-text-property 1 10 'help-echo 'foo) (defun foo (w o p) (goto-char (point-max)) "foo") > HTH. Close the bug if you don't care about this - I have my fix. Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 13 23:53:25 2014 Received: (at 18011-done) by debbugs.gnu.org; 14 Jul 2014 03:53:25 +0000 Received: from localhost ([127.0.0.1]:54089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6XKO-0002pH-N5 for submit@debbugs.gnu.org; Sun, 13 Jul 2014 23:53:24 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:49012) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1X6XKL-0002p2-Lw for 18011-done@debbugs.gnu.org; Sun, 13 Jul 2014 23:53:22 -0400 Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s6E3rDoK003620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Jul 2014 03:53:15 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6E3rCGY028718 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 14 Jul 2014 03:53:13 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s6E3rBh6009070; Mon, 14 Jul 2014 03:53:12 GMT MIME-Version: 1.0 Message-ID: <9a3251df-2c12-4e81-a0aa-4164a0bd0dc0@default> Date: Sun, 13 Jul 2014 20:53:09 -0700 (PDT) From: Drew Adams To: Glenn Morris , 18011-done@debbugs.gnu.org Subject: RE: bug#18011: 24.4.50; REGRESSION, `help-echo' function value now needs `save-excursion' References: In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Source-IP: ucsinet21.oracle.com [156.151.31.93] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 18011-done 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: -2.3 (--) > nor can I find any Emacs release where it does not need to. > I tested back to 22.3 True. For some reason the problem does not manifest with my original code, for Emacs 24.3 or earlier. But the simple test case does show the same behavior for earlier versions. And yes, the behavior that the cursor stays with the mouse makes sense, since POS is the mouse position. Not a bug. From unknown Mon Aug 18 14:25:34 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 11 Aug 2014 11:24:03 +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