unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Last commit to mouse.el has a bug
@ 2004-10-28 13:50 CHENG Gao
  2004-10-28 22:13 ` John Paul Wallington
  0 siblings, 1 reply; 2+ messages in thread
From: CHENG Gao @ 2004-10-28 13:50 UTC (permalink / raw)



,----
| CVSROOT:	/cvsroot/emacs
| Module name:	emacs
| Branch: 	
| Changes by:	Richard M. Stallman <rms@gnu.org>	04/10/27 17:44:59
| 
| Modified files:
| 	lisp           : mouse.el 
| 
| Log message:
| 	(mouse-show-mark): Do most processing the same
| 	regardless of transient-mark-mode.
| 
| CVSWeb URLs:
| http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/mouse.el.diff?tr1=1.251&tr2=1.252&r1=text&r2=text
`----
It's latest commit of mouse.el by RMS.

I found it has a bug.

,----
| (let ((inhibit-quit t)
|        (echo-keystrokes 0)
|         event events key ignore
|        (x-lost-selection-hooks (copy-sequence
|        x-lost-selection-hooks)))...
`----

(let (x-lost-selection-hooks (copy-sequence x-lost-selection-hooks)))
<-- Bug here

At this time, x-lost-selection-hooks is not set, so copy-sequence will
fail.

You can try to use mouse to select a region, and you'll get error
message as:

"mouse-drag-region-1: Symbol's value as variable is void:
x-lost-selection-hooks"

Just revert it to

 (let ((inhibit-quit t)
	(echo-keystrokes 0)
	event events key ignore
	x-lost-selection-hooks )

fixes this bug.

-- 
"When the government fears the people, you have liberty.
 When the people fear the government, you have tyranny."
 		--Thomas Jefferson

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Last commit to mouse.el has a bug
  2004-10-28 13:50 Last commit to mouse.el has a bug CHENG Gao
@ 2004-10-28 22:13 ` John Paul Wallington
  0 siblings, 0 replies; 2+ messages in thread
From: John Paul Wallington @ 2004-10-28 22:13 UTC (permalink / raw)
  Cc: emacs-devel

> (let (x-lost-selection-hooks (copy-sequence x-lost-selection-hooks)))
> <-- Bug here
> 
> At this time, x-lost-selection-hooks is not set, so copy-sequence will
> fail.
> 
> You can try to use mouse to select a region, and you'll get error
> message as:
> 
> "mouse-drag-region-1: Symbol's value as variable is void:
> x-lost-selection-hooks"
> 
> Just revert it to
> 
>  (let ((inhibit-quit t)
> 	(echo-keystrokes 0)
> 	event events key ignore
> 	x-lost-selection-hooks )
> 
> fixes this bug.

There may be other functions on that hook that should be run.  How
about testing whether it is bound before copying it?

--- mouse.el	27 Oct 2004 17:44:59 -0000	1.252
+++ mouse.el	28 Oct 2004 22:16:32 -0000
@@ -1028,7 +1028,8 @@
   (let ((inhibit-quit t)
 	(echo-keystrokes 0)
 	event events key ignore
-	(x-lost-selection-hooks (copy-sequence x-lost-selection-hooks)))
+	(x-lost-selection-hooks (if (boundp 'x-lost-selection-hooks)
+				    (copy-sequence x-lost-selection-hooks))))
     (add-hook 'x-lost-selection-hooks
 	      (lambda (seltype)
 		(if (eq seltype 'PRIMARY)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-10-28 22:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-28 13:50 Last commit to mouse.el has a bug CHENG Gao
2004-10-28 22:13 ` John Paul Wallington

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).