/[emacs]/emacs/lisp/mouse.el
ViewVC logotype

Diff of /emacs/lisp/mouse.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.267 by kfstorm, Tue Feb 22 09:42:06 2005 UTC revision 1.268 by kfstorm, Fri Feb 25 23:30:59 2005 UTC
# Line 82  packages.  See `mouse-on-link-p' for det Line 82  packages.  See `mouse-on-link-p' for det
82                   (other :tag "Single click" t))                   (other :tag "Single click" t))
83    :group 'mouse)    :group 'mouse)
84    
85    (defcustom mouse-1-click-in-non-selected-windows t
86      "*If non-nil, a Mouse-1 click also follows links in non-selected windows.
87    
88    If nil, a Mouse-1 click on a link in a non-selected window performs
89    the normal mouse-1 binding, typically selects the window and sets
90    point at the click position."
91      :type 'boolean
92      :version "22.1"
93      :group 'mouse)
94    
95    
96    
97  ;; Provide a mode-specific menu on a mouse button.  ;; Provide a mode-specific menu on a mouse button.
98    
# Line 771  If the click is in the echo area, displa Line 782  If the click is in the echo area, displa
782    "Return non-nil if POS is on a link in the current buffer.    "Return non-nil if POS is on a link in the current buffer.
783  POS must be a buffer position in the current buffer or an mouse  POS must be a buffer position in the current buffer or an mouse
784  event location in the selected window, see `event-start'.  event location in the selected window, see `event-start'.
785    However, if `mouse-1-click-in-non-selected-windows' is non-nil,
786    POS may be a mouse event location in any window.
787    
788  A clickable link is identified by one of the following methods:  A clickable link is identified by one of the following methods:
789    
# Line 805  click is the local or global binding of Line 818  click is the local or global binding of
818    
819  - Otherwise, the mouse-1 event is translated into a mouse-2 event  - Otherwise, the mouse-1 event is translated into a mouse-2 event
820  at the same position."  at the same position."
821    (if (consp pos)    (let ((w (and (consp pos) (posn-window pos))))
822        (setq pos (and (eq (selected-window) (posn-window pos))      (if (consp pos)
823                       (posn-point pos))))          (setq pos (and (or mouse-1-click-in-non-selected-windows
824    (when pos                             (eq (selected-window) w))
825      (let ((action                         (posn-point pos))))
826             (or (get-char-property pos 'follow-link)      (when pos
827                 (save-excursion        (with-current-buffer (window-buffer w)
828                   (goto-char pos)          (let ((action
829                   (key-binding [follow-link] nil t)))))                 (or (get-char-property pos 'follow-link)
830        (cond                     (save-excursion
831         ((eq action 'mouse-face)                       (goto-char pos)
832          (and (get-char-property pos 'mouse-face) t))                       (key-binding [follow-link] nil t)))))
833         ((functionp action)            (cond
834          (funcall action pos))             ((eq action 'mouse-face)
835         (t action)))))              (and (get-char-property pos 'mouse-face) t))
836               ((functionp action)
837                (funcall action pos))
838               (t action)))))))
839    
840    
841  (defun mouse-drag-region-1 (start-event)  (defun mouse-drag-region-1 (start-event)
# Line 839  at the same position." Line 855  at the same position."
855                     ;; Don't count the mode line.                     ;; Don't count the mode line.
856                     (1- (nth 3 bounds))))                     (1- (nth 3 bounds))))
857           (on-link (and mouse-1-click-follows-link           (on-link (and mouse-1-click-follows-link
858                         (eq start-window (selected-window))))                         (or mouse-1-click-in-non-selected-windows
859                               (eq start-window (selected-window)))))
860           remap-double-click           remap-double-click
861           (click-count (1- (event-click-count start-event))))           (click-count (1- (event-click-count start-event))))
862      (setq mouse-selection-click-count click-count)      (setq mouse-selection-click-count click-count)

Legend:
Removed from v.1.267  
changed lines
  Added in v.1.268

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26