diff options
| author | Stefan Monnier | 2014-07-08 14:47:47 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2014-07-08 14:47:47 -0400 |
| commit | dee89b6708a2f369ea1ba4ff0366f6506ccaeaef (patch) | |
| tree | 96d00587032f61fca4e09dd47e921d47c4ffa4e5 | |
| parent | ef0cc37f8552b30fd48cd4437f8307182533d3db (diff) | |
| download | emacs-dee89b6708a2f369ea1ba4ff0366f6506ccaeaef.tar.gz emacs-dee89b6708a2f369ea1ba4ff0366f6506ccaeaef.zip | |
* lisp/xt-mouse.el (xterm-mouse-translate-1): Intern drag event.
Remove also pointless window&mark manipulation.
Fixes: debbugs:17894
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/xt-mouse.el | 79 |
2 files changed, 40 insertions, 42 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29e55de249d..b2982c56754 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2014-07-08 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2014-07-08 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * xt-mouse.el (xterm-mouse-translate-1): Intern drag event (bug#17894). | ||
| 4 | Remove also pointless window&mark manipulation. | ||
| 5 | |||
| 3 | * progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case. | 6 | * progmodes/perl-mode.el: Use syntax-ppss; fix one indentation case. |
| 4 | (perl-indent-line): Use syntax-ppss to detect we're in a doc-section. | 7 | (perl-indent-line): Use syntax-ppss to detect we're in a doc-section. |
| 5 | (perl-continuation-line-p): Don't skip over anything else than labels. | 8 | (perl-continuation-line-p): Don't skip over anything else than labels. |
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index e5e77405b02..59f1eb8c887 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el | |||
| @@ -62,49 +62,44 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)." | |||
| 62 | 62 | ||
| 63 | (defun xterm-mouse-translate-1 (&optional extension) | 63 | (defun xterm-mouse-translate-1 (&optional extension) |
| 64 | (save-excursion | 64 | (save-excursion |
| 65 | (save-window-excursion ;FIXME: Why? | 65 | (let* ((event (xterm-mouse-event extension)) |
| 66 | (deactivate-mark) ;FIXME: Why? | 66 | (ev-command (nth 0 event)) |
| 67 | (let* ((event (xterm-mouse-event extension)) | 67 | (ev-data (nth 1 event)) |
| 68 | (ev-command (nth 0 event)) | 68 | (ev-where (nth 1 ev-data)) |
| 69 | (ev-data (nth 1 event)) | 69 | (vec (vector event)) |
| 70 | (ev-where (nth 1 ev-data)) | 70 | (is-down (string-match "down-" (symbol-name ev-command)))) |
| 71 | (vec (if (and (symbolp ev-where) (consp ev-where)) | 71 | |
| 72 | ;; FIXME: This condition can *never* be non-nil!?! | 72 | (cond |
| 73 | (vector (list ev-where ev-data) event) | 73 | ((null event) nil) ;Unknown/bogus byte sequence! |
| 74 | (vector event))) | 74 | (is-down |
| 75 | (is-down (string-match "down-" (symbol-name ev-command)))) | 75 | (setf (terminal-parameter nil 'xterm-mouse-last-down) event) |
| 76 | 76 | vec) | |
| 77 | (cond | 77 | (t |
| 78 | ((null event) nil) ;Unknown/bogus byte sequence! | 78 | (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) |
| 79 | (is-down | 79 | (down-data (nth 1 down)) |
| 80 | (setf (terminal-parameter nil 'xterm-mouse-last-down) event) | 80 | (down-where (nth 1 down-data))) |
| 81 | vec) | 81 | (setf (terminal-parameter nil 'xterm-mouse-last-down) nil) |
| 82 | (t | 82 | (cond |
| 83 | (let* ((down (terminal-parameter nil 'xterm-mouse-last-down)) | 83 | ((null down) |
| 84 | (down-data (nth 1 down)) | 84 | ;; This is an "up-only" event. Pretend there was an up-event |
| 85 | (down-where (nth 1 down-data))) | 85 | ;; right before and keep the up-event for later. |
| 86 | (setf (terminal-parameter nil 'xterm-mouse-last-down) nil) | 86 | (push event unread-command-events) |
| 87 | (cond | 87 | (vector (cons (intern (replace-regexp-in-string |
| 88 | ((null down) | 88 | "\\`\\([ACMHSs]-\\)*" "\\&down-" |
| 89 | ;; This is an "up-only" event. Pretend there was an up-event | 89 | (symbol-name ev-command) t)) |
| 90 | ;; right before and keep the up-event for later. | 90 | (cdr event)))) |
| 91 | (push event unread-command-events) | 91 | ((equal ev-where down-where) vec) |
| 92 | (vector (cons (intern (replace-regexp-in-string | ||
| 93 | "\\`\\([ACMHSs]-\\)*" "\\&down-" | ||
| 94 | (symbol-name ev-command) t)) | ||
| 95 | (cdr event)))) | ||
| 96 | ((equal ev-where down-where) vec) | ||
| 97 | (t | 92 | (t |
| 98 | (let ((drag (if (symbolp ev-where) | 93 | (let ((drag (if (symbolp ev-where) |
| 99 | 0 ;FIXME: Why?!? | 94 | 0 ;FIXME: Why?!? |
| 100 | (list (replace-regexp-in-string | 95 | (list (intern (replace-regexp-in-string |
| 101 | "\\`\\([ACMHSs]-\\)*" "\\&drag-" | 96 | "\\`\\([ACMHSs]-\\)*" "\\&drag-" |
| 102 | (symbol-name ev-command) t) | 97 | (symbol-name ev-command) t)) |
| 103 | down-data ev-data)))) | 98 | down-data ev-data)))) |
| 104 | (if (null track-mouse) | 99 | (if (null track-mouse) |
| 105 | (vector drag) | 100 | (vector drag) |
| 106 | (push drag unread-command-events) | 101 | (push drag unread-command-events) |
| 107 | (vector (list 'mouse-movement ev-data))))))))))))) | 102 | (vector (list 'mouse-movement ev-data)))))))))))) |
| 108 | 103 | ||
| 109 | ;; These two variables have been converted to terminal parameters. | 104 | ;; These two variables have been converted to terminal parameters. |
| 110 | ;; | 105 | ;; |