emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

mouse-yank-at-point in Comint modes


From: Bob Nnamtrop
Subject: mouse-yank-at-point in Comint modes
Date: Thu, 14 May 2009 17:59:45 -0600

Comint mode does not honor mouse-yank-at-point.  This has been mentioned in 2006 and 2008 in these posts:

http://www.nabble.com/mouse-yank-at-point-in-Comint-modes-to19445336.html

http://www.nabble.com/mouse-yank-at-point-in-Comint-modes-to7731895.html

Here is an updated patch of the simple one-line fix (which works great in my usage).  Could it get applied before the release?

--- emacs-23.0.93/lisp/comint.el    2009-01-06 13:29:03.000000000 -0700
+++ emacs/lisp/comint.el    2009-05-14 17:31:05.000000000 -0600
@@ -816,7 +816,7 @@
 If there is no previous input at point, run the command specified
 by the global keymap (usually `mouse-yank-at-point')."
   (interactive "e")
-  (mouse-set-point event)
+  (unless mouse-yank-at-point (mouse-set-point event))
   (let ((pos (posn-point (event-end event)))
     field input)
     (with-selected-window (posn-window (event-end event))

Here is another simple patch which fixes another annoyance.  When the mouse is over an old input in comint mode, that input is highlighted and a mouse-2 click will yank it to the command line.  This is fine except that it still happens if the mouse is beyond the end of the old input and the old input is not highlighted.  This simple patch fixes this.  Could it also get applied before the release?

diff -r -u emacs-23.0.93/lisp/subr.el emacs/lisp/subr.el
--- emacs-23.0.93/lisp/subr.el    2009-04-28 22:45:17.000000000 -0600
+++ emacs/lisp/subr.el    2009-05-14 17:52:33.000000000 -0600
@@ -2319,10 +2319,11 @@
 
 (defun field-at-pos (pos)
   "Return the field at position POS, taking stickiness etc into account."
-  (let ((raw-field (get-char-property (field-beginning pos) 'field)))
-    (if (eq raw-field 'boundary)
-    (get-char-property (1- (field-end pos)) 'field)
-      raw-field)))
+  (if (< pos (field-end pos))
+      (let ((raw-field (get-char-property (field-beginning pos) 'field)))
+        (if (eq raw-field 'boundary)
+            (get-char-property (1- (field-end pos)) 'field)
+          raw-field))))
 
 

 ;;;; Support for yanking and text properties.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]