GNU bug report logs -
#18011
24.4.50; REGRESSION, `help-echo' function value now needs `save-excursion'
Previous Next
Reported by: Drew Adams <drew.adams <at> oracle.com>
Date: Sun, 13 Jul 2014 23:13:01 UTC
Severity: normal
Tags: notabug, wontfix
Found in version 24.4.50
Done: Glenn Morris <rgm <at> gnu.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 18011 in the body.
You can then email your comments to 18011 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18011
; Package
emacs
.
(Sun, 13 Jul 2014 23:13:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Drew Adams <drew.adams <at> oracle.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sun, 13 Jul 2014 23:13:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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 <at> 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
(if (not (dired-move-to-filename))
(unless (or (looking-at-p "^$")
(looking-at-p dired-subdir-regexp))
(put-text-property (line-beginning-position)
(1+ (line-end-position))
'invisible 'dired-hide-details-information))
(put-text-property (+ (line-beginning-position) 1) (1- (point))
'invisible 'dired-hide-details-detail)
(add-text-properties ; @@@@@@@
(line-beginning-position) (line-end-position)
'(mouse-face highlight help-echo my-help))
;; (add-text-properties
;; (point)
;; (progn
;; (dired-move-to-end-of-filename)
;; (point))
;; '(mouse-face
;; highlight
;; dired-filename t
;; ;; help-echo "mouse-2: visit this file in other window"))
(when (< (+ (point) 4) (line-end-position))
(put-text-property (+ (point) 4) (line-end-position)
'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 <at> gnu.org-20140628015517-eku6hj8mpgcvfnso
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
`configure --prefix=/c/Devel/emacs/snapshot/trunk
--enable-checking=yes,glyphs 'CFLAGS=-O0 -g3'
LDFLAGS=-Lc:/Devel/emacs/lib 'CPPFLAGS=-DGC_MCHECK=1
-Ic:/Devel/emacs/include''
Added tag(s) notabug and wontfix.
Request was from
Glenn Morris <rgm <at> gnu.org>
to
control <at> debbugs.gnu.org
.
(Sun, 13 Jul 2014 23:42:02 GMT)
Full text and
rfc822 format available.
Reply sent
to
Glenn Morris <rgm <at> gnu.org>
:
You have taken responsibility.
(Sun, 13 Jul 2014 23:42:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Drew Adams <drew.adams <at> oracle.com>
:
bug acknowledged by developer.
(Sun, 13 Jul 2014 23:42:03 GMT)
Full text and
rfc822 format available.
Message #12 received at 18011-done <at> debbugs.gnu.org (full text, mbox):
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.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#18011
; Package
emacs
.
(Mon, 14 Jul 2014 03:54:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 18011-done <at> debbugs.gnu.org (full text, mbox):
> 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.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Mon, 11 Aug 2014 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 11 years and 8 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.