* lisp/cedet/semantic/db-find.el
(semanticdb-find-tags-by-name-method)
(semanticdb-find-tags-by-name-regexp-method)
(semanticdb-find-tags-for-completion-method)
(semanticdb-find-tags-by-class-method)
(semanticdb-find-tags-external-children-of-type-method)
(semanticdb-find-tags-subclasses-of-type-method)
(semanticdb-deep-find-tags-by-name-method)
(semanticdb-deep-find-tags-by-name-regexp-method)
(semanticdb-deep-find-tags-for-completion-method): Verify that
tags is bound before accessing it; this slot is unbound in
tables created for unloaded files when the `unloaded' throttle
is disabled.
* test/infra/Makefile.in (TREE-SITTER-FILES): Add js-tests.el and
python-tests.el, which don't follow test file name convention.
* test/infra/test-jobs.yml: Regenerate.
* lisp/tab-line.el (tab-line-select-tab-buffer)
(tab-line-switch-to-prev-tab, tab-line-switch-to-next-tab): Let-bind
switch-to-buffer-obey-display-actions to nil around the call to
switch-to-buffer to restrain buffer switching in bounds of
the same window only (bug#69993).
* java/org/gnu/emacs/EmacsActivity.java (destroy): Detach from
current window before calling finish.
* java/org/gnu/emacs/EmacsWindow.java (reparentTo): Don't clear
attachment state here...
* java/org/gnu/emacs/EmacsWindowManager.java (detachWindow):
...but do so here instead.
Allow passing C-TAB on to the Haiku operating system, fixing
window switching when an Emacs frame has focus (Bug#70138).
* src/haiku_support.cc (DispatchMessage): Conditionally pass
message to BWindow.
* src/haiku_support.h:
* src/haikufns.c (haiku_should_pass_control_tab_to_system): Add
variable haiku-pass-control-tab-to-system, and C function
haiku_should_pass_control_tab_to_system.
Co-authored-by: Po Lu <luangruo@yahoo.com>
Copyright-paperwork-exempt: yes
`file-truepath' is slow because of recursive calls and being implemented
in lisp. It seems to not be needed in eglot, but it is used behind the
scenes in `find-buffer-visiting', thus appearing in profiles. Moving
the implementation to a hash map will yield similar performance
benefits, but wouldn't require us to rewrite `file-truename' in C.
* lisp/progmodes/eglot.el (eglot-lsp-server): Convert 'managed-buffers'
to a hashmap.
(eglot-uri-to-path): Don't use file-truepath, as it is too slow to be
included in the hot path.
(eglot--on-shutdown): Use buffers from buffer map.
(eglot--managed-mode): Add buffer to map, rather than list. Also remove
it from the map on deactivation.
(eglot-handle-notification): Expose server and get buffer from the
buffer map.
* java/org/gnu/emacs/EmacsActivity.java (onCreate): Permit
overriding by child classes.
(onDestroy): Minor stylistic adjustments.
(getAttachmentToken): New function.
* java/org/gnu/emacs/EmacsMultitaskActivity.java (onCreate)
(getAttachmentToken): New functions.
* java/org/gnu/emacs/EmacsWindow.java (EmacsWindow):
<attachmentToken, preserve, previouslyAttached>: New variables.
(onActivityDetached): Remove redundant isFinishing argument.
(reparentTo): Reset the foregoing fields before registering with
the window manager.
* java/org/gnu/emacs/EmacsWindowManager.java
(EmacsWindowManager): Rename from EmacsWindowAttachmentManager.
(WindowConsumer): New function getAttachmentToken.
(isWindowEligible): New function.
(registerWindowConsumer, registerWindow, removeWindowConsumer)
(detachWindow): Implement a new window management strategy on
API 29 and subsequent releases where both varieties of toplevel
window are permanently, except when reparented, bound to the
activities to which they attach, and Emacs establishes at
strategic junctures whether those activities remain present.
(getTaskToken, pruneWindows): New functions.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): Suppress "file
has no `lexical-binding' directive" is the variable is non-nil,
as is the case with 'lisp-interaction-mode'. (Bug#70068)
* lisp/dired.el (dired-mode): Set buffer-local
'window-point-context-set-function' to remember 'dired-filename'
or 'position' in the window with the Dired buffer.
Set buffer-local 'window-point-context-use-function' to restore
the remembered position of the window point.
* lisp/tab-bar.el (tab-bar--tab): Use window-point-context-set.
(tab-bar-select-restore-context): New user option.
(tab-bar-select-tab): Use window-point-context-use.
* lisp/window.el: Add '(context . writable)' to
'window-persistent-parameters'.
(window-point-context-set, window-point-context-use): New functions.
(window-point-context-set-default-function)
(window-point-context-use-default-function): New functions.
(window-point-context-set-function)
(window-point-context-use-function): New variables.
Previously, a unibyte target buffer could be put in an incorrect state
if json-insert was used to insert non-ASCII characters.
* src/json.c (Fjson_insert): Simplify. Don't attempt to decode the data
being inserted: it is guaranteed to be correct UTF-8 and is correct for
both unibyte and multibyte buffers.
* test/src/json-tests.el (json-serialize/roundtrip)
(json-serialize/roundtrip-scalars): Extend tests.
* src/json.c (Fjson_insert): Precise the behaviour when the current
buffer is multibyte and unibyte, respectively.
* doc/lispref/text.texi (Parsing JSON): Refer to the right function.
* doc/lispref/windows.texi (Choosing Window): Provide an example
of using '(category . comint)' in the condition of 'display-buffer-alist'
and in the action of 'display-buffer'.
(Buffer Display Action Alists): Add a new action alist entry 'category'.
* lisp/subr.el (buffer-match-p): Add a new condition 'category'.
* lisp/window.el (display-buffer): Document a new action alist entry
'category'.
* src/json.c (Fjson_serialize, Fjson_insert, Fjson_parse_string)
(Fjson_parse_buffer): Make the text more readable, fix minor
errors and avoid terminology confusion.
* src/image.c (image_get_dimension, lookup_image): Handle `ch'
and `cw' dimension specifiers in addition to `em'.
* src/dispextern.h: Add new members `face_font_height' and
`face_font_width' to `struct image'.
* doc/lispref/display.texi (Image Descriptors): Document
`ch' and `cw'.
Fix symbol list matching regexp performance
Allow empty face lists, improve the face list matching regexp (see
discussion in Bug#69714) based on relint's comments, add tests:
* test/lisp/emacs-lisp/ert-font-lock-tests.el: Add tests.
* lisp/emacs-lisp/ert-font-lock.el: Fix regexps.
Speed up JSON parsing substantially by only UTF-8-parsing string
literals and only exactly once. Previously, json-parse-string always
first parsed the entire input and copied it to a new string, and then
validated each string literal twice.
We no longer create an extra new string when interning an alist key,
nor do we garble plist keys with Unicode characters.
* src/lread.c (intern_c_multibyte): New.
* src/json.c (json_encode): Remove.
(utf8_error): New.
(json_parse_string): Faster and more careful UTF-8 decoding.
Create and return a new multibyte string or symbol without extra
decoding. All callers adapted.
(Fjson_parse_string): Skip expensive input pre-decoding.
* test/src/json-tests.el (json-parse-string/object-unicode-keys)
(json-parse-string/short): New.
(json-parse-string/string, json-parse-string/invalid-unicode):
Adapt tests.
* etc/NEWS: Mentioned change in errors.
* lisp/emacs-lisp/bytecomp.el (bytecomp--sort-call-in-place-p)
(bytecomp--mutargs-nconc, bytecomp--mutargs-sort): New.
(byte-compile-form, bytecomp--actually-important-return-value-p)
(mutating-fns):
Use a slightly more extendible scheme for specifying what arguments
a function mutates. Give `sort` special treatment.
Well, I'm not completely sure this will work right in all cases,
because I've been confused about this in the past.
It works in my test case, at least.
* lisp/progmodes/scheme.el (scheme-syntax-propertize-sexp-comment):
Look for nested `#;` and mark them appropriately.