1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

170140 commits

Author SHA1 Message Date
Mattias Engdegård
9370bc9d1a Remove byte-compile-form-stack backstop
* lisp/emacs-lisp/cconv.el (cconv-closure-convert):
Eliminate a binding that probably isn't useful after all.
2023-12-22 15:46:45 +01:00
Mattias Engdegård
61190b5146 * lisp/emacs-lisp/byte-opt.el (byte-compile-nilconstp): Extend list. 2023-12-22 14:53:04 +01:00
Mattias Engdegård
1ece474c69 Slight funcall_subr optimisation
* src/eval.c (funcall_subr): Help the compiler by reducing aliasing
problems, and compensate for a missed-optimisation bug in LLVM where
switches sometimes forget to use variable range information (reported
in https://github.com/llvm/llvm-project/issues/76085).
2023-12-22 14:13:23 +01:00
Mattias Engdegård
c638a40d88 Ensure proper mode of *Compile-Log* buffer (bug#67920)
Reported by OGAWA Hirofumi.

* lisp/emacs-lisp/bytecomp.el (displaying-byte-compile-warnings):
Move most of the innards to...
(bytecomp--displaying-warnings): ...this new function, for ease
of maintenance.
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
Wrap early warning about missing lexbind declaration in
`displaying-byte-compile-warnings` so that it doesn't cause the
creation of a compile-log buffer with the wrong mode.
2023-12-22 13:16:40 +01:00
Mattias Engdegård
9db1fe638e Encapsulate byte-compile-form-stack maintenance
* lisp/emacs-lisp/bytecomp.el (byte-compile-toplevel-file-form)
(byte-compile-form):
* lisp/emacs-lisp/macroexp.el (macroexp--expand-all):
Use `macroexp--with-extended-form-stack` instead of explicit
push and pop.
2023-12-22 13:10:14 +01:00
Po Lu
f34f474e38 Properly instruct compound glyphs with compound components
* src/sfnt.c (sfnt_interpret_compound_glyph_2): Don't grow the
compound decomposition context for saving compound points into,
since the space for them already exists.
2023-12-22 10:26:08 +08:00
João Távora
e0b9944b69 Jsonrpc: overhaul logging mechanics
* lisp/jsonrpc.el (jsonrpc-connection): Rework.
(initialize-instance :after jsonrpc-connection): New method.
(slot-missing jsonrpc-connection :events-buffer-scrollback-size oset):
New hack.
(jsonrpc-connection-receive): Rework.
(initialize-instance :after jsonrpc-process-connection): Rework
from non-after version.
(jsonrpc-connection-send)
(jsonrpc--call-deferred)
(jsonrpc--process-sentinel)
(jsonrpc--async-request-1, jsonrpc--debug, jsonrpc--log-event)
(jsonrpc--forwarding-buffer): Rework.
(jsonrpc--run-event-hook): New helper.
(jsonrpc-event-hook): New hook.

* lisp/progmodes/eglot.el (eglot-lsp-server): Fix project slot
initform.
(eglot--connect): Use new jsonrpc-connection initarg.

* test/lisp/progmodes/eglot-tests.el (eglot--sniffing): Use
jsonrpc-event-hook.
(eglot-test-basic-completions): Fix test.
2023-12-21 18:29:50 -06:00
João Távora
4adc67c59d Jsonrpc: fix destructuring bug
* lisp/jsonrpc.el (jsonrpc--process-sentinel): Fix destructuring bug.
(Version): Bump to 1.0.22
2023-12-21 09:08:41 -06:00
Stefan Monnier
93dea9288a Merge branch 'no-ls-lisp-advice' 2023-12-21 09:37:12 -05:00
Stefan Monnier
ec898e94b3 * test/lisp/ls-lisp-tests.el (ls-lisp-unload): Delete test
We don't use such advice any more.
2023-12-21 09:27:53 -05:00
Eli Zaretskii
843cbb9a15 ; * etc/NEWS: Fix markings (bug#67249). 2023-12-21 15:23:33 +02:00
Mattias Engdegård
25dc93c5c1 ; * lisp/emacs-lisp/cconv.el (cconv-convert): Reindent. 2023-12-21 13:20:27 +01:00
Mattias Engdegård
57fd0f47f6 Maintain byte-compile-form-stack in cconv-convert (bug#67483)
* lisp/emacs-lisp/macroexp.el (macroexp--with-extended-form-stack):
New.
* lisp/emacs-lisp/cconv.el (cconv-closure-convert, cconv-convert):
Push forms onto byte-compile-form-stack.
2023-12-21 13:20:27 +01:00
Mattias Engdegård
14ecc377ab Non-delayed warning for malformed function (bug#67483)
* lisp/emacs-lisp/cconv.el (cconv-convert): Use an immediate warning;
a delayed one made little sense as it's a matter of well-formedness.
2023-12-21 13:20:27 +01:00
Eli Zaretskii
ff3965795f ; * lisp/progmodes/gdb-mi.el (gdb-load-history): Add doc string. 2023-12-21 13:57:00 +02:00
Manuel Giraud
63a38fd292 Function to load GDB history
* lisp/progmodes/gdb-mi.el (gud-gdb-load-history): New function to
load GDB history, code factored out of 'gdb'.
(gdb): Call it.  (Bug#67928)
2023-12-21 13:51:28 +02:00
Eli Zaretskii
7058988fd6 Improve and update documentation of registers
* lisp/register.el (register-use-preview)
(register--read-with-preview-function)
(register-preview-function, register-preview-default-1)
(register-preview-default, register--preview-function)
(register-preview-info, register-command-info)
(register-preview-forward-line, register-preview-next)
(register-preview-previous, set-register, register-type)
(register--type, register-preview, register-preview-1)
(register-preview-get-defaults, register-read-with-preview)
(register-read-with-preview-traditional)
(register-read-with-preview-fancy, register-preview-delay): Doc
fixes.

* doc/emacs/regs.texi (Registers): Describe the new preview modes.

* etc/NEWS: Move the registers entry to its correct place, and
document the modified behavior.

(Bug#66394)
2023-12-21 13:45:58 +02:00
Po Lu
04883c36a6 Implement an undocumented TrueType "feature"
* src/sfnt.c (sfnt_move): Correct commentary.
(sfnt_interpret_control_value_program): Reset dual projection,
freedom and projection vectors, in addition to the reference
points, zone pointers and loop counter.
2023-12-21 16:31:30 +08:00
Po Lu
e6d8e23ede * src/sfnt.c (GETINFO): Implement undocumented selector bit 5. 2023-12-21 14:35:18 +08:00
Po Lu
22da40a5e5 Accept empty contours in glyphs
* src/sfnt.c (sfnt_decompose_glyph_1, sfnt_decompose_glyph_2):
Accept empty contours, for they are not invalid, just redundant.
2023-12-21 13:37:49 +08:00
Stefan Monnier
4239c27f38 * lisp/register.el (register-read-with-preview-fancy): Fit in 80 columns 2023-12-20 22:39:44 -05:00
Po Lu
3aa9fbf4fa Correct defcustoms in register.el
* lisp/register.el (register-preview-default-keys)
(register-use-preview): Render :version tags strings.
2023-12-21 09:37:04 +08:00
João Távora
02b99db661 Jsonrpc: deal with nested synchronous jsonrpc-request
See bug#67945

* lisp/jsonrpc.el (jsonrpc-connection): Add -sync-request-alist
(jsonrpc-connection-receive): Rework.
(jsonrpc-request): Rework.  Pass SYNC-REQUEST to
jsonrpc-async-request-1.
(jsonrpc--process-sentinel): Simplify.
(jsonrpc--schedule): New helper.
(jsonrpc--continue): New helper.
(jsonrpc--async-request-1): Rework.
(jsonrpc--process-sentinel): Also cancel deferred action timers.
(Version): Bump to 1.0.21
2023-12-20 18:57:18 -06:00
João Távora
222f563f13 Jsonrpc: rework implementation of continuations
Preparatory work for fix of bug#67945

* lisp/jsonrpc.el (jsonrpc-connection): Change slots.
(jsonrpc--remove): New helper
(jsonrpc-forget-pending-continuations)
(jsonrpc-connection-receive)
(jsonrpc-request)
(jsonrpc--process-sentinel)
(jsonrpc--async-request-1)
(jsonrpc--async-request-1): Rework.
(jsonrpc-continuation-count): New convenience helper.

* lisp/progmodes/eglot.el (eglot--mode-line-format): Stop using
jsonrpc--request-continuations.
2023-12-20 18:57:18 -06:00
João Távora
018cf86605 trace.el: use cl-print
Any non-trivial EIEO object in particular is impossible to read in the
*trace-output* buffer without this.  Functions, hash-tables, etc now
print as they do in backtrace buffers.

* lisp/emacs-lisp/trace.el (cl-print): Require it
(trace-entry-message, trace-exit-message): Use cl-prin1-to-string
2023-12-20 18:57:18 -06:00
Stefan Monnier
62bf0b7a57 Merge commit 'new-fix-for-bug-60819' 2023-12-20 18:36:26 -05:00
Stefan Monnier
7275cecdf9 * lisp/cedet/semantic/db.el (semanticdb-create-database): Remove obsolete arg 2023-12-20 17:50:48 -05:00
Stefan Monnier
40dafa9af0 * lisp/org/org-src.el (org-src-font-lock-fontify-block): Fix point-min /= 1 2023-12-20 17:50:09 -05:00
Stefan Monnier
c9021c62f2 (bibtex-font-lock-keywords): Expose a lambda to the compiler
Also use #' to quote function names.

* lisp/textmodes/bibtex.el (bibtex-font-lock-keywords): Expose a
lambda to the compiler.
2023-12-20 17:49:21 -05:00
Matto Fransen
b088cf025b Specific rcirc log file time stamp format
The time stamp format in the chat buffer may now
differ from the format in the log files.
* doc/misc/rcirc.texi: Document new variable
* lisp/net/rcirc.el (rcirc-log-time-format):
Custom variable for the format.  (bug#67597)

Copyright-paperwork-exempt: yes
2023-12-20 20:06:11 +01:00
Thierry Volpiatto
2e5d50ee43
Rename *basic symbols and words to traditional in register
* lisp/register.el (register-use-preview): Do it.
(register-read-with-preview-traditional): Renamed from
register-read-with-preview-basic.
2023-12-20 18:14:04 +01:00
Thierry Volpiatto
b499d4f65a
Fix condition in register-read-with-preview-fancy
Now with have :noconfirm no need to check for '(set modify) otherwise
we fail as well in kmacros when register-use-preview is t.
The conditions should not be hard coded in
register-read-with-preview-fancy but in the cl-defmethod
register-command-info for each command.

* lisp/register.el (register-read-with-preview-fancy): Remove now
unneeded condition.
2023-12-20 18:14:03 +01:00
Stefan Monnier
73acd543cb
Fix issue with register commands in kmacro
Using post-command-hook in minibuffer-setup-hook instead of a timer
allow running exit-minibuffer without delay and ensure the serie of
commands used in a kmacro run synchronously.

* lisp/register.el (register-read-with-preview-fancy): Do it.
2023-12-20 18:14:03 +01:00
Thierry Volpiatto
67e16d37e9
Provide emacs-29 behavior for register-preview
It is now the default with a value of register-use-preview eq to
basic.
To change this one have now to customize register-use-preview to
another value.

* lisp/register.el (register-preview-delay): Remove obsolescence.
(register--read-with-preview-function): New.
(register-use-preview): New option basic, it is now the default.
(register-preview-default-1): New the register-preview-default used by
`register-read-with-preview-fancy`.
(register-preview-default): Restored (same as Emacs-29).
(register--preview-function): Generic fn that return the right
function for register--preview-function.
(register-preview): Restored (same behavior as Emacs-29).
(register-preview-1): Used by `register-read-with-preview-fancy'.
(register-read-with-preview-basic): The old
register-read-with-preview.
(register-read-with-preview-fancy): The new
register-read-with-preview.
2023-12-20 18:14:02 +01:00
Thierry Volpiatto
46367e0a5c
Don't confirm with RET even when overwriting in register commands
This happen when register-use-preview is nil or never.
This reproduce what we had previously in 29.1 but with filtering in
the preview and default registers are provided for the commands of
type 'set'.

This is implemented with cl-defmethod to keep the code as much as
possible configurable.

* lisp/register.el (register-preview-info): New slot.
(register-command-info): Add new methods for copy-to-register,
point-to-register, number-to-register,
window-configuration-to-register, frameset-to-register and
copy-rectangle-to-register.
(register-read-with-preview): Bind noconfirm.
2023-12-20 18:14:01 +01:00
Dmitry Gutov
0d518b78d7 project--read-file-cpd-relative: Don't abbreviate at all
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Don't abbreviate at all, only suffixes are shown anyway.
And expand-file-name is slightly faster.
2023-12-20 17:34:12 +02:00
Dmitry Gutov
338409c1f1 Fix project-find-file history (with project--read-file-cpd-relative)
* lisp/progmodes/project.el (project--transplant-file-name):
Don't abbreviate here (bug#67901, bug#63829).
(project--read-file-cpd-relative): Do it here instead.  The reader
functions should decide on the preferred format themselves.
2023-12-20 17:20:26 +02:00
Dmitry Gutov
f248960c71 Add "back" button on top of the pre-rename vc-print-log buffer
* lisp/vc/vc.el (log-view-vc-prev-revision)
(log-view-vc-prev-fileset): New dynamic variables (bug#55871).
(vc-print-log-renamed-add-button): Extract from
'vc-print-log-setup-buttons'.  Bind the above variables to convey
the current revision and fileset to 'vc-print-log-internal'.
(vc-print-log-internal): Use it also here, to print a "back"
button above the log when 'log-view-vc-prev-fileset' is set.
2023-12-20 00:24:37 +02:00
Mattias Engdegård
7c1c251916 Calc: speed up math-read-preprocess-string (bug#67536)
`math-read-preprocess-string` is one of the bottlenecks of `calc-eval`
and was unnecessarily slow even with no substitutions made.
This affected org-mode in particular, where `calc-eval` is called
repeatedly to recalculate tables.

Reported by Raffael Stocker who also wrote the unit tests here.

* lisp/calc/calc-aent.el (math--read-preprocess-re-cache): New.
(math-read-preprocess-string):
Use math--read-preprocess-re-cache, first computing it if necessary.
* test/lisp/calc/calc-tests.el (calc-math-read-preprocess-string):
New test.
2023-12-19 17:11:07 +01:00
Mattias Engdegård
ade814a226 ; * lisp/progmodes/rust-ts-mode.el: Escape asterisks in regexp. 2023-12-19 17:10:19 +01:00
Eli Zaretskii
281be72422 ; * src/eval.c (syms_of_eval) <debugger>: Doc fix. 2023-12-19 14:20:24 +02:00
João Távora
c0c79b0b46 Fido-mode: don't error if case-fold-search is globally nil
bug#67884

To prevent errors, the same case-fold-search setting used for
originally selecting the candidate should be used when scoring it.

* lisp/minibuffer.el (completion--flex-score): Fix
2023-12-19 04:07:17 -06:00
Po Lu
0a57e1cd2c Improve efficiency of operations involving font interpreter scale
* src/sfnt.c (sfnt_mul_f26dot6_fixed): Correct rounding
constant.
(sfnt_make_interpreter, SSW, WCVTF, sfnt_compute_phantom_points)
(sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_1)
(sfnt_vary_interpreter, sfnt_check_ssw): Account for the
fractional bits in a f26dot6 when computing the interpreter
scale factor.
2023-12-19 16:42:38 +08:00
Po Lu
d0e3dfa764 Properly sign-extend freedom and projection vector values
* src/sfnt.c (GPV, GFV): Cast versors to int32_t.
2023-12-19 14:41:38 +08:00
Po Lu
f2693751dd Further corrections to font scaling
* src/sfnt.c (sfnt_dot_fix_14): Correct typo in final division.
(sfnt_compute_phantom_points): New parameters S1 and S2, into
which unrounded phantom point coordinates are saved.
(sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_2)
(sfnt_interpret_compound_glyph_1): Adjust correspondingly.

* src/sfntfont.c (sfntfont_get_glyph_outline): Delete redundant
branch.
2023-12-19 13:41:16 +08:00
João Távora
20e39a12e4 ; Small copyedits to doc/misc/eglot.texi
Motivated in part by bug#67870 and bug#67609.

* doc/misc/eglot.texi (Quick Start): Reword
(Eglot Features): Reword.
(Eglot Commands): Fix typo.
2023-12-18 18:20:17 -06:00
Stefan Monnier
6937182a0e debug.el: Straighten the code that find the "base" of the backtrace
Let the caller tell us clearly where is the base of the backtrace,
if it's not `debug`.  This is done by passing a new `:backtrace-base`
keyword argument to `debug`.

Then use this info systematically in all the places where we access
the real C-level backtrace, to try and avoid inconsistencies and brittle
code that tries to enumerate the expected frames we're in.

* src/eval.c (get_backtrace_starting_at): Add support for offsets in the
`base` argument.
(Fbacktrace_debug): Add optional `base` argument.

* lisp/emacs-lisp/debug.el (debug, debugger-frame, debugger-frame-clear):
Use `debugger--backtrace-base` when calling `backtrace-debug`.
(debugger-setup-buffer): Use `debugger--backtrace-base`
when calling `backtrace-get-frames`.
(debugger-frame-number): Drop `skip-base` arg, assume it's never nil.
Add sanity check.
(debugger--backtrace-base): Use the `:backtrace-base` info
in `debugger-args`.
(debugger-eval-expression): Adjust call to `debugger-frame-number`.
(debug--implement-debug-on-entry): Pass appropriate `:backtrace-base`.
2023-12-18 17:52:58 -05:00
Po Lu
1d5d2f16c3 Further fixes for problems uncovered by the previous fix
* src/sfnt.c (sfnt_deltap): Enable deltap instructions again,
since they now serve a purpose.
(sfnt_compute_phantom_points): Round phantom points to match the
behavior of other TrueType scalers.
2023-12-18 22:14:22 +08:00
Po Lu
1abba7bfa4 ; * src/sfnt.c: Fix typo. 2023-12-18 20:58:53 +08:00
Po Lu
a54bec26c4 * src/sfnt.c (sfnt_interpret_mdap): Correct MDAP opcode. 2023-12-18 20:57:24 +08:00