emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/xt-mouse.el


From: Nick Roberts
Subject: [Emacs-diffs] Changes to emacs/lisp/xt-mouse.el
Date: Wed, 12 Jan 2005 02:00:49 -0500

Index: emacs/lisp/xt-mouse.el
diff -c emacs/lisp/xt-mouse.el:1.21 emacs/lisp/xt-mouse.el:1.22
*** emacs/lisp/xt-mouse.el:1.21 Thu Dec  9 23:05:36 2004
--- emacs/lisp/xt-mouse.el      Wed Jan 12 06:13:08 2005
***************
*** 43,56 ****
  
  ;; Support multi-click -- somehow.
  
- ;; Clicking on the mode-line does not work, although it should.
- 
  ;;; Code:
  
  (define-key function-key-map "\e[M" 'xterm-mouse-translate)
  
  (defvar xterm-mouse-last)
  
  (defun xterm-mouse-translate (event)
    "Read a click and release event from XTerm."
    (save-excursion
--- 43,59 ----
  
  ;; Support multi-click -- somehow.
  
  ;;; Code:
  
  (define-key function-key-map "\e[M" 'xterm-mouse-translate)
  
  (defvar xterm-mouse-last)
  
+ ;; Mouse events symbols must have an 'event-kind property with
+ ;; the value 'mouse-click.
+ (dolist (event-type '(mouse-1 mouse-2 mouse-3))
+   (put event-type 'event-kind 'mouse-click))
+ 
  (defun xterm-mouse-translate (event)
    "Read a click and release event from XTerm."
    (save-excursion
***************
*** 78,84 ****
               (click-where (nth 1 click-data)))
          (if (memq down-binding '(nil ignore))
              (if (and (symbolp click-where)
!                      (not (eq 'menu-bar click-where)))
                  (vector (list click-where click-data) click)
                (vector click))
            (setq unread-command-events
--- 81,87 ----
               (click-where (nth 1 click-data)))
          (if (memq down-binding '(nil ignore))
              (if (and (symbolp click-where)
!                      (consp click-where))
                  (vector (list click-where click-data) click)
                (vector click))
            (setq unread-command-events
***************
*** 92,101 ****
                         0
                       (list (intern (format "drag-mouse-%d"
                                             (+ 1 xterm-mouse-last)))
!                            down-data click-data))
!                    )))
            (if (and (symbolp down-where)
!                    (not (eq 'menu-bar down-where)))
                (vector (list down-where down-data) down)
              (vector down))))))))
  
--- 95,103 ----
                         0
                       (list (intern (format "drag-mouse-%d"
                                             (+ 1 xterm-mouse-last)))
!                            down-data click-data)))))
            (if (and (symbolp down-where)
!                    (consp down-where))
                (vector (list down-where down-data) down)
              (vector down))))))))
  
***************
*** 124,153 ****
    (let* ((type (- (xterm-mouse-event-read) #o40))
         (x (- (xterm-mouse-event-read) #o40 1))
         (y (- (xterm-mouse-event-read) #o40 1))
-        (point (cons x y))
-        (window (window-at x y))
-        (where (if window
-                   (coordinates-in-window-p point window)
-                 'menu-bar))
-        (pos (if (consp where)
-                 (progn
-                   (select-window window)
-                   (goto-char (window-start window))
-                   (move-to-window-line (-
-                                         (cdr where)
-                                         (if (or header-line-format
-                                                 default-header-line-format)
-                                             1
-                                           0)))
-                   (move-to-column (- (+ (car where) (current-column)
-                                      (if (string-match "\\` \\*Minibuf"
-                                                        (buffer-name))
-                                          (- (minibuffer-prompt-width))
-                                        0)
-                                      (max 0 (1- (window-hscroll))))
-                                      left-margin-width))
-                   (point))
-               where))
         (mouse (intern
                 ;; For buttons > 3, the release-event looks
                 ;; differently (see xc/programs/xterm/button.c,
--- 126,131 ----
***************
*** 159,170 ****
                        (format "mouse-%d" (+ 1 xterm-mouse-last)))
                       (t
                        (setq xterm-mouse-last type)
!                       (format "down-mouse-%d" (+ 1 type)))))))
      (setq xterm-mouse-x x
          xterm-mouse-y y)
!     (list mouse
!         (list window pos point
!               (/ (nth 2 (current-time)) 1000)))))
  
  ;;;###autoload
  (define-minor-mode xterm-mouse-mode
--- 137,152 ----
                        (format "mouse-%d" (+ 1 xterm-mouse-last)))
                       (t
                        (setq xterm-mouse-last type)
!                       (format "down-mouse-%d" (+ 1 type))))))
!        (w (window-at x y)))
      (setq xterm-mouse-x x
          xterm-mouse-y y)
!     (if w
!       (list mouse (posn-at-x-y x (if menu-bar-mode (- y 1) y) w))
!       (list mouse
!           (append (list nil 'menu-bar)
!                   (nthcdr 2 (posn-at-x-y
!                              x (if menu-bar-mode (- y 1) y) w)))))))
  
  ;;;###autoload
  (define-minor-mode xterm-mouse-mode




reply via email to

[Prev in Thread] Current Thread [Next in Thread]