aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <[email protected]>2014-06-21 12:45:59 -0700
committerGlenn Morris <[email protected]>2014-06-21 12:45:59 -0700
commitc400516ab1d827d08225ffb3e1bc1969c73cc45e (patch)
treeb16343b9e11c916c96b12ab56b6024cad91d3aff /lisp
parent539ad293eb36b4cf458cbdb5a6b37f5cd1bb68a1 (diff)
parent8047f439ec7d0bbe0085800a13bee8da883ae4dd (diff)
Merge from emacs-24; up to 2014-06-06T02:22:[email protected]
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog95
-rw-r--r--lisp/delsel.el1
-rw-r--r--lisp/dired.el5
-rw-r--r--lisp/emacs-lisp/smie.el25
-rw-r--r--lisp/mouse.el12
-rw-r--r--lisp/net/dbus.el10
-rw-r--r--lisp/progmodes/python.el16
-rw-r--r--lisp/progmodes/ruby-mode.el2
-rw-r--r--lisp/progmodes/sh-script.el13
-rw-r--r--lisp/simple.el9
-rw-r--r--lisp/skeleton.el7
-rw-r--r--lisp/term/w32-win.el17
-rw-r--r--lisp/term/xterm.el4
-rw-r--r--lisp/textmodes/texinfo.el15
-rw-r--r--lisp/window.el2
-rw-r--r--lisp/xt-mouse.el33
16 files changed, 200 insertions, 66 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d8146a9631..95c3566dd5 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,98 @@
+2014-06-21 Fabián Ezequiel Gallina <[email protected]>
+
+ Fix completion retrieval parsing (bug#17209).
+ * progmodes/python.el (python-mode):
+ (python-util-strip-string): New function.
+ (python-shell-completion-get-completions): Use it.
+
+2014-06-21 Eli Zaretskii <[email protected]>
+
+ * skeleton.el (skeleton-insert): Fix last change.
+
+2014-06-21 Fabián Ezequiel Gallina <[email protected]>
+
+ Enhancements for outline integration (bug#17796).
+ * progmodes/python.el (python-mode): Properly set
+ outline-heading-end-regexp so that comments after colons for
+ defuns are supported.
+
+2014-06-21 Eli Zaretskii <[email protected]>
+
+ * skeleton.el (skeleton-insert): Doc fix.
+
+2014-06-21 Stefan Monnier <[email protected]>
+
+ * emacs-lisp/smie.el (smie-config--guess): Fix typo.
+ (smie-config-guess): Use smie-config-local so the rules are obeyed
+ (bug#17818).
+
+ * mouse.el (mouse-drag-line): Don't re-add to unread-comment-events,
+ since it's already done inside the loop (bug#17819).
+
+2014-06-21 Martin Rudalics <[email protected]>
+
+ * mouse.el (mouse-drag-line): Re-remove code initially removed
+ on 2013-03-09 and inadvertently reintroduced on 2013-11-30
+ (Bug#17819).
+
+2014-06-21 Stefan Monnier <[email protected]>
+
+ * progmodes/sh-script.el (sh-smie-sh-rules): For { after &&, don't
+ align with the surrounding parent (bug#17721).
+
+2014-06-21 Eli Zaretskii <[email protected]>
+
+ * textmodes/texinfo.el (texinfo-mode): Set skeleton-end-newline
+ locally to nil.
+ (texinfo-insert-block, texinfo-insert-@end)
+ (texinfo-insert-@example, texinfo-insert-@quotation): Adjust to
+ local setting of skeleton-end-newline by adding an explicit \n to
+ the skeletons where appropriate. (Bug#17801)
+
+2014-06-21 Stefan Monnier <[email protected]>
+
+ * emacs-lisp/smie.el (smie--hanging-eolp-function): New var.
+ (smie-indent--hanging-p): Use it.
+ * progmodes/sh-script.el (sh-set-shell): Set it (bug#17621).
+
+2014-06-21 Leo Liu <[email protected]>
+
+ * simple.el (read-quoted-char): Don't let help chars pop up help
+ buffer. (Bug#16617)
+
+2014-06-21 Stefan Monnier <[email protected]>
+
+ * progmodes/sh-script.el (sh-smie-sh-rules): Use same rule for && as
+ for | (bug#17621).
+
+ * xt-mouse.el (xterm-mouse--read-event-sequence-1000):
+ Drop unknown events instead of burping.
+
+2014-06-21 Eli Zaretskii <[email protected]>
+
+ * term/w32-win.el (dynamic-library-alist): Support giflib 5.1.0
+ and later. (Bug#17790)
+
+2014-06-21 Juri Linkov <[email protected]>
+
+ * dired.el (dired-mark-pop-up): Let-bind display-buffer-mark-dedicated
+ to `soft'. (Bug#17554)
+
+2014-06-21 Stefan Monnier <[email protected]>
+
+ * delsel.el (electric-newline-and-maybe-indent): Mark it as well
+ (bug#17737).
+
+2014-06-21 Dmitry Gutov <[email protected]>
+
+ * progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't fontify
+ `!' in `!~' with `font-lock-negation-char-face'. (Bug#17732)
+
+2014-06-21 Michael Albinus <[email protected]>
+
+ * net/dbus.el (dbus-call-method): Push only non D-Bus events into
+ `unread-command-events'.
+
2014-06-19 William Xu <[email protected]>
* progmodes/hideif.el (hif-string-to-number): Don't return float for
diff --git a/lisp/delsel.el b/lisp/delsel.el
index ab71e60644..1ada02705f 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -188,6 +188,7 @@ See `delete-selection-helper'."
(put 'reindent-then-newline-and-indent 'delete-selection t)
(put 'newline-and-indent 'delete-selection t)
(put 'newline 'delete-selection t)
+(put 'electric-newline-and-maybe-indent 'delete-selection t)
(put 'open-line 'delete-selection 'kill)
;; This is very useful for canceling a selection in the minibuffer without
diff --git a/lisp/dired.el b/lisp/dired.el
index fc90b7a98e..a241fb3b33 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3099,7 +3099,10 @@ argument or confirmation)."
;; If FILES defaulted to the current line's file.
(= (length files) 1))
(apply function args)
- (let ((buffer (get-buffer-create (or buffer-or-name " *Marked Files*"))))
+ (let ((buffer (get-buffer-create (or buffer-or-name " *Marked Files*")))
+ ;; Mark *Marked Files* window as softly-dedicated, to prevent
+ ;; other buffers e.g. *Completions* from reusing it (bug#17554).
+ (display-buffer-mark-dedicated 'soft))
(with-current-buffer buffer
(with-current-buffer-window
buffer
diff --git a/lisp/emacs-lisp/smie.el b/lisp/emacs-lisp/smie.el
index 3e40d37aac..1819daa3df 100644
--- a/lisp/emacs-lisp/smie.el
+++ b/lisp/emacs-lisp/smie.el
@@ -1155,6 +1155,15 @@ NUMBER offset by NUMBER, relative to a base token
The functions whose name starts with \"smie-rule-\" are helper functions
designed specifically for use in this function.")
+(defvar smie--hanging-eolp-function
+ ;; FIXME: This is a quick hack for 24.4. Don't document it and replace with
+ ;; a well-defined function with a cleaner interface instead!
+ (lambda ()
+ (skip-chars-forward " \t")
+ (or (eolp)
+ (and ;; (looking-at comment-start-skip) ;(bug#16041).
+ (forward-comment (point-max))))))
+
(defalias 'smie-rule-hanging-p 'smie-indent--hanging-p)
(defun smie-indent--hanging-p ()
"Return non-nil if the current token is \"hanging\".
@@ -1168,10 +1177,7 @@ the beginning of a line."
(not (eobp))
;; Could be an open-paren.
(forward-char 1))
- (skip-chars-forward " \t")
- (or (eolp)
- (and ;; (looking-at comment-start-skip) ;(bug#16041).
- (forward-comment (point-max))))
+ (funcall smie--hanging-eolp-function)
(point))))))
(defalias 'smie-rule-bolp 'smie-indent--bolp)
@@ -2132,7 +2138,7 @@ position corresponding to each rule."
nil
(push (cons (+ offset (nth 2 sig)) sig) rules)
;; Adjust the rest of the data.
- (pcase-dolist ((and cotrace `(,count ,toffset ,trace))
+ (pcase-dolist ((and cotrace `(,count ,toffset . ,trace))
cotraces)
(setf (nth 1 cotrace) (- toffset offset))
(dolist (sig trace)
@@ -2161,15 +2167,14 @@ To save the result for future sessions, use `smie-config-save'."
(cond
((null config) (message "Nothing to change"))
((null smie-config--buffer-local)
- (message "Local rules set")
- (setq smie-config--buffer-local config))
+ (smie-config-local config)
+ (message "Local rules set"))
((y-or-n-p "Replace existing local config? ")
(message "Local rules replaced")
- (setq smie-config--buffer-local config))
+ (smie-config-local config))
((y-or-n-p "Merge with existing local config? ")
(message "Local rules adjusted")
- (setq smie-config--buffer-local
- (append config smie-config--buffer-local)))
+ (smie-config-local (append config smie-config--buffer-local)))
(t
(message "Rules guessed: %S" config)))))
diff --git a/lisp/mouse.el b/lisp/mouse.el
index ca9ea5dadc..f5a09f45a0 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -390,8 +390,6 @@ must be one of the symbols `header', `mode', or `vertical'."
(window (posn-window start))
(frame (window-frame window))
(minibuffer-window (minibuffer-window frame))
- (on-link (and mouse-1-click-follows-link
- (mouse-on-link-p start)))
(side (and (eq line 'vertical)
(or (cdr (assq 'vertical-scroll-bars
(frame-parameters frame)))
@@ -487,15 +485,7 @@ must be one of the symbols `header', `mode', or `vertical'."
(unless (zerop growth)
(setq dragged t)
(adjust-window-trailing-edge
- window (if (eq line 'mode) growth (- growth)) nil t))))))
- ;; Process the terminating event.
- (when (and (mouse-event-p event) on-link (not dragged)
- (mouse--remap-link-click-p start-event event))
- ;; If mouse-2 has never been done by the user, it doesn't have
- ;; the necessary property to be interpreted correctly.
- (put 'mouse-2 'event-kind 'mouse-click)
- (setcar event 'mouse-2)
- (push event unread-command-events))))
+ window (if (eq line 'mode) growth (- growth)) nil t))))))))
(defun mouse-drag-mode-line (start-event)
"Change the height of a window by dragging on the mode line."
diff --git a/lisp/net/dbus.el b/lisp/net/dbus.el
index 7f230a9d2a..66170dafef 100644
--- a/lisp/net/dbus.el
+++ b/lisp/net/dbus.el
@@ -318,10 +318,12 @@ object is returned instead of a list containing this single Lisp object.
(while (eq (car result) :pending)
(let ((event (let ((inhibit-redisplay t) unread-command-events)
(read-event nil nil check-interval))))
- (when event
- (setf unread-command-events
- (nconc unread-command-events
- (cons event nil))))
+ (when event
+ (if (ignore-errors (dbus-check-event event))
+ (setf result (gethash key dbus-return-values-table))
+ (setf unread-command-events
+ (nconc unread-command-events
+ (cons event nil)))))
(when (< check-interval 1)
(setf check-interval (* check-interval 1.05))))))
(when (eq (car result) :error)
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 91a8552642..743981b371 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2461,8 +2461,10 @@ LINE is used to detect the context on how to complete given INPUT."
(and completion-code
(> (length input) 0)
(with-current-buffer (process-buffer process)
- (let ((completions (python-shell-send-string-no-output
- (format completion-code input) process)))
+ (let ((completions
+ (python-util-strip-string
+ (python-shell-send-string-no-output
+ (format completion-code input) process))))
(and (> (length completions) 2)
(split-string completions
"^'\\|^\"\\|;\\|'$\\|\"$" t)))))))
@@ -3648,6 +3650,14 @@ returned as is."
n (1- n)))
(reverse acc))))
+(defun python-util-strip-string (string)
+ "Strip STRING whitespace and newlines from end and beginning."
+ (replace-regexp-in-string
+ (rx (or (: string-start (* (any whitespace ?\r ?\n)))
+ (: (* (any whitespace ?\r ?\n)) string-end)))
+ ""
+ string))
+
(defun python-electric-pair-string-delimiter ()
(when (and electric-pair-mode
@@ -3736,7 +3746,7 @@ returned as is."
(set (make-local-variable 'outline-regexp)
(python-rx (* space) block-start))
- (set (make-local-variable 'outline-heading-end-regexp) ":\\s-*\n")
+ (set (make-local-variable 'outline-heading-end-regexp) ":[^\n]*\n")
(set (make-local-variable 'outline-level)
#'(lambda ()
"`outline-level' function for Python mode."
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 74edf7a680..3c20279600 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -2152,7 +2152,7 @@ See `font-lock-syntax-table'.")
(ruby-match-expression-expansion
2 font-lock-variable-name-face t)
;; Negation char.
- ("\\(?:^\\|[^[:alnum:]_]\\)\\(!+\\)[^=]"
+ ("\\(?:^\\|[^[:alnum:]_]\\)\\(!+\\)[^=~]"
1 font-lock-negation-char-face)
;; Character literals.
;; FIXME: Support longer escape sequences.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index b4148ef562..c3032b4f19 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1975,7 +1975,11 @@ May return nil if the line should not be treated as continued."
(<= indent initial))
`(column . ,(+ initial sh-indentation)))))
(`(:before . ,(or `"(" `"{" `"["))
- (if (smie-rule-hanging-p) (smie-rule-parent)))
+ (when (smie-rule-hanging-p)
+ (if (not (smie-rule-prev-p "&&" "||" "|"))
+ (smie-rule-parent)
+ (smie-backward-sexp 'halfexp)
+ `(column . ,(smie-indent-virtual)))))
;; FIXME: Maybe this handling of ;; should be made into
;; a smie-rule-terminator function that takes the substitute ";" as arg.
(`(:before . ,(or `";;" `";&" `";;&"))
@@ -1993,7 +1997,7 @@ May return nil if the line should not be treated as continued."
(smie-rule-bolp))))
(current-column)
(smie-indent-calculate)))))
- (`(:after . "|") (if (smie-rule-parent-p "|") nil 4))
+ (`(:after . ,(or `"|" `"&&" `"||")) (if (smie-rule-parent-p token) nil 4))
;; Attempt at backward compatibility with the old config variables.
(`(:before . "fi") (sh-var-value 'sh-indent-for-fi))
(`(:before . "done") (sh-var-value 'sh-indent-for-done))
@@ -2300,6 +2304,11 @@ Calls the value of `sh-set-shell-hook' if set."
(let ((mksym (lambda (name)
(intern (format "sh-smie-%s-%s"
sh-indent-supported-here name)))))
+ (add-function :around (local 'smie--hanging-eolp-function)
+ (lambda (orig)
+ (if (looking-at "[ \t]*\\\\\n")
+ (goto-char (match-end 0))
+ (funcall orig))))
(smie-setup (symbol-value (funcall mksym "grammar"))
(funcall mksym "rules")
:forward-token (funcall mksym "forward-token")
diff --git a/lisp/simple.el b/lisp/simple.el
index 031aac3a49..63bfbb5141 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -658,11 +658,16 @@ any other terminator is used itself as input.
The optional argument PROMPT specifies a string to use to prompt the user.
The variable `read-quoted-char-radix' controls which radix to use
for numeric input."
- (let ((message-log-max nil) done (first t) (code 0) translated)
+ (let ((message-log-max nil)
+ (help-events (delq nil (mapcar (lambda (c) (unless (characterp c) c))
+ help-event-list)))
+ done (first t) (code 0) translated)
(while (not done)
(let ((inhibit-quit first)
- ;; Don't let C-h get the help message--only help function keys.
+ ;; Don't let C-h or other help chars get the help
+ ;; message--only help function keys. See bug#16617.
(help-char nil)
+ (help-event-list help-events)
(help-form
"Type the special character you want to use,
or the octal character code.
diff --git a/lisp/skeleton.el b/lisp/skeleton.el
index f85dc8ef06..28792ac558 100644
--- a/lisp/skeleton.el
+++ b/lisp/skeleton.el
@@ -197,7 +197,8 @@ not needed, a prompt-string or an expression for complex read functions.
If ELEMENT is a string or a character it gets inserted (see also
`skeleton-transformation-function'). Other possibilities are:
- \\n go to next line and indent according to mode
+ \\n if not the last element of the skeleton, or not at eol,
+ go to next line and indent according to mode
_ interesting point, interregion here
- interesting point, no interregion interaction, overrides
interesting point set by _
@@ -212,6 +213,10 @@ If ELEMENT is a string or a character it gets inserted (see also
After termination, point will be positioned at the last occurrence of -
or at the first occurrence of _ or at the end of the inserted text.
+Note that \\n as the last element of the skeleton only inserts a
+newline if not at eol. If you want to unconditionally insert a newline
+at the end of the skeleton, use \"\\n\" instead.
+
Further elements can be defined via `skeleton-further-elements'.
ELEMENT may itself be a SKELETON with an INTERACTOR. The user is prompted
repeatedly for different inputs. The SKELETON is processed as often as
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index e2cabe5397..e103562ba7 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -251,13 +251,16 @@ This returns an error if any Emacs frames are X frames, or always under W32."
;; libraries according to the version of giflib we were
;; compiled against. (If we were compiled without GIF support,
;; libgif-version's value is -1.)
- (if (>= libgif-version 50000)
- ;; Yes, giflib 5.x uses 6 as the major version of the API,
- ;; thus "libgif-6.dll" below (giflib 4.x used 5 as the
- ;; major API version).
- ;; giflib5.dll is from the lua-files project.
- '(gif "libgif-6.dll" "giflib5.dll")
- '(gif "libgif-5.dll" "giflib4.dll" "libungif4.dll" "libungif.dll"))
+ (if (>= libgif-version 50100)
+ ;; Yes, giflib 5.0 uses 6 as the major version of the API,
+ ;; and giflib 5.1 uses 7, thus "libgif-7.dll" and
+ ;; "libgif-6.dll" below (giflib 4.x used 5 as the major API
+ ;; version). giflib5.dll is from the lua-files project,
+ ;; and gif.dll is from luapower.
+ '(gif "libgif-7.dll")
+ (if (>= libgif-version 50000)
+ '(gif "libgif-6.dll" "giflib5.dll" "gif.dll")
+ '(gif "libgif-5.dll" "giflib4.dll" "libungif4.dll" "libungif.dll")))
'(svg "librsvg-2-2.dll")
'(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
'(glib "libglib-2.0-0.dll")
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 20d4d41525..1d08501721 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -606,8 +606,8 @@ The relevant features are:
;; Gnome terminal 2.32.1 reports 1;2802;0
(setq version 200))
(when (equal (match-string 1 str) "83")
- ;; OSX's Terminal.app (version 2.3 (309), which returns 83;40003;0)
- ;; seems to also lack support for some of these (bug#17607).
+ ;; `screen' (which returns 83;40003;0) seems to also lack support for
+ ;; some of these (bug#17607).
(setq version 240))
;; If version is 242 or higher, assume the xterm supports
;; reporting the background color (TODO: maybe earlier
diff --git a/lisp/textmodes/texinfo.el b/lisp/textmodes/texinfo.el
index e1e2656275..6f441d67b3 100644
--- a/lisp/textmodes/texinfo.el
+++ b/lisp/textmodes/texinfo.el
@@ -44,6 +44,8 @@
(defvar outline-heading-alist)
+(defvar skeleton-end-newline)
+
(defgroup texinfo nil
"Texinfo Mode."
:link '(custom-group-link :tag "Font Lock Faces group" font-lock-faces)
@@ -626,6 +628,11 @@ value of `texinfo-mode-hook'."
(setq-local tex-first-line-header-regexp "^\\\\input")
(setq-local tex-trailer "@bye\n")
+ ;; Prevent skeleton.el from adding a newline to each inserted
+ ;; skeleton. Those which do want a newline do that explicitly in
+ ;; their define-skeleton form.
+ (setq-local skeleton-end-newline nil)
+
;; Prevent filling certain lines, in addition to ones specified by
;; the user.
(setq-local auto-fill-inhibit-regexp
@@ -653,7 +660,7 @@ Puts point on a blank line between them."
(if (or (string-match "\\`def" str)
(member str '("table" "ftable" "vtable")))
'(nil " " -))
- \n _ \n "@end " str \n)
+ \n _ \n "@end " str \n \n)
(defun texinfo-inside-macro-p (macro &optional bound)
"Non-nil if inside a macro matching the regexp MACRO."
@@ -732,7 +739,7 @@ With prefix argument or inside @code or @example, inserts a plain \"."
(backward-word 1)
(texinfo-last-unended-begin)
(or (match-string 1) '-)))
- \n "@end " str \n)
+ \n "@end " str \n \n)
(define-skeleton texinfo-insert-braces
"Make a pair of braces and be poised to type inside of them.
@@ -771,7 +778,7 @@ The default is not to surround any existing words with the braces."
(define-skeleton texinfo-insert-@example
"Insert the string `@example' in a Texinfo buffer."
nil
- \n "@example" \n)
+ \n "@example" \n \n)
(define-skeleton texinfo-insert-@file
"Insert a `@file{...}' command in a Texinfo buffer.
@@ -816,7 +823,7 @@ Leave point after `@node'."
(define-skeleton texinfo-insert-@quotation
"Insert the string `@quotation' in a Texinfo buffer."
- \n "@quotation" \n)
+ \n "@quotation" \n _ \n)
(define-skeleton texinfo-insert-@samp
"Insert a `@samp{...}' command in a Texinfo buffer.
diff --git a/lisp/window.el b/lisp/window.el
index e9f4fd0b1d..28dd6a8ab2 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -5966,7 +5966,7 @@ live."
;; FIXME: By the way, there could be more levels of dedication:
;; - `barely' dedicated doesn't prevent reuse of the window, only records that
;; the window hasn't been used for something else yet.
-;; - `softly' dedicated only allows reuse when asked explicitly.
+;; - `soft' (`softly') dedicated only allows reuse when asked explicitly.
;; - `strongly' never allows reuse.
(defvar display-buffer-mark-dedicated nil
"If non-nil, `display-buffer' marks the windows it creates as dedicated.
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el
index 54fd1a44d5..f9e89880da 100644
--- a/lisp/xt-mouse.el
+++ b/lisp/xt-mouse.el
@@ -145,26 +145,25 @@ http://invisible-island.net/xterm/ctlseqs/ctlseqs.html)."
(defun xterm-mouse--read-event-sequence-1000 ()
(let* ((code (- (read-event) 32))
(type
- (intern
- ;; For buttons > 3, the release-event looks differently
- ;; (see xc/programs/xterm/button.c, function EditorButton),
- ;; and come in a release-event only, no down-event.
- (cond ((>= code 64)
- (format "mouse-%d" (- code 60)))
- ((memq code '(8 9 10))
- (format "M-down-mouse-%d" (- code 7)))
- ((memq code '(3 11))
- (let ((down (car (terminal-parameter
- nil 'xterm-mouse-last-down))))
- (when (and down (string-match "[0-9]" (symbol-name down)))
- (format (if (eq code 3) "mouse-%s" "M-mouse-%s")
- (match-string 0 (symbol-name down))))))
- ((memq code '(0 1 2))
- (format "down-mouse-%d" (+ 1 code))))))
+ ;; For buttons > 3, the release-event looks differently
+ ;; (see xc/programs/xterm/button.c, function EditorButton),
+ ;; and come in a release-event only, no down-event.
+ (cond ((>= code 64)
+ (format "mouse-%d" (- code 60)))
+ ((memq code '(8 9 10))
+ (format "M-down-mouse-%d" (- code 7)))
+ ((memq code '(3 11))
+ (let ((down (car (terminal-parameter
+ nil 'xterm-mouse-last-down))))
+ (when (and down (string-match "[0-9]" (symbol-name down)))
+ (format (if (eq code 3) "mouse-%s" "M-mouse-%s")
+ (match-string 0 (symbol-name down))))))
+ ((memq code '(0 1 2))
+ (format "down-mouse-%d" (+ 1 code)))))
(x (- (read-event) 33))
(y (- (read-event) 33)))
(and type (wholenump x) (wholenump y)
- (list type x y))))
+ (list (intern type) x y))))
;; XTerm's 1006-mode terminal mouse click reporting has the form
;; <BUTTON> ; <X> ; <Y> <M or m>, where the button and ordinates are