diff options
| author | Po Lu | 2023-07-20 09:23:06 +0800 |
|---|---|---|
| committer | Po Lu | 2023-07-20 09:23:06 +0800 |
| commit | 4d3442ebad5cb1e1005cd5eca7e91c95e767ed65 (patch) | |
| tree | 671b1d9fad4fe987ea5052417c6d29cb76e5dfce | |
| parent | 882e1d659fec8062e96cfb614e73954840c6ecfe (diff) | |
| parent | e2cc16fbd0d16e6c0ff59221af49e3d4113500cd (diff) | |
| download | emacs-4d3442ebad5cb1e1005cd5eca7e91c95e767ed65.tar.gz emacs-4d3442ebad5cb1e1005cd5eca7e91c95e767ed65.zip | |
Merge remote-tracking branch 'origin/master' into feature/android
| -rw-r--r-- | doc/misc/erc.texi | 27 | ||||
| -rw-r--r-- | etc/ERC-NEWS | 23 | ||||
| -rw-r--r-- | lisp/emacs-lisp/comp.el | 48 | ||||
| -rw-r--r-- | lisp/erc/erc-nicks.el | 6 | ||||
| -rw-r--r-- | lisp/erc/erc.el | 4 | ||||
| -rw-r--r-- | src/fileio.c | 4 | ||||
| -rw-r--r-- | src/xterm.c | 95 | ||||
| -rw-r--r-- | test/src/comp-resources/comp-test-funcs-dyn2.el | 31 | ||||
| -rw-r--r-- | test/src/comp-tests.el | 7 |
9 files changed, 185 insertions, 60 deletions
diff --git a/doc/misc/erc.texi b/doc/misc/erc.texi index 63ea94d9b2e..2e216629a1d 100644 --- a/doc/misc/erc.texi +++ b/doc/misc/erc.texi | |||
| @@ -1218,15 +1218,14 @@ you aren't familiar with @samp{use-package} or have no interest in | |||
| 1218 | learning it. For our purposes, it's just a means of presenting | 1218 | learning it. For our purposes, it's just a means of presenting |
| 1219 | configuration details in a tidy, standardized format. If it helps, | 1219 | configuration details in a tidy, standardized format. If it helps, |
| 1220 | just pretend it's some make-believe, pseudo configuration language. | 1220 | just pretend it's some make-believe, pseudo configuration language. |
| 1221 | Although the syntax below is easy enough to intuit and adapt to your | 1221 | And while the syntax below is easy enough to intuit and adapt to your |
| 1222 | setup, you may wish to keep the following in mind (or @pxref{Top,,, | 1222 | setup, you may wish to keep the following in mind: |
| 1223 | use-package,}): | ||
| 1224 | 1223 | ||
| 1225 | @itemize @bullet | 1224 | @itemize @bullet |
| 1226 | @item | 1225 | @item |
| 1227 | Each @code{use-package} ``declaration'' focuses on a library | 1226 | Each @code{use-package} ``declaration'' focuses on a library |
| 1228 | ``feature'', which is just a symbol you'd normally @code{require} in | 1227 | ``feature'', which is just a symbol you'd normally @code{require} in |
| 1229 | your config @pxref{Named Features,,, elisp,}). | 1228 | your config. |
| 1230 | 1229 | ||
| 1231 | @item | 1230 | @item |
| 1232 | Emacs loads anything in a @code{:config} section @emph{after} loading | 1231 | Emacs loads anything in a @code{:config} section @emph{after} loading |
| @@ -1235,6 +1234,10 @@ whatever library @code{provide}s the declaration's feature. | |||
| 1235 | @item | 1234 | @item |
| 1236 | Everything in a @code{:custom} or @code{:custom-face} section is | 1235 | Everything in a @code{:custom} or @code{:custom-face} section is |
| 1237 | basically something you'd find in your @code{custom-file}. | 1236 | basically something you'd find in your @code{custom-file}. |
| 1237 | |||
| 1238 | @item | ||
| 1239 | For more info, @pxref{Named Features,,, elisp,}, or @pxref{Top,,, | ||
| 1240 | use-package,}. | ||
| 1238 | @end itemize | 1241 | @end itemize |
| 1239 | 1242 | ||
| 1240 | @noindent | 1243 | @noindent |
| @@ -1300,12 +1303,12 @@ settings (@pxref{Sample configuration via Customize}). | |||
| 1300 | 1303 | ||
| 1301 | (use-package erc-goodies | 1304 | (use-package erc-goodies |
| 1302 | ;; Turn on read indicators when joining channels. | 1305 | ;; Turn on read indicators when joining channels. |
| 1303 | :hook (erc-join . my-erc-enable-read-indicator-on-join)) | 1306 | :hook (erc-join . my-erc-enable-keep-place-indicator-on-join)) |
| 1304 | 1307 | ||
| 1305 | (defvar my-erc-read-indicator-channels '("#emacs") | 1308 | (defvar my-erc-read-indicator-channels '("#emacs") |
| 1306 | "Channels in which to show a `keep-place-indicator'.") | 1309 | "Channels in which to show a `keep-place-indicator'.") |
| 1307 | 1310 | ||
| 1308 | (defun my-erc-enable-read-indicator-on-join () | 1311 | (defun my-erc-enable-keep-place-indicator-on-join () |
| 1309 | "Enable read indicators for certain queries or channels." | 1312 | "Enable read indicators for certain queries or channels." |
| 1310 | (when (member (erc-default-target) my-erc-read-indicator-channels) | 1313 | (when (member (erc-default-target) my-erc-read-indicator-channels) |
| 1311 | (erc-keep-place-indicator-mode +1))) | 1314 | (erc-keep-place-indicator-mode +1))) |
| @@ -1313,14 +1316,16 @@ settings (@pxref{Sample configuration via Customize}). | |||
| 1313 | ;; Handy commands from the Emacs Wiki. | 1316 | ;; Handy commands from the Emacs Wiki. |
| 1314 | (defun erc-cmd-TRACK (&optional target) | 1317 | (defun erc-cmd-TRACK (&optional target) |
| 1315 | "Start tracking TARGET or that of current buffer." | 1318 | "Start tracking TARGET or that of current buffer." |
| 1316 | (setq erc-track-exclude (delete (or target (erc-default-target)) | 1319 | (setq erc-track-exclude |
| 1317 | erc-track-exclude))) | 1320 | (delete (or target (erc-default-target) (current-buffer)) |
| 1321 | erc-track-exclude))) | ||
| 1318 | 1322 | ||
| 1319 | (defun erc-cmd-UNTRACK (&optional target) | 1323 | (defun erc-cmd-UNTRACK (&optional target) |
| 1320 | "Stop tracking TARGET or that of current buffer." | 1324 | "Stop tracking TARGET or that of current buffer." |
| 1321 | (setq erc-track-exclude (cl-pushnew (or target (erc-default-target)) | 1325 | (setq erc-track-exclude |
| 1322 | erc-track-exclude | 1326 | (cl-pushnew (or target (erc-default-target) (current-buffer)) |
| 1323 | :test #'equal))) | 1327 | erc-track-exclude |
| 1328 | :test #'equal))) | ||
| 1324 | 1329 | ||
| 1325 | @end lisp | 1330 | @end lisp |
| 1326 | 1331 | ||
diff --git a/etc/ERC-NEWS b/etc/ERC-NEWS index cd0b8e5f823..4c881e32ab4 100644 --- a/etc/ERC-NEWS +++ b/etc/ERC-NEWS | |||
| @@ -15,13 +15,14 @@ GNU Emacs since Emacs version 22.1. | |||
| 15 | * Changes in ERC 5.6 | 15 | * Changes in ERC 5.6 |
| 16 | 16 | ||
| 17 | ** Module 'keep-place' has gained a more flamboyant cousin. | 17 | ** Module 'keep-place' has gained a more flamboyant cousin. |
| 18 | Remember your place in ERC buffers a bit more easily while retaining | 18 | Remember your place in ERC buffers more easily while retaining the |
| 19 | the freedom to look around. Optionally sync the indicator to any | 19 | freedom to look around, all with the help of a configurable, visible |
| 20 | progress made when you haven't yet caught up to the live stream. See | 20 | indicator. Optionally sync the indicator to any progress made when |
| 21 | options 'erc-keep-place-indicator-style' and friends, and try M-x | 21 | you haven't yet caught up to the live stream. See options |
| 22 | 'erc-keep-place-indicator-style' and friends, and try M-x | ||
| 22 | keep-place-indicator-mode to see it in action. | 23 | keep-place-indicator-mode to see it in action. |
| 23 | 24 | ||
| 24 | ** Module 'fill' now offers a style based on 'visual-line-mode'. | 25 | ** Module 'fill' offers a style based on 'visual-line-mode'. |
| 25 | This fill style mimics the "hanging indent" look of 'erc-fill-static' | 26 | This fill style mimics the "hanging indent" look of 'erc-fill-static' |
| 26 | and provides some movement and editing commands to optionally tame the | 27 | and provides some movement and editing commands to optionally tame the |
| 27 | less familiar aspects of 'visual-line' behavior. An interactive | 28 | less familiar aspects of 'visual-line' behavior. An interactive |
| @@ -29,7 +30,7 @@ helper called 'erc-fill-wrap-nudge' allows for dynamic "refilling" of | |||
| 29 | buffers on the fly. Set 'erc-fill-function' to 'erc-fill-wrap' to get | 30 | buffers on the fly. Set 'erc-fill-function' to 'erc-fill-wrap' to get |
| 30 | started. | 31 | started. |
| 31 | 32 | ||
| 32 | ** A new module for nickname highlighting has joined ERC. | 33 | ** A module for nickname highlighting has joined ERC. |
| 33 | Automatic nickname coloring has come to ERC core. Users familiar with | 34 | Automatic nickname coloring has come to ERC core. Users familiar with |
| 34 | 'erc-hl-nicks', from which this module directly descends, will already | 35 | 'erc-hl-nicks', from which this module directly descends, will already |
| 35 | be familiar with its suite of handy options. By default, each | 36 | be familiar with its suite of handy options. By default, each |
| @@ -140,7 +141,7 @@ This is especially handy when using the option 'erc-fill-wrap-merge' | |||
| 140 | to omit repeated speaker tags, which can make message boundaries less | 141 | to omit repeated speaker tags, which can make message boundaries less |
| 141 | detectable by tired eyes. | 142 | detectable by tired eyes. |
| 142 | 143 | ||
| 143 | ** Some keybindings are now set by modules rather than their libraries. | 144 | ** Modules rather than their libraries set major-mode keybindings. |
| 144 | To put it another way, simply loading a built-in module's library no | 145 | To put it another way, simply loading a built-in module's library no |
| 145 | longer modifies 'erc-mode-map'. Instead, modifications occur during | 146 | longer modifies 'erc-mode-map'. Instead, modifications occur during |
| 146 | module setup. This should not impact most user configs since ERC | 147 | module setup. This should not impact most user configs since ERC |
| @@ -149,7 +150,7 @@ previously created. Note that while all affected bindings still | |||
| 149 | reside in 'erc-mode-map', future built-in modules will use their own | 150 | reside in 'erc-mode-map', future built-in modules will use their own |
| 150 | minor-mode maps, and new third-party modules should do the same. | 151 | minor-mode maps, and new third-party modules should do the same. |
| 151 | 152 | ||
| 152 | ** The option 'erc-timestamp-format-right' has been deprecated. | 153 | ** Option 'erc-timestamp-format-right' deprecated. |
| 153 | Having to account for this option prevented other ERC modules from | 154 | Having to account for this option prevented other ERC modules from |
| 154 | easily determining what right-hand stamps would look like before | 155 | easily determining what right-hand stamps would look like before |
| 155 | insertion, which is knowledge needed for certain UI decisions. The | 156 | insertion, which is knowledge needed for certain UI decisions. The |
| @@ -270,7 +271,7 @@ encouraged to keep a module's name aligned with its group's as well as | |||
| 270 | the provided feature of its containing library, if only for the usual | 271 | the provided feature of its containing library, if only for the usual |
| 271 | reasons of namespace hygiene and discoverability. | 272 | reasons of namespace hygiene and discoverability. |
| 272 | 273 | ||
| 273 | *** ERC now supports arbitrary CHANTYPES. | 274 | *** ERC supports arbitrary CHANTYPES. |
| 274 | Specifically, channels can be prefixed with any predesignated | 275 | Specifically, channels can be prefixed with any predesignated |
| 275 | character, mainly to afford more flexibility to specialty services, | 276 | character, mainly to afford more flexibility to specialty services, |
| 276 | like bridges to other protocols. | 277 | like bridges to other protocols. |
| @@ -281,7 +282,7 @@ specify a subcommand to actually carry out anything of consequence. | |||
| 281 | Built-in modules can now provide more detailed help for a particular | 282 | Built-in modules can now provide more detailed help for a particular |
| 282 | subcommand by telling ERC to defer to a specialized handler. | 283 | subcommand by telling ERC to defer to a specialized handler. |
| 283 | 284 | ||
| 284 | *** Longtime quasi modules have been made proper. | 285 | *** Longtime quasi modules made proper. |
| 285 | The 'fill' module is now defined by 'define-erc-module'. The same | 286 | The 'fill' module is now defined by 'define-erc-module'. The same |
| 286 | goes for ERC's imenu integration, which has 'imenu' now appearing in | 287 | goes for ERC's imenu integration, which has 'imenu' now appearing in |
| 287 | the default value of 'erc-modules'. | 288 | the default value of 'erc-modules'. |
| @@ -299,7 +300,7 @@ third-party code, the key takeaway is that more 'font-lock-face' | |||
| 299 | properties encountered in the wild may be combinations of faces rather | 300 | properties encountered in the wild may be combinations of faces rather |
| 300 | than lone ones. | 301 | than lone ones. |
| 301 | 302 | ||
| 302 | *** Prompt input is split before 'erc-pre-send-functions' has a say. | 303 | *** Prompt input split before 'erc-pre-send-functions' gets a say. |
| 303 | Hook members are now treated to input whose lines have already been | 304 | Hook members are now treated to input whose lines have already been |
| 304 | adjusted to fall within the allowed length limit. For convenience, | 305 | adjusted to fall within the allowed length limit. For convenience, |
| 305 | third-party code can request that the final input be "re-filled" prior | 306 | third-party code can request that the final input be "re-filled" prior |
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el index 4892733d456..b35e1b97e9d 100644 --- a/lisp/emacs-lisp/comp.el +++ b/lisp/emacs-lisp/comp.el | |||
| @@ -1301,33 +1301,45 @@ clashes." | |||
| 1301 | (make-temp-file (comp-c-func-name function-name "freefn-") | 1301 | (make-temp-file (comp-c-func-name function-name "freefn-") |
| 1302 | nil ".eln"))) | 1302 | nil ".eln"))) |
| 1303 | (let* ((f (symbol-function function-name)) | 1303 | (let* ((f (symbol-function function-name)) |
| 1304 | (byte-code (byte-compile function-name)) | ||
| 1304 | (c-name (comp-c-func-name function-name "F")) | 1305 | (c-name (comp-c-func-name function-name "F")) |
| 1305 | (func (make-comp-func-l :name function-name | 1306 | (func |
| 1306 | :c-name c-name | 1307 | (if (comp-lex-byte-func-p byte-code) |
| 1307 | :doc (documentation f t) | 1308 | (make-comp-func-l :name function-name |
| 1308 | :int-spec (interactive-form f) | 1309 | :c-name c-name |
| 1309 | :command-modes (command-modes f) | 1310 | :doc (documentation f t) |
| 1310 | :speed (comp-spill-speed function-name) | 1311 | :int-spec (interactive-form f) |
| 1311 | :pure (comp-spill-decl-spec function-name | 1312 | :command-modes (command-modes f) |
| 1312 | 'pure)))) | 1313 | :speed (comp-spill-speed function-name) |
| 1314 | :pure (comp-spill-decl-spec function-name | ||
| 1315 | 'pure)) | ||
| 1316 | (make-comp-func-d :name function-name | ||
| 1317 | :c-name c-name | ||
| 1318 | :doc (documentation f t) | ||
| 1319 | :int-spec (interactive-form f) | ||
| 1320 | :command-modes (command-modes f) | ||
| 1321 | :speed (comp-spill-speed function-name) | ||
| 1322 | :pure (comp-spill-decl-spec function-name | ||
| 1323 | 'pure))))) | ||
| 1313 | (when (byte-code-function-p f) | 1324 | (when (byte-code-function-p f) |
| 1314 | (signal 'native-compiler-error | 1325 | (signal 'native-compiler-error |
| 1315 | '("can't native compile an already byte-compiled function"))) | 1326 | '("can't native compile an already byte-compiled function"))) |
| 1316 | (setf (comp-func-byte-func func) | 1327 | (setf (comp-func-byte-func func) byte-code) |
| 1317 | (byte-compile (comp-func-name func))) | ||
| 1318 | (let ((lap (byte-to-native-lambda-lap | 1328 | (let ((lap (byte-to-native-lambda-lap |
| 1319 | (gethash (aref (comp-func-byte-func func) 1) | 1329 | (gethash (aref (comp-func-byte-func func) 1) |
| 1320 | byte-to-native-lambdas-h)))) | 1330 | byte-to-native-lambdas-h)))) |
| 1321 | (cl-assert lap) | 1331 | (cl-assert lap) |
| 1322 | (comp-log lap 2 t) | 1332 | (comp-log lap 2 t) |
| 1323 | (let ((arg-list (aref (comp-func-byte-func func) 0))) | 1333 | (if (comp-func-l-p func) |
| 1324 | (setf (comp-func-l-args func) | 1334 | (let ((arg-list (aref (comp-func-byte-func func) 0))) |
| 1325 | (comp-decrypt-arg-list arg-list function-name) | 1335 | (setf (comp-func-l-args func) |
| 1326 | (comp-func-lap func) | 1336 | (comp-decrypt-arg-list arg-list function-name))) |
| 1327 | lap | 1337 | (setf (comp-func-d-lambda-list func) (cadr f))) |
| 1328 | (comp-func-frame-size func) | 1338 | (setf (comp-func-lap func) |
| 1329 | (comp-byte-frame-size (comp-func-byte-func func)))) | 1339 | lap |
| 1330 | (setf (comp-ctxt-top-level-forms comp-ctxt) | 1340 | (comp-func-frame-size func) |
| 1341 | (comp-byte-frame-size (comp-func-byte-func func)) | ||
| 1342 | (comp-ctxt-top-level-forms comp-ctxt) | ||
| 1331 | (list (make-byte-to-native-func-def :name function-name | 1343 | (list (make-byte-to-native-func-def :name function-name |
| 1332 | :c-name c-name))) | 1344 | :c-name c-name))) |
| 1333 | (comp-add-func-to-ctxt func)))) | 1345 | (comp-add-func-to-ctxt func)))) |
diff --git a/lisp/erc/erc-nicks.el b/lisp/erc/erc-nicks.el index 3f753adc625..67f513f8d3e 100644 --- a/lisp/erc/erc-nicks.el +++ b/lisp/erc/erc-nicks.el | |||
| @@ -480,6 +480,12 @@ Abandon search after examining LIMIT faces." | |||
| 480 | "Uniquely colorize nicknames in target buffers." | 480 | "Uniquely colorize nicknames in target buffers." |
| 481 | ((if erc--target | 481 | ((if erc--target |
| 482 | (progn | 482 | (progn |
| 483 | (erc-with-server-buffer | ||
| 484 | (unless erc-nicks-mode | ||
| 485 | (erc--warn-once-before-connect 'erc-nicks-mode | ||
| 486 | "Module `nicks' must be enabled or disabled session-wide." | ||
| 487 | " Toggling it in individual target buffers is unsupported.") | ||
| 488 | (erc-nicks-mode +1))) ; but do it anyway | ||
| 483 | (setq erc-nicks--downcased-skip-nicks | 489 | (setq erc-nicks--downcased-skip-nicks |
| 484 | (mapcar #'erc-downcase erc-nicks-skip-nicks)) | 490 | (mapcar #'erc-downcase erc-nicks-skip-nicks)) |
| 485 | (add-function :filter-return (local 'erc-button--modify-nick-function) | 491 | (add-function :filter-return (local 'erc-button--modify-nick-function) |
diff --git a/lisp/erc/erc.el b/lisp/erc/erc.el index 03c21059a92..eca6a90d706 100644 --- a/lisp/erc/erc.el +++ b/lisp/erc/erc.el | |||
| @@ -6350,7 +6350,9 @@ This option mainly prevents text accidentally entered into Emacs | |||
| 6350 | from being sent to the server. Offending sources include | 6350 | from being sent to the server. Offending sources include |
| 6351 | terminal multiplexers, desktop-automation scripts, and anything | 6351 | terminal multiplexers, desktop-automation scripts, and anything |
| 6352 | capable of rapidly submitting successive lines of prompt input. | 6352 | capable of rapidly submitting successive lines of prompt input. |
| 6353 | For example, entering \"one\\ntwo\\nthree\\n\" will send \"one\" | 6353 | For example, if you could somehow manage to type \"one \\`RET' |
| 6354 | two \\`RET' three \\`RET'\" at the prompt in less than | ||
| 6355 | `erc-accidental-paste-threshold-seconds', ERC would send \"one\" | ||
| 6354 | to the server, leave \"two\" at the prompt, and insert \"three\" | 6356 | to the server, leave \"two\" at the prompt, and insert \"three\" |
| 6355 | into an \"overflow\" buffer. See `erc-inhibit-multiline-input' | 6357 | into an \"overflow\" buffer. See `erc-inhibit-multiline-input' |
| 6356 | and `erc-warn-about-blank-lines' for suppression involving input | 6358 | and `erc-warn-about-blank-lines' for suppression involving input |
diff --git a/src/fileio.c b/src/fileio.c index 67a34d8415d..d24f25c2e06 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -2644,7 +2644,7 @@ internal_delete_file (Lisp_Object filename) | |||
| 2644 | #endif | 2644 | #endif |
| 2645 | 2645 | ||
| 2646 | /* Return -1 if FILE is a case-insensitive file name, 0 if not, | 2646 | /* Return -1 if FILE is a case-insensitive file name, 0 if not, |
| 2647 | and a positive errno value if the result cannot be determined. */ | 2647 | and 1 if the result cannot be determined. */ |
| 2648 | 2648 | ||
| 2649 | static int | 2649 | static int |
| 2650 | file_name_case_insensitive_err (Lisp_Object file) | 2650 | file_name_case_insensitive_err (Lisp_Object file) |
| @@ -2678,7 +2678,7 @@ file_name_case_insensitive_err (Lisp_Object file) | |||
| 2678 | return - (res == 0); | 2678 | return - (res == 0); |
| 2679 | # endif | 2679 | # endif |
| 2680 | if (errno != EINVAL) | 2680 | if (errno != EINVAL) |
| 2681 | return errno; | 2681 | return 1; |
| 2682 | #endif | 2682 | #endif |
| 2683 | 2683 | ||
| 2684 | #if defined CYGWIN || defined DOS_NT | 2684 | #if defined CYGWIN || defined DOS_NT |
diff --git a/src/xterm.c b/src/xterm.c index 1865324d87a..f454733c659 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -5497,12 +5497,24 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5497 | no input. | 5497 | no input. |
| 5498 | 5498 | ||
| 5499 | The device attachment is a device ID whose meaning varies | 5499 | The device attachment is a device ID whose meaning varies |
| 5500 | depending on the device use. If the device is a master device, | 5500 | depending on the device's use. If a device is a master device, |
| 5501 | then the attachment is the device ID of the other device in its | 5501 | then its attachment is the device ID of the other device in its |
| 5502 | seat (the master keyboard for master pointer devices, and vice | 5502 | seat (the master keyboard for master pointer devices and vice |
| 5503 | versa). Otherwise, it is the ID of the master device the slave | 5503 | versa.) Otherwise, it is the ID of the master device the slave |
| 5504 | device is attached to. For slave devices not attached to any | 5504 | device is attached to. For slave devices not attached to any |
| 5505 | seat, its value is undefined. */ | 5505 | seat, its value is undefined. |
| 5506 | |||
| 5507 | Emacs receives ordinary pointer and keyboard events from the | ||
| 5508 | master devices associated with each seat, discarding events from | ||
| 5509 | slave devices. However, multiplexing events from touch devices | ||
| 5510 | onto a master device poses problems: if both dependent and direct | ||
| 5511 | touch devices are attached to the same master pointer device, the | ||
| 5512 | coordinate space of touch events sent from that seat becomes | ||
| 5513 | ambiguous. In addition, the X server does not send TouchEnd | ||
| 5514 | events to cancel ongoing touch sequences if the slave device that | ||
| 5515 | is their source is detached. As a result of these ambiguities, | ||
| 5516 | touch events are processed from and recorded onto their slave | ||
| 5517 | devices instead. */ | ||
| 5506 | 5518 | ||
| 5507 | xi_device->device_id = device->deviceid; | 5519 | xi_device->device_id = device->deviceid; |
| 5508 | xi_device->grab = 0; | 5520 | xi_device->grab = 0; |
| @@ -5516,7 +5528,7 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5516 | #ifdef HAVE_XINPUT2_2 | 5528 | #ifdef HAVE_XINPUT2_2 |
| 5517 | xi_device->touchpoints = NULL; | 5529 | xi_device->touchpoints = NULL; |
| 5518 | xi_device->direct_p = false; | 5530 | xi_device->direct_p = false; |
| 5519 | #endif | 5531 | #endif /* HAVE_XINPUT2_1 */ |
| 5520 | 5532 | ||
| 5521 | #ifdef HAVE_XINPUT2_1 | 5533 | #ifdef HAVE_XINPUT2_1 |
| 5522 | if (!dpyinfo->xi2_version) | 5534 | if (!dpyinfo->xi2_version) |
| @@ -5582,9 +5594,34 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5582 | case XITouchClass: | 5594 | case XITouchClass: |
| 5583 | { | 5595 | { |
| 5584 | touch_info = (XITouchClassInfo *) device->classes[c]; | 5596 | touch_info = (XITouchClassInfo *) device->classes[c]; |
| 5585 | xi_device->direct_p = touch_info->mode == XIDirectTouch; | 5597 | |
| 5598 | /* touch_info->mode indicates the coordinate space that | ||
| 5599 | this device reports in its touch events. | ||
| 5600 | |||
| 5601 | DirectTouch means that the device uses a coordinate | ||
| 5602 | space that corresponds to locations on the screen. It | ||
| 5603 | is set by touch screen devices which are overlaid | ||
| 5604 | over the raster itself. | ||
| 5605 | |||
| 5606 | The other value (DependentTouch) means that the device | ||
| 5607 | uses a separate abstract coordinate space corresponding | ||
| 5608 | to its own surface. Emacs ignores events from these | ||
| 5609 | devices because it does not support recognizing touch | ||
| 5610 | gestures from surfaces other than the screen. | ||
| 5611 | |||
| 5612 | Master devices may report multiple touch classes for | ||
| 5613 | attached slave devices, leaving the nature of touch | ||
| 5614 | events they send ambiguous. The problem of | ||
| 5615 | discriminating between these events is bypassed | ||
| 5616 | entirely through only processing touch events from the | ||
| 5617 | slave devices where they originate. */ | ||
| 5618 | |||
| 5619 | if (touch_info->mode == XIDirectTouch) | ||
| 5620 | xi_device->direct_p = true; | ||
| 5621 | else | ||
| 5622 | xi_device->direct_p = false; | ||
| 5586 | } | 5623 | } |
| 5587 | #endif | 5624 | #endif /* HAVE_XINPUT2_2 */ |
| 5588 | default: | 5625 | default: |
| 5589 | break; | 5626 | break; |
| 5590 | } | 5627 | } |
| @@ -5611,7 +5648,7 @@ xi_populate_device_from_info (struct x_display_info *dpyinfo, | |||
| 5611 | } | 5648 | } |
| 5612 | 5649 | ||
| 5613 | SAFE_FREE (); | 5650 | SAFE_FREE (); |
| 5614 | #endif | 5651 | #endif /* HAVE_XINPUT2_1 */ |
| 5615 | } | 5652 | } |
| 5616 | 5653 | ||
| 5617 | /* Populate our client-side record of all devices, which includes | 5654 | /* Populate our client-side record of all devices, which includes |
| @@ -13443,7 +13480,7 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13443 | device->scroll_valuator_count = 0; | 13480 | device->scroll_valuator_count = 0; |
| 13444 | #ifdef HAVE_XINPUT2_2 | 13481 | #ifdef HAVE_XINPUT2_2 |
| 13445 | device->direct_p = false; | 13482 | device->direct_p = false; |
| 13446 | #endif | 13483 | #endif /* HAVE_XINPUT2_2 */ |
| 13447 | 13484 | ||
| 13448 | for (i = 0; i < num_classes; ++i) | 13485 | for (i = 0; i < num_classes; ++i) |
| 13449 | { | 13486 | { |
| @@ -13461,10 +13498,34 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13461 | case XITouchClass: | 13498 | case XITouchClass: |
| 13462 | touch = (XITouchClassInfo *) classes[i]; | 13499 | touch = (XITouchClassInfo *) classes[i]; |
| 13463 | 13500 | ||
| 13501 | /* touch_info->mode indicates the coordinate space that this | ||
| 13502 | device reports in its touch events. | ||
| 13503 | |||
| 13504 | DirectTouch means that the device uses a coordinate space | ||
| 13505 | that corresponds to locations on the screen. It is set | ||
| 13506 | by touch screen devices which are overlaid over the | ||
| 13507 | raster itself. | ||
| 13508 | |||
| 13509 | The other value (DependentTouch) means that the device | ||
| 13510 | uses a separate abstract coordinate space corresponding | ||
| 13511 | to its own surface. Emacs ignores events from these | ||
| 13512 | devices because it does not support recognizing touch | ||
| 13513 | gestures from surfaces other than the screen. | ||
| 13514 | |||
| 13515 | Master devices may report multiple touch classes for | ||
| 13516 | attached slave devices, leaving the nature of touch | ||
| 13517 | events they send ambiguous. The problem of | ||
| 13518 | discriminating between these events is bypassed entirely | ||
| 13519 | through only processing touch events from the slave | ||
| 13520 | devices where they originate. */ | ||
| 13521 | |||
| 13464 | if (touch->mode == XIDirectTouch) | 13522 | if (touch->mode == XIDirectTouch) |
| 13465 | device->direct_p = true; | 13523 | device->direct_p = true; |
| 13524 | else | ||
| 13525 | device->direct_p = false; | ||
| 13526 | |||
| 13466 | break; | 13527 | break; |
| 13467 | #endif | 13528 | #endif /* HAVE_XINPUT2_2 */ |
| 13468 | } | 13529 | } |
| 13469 | } | 13530 | } |
| 13470 | 13531 | ||
| @@ -13502,7 +13563,7 @@ xi_handle_new_classes (struct x_display_info *dpyinfo, struct xi_device_t *devic | |||
| 13502 | } | 13563 | } |
| 13503 | } | 13564 | } |
| 13504 | 13565 | ||
| 13505 | #endif | 13566 | #endif /* HAVE_XINPUT2_1 */ |
| 13506 | 13567 | ||
| 13507 | /* Handle EVENT, a DeviceChanged event. Look up the device that | 13568 | /* Handle EVENT, a DeviceChanged event. Look up the device that |
| 13508 | changed, and update its information with the data in EVENT. */ | 13569 | changed, and update its information with the data in EVENT. */ |
| @@ -32250,10 +32311,12 @@ reported as iconified. */); | |||
| 32250 | 32311 | ||
| 32251 | DEFVAR_BOOL ("x-input-grab-touch-events", x_input_grab_touch_events, | 32312 | DEFVAR_BOOL ("x-input-grab-touch-events", x_input_grab_touch_events, |
| 32252 | doc: /* Non-nil means to actively grab touch events. | 32313 | doc: /* Non-nil means to actively grab touch events. |
| 32253 | This means touch sequences that started on an Emacs frame will | 32314 | This means touch sequences that are obtained through a passive grab on |
| 32254 | reliably continue to receive updates even if the finger moves off the | 32315 | an Emacs frame (or a parent window of such a frame) will reliably |
| 32255 | frame, but may cause crashes with some window managers and/or external | 32316 | continue to receive updates, but may cause crashes with some window |
| 32256 | programs. */); | 32317 | managers and/or external programs. Changing this option is only |
| 32318 | useful when other programs are making their own X requests pertaining | ||
| 32319 | to the window hierarchy of an Emacs frame. */); | ||
| 32257 | x_input_grab_touch_events = true; | 32320 | x_input_grab_touch_events = true; |
| 32258 | 32321 | ||
| 32259 | DEFVAR_BOOL ("x-dnd-fix-motif-leave", x_dnd_fix_motif_leave, | 32322 | DEFVAR_BOOL ("x-dnd-fix-motif-leave", x_dnd_fix_motif_leave, |
diff --git a/test/src/comp-resources/comp-test-funcs-dyn2.el b/test/src/comp-resources/comp-test-funcs-dyn2.el new file mode 100644 index 00000000000..3d70489d1ca --- /dev/null +++ b/test/src/comp-resources/comp-test-funcs-dyn2.el | |||
| @@ -0,0 +1,31 @@ | |||
| 1 | ;;; comp-test-funcs-dyn2.el -*- lexical-binding: nil; no-byte-compile: t; -*- | ||
| 2 | |||
| 3 | ;; Copyright (C) 2023 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; Author: Alan Mackenzie <acm@muc.de> | ||
| 6 | |||
| 7 | ;; This file is part of GNU Emacs. | ||
| 8 | |||
| 9 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 10 | ;; it under the terms of the GNU General Public License as published by | ||
| 11 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 12 | ;; (at your option) any later version. | ||
| 13 | |||
| 14 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 15 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 16 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 17 | ;; GNU General Public License for more details. | ||
| 18 | |||
| 19 | ;; You should have received a copy of the GNU General Public License | ||
| 20 | ;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. | ||
| 21 | |||
| 22 | ;;; Commentary: | ||
| 23 | ;; Test the compilation of a function under dynamic binding. | ||
| 24 | |||
| 25 | ;;; Code: | ||
| 26 | |||
| 27 | (defun comp-tests-result-lambda () | ||
| 28 | (lambda (bar) (car bar))) | ||
| 29 | |||
| 30 | (provide 'comp-test-funcs-dyn2) | ||
| 31 | ;;; comp-test-funcs-dyn2.el ends here. | ||
diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index ce7899d9d4c..30dfd669ded 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el | |||
| @@ -33,7 +33,8 @@ | |||
| 33 | 33 | ||
| 34 | (eval-and-compile | 34 | (eval-and-compile |
| 35 | (defconst comp-test-src (ert-resource-file "comp-test-funcs.el")) | 35 | (defconst comp-test-src (ert-resource-file "comp-test-funcs.el")) |
| 36 | (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el"))) | 36 | (defconst comp-test-dyn-src (ert-resource-file "comp-test-funcs-dyn.el")) |
| 37 | (defconst comp-test-dyn-src2 (ert-resource-file "comp-test-funcs-dyn2.el"))) | ||
| 37 | 38 | ||
| 38 | (when (native-comp-available-p) | 39 | (when (native-comp-available-p) |
| 39 | (message "Compiling tests...") | 40 | (message "Compiling tests...") |
| @@ -44,6 +45,7 @@ | |||
| 44 | ;; names used in this file. | 45 | ;; names used in this file. |
| 45 | (require 'comp-test-funcs comp-test-src) | 46 | (require 'comp-test-funcs comp-test-src) |
| 46 | (require 'comp-test-dyn-funcs comp-test-dyn-src) ;Non-standard feature name! | 47 | (require 'comp-test-dyn-funcs comp-test-dyn-src) ;Non-standard feature name! |
| 48 | (require 'comp-test-funcs-dyn2 comp-test-dyn-src2) | ||
| 47 | 49 | ||
| 48 | (defmacro comp-deftest (name args &rest docstring-and-body) | 50 | (defmacro comp-deftest (name args &rest docstring-and-body) |
| 49 | "Define a test for the native compiler tagging it as :nativecomp." | 51 | "Define a test for the native compiler tagging it as :nativecomp." |
| @@ -1528,4 +1530,7 @@ folded." | |||
| 1528 | (equal (comp-mvar-typeset mvar) | 1530 | (equal (comp-mvar-typeset mvar) |
| 1529 | comp-tests-cond-rw-expected-type)))))))) | 1531 | comp-tests-cond-rw-expected-type)))))))) |
| 1530 | 1532 | ||
| 1533 | (ert-deftest comp-tests-result-lambda () | ||
| 1534 | (native-compile 'comp-tests-result-lambda) | ||
| 1535 | (should (eq (funcall (comp-tests-result-lambda) '(a . b)) 'a))) | ||
| 1531 | ;;; comp-tests.el ends here | 1536 | ;;; comp-tests.el ends here |