unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Bug fix in isearch.el
@ 2006-10-03  9:59 David Kastrup
  2006-10-03 13:58 ` David Kastrup
  2006-10-03 14:13 ` Stefan Monnier
  0 siblings, 2 replies; 3+ messages in thread
From: David Kastrup @ 2006-10-03  9:59 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 313 bytes --]


Anything speaking against the following patch?  It would end the
annoyance that clicking with mouse-2 on a clickable overlay when doing
isearch would rather cause a paste to occur.  This has been bothering
me for years, and now it can be fixed reasonably easy.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 2358 bytes --]

Index: lisp/isearch.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/isearch.el,v
retrieving revision 1.290
diff -u -r1.290 isearch.el
*** lisp/isearch.el	20 Sep 2006 06:13:43 -0000	1.290
--- lisp/isearch.el	3 Oct 2006 09:55:18 -0000
***************
*** 1297,1313 ****
    (interactive "e")
    (let* ((w (posn-window (event-start click)))
  	 (overriding-terminal-local-map nil)
! 	 (key (vector (event-basic-type click)))
! 	 ;; FIXME: `key-binding' should accept an event as argument
! 	 ;; and do all the overlay/text-properties lookup etc...
! 	 (binding (with-current-buffer
! 		      (if (window-live-p w) (window-buffer w) (current-buffer))
! 		    (key-binding key))))
      (if (and (window-minibuffer-p w)
  	     (not (minibuffer-window-active-p w))) ; in echo area
  	(isearch-yank-x-selection)
        (when (functionp binding)
! 	(call-interactively binding)))))
  
  
  (defun isearch-yank-internal (jumpform)
--- 1297,1311 ----
    (interactive "e")
    (let* ((w (posn-window (event-start click)))
  	 (overriding-terminal-local-map nil)
! ;;   Should we rather use the output of `this-command-keys-vector'
! ;;   instead of `(vector click)' for `keys'?
! 	 (keys (vector click))
! 	 (binding (key-binding keys t)))
      (if (and (window-minibuffer-p w)
  	     (not (minibuffer-window-active-p w))) ; in echo area
  	(isearch-yank-x-selection)
        (when (functionp binding)
! 	(call-interactively binding nil keys)))))
  
  
  (defun isearch-yank-internal (jumpform)
Index: lisp/ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.10156
diff -u -r1.10156 ChangeLog
*** lisp/ChangeLog	2 Oct 2006 23:26:42 -0000	1.10156
--- lisp/ChangeLog	3 Oct 2006 09:55:50 -0000
***************
*** 1,3 ****
--- 1,10 ----
+ 2006-10-03  David Kastrup  <dak@gnu.org>
+ 
+ 	* isearch.el (isearch-mouse-2): Use new semantics of `key-binding'
+ 	in order to better redirect mouse-2 clicks.  Also allow default
+ 	bindings to apply, and pass the synthetic key-sequence to
+ 	`call-interactively'.
+ 
  2006-10-03  Denis St^[,A|^[(Bnkel  <dstuenkel@googlemail.com>  (tiny change)
  
  	* ibuf-ext.el (eval, view-and-eval) <define-ibuffer-op>:

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: Bug fix in isearch.el
  2006-10-03  9:59 Bug fix in isearch.el David Kastrup
@ 2006-10-03 13:58 ` David Kastrup
  2006-10-03 14:13 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: David Kastrup @ 2006-10-03 13:58 UTC (permalink / raw)


David Kastrup <dak@gnu.org> writes:

> Anything speaking against the following patch?  It would end the
> annoyance that clicking with mouse-2 on a clickable overlay when
> doing isearch would rather cause a paste to occur.  This has been
> bothering me for years, and now it can be fixed reasonably easy.

I have digged through some of the related sources, and I am now pretty
sure that using (this-command-keys-vector) is the correct thing to use
here as long as isearch-mouse-2 is called interactively (and there is
only a singer caller, a keybinding).  I am checking a somewhat changed
version in.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

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

* Re: Bug fix in isearch.el
  2006-10-03  9:59 Bug fix in isearch.el David Kastrup
  2006-10-03 13:58 ` David Kastrup
@ 2006-10-03 14:13 ` Stefan Monnier
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2006-10-03 14:13 UTC (permalink / raw)
  Cc: emacs-devel

> Anything speaking against the following patch?  It would end the
> annoyance that clicking with mouse-2 on a clickable overlay when doing
> isearch would rather cause a paste to occur.  This has been bothering
> me for years, and now it can be fixed reasonably easy.

No objection here.  Actually, the comment there is begging you to install
your patch, so please do.


        Stefan

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

end of thread, other threads:[~2006-10-03 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-03  9:59 Bug fix in isearch.el David Kastrup
2006-10-03 13:58 ` David Kastrup
2006-10-03 14:13 ` Stefan Monnier

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).