mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-09 15:50:40 -08:00
Merge from emacs-24; up to 2014-06-28T23:35:17Z!rgm@gnu.org
This commit is contained in:
commit
c7367d2de3
20 changed files with 323 additions and 107 deletions
|
|
@ -94,15 +94,14 @@ point at the click position."
|
|||
(defun mouse--down-1-maybe-follows-link (&optional _prompt)
|
||||
"Turn `mouse-1' events into `mouse-2' events if follows-link.
|
||||
Expects to be bound to `down-mouse-1' in `key-translation-map'."
|
||||
(if (or (null mouse-1-click-follows-link)
|
||||
(not (eq (if (eq mouse-1-click-follows-link 'double)
|
||||
'double-down-mouse-1 'down-mouse-1)
|
||||
(car-safe last-input-event)))
|
||||
(not (mouse-on-link-p (event-start last-input-event)))
|
||||
(and (not mouse-1-click-in-non-selected-windows)
|
||||
(not (eq (selected-window)
|
||||
(posn-window (event-start last-input-event))))))
|
||||
nil
|
||||
(when (and mouse-1-click-follows-link
|
||||
(eq (if (eq mouse-1-click-follows-link 'double)
|
||||
'double-down-mouse-1 'down-mouse-1)
|
||||
(car-safe last-input-event))
|
||||
(mouse-on-link-p (event-start last-input-event))
|
||||
(or mouse-1-click-in-non-selected-windows
|
||||
(eq (selected-window)
|
||||
(posn-window (event-start last-input-event)))))
|
||||
(let ((this-event last-input-event)
|
||||
(timedout
|
||||
(sit-for (if (numberp mouse-1-click-follows-link)
|
||||
|
|
@ -118,19 +117,14 @@ Expects to be bound to `down-mouse-1' in `key-translation-map'."
|
|||
'double-mouse-1 'mouse-1))
|
||||
;; Turn the mouse-1 into a mouse-2 to follow links.
|
||||
(let ((newup (if (eq mouse-1-click-follows-link 'double)
|
||||
'double-mouse-2 'mouse-2))
|
||||
(newdown (if (eq mouse-1-click-follows-link 'double)
|
||||
'double-down-mouse-2 'down-mouse-2)))
|
||||
'double-mouse-2 'mouse-2)))
|
||||
;; If mouse-2 has never been done by the user, it doesn't have
|
||||
;; the necessary property to be interpreted correctly.
|
||||
(put newup 'event-kind (get (car event) 'event-kind))
|
||||
(put newdown 'event-kind (get (car this-event) 'event-kind))
|
||||
(unless (get newup 'event-kind)
|
||||
(put newup 'event-kind (get (car event) 'event-kind)))
|
||||
(push (cons newup (cdr event)) unread-command-events)
|
||||
;; Modify the event in place, so read-key-sequence doesn't
|
||||
;; generate a second fake prefix key (see fake_prefixed_keys in
|
||||
;; src/keyboard.c).
|
||||
(setcar this-event newdown)
|
||||
(vector this-event))
|
||||
;; Don't change the down event, only the up-event (bug#18212).
|
||||
nil)
|
||||
(push event unread-command-events)
|
||||
nil))))))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue