Show
Ignore:
Timestamp:
09/18/06 20:48:14 (2 years ago)
Author:
miyoshi
Message:

Sync up with Emacs CVS HEAD.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lisp/mouse.el

    r4148 r4166  
    776776 
    777777 
     778(defun mouse-posn-property (pos property) 
     779  "Look for a property at click position." 
     780  (if (consp pos) 
     781      (let ((w (posn-window pos)) (pt (posn-point pos)) 
     782            (str (posn-string pos))) 
     783        (or (and str 
     784                 (get-text-property (cdr str) property (car str))) 
     785            (and pt 
     786                 (get-char-property pt property w)))) 
     787    (get-char-property pos property))) 
     788 
    778789(defun mouse-on-link-p (pos) 
    779790  "Return non-nil if POS is on a link in the current buffer. 
     
    815826- Otherwise, the mouse-1 event is translated into a mouse-2 event 
    816827at the same position." 
    817   (let ((w (and (consp pos) (posn-window pos)))) 
    818     (if (consp pos) 
    819         (setq pos (and (or mouse-1-click-in-non-selected-windows 
    820                            (eq (selected-window) w)) 
    821                        (posn-point pos)))) 
    822     (when pos 
    823       (with-current-buffer (window-buffer w) 
    824         (let ((action 
    825                (or (get-char-property pos 'follow-link) 
    826                    (save-excursion 
    827                      (goto-char pos) 
    828                      (key-binding [follow-link] nil t))))) 
    829           (cond 
    830            ((eq action 'mouse-face) 
    831             (and (get-char-property pos 'mouse-face) t)) 
    832            ((functionp action) 
    833             (funcall action pos)) 
    834            (t action))))))) 
     828  (let ((action 
     829         (and (or (not (consp pos)) 
     830                  mouse-1-click-in-non-selected-windows 
     831                  (eq (selected-window) (posn-window pos))) 
     832              (or (mouse-posn-property pos 'follow-link) 
     833                  (key-binding [follow-link] nil t pos))))) 
     834    (cond 
     835     ((eq action 'mouse-face) 
     836      (and (mouse-posn-property pos 'mouse-face) t)) 
     837     ((functionp action) 
     838      (funcall action pos)) 
     839     (t action)))) 
    835840 
    836841(defun mouse-fixup-help-message (msg) 
     
    905910                       ;; treatment, in case we click on a link inside an 
    906911                       ;; intangible text. 
    907                        (mouse-on-link-p start-point))) 
     912                       (mouse-on-link-p start-posn))) 
    908913         (click-count (1- (event-click-count start-event))) 
    909914         (remap-double-click (and on-link