GNU bug report logs - #13979
24.3.50; NS: scroll-bar not draggable

Previous Next

Package: emacs;

Reported by: Darren Hoo <darren.hoo <at> gmail.com>

Date: Sat, 16 Mar 2013 19:40:02 UTC

Severity: normal

Found in version 24.3.50

Done: Jan Djärv <jan.h.d <at> swipnet.se>

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 13979 in the body.
You can then email your comments to 13979 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sat, 16 Mar 2013 19:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Darren Hoo <darren.hoo <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 16 Mar 2013 19:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Darren Hoo <darren.hoo <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 03:37:23 +0800
turn on scroll-bar mode
 (scroll-bar-mode t)

then open a file and drag the scroll bar, it shows:

`mouse-on-link-p: Wrong type argument: listp, handle'

the stacktrace:

Debugger entered--Lisp error: (wrong-type-argument listp handle)
  mouse-posn-property((#<window 0x10506e250 on *info*>
vertical-scroll-bar (4 . 428) 95079520 handle) follow-link)
  mouse-on-link-p((#<window 0x10506e250 on *info*> vertical-scroll-bar
(4 . 428) 95079520 handle))
  mouse--down-1-maybe-follows-link(nil)

Also with scroll-bar turned on, horizontally splitted windows can not be
resized by dragging.

In GNU Emacs 24.3.50.3 (x86_64-apple-darwin12.2.1, NS apple-appkit-1187.37)
 of 2013-03-17 on Darren-rMBP
Bzr revision: 112060 jan.h.d <at> swipnet.se-20130316142237-fbp077v13rwbq20y
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure --with-ns'




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 02:45:02 GMT) Full text and rfc822 format available.

Message #8 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Darren Hoo <darren.hoo <at> gmail.com>
Cc: 13979 <at> debbugs.gnu.org
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sat, 16 Mar 2013 22:43:07 -0400
> turn on scroll-bar mode
>  (scroll-bar-mode t)

They're on by default, aren't they?

> then open a file and drag the scroll bar, it shows:
> `mouse-on-link-p: Wrong type argument: listp, handle'
> the stacktrace:
> Debugger entered--Lisp error: (wrong-type-argument listp handle)
>   mouse-posn-property((#<window 0x10506e250 on *info*>
> vertical-scroll-bar (4 . 428) 95079520 handle) follow-link)

I can't reproduce it here on GNU/Linux.  I'm not sure if the format of
the posn object quoted above is correct, but can you try the patch
below (which is either a fix, or a workaround)?

> Also with scroll-bar turned on, horizontally splitted windows can not be
> resized by dragging.

I can't reproduce the problem here, either.


        Stefan


=== modified file 'lisp/mouse.el'
--- lisp/mouse.el	2013-03-09 17:14:24 +0000
+++ lisp/mouse.el	2013-03-17 02:39:03 +0000
@@ -709,7 +713,7 @@
   (if (consp pos)
       (let ((w (posn-window pos)) (pt (posn-point pos))
 	    (str (posn-string pos)))
-	(or (and str
+	(or (and (consp str)
 		 (get-text-property (cdr str) property (car str)))
 	    (and pt
 		 (get-char-property pt property w))))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 09:48:01 GMT) Full text and rfc822 format available.

Message #11 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13979 <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 10:45:45 +0100
Hello.

17 mar 2013 kl. 03:43 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

>> turn on scroll-bar mode
>> (scroll-bar-mode t)
> 
> They're on by default, aren't they?
> 
>> then open a file and drag the scroll bar, it shows:
>> `mouse-on-link-p: Wrong type argument: listp, handle'
>> the stacktrace:
>> Debugger entered--Lisp error: (wrong-type-argument listp handle)
>>  mouse-posn-property((#<window 0x10506e250 on *info*>
>> vertical-scroll-bar (4 . 428) 95079520 handle) follow-link)
> 
> I can't reproduce it here on GNU/Linux.  I'm not sure if the format of
> the posn object quoted above is correct, but can you try the patch
> below (which is either a fix, or a workaround)?
> 

It may be a NS-specific error.  I can reproduce it on OSX.  Emacs-24.3 works fine though, so I assume there has been some change in common code, and that the NS code was not adjusted.

>> Also with scroll-bar turned on, horizontally splitted windows can not be
>> resized by dragging.
> 
> I can't reproduce the problem here, either.
> 

I can on OSX.
The patch below only changes the error message to

mouse-posn-property: Wrong type argument: integer-or-marker-p, vertical-scroll-bar

	Jan D.

> 
>        Stefan
> 
> 
> === modified file 'lisp/mouse.el'
> --- lisp/mouse.el	2013-03-09 17:14:24 +0000
> +++ lisp/mouse.el	2013-03-17 02:39:03 +0000
> @@ -709,7 +713,7 @@
>   (if (consp pos)
>       (let ((w (posn-window pos)) (pt (posn-point pos))
> 	    (str (posn-string pos)))
> -	(or (and str
> +	(or (and (consp str)
> 		 (get-text-property (cdr str) property (car str)))
> 	    (and pt
> 		 (get-char-property pt property w))))
> 
> 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 11:05:02 GMT) Full text and rfc822 format available.

Message #14 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13979 <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 12:02:57 +0100
Hello.

On OSX the event produced when clicking below the handle looks like:

(down-mouse-1 (#<window 0x103229e50 on *info*> vertical-scroll-bar (0 . 428) 83281193 below-handle))

On Gtk3 it looks like:

(mouse-1 (#<window 0x11a0228 on *info*> vertical-scroll-bar (0 . 0) 0 below-handle))

Gtk does not have y or timestamp, but that hardly matters.
If I remove modifier down, so NS also produces mouse-1, I get:

<vertical-scroll-bar> <mouse-1> is undefined.

If I bind that to ns-handle-scroll-bar-event, everything works OK.

Which code has changed to care about mouse-1 versus down-mouse-1?
As I said, this problem does not exist on 24.3.

	Jan D.

17 mar 2013 kl. 10:45 skrev Jan Djärv <jan.h.d <at> swipnet.se>:

> Hello.
> 
> 17 mar 2013 kl. 03:43 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:
> 
>>> turn on scroll-bar mode
>>> (scroll-bar-mode t)
>> 
>> They're on by default, aren't they?
>> 
>>> then open a file and drag the scroll bar, it shows:
>>> `mouse-on-link-p: Wrong type argument: listp, handle'
>>> the stacktrace:
>>> Debugger entered--Lisp error: (wrong-type-argument listp handle)
>>> mouse-posn-property((#<window 0x10506e250 on *info*>
>>> vertical-scroll-bar (4 . 428) 95079520 handle) follow-link)
>> 
>> I can't reproduce it here on GNU/Linux.  I'm not sure if the format of
>> the posn object quoted above is correct, but can you try the patch
>> below (which is either a fix, or a workaround)?
>> 
> 
> It may be a NS-specific error.  I can reproduce it on OSX.  Emacs-24.3 works fine though, so I assume there has been some change in common code, and that the NS code was not adjusted.
> 
>>> Also with scroll-bar turned on, horizontally splitted windows can not be
>>> resized by dragging.
>> 
>> I can't reproduce the problem here, either.
>> 
> 
> I can on OSX.
> The patch below only changes the error message to
> 
> mouse-posn-property: Wrong type argument: integer-or-marker-p, vertical-scroll-bar
> 
> 	Jan D.
> 
>> 
>>       Stefan
>> 
>> 
>> === modified file 'lisp/mouse.el'
>> --- lisp/mouse.el	2013-03-09 17:14:24 +0000
>> +++ lisp/mouse.el	2013-03-17 02:39:03 +0000
>> @@ -709,7 +713,7 @@
>>  (if (consp pos)
>>      (let ((w (posn-window pos)) (pt (posn-point pos))
>> 	    (str (posn-string pos)))
>> -	(or (and str
>> +	(or (and (consp str)
>> 		 (get-text-property (cdr str) property (car str)))
>> 	    (and pt
>> 		 (get-char-property pt property w))))
>> 
>> 
> 





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 13:15:02 GMT) Full text and rfc822 format available.

Message #17 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 13979 <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 09:12:48 -0400
> Which code has changed to care about mouse-1 versus down-mouse-1?

The code that turns mouse-1 into mouse-2 in case of follow-link (which
is now run more often: it used to be done in the mouse-drag-region
command, but is now done in a key-translation-map entry).


        Stefan




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 14:44:01 GMT) Full text and rfc822 format available.

Message #20 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: "Jan D." <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13979 <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 15:41:57 +0100
Hello.

Stefan Monnier skrev 2013-03-17 14:12:
>> Which code has changed to care about mouse-1 versus down-mouse-1?
> The code that turns mouse-1 into mouse-2 in case of follow-link (which
> is now run more often: it used to be done in the mouse-drag-region
> command, but is now done in a key-translation-map entry).
>

So shall we change key-translation-map or is it better for the NS-port 
to use mouse-1 for scroll events?
Actually, the latter is probably best, keeps it in line with other ports.

    Jan D.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Sun, 17 Mar 2013 15:40:01 GMT) Full text and rfc822 format available.

Message #23 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Jan D." <jan.h.d <at> swipnet.se>
Cc: 13979 <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Sun, 17 Mar 2013 11:37:29 -0400
>>> Which code has changed to care about mouse-1 versus down-mouse-1?
>> The code that turns mouse-1 into mouse-2 in case of follow-link (which
>> is now run more often: it used to be done in the mouse-drag-region
>> command, but is now done in a key-translation-map entry).
> So shall we change key-translation-map or is it better for the NS-port to
> use mouse-1 for scroll events?

I don't know the backtrace for your latest problem, but for the other
the bug was in mouse-on-link-p which just needs to be fixed to return
the proper boolean for that case.


        Stefan




Reply sent to Jan Djärv <jan.h.d <at> swipnet.se>:
You have taken responsibility. (Mon, 18 Mar 2013 17:26:02 GMT) Full text and rfc822 format available.

Notification sent to Darren Hoo <darren.hoo <at> gmail.com>:
bug acknowledged by developer. (Mon, 18 Mar 2013 17:26:02 GMT) Full text and rfc822 format available.

Message #28 received at 13979-done <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13979-done <at> debbugs.gnu.org, Darren Hoo <darren.hoo <at> gmail.com>
Subject: Re: bug#13979: 24.3.50; NS: scroll-bar not draggable
Date: Mon, 18 Mar 2013 18:23:56 +0100
Hello.

This has been fixed in trunk.

	Jan D.

17 mar 2013 kl. 16:37 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

>>>> Which code has changed to care about mouse-1 versus down-mouse-1?
>>> The code that turns mouse-1 into mouse-2 in case of follow-link (which
>>> is now run more often: it used to be done in the mouse-drag-region
>>> command, but is now done in a key-translation-map entry).
>> So shall we change key-translation-map or is it better for the NS-port to
>> use mouse-1 for scroll events?
> 
> I don't know the backtrace for your latest problem, but for the other
> the bug was in mouse-on-link-p which just needs to be fixed to return
> the proper boolean for that case.
> 
> 
>        Stefan





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Tue, 19 Mar 2013 12:44:01 GMT) Full text and rfc822 format available.

Message #31 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: 13979 <at> debbugs.gnu.org
Subject: NS: scroll-bar not draggable
Date: Tue, 19 Mar 2013 08:41:13 -0400
>>>>> Jan said:
> On OSX the event produced when clicking below the handle looks like:
> (down-mouse-1 (#<window 0x103229e50 on *info*> vertical-scroll-bar (0 . 428) 83281193 below-handle))
> On Gtk3 it looks like:
> (mouse-1 (#<window 0x11a0228 on *info*> vertical-scroll-bar (0 . 0) 0 below-handle))

So it seems that we need the patch below instead.  Can you try it (after
removing your earlier patch) and confirm that it also fixes the problem?


        Stefan


=== modified file 'lisp/subr.el'
--- lisp/subr.el	2013-03-08 08:11:59 +0000
+++ lisp/subr.el	2013-03-19 12:40:38 +0000
@@ -1044,14 +1044,16 @@
 		(nth 1 position))))
     (and (symbolp area) area)))
 
-(defsubst posn-point (position)
+(defun posn-point (position)
   "Return the buffer location in POSITION.
 POSITION should be a list of the form returned by the `event-start'
-and `event-end' functions."
+and `event-end' functions.
+Returns nil if POSITION does not correspond to any buffer location (e.g.
+a click on a scroll bar)."
   (or (nth 5 position)
-      (if (consp (nth 1 position))
-	  (car (nth 1 position))
-	(nth 1 position))))
+      (let ((pt (nth 1 position)))
+        (or (car-safe pt)
+            (if (integerp pt) pt)))))
 
 (defun posn-set-point (position)
   "Move point to POSITION.
@@ -1124,12 +1126,14 @@
 and `event-end' functions."
   (nth 3 position))
 
-(defsubst posn-string (position)
+(defun posn-string (position)
   "Return the string object of POSITION.
 Value is a cons (STRING . STRING-POS), or nil if not a string.
 POSITION should be a list of the form returned by the `event-start'
 and `event-end' functions."
-  (nth 4 position))
+  (let ((x (nth 4 position)))
+    ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
+    (when (consp x) x)))
 
 (defsubst posn-image (position)
   "Return the image object of POSITION.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#13979; Package emacs. (Tue, 19 Mar 2013 18:50:01 GMT) Full text and rfc822 format available.

Message #34 received at 13979 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 13979 <at> debbugs.gnu.org
Subject: Re: bug#13979: NS: scroll-bar not draggable
Date: Tue, 19 Mar 2013 19:47:40 +0100
It does.

	Jan D.

19 mar 2013 kl. 13:41 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:

>>>>>> Jan said:
>> On OSX the event produced when clicking below the handle looks like:
>> (down-mouse-1 (#<window 0x103229e50 on *info*> vertical-scroll-bar (0 . 428) 83281193 below-handle))
>> On Gtk3 it looks like:
>> (mouse-1 (#<window 0x11a0228 on *info*> vertical-scroll-bar (0 . 0) 0 below-handle))
> 
> So it seems that we need the patch below instead.  Can you try it (after
> removing your earlier patch) and confirm that it also fixes the problem?
> 
> 
>        Stefan
> 
> 
> === modified file 'lisp/subr.el'
> --- lisp/subr.el	2013-03-08 08:11:59 +0000
> +++ lisp/subr.el	2013-03-19 12:40:38 +0000
> @@ -1044,14 +1044,16 @@
> 		(nth 1 position))))
>     (and (symbolp area) area)))
> 
> -(defsubst posn-point (position)
> +(defun posn-point (position)
>   "Return the buffer location in POSITION.
> POSITION should be a list of the form returned by the `event-start'
> -and `event-end' functions."
> +and `event-end' functions.
> +Returns nil if POSITION does not correspond to any buffer location (e.g.
> +a click on a scroll bar)."
>   (or (nth 5 position)
> -      (if (consp (nth 1 position))
> -	  (car (nth 1 position))
> -	(nth 1 position))))
> +      (let ((pt (nth 1 position)))
> +        (or (car-safe pt)
> +            (if (integerp pt) pt)))))
> 
> (defun posn-set-point (position)
>   "Move point to POSITION.
> @@ -1124,12 +1126,14 @@
> and `event-end' functions."
>   (nth 3 position))
> 
> -(defsubst posn-string (position)
> +(defun posn-string (position)
>   "Return the string object of POSITION.
> Value is a cons (STRING . STRING-POS), or nil if not a string.
> POSITION should be a list of the form returned by the `event-start'
> and `event-end' functions."
> -  (nth 4 position))
> +  (let ((x (nth 4 position)))
> +    ;; Apparently this can also be `handle' or `below-handle' (bug#13979).
> +    (when (consp x) x)))
> 
> (defsubst posn-image (position)
>   "Return the image object of POSITION.
> 
> 
> 





bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 17 Apr 2013 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 32 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.