[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/mouse.el
From: |
Kim F . Storm |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/mouse.el |
Date: |
Fri, 25 Feb 2005 18:30:59 -0500 |
Index: emacs/lisp/mouse.el
diff -c emacs/lisp/mouse.el:1.267 emacs/lisp/mouse.el:1.268
*** emacs/lisp/mouse.el:1.267 Tue Feb 22 09:42:06 2005
--- emacs/lisp/mouse.el Fri Feb 25 23:30:59 2005
***************
*** 82,87 ****
--- 82,98 ----
(other :tag "Single click" t))
:group 'mouse)
+ (defcustom mouse-1-click-in-non-selected-windows t
+ "*If non-nil, a Mouse-1 click also follows links in non-selected windows.
+
+ If nil, a Mouse-1 click on a link in a non-selected window performs
+ the normal mouse-1 binding, typically selects the window and sets
+ point at the click position."
+ :type 'boolean
+ :version "22.1"
+ :group 'mouse)
+
+
;; Provide a mode-specific menu on a mouse button.
***************
*** 771,776 ****
--- 782,789 ----
"Return non-nil if POS is on a link in the current buffer.
POS must be a buffer position in the current buffer or an mouse
event location in the selected window, see `event-start'.
+ However, if `mouse-1-click-in-non-selected-windows' is non-nil,
+ POS may be a mouse event location in any window.
A clickable link is identified by one of the following methods:
***************
*** 805,825 ****
- Otherwise, the mouse-1 event is translated into a mouse-2 event
at the same position."
! (if (consp pos)
! (setq pos (and (eq (selected-window) (posn-window pos))
! (posn-point pos))))
! (when pos
! (let ((action
! (or (get-char-property pos 'follow-link)
! (save-excursion
! (goto-char pos)
! (key-binding [follow-link] nil t)))))
! (cond
! ((eq action 'mouse-face)
! (and (get-char-property pos 'mouse-face) t))
! ((functionp action)
! (funcall action pos))
! (t action)))))
(defun mouse-drag-region-1 (start-event)
--- 818,841 ----
- Otherwise, the mouse-1 event is translated into a mouse-2 event
at the same position."
! (let ((w (and (consp pos) (posn-window pos))))
! (if (consp pos)
! (setq pos (and (or mouse-1-click-in-non-selected-windows
! (eq (selected-window) w))
! (posn-point pos))))
! (when pos
! (with-current-buffer (window-buffer w)
! (let ((action
! (or (get-char-property pos 'follow-link)
! (save-excursion
! (goto-char pos)
! (key-binding [follow-link] nil t)))))
! (cond
! ((eq action 'mouse-face)
! (and (get-char-property pos 'mouse-face) t))
! ((functionp action)
! (funcall action pos))
! (t action)))))))
(defun mouse-drag-region-1 (start-event)
***************
*** 839,845 ****
;; Don't count the mode line.
(1- (nth 3 bounds))))
(on-link (and mouse-1-click-follows-link
! (eq start-window (selected-window))))
remap-double-click
(click-count (1- (event-click-count start-event))))
(setq mouse-selection-click-count click-count)
--- 855,862 ----
;; Don't count the mode line.
(1- (nth 3 bounds))))
(on-link (and mouse-1-click-follows-link
! (or mouse-1-click-in-non-selected-windows
! (eq start-window (selected-window)))))
remap-double-click
(click-count (1- (event-click-count start-event))))
(setq mouse-selection-click-count click-count)