[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/mouse.el,v
From: |
David Kastrup |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/mouse.el,v |
Date: |
Wed, 20 Sep 2006 04:57:00 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: David Kastrup <dak> 06/09/20 04:56:59
Index: mouse.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mouse.el,v
retrieving revision 1.302
retrieving revision 1.303
diff -u -b -r1.302 -r1.303
--- mouse.el 19 Sep 2006 16:33:29 -0000 1.302
+++ mouse.el 20 Sep 2006 04:56:58 -0000 1.303
@@ -776,7 +776,14 @@
(defun mouse-posn-property (pos property)
- "Look for a property at click position."
+ "Look for a property at click position.
+POS may be either a buffer position or a click position like
+those returned from `start-event'. If the click position is on
+a string, the text property PROPERTY is examined.
+If this is nil or the click is not on a string, then
+the corresponding buffer position is searched for PROPERTY.
+If PROPERTY is encountered in one of those places,
+its value is returned."
(if (consp pos)
(let ((w (posn-window pos)) (pt (posn-point pos))
(str (posn-string pos)))
@@ -835,9 +842,12 @@
((eq action 'mouse-face)
(and (mouse-posn-property pos 'mouse-face) t))
((functionp action)
- ;; FIXME: This is wrong if the click is in a different buffer.
+ ;; FIXME: This seems questionable if the click is not in a buffer.
;; Should we instead decide that `action' takes a `posn'?
- (funcall action (if (consp pos) (posn-point pos) pos)))
+ (if (consp pos)
+ (with-current-buffer (window-buffer (posn-window pos))
+ (funcall action (posn-point pos)))
+ (funcall action pos)))
(t action))))
(defun mouse-fixup-help-message (msg)