The test works when run interactively and in batch mode started from
a terminal, but not from M-x compile.
* test/lisp/tab-bar-tests.el (tab-bar-tests-quit-restore-window):
Disable on macOS when TERM=dumb.
bug#79616
* lisp/progmodes/hideshow.el (hs-discard-overlays)
(hs-make-overlay, hs-show-block): Rework
'hs--refresh-indicators' calls.
(hs--refresh-indicators): Rework code, add new function
arguments.
(hs-minor-mode): Properly remove the indicators after turning
off the mode.
This way major modes can compute font-lock settings and
indentation rules dynamically when the major mode is enabled.
We don't want to compute it at package load time because the
grammar might not be installed at that point. (Grammar might
be (semi)auto-installed when the major mode is enabled.)
This commit adds treesit--query-cache and changes
treesit-font-lock-rules to not compile the query. Instead, the
queries are compiled in
treesit-validate-and-compile-font-lock-rules.
Go-ts-mode is modified to use this new framework.
* lisp/progmodes/go-ts-mode.el (go-ts-mode--iota-query-supported-p):
(go-ts-mode--method-elem-supported-p):
(go-ts-mode--font-lock-settings-cached): Removed.
(go-ts-mode--font-lock-settings): Simply return the result of
treesit-font-lock-rules rather than saving to
go-ts-mode--font-lock-settings-cached. Use
treesit-query-with-optional for computed queries.
* lisp/treesit.el (treesit--query-cache): New variable.
(treesit-font-lock-settings): Add new field language.
(treesit-font-lock-setting-language): New function.
(treesit-query-with-optional): New function.
(treesit-font-lock-recompute-features): Don't compile query and
store language (because we can't derive from compiled query anymore).
(treesit-replace-font-lock-feature-settings): Use the new
language field.
(treesit-validate-and-compile-font-lock-rules): Renamed from
treesit-validate-font-lock-rules, add logic to compile queries.
(treesit-major-mode-setup): Use treesit-validate-and-compile-font-lock-rules.
* src/lisp.h (record_in_backtrace): Don't record the argument address as
stack_top because most of the time it won't be on the C stack at all.
* src/eval.c (eval_sub): Do it here instead using an address guaranteed
to be on the C stack and we are just in the Lisp interpreter anyway.
To make Flymake's margin/fringe decision correct, four cases
must be tested. (1) A daemon that starts flymake-mode on a
buffer and then connecting a graphical client. Here fringes
must be used. (2) Like 1, but with a tty client. Here margins
must be used automatically. (3) A non-daemonic start of a
graphical emacs. (4) A non-daemonic start of a tty emacs.
The code was failing case 1. 1 and 2 are the trickiest to get
right and currently can't be gotten right unless the margin
auto-resize is done at buffer annotation time.
Additionally, fix bugs in 'flymake-start's buffer visibility logic.
Refactor duplicate code in 'flymake--highlight-line' and fix docstrings.
* lisp/progmodes/flymake.el (flymake-autoresize-margins): Fix
focstring.
(flymake--bs-display): Rename from flymake--indicator-overlay-spec.
Fix docstring. Return just the display spec.
(flymake--suitably-fringed-p): New helper, instead of duplication.
(flymake--resize-margins): Cut up into two functions.
(flymake--restore-margins): Dedicated to restoring functions.
(flymake--highlight-line): Simplify logic when
flymake-indicator-type is 'auto'.
(flymake-start): Fix visibility logic to account for daemon mode.
Maybe resize margins here.
(flymake-mode): Call restore margins.
* lisp/progmodes/flymake.el (flymake-indicator-type):
Change the default value from 'fringes' to 'auto'.
(flymake--resize-margins): Use margins when
'flymake-indicator-type' is 'auto', but fringes are no available.
(flymake--highlight-line): Use display condition '(when CONDITION . SPEC)'
that checks for 'window-fringes' at display time and switches
between fringes and margins (bug#77313).
* lisp/vc/vc.el (vc-rename-file): Make it work regardless of
default-directory; now the only influence of default-directory
should be resolving OLD and NEW if they are relative file names.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--rename-file): Test
the influence of default-directory on vc-rename-file.
* src/bytecode.c (exec_byte_code):
Disable the -Wclobbered warning for GCC locally as the old work-around
doesn't appear to be effective for variables with explicitly assigned
registers. This also allows us to remove that work-around which
improves the code somewhat.
GCC seems to have difficulty allocating important global interpreter
variables in registers; telling it which ones to use for 'top' and 'pc'
makes a big difference and seems to ease pressure enough for it to
deal with other variables as well.
We do it for AMD64 and ARM64. Clang doesn't seem to need these directives.
It does result in -Wclobbered warnings that seem difficult to silence.
* src/bytecode.c (BC_REG_TOP, BC_REG_PC): New.
(exec_byte_code): Use them.
* src/bytecode.c (exec_byte_code):
Re-type op from int to ptrdiff_t, which avoids some useless conversions.
Reduce its use by using local variables for intra-block use,
and another variable (arg) where it doesn't need to be alive across
instruction dispatch. We also eliminate it where performance doesn't
matter by re-fetching it from the instruction stream.
All this should help the register allocator.
Implement a better fix for bug#79634.
* lisp/emacs-lisp/byte-run.el (eval-and-compile):
* lisp/emacs-lisp/bytecomp.el (byte-compile-initial-macro-environment)
<eval-and-compile>: Preserve the surrounding lexical context (the part
available during macroexpansion, i.e. which vars are dynbound).
* lisp/emacs-lisp/rx.el (<pcase> rx): Remove workaround.
* test/lisp/emacs-lisp/macroexp-tests.el
(macroexp--dynbound-eval-and-compile): New test.
Provide the 'frame-height' call with the frame of the window where
the *Completions* buffer is displayed for the case when the minibuffer
window uses a dedicated frame (bug#79635).
When clicking on a string displayed by a display property, also
look at the text properties of the underlying buffer text for
keymaps, not just the displayed string. The displayed string
takes precedence over the buffer text, but it doesn't replace
it.
Also, we should use the buffer's local map even for clicks on
the mode line. (Otherwise, what's the point of the <mode-line>
event?)
* src/keymap.c (Fcurrent_active_maps): Consider displayed
string, then buffer text, then fall back to local
map. (Bug#79505)
* test/src/keymap-tests.el
(keymap-test-keymaps-for-non-buffer-positions): Add more tests.
* lisp/progmodes/lua-mode.el (lua-process-buffer-name)
(lua-process-history-file, lua-process-startfile): New options.
(lua-start-process): Use new options.
(lua-send-file): New command.
(lua--repl-buffer-p): Remove unused internal variable. (Bug#79573)
* doc/emacs/sending.texi (Sending Mail):
* doc/emacs/dired.texi (Dired Enter, Dired Visiting):
* doc/emacs/maintaining.texi (Old Revisions)
(Change Log Commands, Looking Up Identifiers):
* doc/emacs/windows.texi (Displaying Buffers):
* doc/emacs/files.texi (Visiting): Add cross-references to where
user options are described which control how windows are split.
* lisp/mail/sendmail.el (mail-other-window):
* lisp/gnus/message.el (message-mail-other-window)
(message-news-other-window):
* lisp/replace.el (occur-mode-goto-occurrence-other-window):
* lisp/vc/vc.el (vc-revision-other-window):
* lisp/vc/vc-dir.el (vc-dir-find-file-other-window):
* lisp/progmodes/xref.el (xref-find-definitions-other-window):
* lisp/simple.el (compose-mail-other-window)
(clone-indirect-buffer-other-window):
* lisp/vc/add-log.el (add-change-log-entry-other-window):
* lisp/view.el (view-file-other-window)
(view-buffer-other-window):
* lisp/window.el (switch-to-buffer-other-window):
* lisp/files.el (find-file-other-window)
(find-file-read-only-other-window)
(find-alternate-file-other-window):
* lisp/dired.el (dired-other-window)
(dired-mouse-find-file-other-window)
(dired-find-file-other-window, dired-jump-other-window): Mention
in the doc strings how to control the way the current window is
split.