;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar xterm-mouse-debug-buffer nil) #@56 Read a click and release event from XTerm. (fn EVENT) (defalias 'xterm-mouse-translate #[257 "\300 \207" [xterm-mouse-translate-1] 2 (#$ . 446)]) #@221 Read a click and release event from XTerm. Similar to `xterm-mouse-translate', but using the "1006" extension, which supports coordinates >= 231 (see https://invisible-island.net/xterm/ctlseqs/ctlseqs.html). (fn EVENT) (defalias 'xterm-mouse-translate-extended #[257 "\300\301!\207" [xterm-mouse-translate-1 1006] 3 (#$ . 600)]) #@28 (fn &optional EXTENSION) (defalias 'xterm-mouse-translate-1 #[256 "\212\302!\211@A@\211A@\303!\304=\305\306\307!\"\203$\310\311\312#\210\204-\313\202\257\211\203>\314\313\315\316\n!#\210\202\257\203F\202\257\317\313\315\"\211A@\211A@\314\313\315\313#\210\204s B\303\320\321\322\323\307!\324$! AB!\202\255\232\203~\202\2559\203\210\325\202\227\320\321\322\326\307 !\324$! E \204\241\303!\202\253\211B\303\304\nD!\262\266\203\266\207)\207" [unread-command-events track-mouse xterm-mouse-event vector mouse-movement string-match "down-" symbol-name put event-kind mouse-click nil set-terminal-parameter xterm-mouse-last-down copy-sequence terminal-parameter intern replace-regexp-in-string "\\`\\([ACMHSs]-\\)*" "\\&down-" t 0 "\\&drag-"] 18 (#$ . 936)]) (defvar xt-mouse-epoch nil) #@67 Bound to `mouse-position-function' in XTerm mouse mode. (fn POS) (defalias 'xterm-mouse-position-function #[257 "\300\301\302\"\203\211\300\301\302\"\300\301\303\"B\241\210\207" [terminal-parameter nil xterm-mouse-x xterm-mouse-y] 6 (#$ . 1775)]) (byte-code "\300\301\302\303#\210\304\301\302\305#\210\306\307\310\311\312DD\313\314\315\316\317\320\321\322\323& \207" [defalias xterm-mouse-truncate-wrap truncate nil make-obsolete "27.1" custom-declare-variable xterm-mouse-utf-8 funcall function #[0 "\300\207" [nil] 1] "Non-nil if UTF-8 coordinates should be used to read mouse coordinates.\nSet this to non-nil if you are sure that your terminal\nunderstands UTF-8 coordinates, but not SGR coordinates." :version "25.1" :type boolean :risky t :group xterm] 12) #@232 Read a mouse coordinate from the current terminal. If `xterm-mouse-utf-8' was non-nil when `turn-on-xterm-mouse-tracking-on-terminal' was called, reads the coordinate as an UTF-8 code unit sequence; otherwise, reads a single byte. (defalias 'xterm-mouse--read-coordinate #[0 "\300 \301\302\303\304\305!\306\"\307$\216\310\311\312\313\"\203\314\202\315!\210\316\312\211\317#)\207" [keyboard-coding-system make-byte-code 0 "\301\300!\207" vconcat vector [set-keyboard-coding-system] 2 set-keyboard-coding-system terminal-parameter nil xterm-mouse-utf-8 utf-8-unix no-conversion read-char 0.1] 7 (#$ . 2548)]) #@18 (fn EXTENSION) (defalias 'xterm-mouse--read-number-from-terminal #[257 "\300\203*\301\302 \262\303X\203\"\304X\203\"\305\306_\307#\262\202\211B\262\2023\310 \211\262\311ZB\207" [nil 0 read-char 48 57 + 10 -48 xterm-mouse--read-coordinate 32] 7 (#$ . 3166)]) #@28 (fn &optional EXTENSION) (defalias 'xterm-mouse--read-event-sequence #[256 "\300!\211@\211\300!\211@\211\300!\211@A\211\301 \302\"\303U?\301\n\304\"\303U?\301 \305\"\303U?\301\f\306\"\303U?\301 \307\"\303U??\205\\?\205\\\203T\310=\202\\\301\311\"\311U?\204i\211\204i\203|\301\311\"\203w\307\202x\312\\\202\223\313\314\315\"\203\222\316\317\320\313\314\315\"@!\321\"!\202\223\312\203\233\322\202\310\323\203\244\324\202\245\325\203\255\326\202\256\325\203\266\327\202\267\325\203\277\330\202\300\325\331\332!\260!\211S\nSE\266\210\266\202\266\203\262\266\202\262\207" [xterm-mouse--read-number-from-terminal logand 64 0 32 16 8 4 77 3 1 terminal-parameter nil xterm-mouse-last-down string-to-number substring symbol-name -1 mouse-movement intern "C-" "" "M-" "S-" "down-" "mouse-" number-to-string] 27 (#$ . 3449)]) #@26 (fn EVENT CLICK-COUNT) (defalias 'xterm-mouse--set-click-count #[514 "AC\241\210\300@!\301\302\"\205*\303\304\305\"\306U\203!\307\202\"\310\304\306\"Q!\240\207" [symbol-name string-match "\\(.*?\\)\\(\\(?:down-\\)?mouse-.*\\)" intern match-string 1 2 "double-" "triple-"] 10 (#$ . 4333)]) #@258 Convert XTerm mouse event to Emacs mouse event. EXTENSION, if non-nil, means to use an extension to the usual terminal mouse protocol; we currently support the value 1006, which is the "1006" extension implemented in Xterm >= 277. (fn &optional EXTENSION) (defalias 'xterm-mouse-event #[256 "\211\306>\203\f\307!\202\310\311!\211\205:\211@A@\3128\204&\313 \314\202-\315\316!\317\"@\320\"\321!\211@A@\203M\322ZZ\323$\202m\324\325 \203b\n\203^\326=\203b\327\202c\330D\322  \"AA\"D\331\233\240\210\332\325\333\"\211@\334!A@\3128\3318\3358\313 \334!\336\337\"\204\306\262\203\326V\203\336\337\"\203\211\340\341\323\211 $\232\203\342\n\"\210\202\203 \203 \323=\204\337 \317Z_V\203\343Z!\f\344\245X\203\343Z!\f\344\245X\203\340\341\323\211$\232\203T\262\342\n\"\210\202\326\262\345\325\333 \257#\266\n\345\325\346 #\210\345\325\347\n#\210\211\211\266\212\207" [xt-mouse-epoch tab-bar-mode menu-bar-mode double-click-time double-click-fuzz last-input-event (1006 nil) xterm-mouse--read-event-sequence error "Unsupported XTerm mouse protocol" 2 float-time 0 time-convert time-since 1000 window-at window-edges posn-at-x-y t append nil 1 tab-bar menu-bar 3 terminal-parameter xterm-mouse-last-click symbol-name 4 string-match "down-" replace-match "" xterm-mouse--set-click-count abs 8 set-terminal-parameter xterm-mouse-x xterm-mouse-y] 29 (#$ . 4643)]) (byte-code "\300\301\302\303\304DD\305\306\307\310\311\312\313\314\315& \207" [custom-declare-variable xterm-mouse-mode funcall function #[0 "\300\207" [nil] 1] "Non-nil if Xterm-Mouse mode is enabled.\nSee the `xterm-mouse-mode' command\nfor a description of this minor mode.\nSetting this variable directly does not take effect;\neither customize it (see the info node `Easy Customization')\nor call the function `xterm-mouse-mode'." :set custom-set-minor-mode :initialize custom-initialize-default :group mouse :type boolean] 12) #@680 Toggle XTerm mouse mode. If called interactively, enable Xterm-Mouse mode if ARG is positive, and disable it if ARG is zero or negative. If called from Lisp, also enable the mode if ARG is omitted or nil, and toggle it if ARG is `toggle'; disable the mode otherwise. Turn it on to use Emacs mouse commands, and off to use xterm mouse commands. This works in terminal emulators compatible with xterm. It only works for simple uses of the mouse. Basically, only non-modified single clicks are supported. When turned on, the normal xterm mouse functionality for such clicks is still available by holding down the SHIFT key while pressing the mouse button. (fn &optional ARG) (defalias 'xterm-mouse-mode #[256 "\302 \303\300\304=\203\305\300!?\202\306!\307V\"\210\203 \310\202!\311\312\313\"\210\2034\314\315\313\316 \"\210\202<\315\317\316 \"\210\320\321\322\305\300!\203H\323\202I\324\"\210\325\326!\203s\327\300!\210\302 \203a\211\302 \232\203s\330\331\332\305\300!\203n\333\202o\334#\266\210\335 \210\305\300!\207" [xterm-mouse-mode mouse-position-function current-message set-default toggle default-value prefix-numeric-value 0 add-hook remove-hook terminal-init-xterm-hook turn-on-xterm-mouse-tracking-on-terminal xterm-mouse-position-function mapc terminal-list turn-off-xterm-mouse-tracking-on-terminal nil run-hooks xterm-mouse-mode-hook xterm-mouse-mode-on-hook xterm-mouse-mode-off-hook called-interactively-p any customize-mark-as-set "" message "Xterm-Mouse mode %sabled%s" "en" "dis" force-mode-line-update] 7 (#$ . 6647) (byte-code "\206\301C\207" [current-prefix-arg toggle] 1)]) (defvar xterm-mouse-mode-hook nil) (byte-code "\301\302N\204\f\303\301\302\304#\210\305\306\307\310\300!\205\307\211%\207" [xterm-mouse-mode-map xterm-mouse-mode-hook variable-documentation put "Hook run after entering or leaving `xterm-mouse-mode'.\nNo problems result if this variable is not bound.\n`add-hook' automatically binds it. (This is true for all hook variables.)" add-minor-mode xterm-mouse-mode nil boundp] 6) #@1317 Return a control sequence to enable XTerm mouse tracking. The returned control sequence enables basic mouse tracking, mouse motion events and finally extended tracking on terminals that support it. The following escape sequences are understood by modern xterms: "\e[?1000h" "Basic mouse mode": Enables reports for mouse clicks. There is a limit to the maximum row/column position (<= 223), which can be reported in this basic mode. "\e[?1002h" "Mouse motion mode": Enables reports for mouse motion events during dragging operations. "\e[?1005h" "UTF-8 coordinate extension": Enables an extension to the basic mouse mode, which uses UTF-8 characters to overcome the 223 row/column limit. This extension may conflict with non UTF-8 applications or non UTF-8 locales. It is only enabled when the option `xterm-mouse-utf-8' is non-nil. "\e[?1006h" "SGR coordinate extension": Enables a newer alternative extension to the basic mouse mode, which overcomes the 223 row/column limit without the drawbacks of the UTF-8 coordinate extension. The two extension modes are mutually exclusive, where the last given escape sequence takes precedence over the former. (defalias 'xterm-mouse-tracking-enable-sequence #[0 "\300\301\302\303!\"\207" [apply concat xterm-mouse--tracking-sequence 104] 4 (#$ . 8709)]) #@1184 Control sequence to enable xterm mouse tracking. Enables basic mouse tracking, mouse motion events and finally extended tracking on terminals that support it. The following escape sequences are understood by modern xterms: "\e[?1000h" "Basic mouse mode": Enables reports for mouse clicks. There is a limit to the maximum row/column position (<= 223), which can be reported in this basic mode. "\e[?1002h" "Mouse motion mode": Enables reports for mouse motion events during dragging operations. "\e[?1005h" "UTF-8 coordinate extension": Enables an extension to the basic mouse mode, which uses UTF-8 characters to overcome the 223 row/column limit. This extension may conflict with non UTF-8 applications or non UTF-8 locales. "\e[?1006h" "SGR coordinate extension": Enables a newer alternative extension to the basic mouse mode, which overcomes the 223 row/column limit without the drawbacks of the UTF-8 coordinate extension. The two extension modes are mutually exclusive, where the last given escape sequence takes precedence over the former. (defconst xterm-mouse-tracking-enable-sequence "[?1000h[?1002h[?1005h[?1006h" (#$ . 10177)) (make-obsolete-variable 'xterm-mouse-tracking-enable-sequence "use the function `xterm-mouse-tracking-enable-sequence' instead." "25.1") #@145 Return a control sequence to disable XTerm mouse tracking. The control sequence resets the modes set by `xterm-mouse-tracking-enable-sequence'. (defalias 'xterm-mouse-tracking-disable-sequence #[0 "\300\301\302\303!\237\"\207" [apply concat xterm-mouse--tracking-sequence 108] 4 (#$ . 11600)]) #@64 Reset the modes set by `xterm-mouse-tracking-enable-sequence'. (defconst xterm-mouse-tracking-disable-sequence "[?1006l[?1005l[?1002l[?1000l" (#$ . 11900)) (make-obsolete-variable 'xterm-mouse-tracking-disable-sequence "use the function `xterm-mouse-tracking-disable-sequence' instead." "25.1") #@161 Return a control sequence to enable or disable mouse tracking. SUFFIX is the last character of each escape sequence (?h to enable, ?l to disable). (fn SUFFIX) (defalias 'xterm-mouse--tracking-sequence #[257 "\301\302\303\304\305\306!\307\"\310\311%\312\313\314\205\315\316\"BB\"\207" [xterm-mouse-utf-8 mapcar make-byte-code 257 "\301\302\300#\207" vconcat vector [format "[?%d%c"] 5 "\n\n(fn CODE)" 1000 1002 append (1005) (1006)] 8 (#$ . 12206)]) #@67 Enable xterm mouse tracking on TERMINAL. (fn &optional TERMINAL) (defalias 'turn-on-xterm-mouse-tracking-on-terminal #[256 "\205\213\303!\304=\205\213\305!\306\230?\205\213\307\300\"?\205\213\310 p\311\312\313\314\315\"\316\"\317$\216\320\321!@\322\"\210\323 \324\325#\210\323 \326\327#\210)\266\330 \331 \3321V\333\"0\202g\211A@\334\232?\205e\335@A\"\262\210\336\337\340\307\337\340\"B#\210\336\337\341\307\337\341\"B#\210\336\300\304#\210\336\302\n#\266\202\207" [xterm-mouse-mode input-decode-map xterm-mouse-utf-8 terminal-live-p t terminal-name "initial_terminal" terminal-parameter selected-frame make-byte-code 0 "\302\300!\203 \303\300\304\"\210\305\301!\205\301q\207" vconcat vector [frame-live-p select-frame norecord buffer-live-p] 3 select-frame frames-on-display-list norecord define-key "" xterm-mouse-translate "[<" xterm-mouse-translate-extended xterm-mouse-tracking-enable-sequence xterm-mouse-tracking-disable-sequence (error) send-string-to-terminal "Terminal is currently suspended" signal set-terminal-parameter nil tty-mode-set-strings tty-mode-reset-strings] 10 (#$ . 12669)]) #@58 Disable xterm mouse tracking on TERMINAL. (fn TERMINAL) (defalias 'turn-off-xterm-mouse-tracking-on-terminal #[257 "\302\303\"\205J\304!\305=\205J\3061\307\"0\202,\211A@\310\232?\205*\311@A\"\262\210\312\313\314\315 \302\313\314\"\"#\210\312\313\316\315\302\313\316\"\"#\210\312\303\313#\207" [xterm-mouse-tracking-disable-sequence xterm-mouse-tracking-enable-sequence terminal-parameter xterm-mouse-mode terminal-live-p t (error) send-string-to-terminal "Terminal is currently suspended" signal set-terminal-parameter nil tty-mode-set-strings remq tty-mode-reset-strings] 9 (#$ . 13809)]) (provide 'xt-mouse)