Po Lu [Mon, 8 Jan 2024 07:32:07 +0000 (15:32 +0800)]
Properly instruct Italic Arial or BS Mono at small PPEM sizes
* src/sfnt.c (sfnt_read_simple_glyph): Correct alignment errors.
(PUSH2_UNCHECKED): Don't shift negative signed value to the
left.
(SLOOP): Permit LOOP to be set to 0, which inhibits the
execution of instructions it affects.
(sfnt_address_zp2, sfnt_address_zp1, sfnt_address_zp0): Permit X
and Y to be NULL.
(sfnt_dot_fix_14): Guarantee that the final value is rounded to
negative infinity, not zero.
(sfnt_project_zp1_zp0_org): New function.
(sfnt_interpret_mdrp): Avoid rounding issues by computing
original distance from unscaled coordinates, if at all possible.
(sfnt_interpret_simple_glyph, sfnt_interpret_compound_glyph_2):
Set zone->simple.
(all_tests) <LOOP>: Update test.
(sfnt_identify_instruction, main): Adjust tests.
* src/sfnt.h (struct sfnt_interpreter_zone): New field simple.
Po Lu [Mon, 8 Jan 2024 07:26:50 +0000 (15:26 +0800)]
; * etc/PROBLEMS: Remove several resolved problems.
Stefan Kangas [Sun, 7 Jan 2024 21:19:06 +0000 (22:19 +0100)]
Remove redundant conversion from bool to bool
* src/xdisp.c (maybe_produce_line_number): Remove redundant conversion
of the value of an expression from bool to bool.
Stefan Kangas [Sun, 7 Jan 2024 21:07:45 +0000 (22:07 +0100)]
Support string literals in build_string.cocci
* admin/coccinelle/build_string.cocci: Support string literals.
Stefan Kangas [Sun, 7 Jan 2024 20:43:56 +0000 (21:43 +0100)]
; Delete a superfluous bitwise 'or'
* src/xterm.c (x_term_init): Avoid bitwise 'or' using the same
variable as both operands (X | X => X).
F. Jason Park [Fri, 5 Jan 2024 15:20:34 +0000 (07:20 -0800)]
Clarify purpose of module aliases in ERC
* doc/misc/erc.texi: Mention that aliases should not be defined for
new modules.
* lisp/erc/erc-common.el (define-erc-module): Refactor slightly for
readability.
(erc-with-all-buffers-of-server): Redo doc string.
* lisp/erc/erc-pcomplete.el: Declare `completion' module's feature and
group as being `erc-pcomplete'.
* test/lisp/erc/erc-tests.el (erc--find-group--real): Assert group
lookup works for "normalized" module name `completion' of
`erc-pcomplete-mode'.
F. Jason Park [Thu, 4 Jan 2024 07:10:55 +0000 (23:10 -0800)]
Make ERC's format catalogs more extensible
* lisp/erc/erc-common.el (erc--define-catalog): Accept a `:parent'
keyword to allow for extending an existing catalog by overriding some
subset of defined entries.
(erc-define-message-format-catalog): Add edebug spec.
* lisp/erc/erc.el (erc-retrieve-catalog-entry): Check parent for
definition before looking to `default-toplevel-value'.
* test/lisp/erc/erc-tests.el (erc-retrieve-catalog-entry): Add test
case for inheritance.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-pp-propertized-parts): Fix bug in convenience
command. (Bug#67677)
F. Jason Park [Wed, 3 Jan 2024 10:00:45 +0000 (02:00 -0800)]
Allow setting `erc-split-line-length' to zero
* etc/ERC-NEWS: Mention that `erc-flood-protect' no longer affects
line splitting.
* lisp/erc/erc-backend.el (erc-split-line-length): Mention ways for
modules to suppress line splitting entirely.
(erc--split-line): Exit loop instead of asserting progress has been
made.
* lisp/erc/erc.el (erc--split-lines): Don't split input when
option `erc-split-line-length' is zero.
* test/lisp/erc/erc-tests.el (erc--split-line): Assert behavior when
`erc-split-line-length' is 0. (Bug#62947)
F. Jason Park [Tue, 2 Jan 2024 07:18:54 +0000 (23:18 -0800)]
Use global window hook for erc-keep-place-indicator
* lisp/erc/erc-goodies.el
(erc--keep-place-indicator-on-window-buffer-change): Expect a frame
instead of a window argument for the only parameter, which is now
ignored, and exit early when entering a minibuffer.
(erc--keep-place-indicator-setup): Remove function because local
modules don't need a separate setup function.
(erc-keep-place-indicator-mode): Add autoload cookie even though this
is a local module, since this particular one is intended for more
granular, interactive activation. This is mostly a formality because
it only matters in the unlikely event `erc-modules' is missing all
other modules defined in `erc-goodies'.
(erc-keep-place-indicator-mode, erc-keep-place-indicator-enable,
erc-keep-place-indicator-disable): Move functionality from
`erc--keep-place-indicator-setup' into enable body. Use global
instead of local members for `erc-keep-place-mode-hook' and
`window-buffer-change-functions'.
(erc--keep-place-indicator-on-global-module): Perform necessary action
in all ERC buffers, not just the current one, where the user has
ostensibly disabled `erc-keep-place-mode'.
* test/lisp/erc/erc-goodies-tests.el
(erc-goodies-tests--assert-kp-indicator-on,
erc-goodies-tests--assert-kp-indicator-off): Change expected hook
membership for dependencies from global to local.
(erc-goodies-tests--keep-place-indicator): Use new helpers from
the `erc-tests-common' library. (Bug#59943)
F. Jason Park [Mon, 1 Jan 2024 08:34:53 +0000 (00:34 -0800)]
; Make erc--send-input-lines a normal function again
* lisp/erc/erc.el (erc--send-input-lines): Revert portion of
174b3dd9bd78c662ce9fff78404dcfa02259d21b "Make nested input handling
more robust in ERC" that converted this from a function to a method.
Instead, defer change until it's needed, likely for bug#49860. Also,
don't inadvertently allow overloading of `insertp' because user code
can legitimately set that to a function, which we then blindly call.
Instead, hard-code it to the only expected alternate display function.
F. Jason Park [Sat, 6 Jan 2024 21:32:42 +0000 (13:32 -0800)]
; doc/misc/erc.texi: Improve SASL intro.
Juri Linkov [Sun, 7 Jan 2024 18:04:06 +0000 (20:04 +0200)]
Support more metadata properties in completion-category-overrides (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables): Add
to the table of completion-category-overrides new items:
`cycle-sort-function', `group-function', `annotation-function',
`affixation-function'.
* lisp/minibuffer.el (completion-metadata-get): Try also to get
the property from completion-category-overrides by category.
Suggested by Daniel Mendler <mail@daniel-mendler.de>.
(completion-category-defaults): Add new properties to docstring.
(completion-category-overrides): Add customization for new
properties: `cycle-sort-function', `group-function',
`annotation-function', `affixation-function'.
(completion-metadata-override-get): Remove function.
(minibuffer-completion-help): Replace 'completion-metadata-override-get'
with 'completion-metadata-get' for 'display-sort-function'.
Michael Albinus [Sun, 7 Jan 2024 11:39:47 +0000 (12:39 +0100)]
Handle local default directory in connection-local-value
* lisp/files-x.el (connection-local-p, connection-local-value):
Handle local `default-directory'.
* test/lisp/files-x-tests.el (files-x-test-connection-local-value):
Extend test.
Stefan Monnier [Sun, 7 Jan 2024 05:02:08 +0000 (00:02 -0500)]
(jsonrpc--log-event): Try and fix bug#68072
* lisp/jsonrpc.el (jsonrpc--log-event): Force the use of
`lisp-indent-function` in `pp-to-string`.
João Távora [Sat, 6 Jan 2024 23:56:33 +0000 (17:56 -0600)]
Eglot: careful when invoking code actions on no symbol at all
Invoking code actions without a marked region or over a symbol
will trip certain servers up since BEG and END in eglot-code-actions
will be nil, causing 'eglot--pos-to-lsp-position' to assume point (which
is OK) but the 'flymake-diagnostics' call to return all diagnostics.
This causes an absolutely undecipherable JavaScript backtrace to be
sent back to Eglot from typescript-language-server.
Github-reference: https://github.com/joaotavora/eglot/issues/847
* lisp/progmodes/eglot.el (eglot--code-action-bounds): Avoid returning
(list nil nil)
Stefan Monnier [Sat, 6 Jan 2024 23:50:25 +0000 (18:50 -0500)]
(describe-package-1): Fix bug#68288
Fix support for multiple maintainers in `describe-package` and
in `package-report-bug`.
* lisp/emacs-lisp/package.el (describe-package-1): There's no
`:maintainers:`, instead `:maintainer` can hold a list of maintainers.
(package-maintainers): Adapt to the possibility of having
multiple maintainers.
(package-report-bug): Don't burp if the package is not installed.
Paul Eggert [Sat, 6 Jan 2024 21:39:57 +0000 (13:39 -0800)]
Pacify Ubuntu GCC 13.2 in x_get_local_selection
* src/xselect.c: Ignore -Wanalyzer-null-dereference,
to work around GCC bug 102671.
Paul Eggert [Sat, 6 Jan 2024 21:38:13 +0000 (13:38 -0800)]
Pacify Ubuntu GCC 13.2 in set_marker_internal
* src/marker.c (set_marker_internal): Ignore
-Wanalyzer-deref-before-check, to work around GCC bug 113253.
Michael Albinus [Sat, 6 Jan 2024 17:15:23 +0000 (18:15 +0100)]
Complete change of ert-remote-temporary-file-directory
* lisp/emacs-lisp/ert-x.el: Adapt comment.
* test/lisp/net/tramp-tests.el (ert-remote-temporary-file-directory):
Make it a defvar.
Michael Albinus [Sat, 6 Jan 2024 17:14:15 +0000 (18:14 +0100)]
Minor change in tramp.texi
* doc/misc/tramp.texi (Obtaining @value{tramp}): Mention the ELPA
Tramp manual.
Michael Albinus [Sat, 6 Jan 2024 17:12:47 +0000 (18:12 +0100)]
Adapt Tramp version
* doc/misc/trampver.texi:
* lisp/net/trampver.el (tramp-version): Adapt Tramp versions.
Steven Allen [Fri, 29 Dec 2023 17:53:05 +0000 (09:53 -0800)]
Make 'advice-remove' interactive
`ad-advice-remove' is already interactive, but it doesn't work with
new-style advice.
* lisp/emacs-lisp/nadvice.el (advice-remove): Make it
interactive (Bug#67926).
* doc/lispref/functions.texi (Advising Named Functions): Document that
'advice-remove' is now an interactive command.
Eli Zaretskii [Sat, 6 Jan 2024 13:25:29 +0000 (15:25 +0200)]
; * doc/lispref/buffers.texi (Buffer List): Fix merge snafu.
Eli Zaretskii [Sat, 6 Jan 2024 13:20:19 +0000 (08:20 -0500)]
Merge from origin/emacs-29
bf7034048c1 ; * doc/emacs/custom.texi (Changing a Variable): Update e...
466d1c98a9e Fix icons.el when icon does not exist as a file
2a861124e89 ; Improve documentation of 'buffer-match-p'
dc9d02f8a01 * lisp/isearch.el (isearch-search-and-update): Let-bind '...
9308d9a74ab * src/comp.c (Fcomp__compile_ctxt_to_file): Fix hash tabl...
a2a6619b282 Provide decent documentation for 'help-quick'
ab66b749a27 ; * src/window.c (Fset_window_margins): Doc fix.
1a677d1429d treesit--pre-syntax-ppss: Fix args-out-of-range in intern...
Eli Zaretskii [Sat, 6 Jan 2024 11:45:33 +0000 (13:45 +0200)]
; * doc/emacs/custom.texi (Changing a Variable): Update example (bug#68279).
Eli Zaretskii [Sat, 6 Jan 2024 11:26:29 +0000 (13:26 +0200)]
Fix icons.el when icon does not exist as a file
* lisp/emacs-lisp/icons.el (icons--create): Handle the case when
ICON is a file that doesn't exists or is unreadable. Suggested by
David Ponce <da_vid@orange.fr>. (Bug#66846)
Eli Zaretskii [Sat, 6 Jan 2024 10:44:26 +0000 (12:44 +0200)]
; Minor copyedits of doc of 'handler-bind'
* doc/lispref/control.texi (Handling Errors): Fix wording and
punctuation.
Eli Zaretskii [Sat, 6 Jan 2024 10:33:44 +0000 (12:33 +0200)]
Fix last change (bug#67930)
* lisp/progmodes/compile.el (compilation--expand-fn): Renamed from
'safe-expand-file-name'; all callers changed. Doc fix.
Jurgen De Backer [Thu, 4 Jan 2024 11:10:56 +0000 (11:10 +0000)]
Fix file-name resolution in *compilation* and *grep* buffers
Resolving symlinks in file names could lead to non-existent files
if some leading directory is a symlink to its parent.
In emacs 28 'expand-file-name' was replaced by 'file-truename' to
solve bug #8035.
* lisp/progmodes/compile.el (safe-expand-file-name): New function.
(compilation-find-file-1): Call 'safe-expand-file-name'. (Bug#67930)
Martin Rudalics [Wed, 3 Jan 2024 10:35:25 +0000 (11:35 +0100)]
Fix use of 'display-buffer-alist' for Info buffers
* lisp/info.el (info-pop-to-buffer): New function.
(info-other-window, info, Info-find-node, Info-revert-find-node)
(Info-next, Info-prev, Info-up, info-display-manual): Call
'info-pop-to-buffer'. (Bug#68081)
Eli Zaretskii [Sat, 6 Jan 2024 09:15:31 +0000 (11:15 +0200)]
; Improve documentation of 'buffer-match-p'
* doc/lispref/buffers.texi (Buffer List):
* doc/lispref/windows.texi (Choosing Window): Add caveats for
calling 'buffer-match-p' too early, when CONDITION is
'derived-mode' or 'major-mode'. (Bug#68081)
Po Lu [Sat, 6 Jan 2024 07:28:14 +0000 (15:28 +0800)]
Revert "Add new `swap` macro and use it"
typeof is an extension which does not exist in Standard C, so macros
using it are unsuitable for inclusion in Emacs.
This reverts commit
37889523278fe65733938fb11c3701898309961c.
Po Lu [Sat, 6 Jan 2024 07:24:58 +0000 (15:24 +0800)]
Properly parse TTC tables with digital signatures
* src/sfnt.c (sfnt_read_ttc_header): Don't inadvertently
overwrite first two offsets while reading the digital signature.
Stefan Kangas [Sat, 6 Jan 2024 07:22:08 +0000 (08:22 +0100)]
Add new `swap` macro and use it
A `swap` macro prevents programming errors and is more concise.
It is a natural addition to our existing `min` and `max` macros.
* src/lisp.h (swap): New macro.
* lwlib/xlwmenu.c (draw_shadow_rectangle, draw_shadow_rhombus):
* src/androidterm.c (android_get_surrounding_text):
* src/buffer.c (Fmake_overlay, modify_overlay, Fmove_overlay):
* src/dispnew.c (swap_glyphs_in_rows, reverse_rows):
* src/editfns.c (Finsert_buffer_substring)
(Fcompare_buffer_substrings):
* src/eval.c (run_hook_wrapped_funcall):
* src/fns.c (extract_data_from_object):
* src/regex-emacs.c (forall_firstchar_1):
* src/textconv.c (textconv_query, get_extracted_text)
(get_surrounding_text):
* src/textprop.c (validate_interval_range)
(verify_interval_modification):
* src/w32uniscribe.c (OTF_INT16_VAL):
* src/xfaces.c (load_face_colors):
* src/xterm.c (SWAPCARD32): Prefer using above macro to open-coding.
Po Lu [Fri, 5 Jan 2024 09:51:40 +0000 (17:51 +0800)]
; Update Android port splash screen message
* lisp/term/android-win.el (android-after-splash-screen): Insert
missing newline.
Nicholas Vollmer [Fri, 5 Jan 2024 17:22:10 +0000 (12:22 -0500)]
Use special-mode in checkdoc status buffer
* lisp/emacs-lisp/checkdoc.el (checkdoc-display-status-buffer): Use
`special-mode'. (Bug#68268)
Jeremy Bryant [Thu, 4 Jan 2024 23:58:19 +0000 (23:58 +0000)]
* lisp/mail/rmail.el (rmail-epa-decrypt): Fix typo (bug#68248).
Juri Linkov [Fri, 5 Jan 2024 07:39:04 +0000 (09:39 +0200)]
* lisp/isearch.el (isearch-search-and-update): Let-bind 'isearch-cmds'.
When 'isearch-wrap-pause' is 'no' or 'no-ding', let-bind 'isearch-cmds'
to avoid changing it by 'isearch-push-state' in 'isearch-repeat',
so that a later DEL (isearch-delete-char) doesn't stop at the
intermediate failing state (bug#68158).
Eli Zaretskii [Fri, 5 Jan 2024 07:38:58 +0000 (09:38 +0200)]
Improve documentation of derived modes and their parents
* doc/lispref/modes.texi (Derived Modes): Expand documentation of
functions that manipulate parent modes of a derived mode.
Document 'provided-mode-derived-p'. Improve indexing.
* lisp/subr.el (derived-mode-all-parents)
(derived-mode-add-parents, provided-mode-derived-p)
(derived-mode-p): Doc fixes.
Stefan Monnier [Fri, 5 Jan 2024 03:12:14 +0000 (22:12 -0500)]
* lisp/startup.el (startup--load-user-init-file): Fix last change
Use `condition-case-unless-debug` only in the branch when
`--debug-init` is not in use, otherwise it prevents `handler-bind`
from triggering the debugger.
Graham Marlow [Tue, 2 Jan 2024 21:58:22 +0000 (13:58 -0800)]
Improve yaml-ts-mode fill-paragraph (bug#68226)
When using fill-paragraph on a block_scalar (the element within a
block_node) fill the paragraph such that the contents remain
within the block_node. This fixes the previous behavior that would
clobber a block_node.
* lisp/textmodes/yaml-ts-mode.el: Add yaml-ts-mode--fill-paragraph
Stefan Monnier [Thu, 4 Jan 2024 23:46:16 +0000 (18:46 -0500)]
Merge branch 'handler-bind'
Stefan Monnier [Thu, 4 Jan 2024 23:44:43 +0000 (18:44 -0500)]
Avoid `defconst` for vars which we modify
If we `setq` or let-bind a var, then presumably it's not a const.
* lisp/bookmark.el (bookmark-bmenu-buffer):
* lisp/char-fold.el (char-fold-table):
* lisp/pcmpl-linux.el (pcmpl-linux-fs-modules-path-format)
(pcmpl-linux-mtab-file):
* lisp/emacs-lisp/bytecomp.el (byte-compile-log-buffer):
* lisp/emacs-lisp/check-declare.el (check-declare-warning-buffer):
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory):
* lisp/erc/erc.el (erc-default-port):
* lisp/net/tramp.el (tramp-unknown-id-string)
(tramp-unknown-id-integer):
* lisp/url/url-util.el (url-unreserved-chars):
Stefan Monnier [Thu, 4 Jan 2024 21:28:39 +0000 (16:28 -0500)]
Improve `handler-bind` doc
* doc/lispref/control.texi (Handling Errors) <handler-bind>: Expand.
* doc/lispref/variables.texi (Variable Scoping): Mention static scoping.
Stefan Monnier [Tue, 26 Dec 2023 02:41:08 +0000 (21:41 -0500)]
(backtrace-on-redisplay-error): Use `handler-bind`
Reimplement `backtrace-on-redisplay-error` using `push_handler_bind`.
This moves the code from `signal_or_quit` to `xdisp.c` and
`debug-early.el`.
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace):
Add `base` arg to strip "internal" frames.
(debug--early): New function, extracted from `debug-early`.
(debug-early, debug-early--handler): Use it.
(debug-early--muted): New function, extracted (translated) from
`signal_or_quit`; trim the buffer to a max of 10 backtraces.
* src/xdisp.c (funcall_with_backtraces): New function.
(dsafe_calln): Use it.
(syms_of_xdisp): Defsym `Qdebug_early__muted`.
* src/eval.c (redisplay_deep_handler): Delete var.
(init_eval, internal_condition_case_n): Don't set it any more.
(backtrace_yet): Delete var.
(signal_or_quit): Remove special case for `backtrace_on_redisplay_error`.
* src/keyboard.c (command_loop_1): Don't set `backtrace_yet` any more.
* src/lisp.h (backtrace_yet): Don't declare.
Stefan Monnier [Wed, 27 Dec 2023 20:06:32 +0000 (15:06 -0500)]
(signal_or_quit): Preserve error object identity
Make sure we build the (ERROR-SYMBOL . ERROR-DATA) object only once
when signaling an error, so that its `eq` identity can be used.
It also gets us a tiny bit closer to having real "error objects"
like in most other current programming languages.
* src/eval.c (maybe_call_debugger): Change arglist to receive the error
object instead of receiving the signal and the data separately.
(signal_or_quit): Build the error object right at the beginning so it
stays `eq` to itself.
Rename the `keyboard_quit` arg to `continuable` so say what it does
rather than what it's used for.
(signal_quit_p): Change arg to be the error object rather than just the
error-symbol.
* src/keyboard.c (cmd_error_internal, menu_item_eval_property_1):
Adjust calls to `signal_quit_p` accordingly.
* test/src/eval-tests.el (eval-tests--error-id): New test.
Stefan Monnier [Wed, 27 Dec 2023 04:56:09 +0000 (23:56 -0500)]
eval.c: Add new var `lisp-eval-depth-reserve`
Rather than blindly increase `max-lisp-eval-depth` when entering the
debugger or running `signal-hook-function`, use this new "reserve"
to keep track of how much we have grown the stack for "debugger"
purposes so that for example recursive calls to `signal-hook-function`
can't eat up the whole C stack.
* src/eval.c (max_ensure_room): Rewrite.
(restore_stack_limits): Move before `max_ensure_room`. Rewrite.
(call_debugger, signal_or_quit): Adjust calls accordingly.
Also grow `max-lisp-eval-depth` for `hander-bind` handlers.
(init_eval_once): Don't initialize `max_lisp_eval_depth` here.
(syms_of_eval): Initialize it here instead.
Add new var `lisp-eval-depth-reserve`.
* doc/lispref/eval.texi (Eval): Add `lisp-eval-depth-reserve`.
Stefan Monnier [Tue, 26 Dec 2023 04:55:53 +0000 (23:55 -0500)]
(macroexp--with-extended-form-stack): Use plain `let`
`macroexp--with-extended-form-stack` used manual push/pop so that upon
non-local exits the "deeper" value is kept, so the error handler gets
to know what was the deeper value, so as to be able to compute more
precise error locations.
Replace this with a `handler-bind` which catches that "deeper" value
more explicitly.
* lisp/emacs-lisp/bytecomp.el (bytecomp--displaying-warnings):
Use `handler-bind` to catch the value of `byte-compile-form-stack`
at the time of the error. Also consolidate the duplicated code.
* lisp/emacs-lisp/macroexp.el (macroexp--with-extended-form-stack):
Use a plain dynbound let-rebinding.
Stefan Monnier [Thu, 21 Dec 2023 04:31:39 +0000 (23:31 -0500)]
Move batch backtrace code to `top_level_2`
Move ad-hoc code meant to ease debugging of bootstrap (and batch mode)
to `top_level_2` so it doesn't pollute `signal_or_quit`.
* src/lisp.h (pop_handler, push_handler_bind): Declare.
* src/keyboard.c (top_level_2): Setup an error handler to call
`debug-early` when noninteractive.
* src/eval.c (pop_handler): Not static any more.
(signal_or_quit): Remove special case for noninteractive use.
(push_handler_bind): New function, extracted from `Fhandler_bind_1`.
(Fhandler_bind_1): Use it.
(syms_of_eval): Declare `Qdebug_early__handler`.
* lisp/emacs-lisp/debug-early.el (debug-early-backtrace): Weed out
frames below `debug-early`.
(debug-early--handler): New function.
Stefan Monnier [Wed, 20 Dec 2023 00:46:47 +0000 (19:46 -0500)]
startup.el: Use `handler-bind` to implement `--debug-init`
This provides a more reliable fix for bug#65267 since we don't
touch `debug-on-error` nor `debug-ignore-errors` any more.
* lisp/startup.el (startup--debug): New function.
(startup--load-user-init-file): Use it and `handler-bind` instead of
let-binding `debug-on-error`.
Stefan Monnier [Thu, 28 Dec 2023 05:49:39 +0000 (00:49 -0500)]
emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test
That test relied on `debugger` and `debug-on-signal` in a way that
doesn't work with the new ERT code.
* test/src/emacs-module-tests.el (mod-test-non-local-exit-signal-test):
Use `handler-bind` rather than the debugger.
Mattias Engdegård [Wed, 27 Dec 2023 10:32:49 +0000 (11:32 +0100)]
Use handler-bind to repair bytecomp-tests
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--error-frame, bytecomp--byte-op-error-backtrace):
Make test pass again and simplify, using handler-bind instead
of the previous debugger hack.
Stefan Monnier [Thu, 28 Dec 2023 05:46:36 +0000 (00:46 -0500)]
Fix ert-tests.el for the new `handler-bind` code
Now that `ert.el` uses `handler-bind` instead of `debugger`, some
details of the behavior have changed. More specifically,
three tests are now broken, but these basically tested the failure
of ERT's machinery to record errors when ERT was run within
a `condition-case`.
AFAICT, these tests do not check for a behavior that we want,
so rather than "fix" them, I deleted them (bug#67862).
* test/lisp/emacs-lisp/ert-tests.el (ert-test-error-debug)
(ert-test-fail-debug-with-condition-case): Delete.
(ert-test-should-failure-debugging): Don't use `ert-debug-on-error`.
(ert-test-with-demoted-errors): It now passes. Bug#11218 is fixed!
Stefan Monnier [Tue, 19 Dec 2023 04:57:45 +0000 (23:57 -0500)]
ert.el: Use `handler-bind` to record backtraces
* lisp/emacs-lisp/ert.el (ert--should-signal-hook): Delete function.
(ert--expand-should-1): Don't bind `signal-hook-function`.
(ert--test-execution-info): Remove `next-debugger` slot.
(ert--run-test-debugger): Adjust to new calling convention.
Pass the `:backtrace-base` info to the debugger.
(ert--run-test-internal): Use `handler-bind` rather than let-binding
`debugger` and `debug-on-error`.
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory): Don't
use `defconst` if it's not meant to stay constant (e.g. we let-bind it
in tramp-tests.el).
Stefan Monnier [Tue, 19 Dec 2023 04:47:56 +0000 (23:47 -0500)]
(eval-expression): Fix bug#67196
* lisp/simple.el (eval-expression--debug): New function.
(eval-expression): Use it together with `handler-bind` instead of
let-binding `debug-on-error`.
Stefan Monnier [Tue, 26 Dec 2023 03:32:17 +0000 (22:32 -0500)]
New special form `handler-bind`
AFAIK, this provides the same semantics as Common Lisp's `handler-bind`,
modulo the differences about how error objects and conditions are
represented.
* lisp/subr.el (handler-bind): New macro.
* src/eval.c (pop_handler): New function.
(Fhandler_Bind_1): New function.
(signal_or_quit): Handle new handlertypes `HANDLER` and `SKIP_CONDITIONS`.
(find_handler_clause): Simplify.
(syms_of_eval): Defsubr `Fhandler_bind_1`.
* doc/lispref/control.texi (Handling Errors): Add `handler-bind`.
* test/src/eval-tests.el (eval-tests--handler-bind): New test.
* lisp/emacs-lisp/lisp-mode.el (lisp-font-lock-keywords):
Move 'handler-bind' from CL-only to generic Lisp.
(handler-bind): Remove indentation setting, it now lives in the macro
definition.
Antero Mejr [Thu, 4 Jan 2024 19:49:23 +0000 (19:49 +0000)]
Add file completion for "git blame" to pcomplete
* lisp/pcmpl-git.el (pcomplete/git): Add "blame" to the tracked files
clause. (Bug#68245)
Eli Zaretskii [Thu, 4 Jan 2024 18:47:06 +0000 (20:47 +0200)]
; Fix documentation of last change
* lisp/minibuffer.el (completion-category-overrides): Doc fix.
* doc/emacs/mini.texi (Completion Options): Update documentation
of 'completions-sort'.
* doc/lispref/minibuf.texi (Completion Variables): Fox wording.
Add a cross-reference to where 'completions-sort' is documented.
Juri Linkov [Thu, 4 Jan 2024 17:20:30 +0000 (19:20 +0200)]
Support display-sort-function in completion-category-overrides (bug#68214)
* doc/lispref/minibuf.texi (Completion Variables):
Add 'display-sort-function' to the table of
'completion-category-overrides'.
* lisp/calendar/calendar.el (calendar-read-date): Add metadata
category 'calendar-month' for completing-read reading a month name.
* lisp/minibuffer.el (completion-category-defaults):
Add 'display-sort-function' with identity for the category 'calendar-month'.
(completion-category-overrides): Add customization for completion sorting
with 'display-sort-function' and a choice like in 'completions-sort'.
(completion-metadata-override-get): New function.
(minibuffer-completion-help): Use 'completion-metadata-override-get'
instead of 'completion-metadata-get' to get sort-fun from
'display-sort-function'.
Morgan Willcock [Sun, 31 Dec 2023 20:47:17 +0000 (20:47 +0000)]
Fix last change in tempo.el
* lisp/tempo.el: Set marker type for tempo-region-start to
move when text is inserted at its position. This prevents
the template from inserting text into the region. (Bug#68185)
Morgan Willcock [Sun, 31 Dec 2023 20:47:17 +0000 (20:47 +0000)]
Ensure indent-region argument order in tempo.el is correct
* lisp/tempo.el (tempo-insert): Call 'indent-region' with the
stored region markers to ensure that the start and end arguments
are used in the correct order. (Bug#68185)
Andrea Corallo [Thu, 4 Jan 2024 10:06:41 +0000 (11:06 +0100)]
* src/comp.c (Fcomp__compile_ctxt_to_file): Fix hash table Qunbound use.
Eli Zaretskii [Thu, 4 Jan 2024 09:34:21 +0000 (11:34 +0200)]
Document 'etags-regen-mode' in the Emacs user manual
* doc/emacs/maintaining.texi (Create Tags Table): Document
'etags-regen-mode'.
Eli Zaretskii [Thu, 4 Jan 2024 08:17:30 +0000 (10:17 +0200)]
Provide decent documentation for 'help-quick'
* lisp/help.el (help-quick, help-quick-toggle): Doc fix.
* doc/emacs/help.texi (Help Summary, Misc Help): Document
'help-quick-toggle'.
Stefan Kangas [Thu, 4 Jan 2024 01:41:22 +0000 (02:41 +0100)]
Remove semantic patch for adjusting `XSAVE_*`
* admin/coccinelle/xsave.cocci: Delete file. The corresponding macros
were removed in
4139c98eb5f 2018-06-14 "Remove Lisp_Misc_Save_Value".
Stefan Kangas [Thu, 4 Jan 2024 01:24:13 +0000 (02:24 +0100)]
Prefer build_unibyte_string where applicable
* src/fns.c (syms_of_fns):
* src/image.c (slurp_image): Prefer build_unibyte_string (str) to
make_unibyte_string (str, strlen (str)).
* admin/coccinelle/unibyte_string.cocci: Support string literals.
Stefan Kangas [Thu, 4 Jan 2024 00:49:34 +0000 (01:49 +0100)]
Prefer NILP (x) to EQ (x, Qnil)
* src/image.c (anim_prune_animation_cache):
Prefer NILP (x) to EQ (x, Qnil).
* admin/coccinelle/nilp.cocci: Semantic patch for above change.
Dmitry Gutov [Thu, 4 Jan 2024 01:44:23 +0000 (03:44 +0200)]
New feature: etags-regen-mode
* lisp/progmodes/etags-regen.el: New file (bug#67687).
* etc/NEWS: Mention the addition.
* .dir-locals.el: Add this project's settings for
etags-regen-regexp-alist and etags-regen-ignores.
Eli Zaretskii [Wed, 3 Jan 2024 17:21:56 +0000 (19:21 +0200)]
; * etc/themes/manoj-dark-theme.el (manoj-dark): Fix :box faces.
Eli Zaretskii [Wed, 3 Jan 2024 13:14:41 +0000 (15:14 +0200)]
; * src/window.c (Fset_window_margins): Doc fix.
Eli Zaretskii [Wed, 3 Jan 2024 12:39:30 +0000 (14:39 +0200)]
; * lisp/vc/vc.el (vc-deduce-fileset): Add commentary for bug#68174.
Po Lu [Wed, 3 Jan 2024 05:42:27 +0000 (13:42 +0800)]
Don't magnify extent of shifts by variable glyph interpolation
* src/sfnt.c (sfnt_infer_deltas_2): Correctly index
x_coordinates and y_coordinates computing deltas for plain
shift.
(sfnt_vary_simple_glyph): Copy glyph contents to original_x and
original_y not the first time is create, but before each tuple
is applied.
Stefan Kangas [Wed, 3 Jan 2024 04:22:15 +0000 (05:22 +0100)]
Don't include sheap.h in sysdep.c
The symbol we used from sheap.h (bss_sbrk_did_unexec) was removed with
the introduction of the portable dumper.
* src/sysdep.c: Don't include "sheap.h".
Stefan Kangas [Wed, 3 Jan 2024 04:11:10 +0000 (05:11 +0100)]
Delete obsolete GC debugging code
This code was introduced in 2014 to catch a GC bug that, according to
Paul Eggert in 2019, "seems to have been fixed" (see
2b552f34892
2019-08-21 "Don’t debug fset by default"). It has been marked
obsolete since that time, and no one has mentioned it on our mailing
lists since. Let's just get rid of it.
* src/alloc.c
(SUSPICIOUS_OBJECT_CHECKING) [ENABLE_CHECKING]: Don't define.
(suspicious_free_record, suspicious_objects, suspicious_object_index)
(suspicious_free_history, suspicious_free_history_index)
(note_suspicious_free) [SUSPICIOUS_OBJECT_CHECKING]: Delete.
(find_suspicious_object_in_range)
(detect_suspicious_free): Delete functions.
(cleanup_vector)
(allocate_vectorlike): Don't call above deleted functions.
(Fsuspicious_object): Delete DEFUN.
(syms_of_alloc) <Ssuspicious_object>: Delete defsubr.
Dmitry Gutov [Wed, 3 Jan 2024 00:11:56 +0000 (02:11 +0200)]
(vc-deduce-fileset): Handle log-view-mode derivatives specially
* lisp/vc/vc.el (vc-deduce-fileset):
Handle log-view-mode derivatives specially, that helps after
switching projects (bug#68174).
Eli Zaretskii [Tue, 2 Jan 2024 17:13:55 +0000 (19:13 +0200)]
; * lisp/mail/rmail.el (rmail-epa-decrypt): Fix whitespace.
Eli Zaretskii [Tue, 2 Jan 2024 17:10:33 +0000 (19:10 +0200)]
; Fix compilation errors in completion-preview.el
* lisp/completion-preview.el (mouse-wheel-up-event)
(mouse-wheel-up-alternate-event, mouse-wheel-down-event)
(mouse-wheel-down-alternate-event): Defvar, to avoid warnings and
errors in builds --without-x. (Bug#68213)
Richard Stallman [Tue, 2 Jan 2024 14:45:45 +0000 (09:45 -0500)]
Fix non-permenent decryption to show up temperarily.
In a decrypted mime part, replace CRLF with newline,
* lisp/mail/rmail.el (rmail-epa-decrypt-1): If NOT descrypting permanently,
put the decrypts into the view buffer.
(rmail-epa-decrypt, rmail-epa-decrypt-1):
In a decrypted mime part, replace CRLF with newline,
Dmitry Gutov [Tue, 2 Jan 2024 13:32:03 +0000 (15:32 +0200)]
treesit--pre-syntax-ppss: Fix args-out-of-range in internal--syntax-propertize
* lisp/treesit.el (treesit--pre-syntax-ppss): Make sure the lower
bound is still within the current restriction (bug#67977).
Stefan Kangas [Tue, 2 Jan 2024 05:57:17 +0000 (06:57 +0100)]
Don't include sheap.h from alloc.c
The symbol we used from sheap.h (bss_sbrk_did_unexec) was removed with
the introduction of the portable dumper.
* src/alloc.c: Don't include sheap.h.
Po Lu [Tue, 2 Jan 2024 04:26:57 +0000 (12:26 +0800)]
Improve rounding of projection vector versors
* src/sfnt.c (sfnt_short_frac_dot): New function.
(sfnt_validate_gs): Guarantee dot product of freedom and
projection vectors are properly rounded. If the final product
is short of 1/16th of a vector, reset it to an entire vector.
Stefan Kangas [Tue, 2 Jan 2024 03:08:43 +0000 (04:08 +0100)]
; Clarify two comments in byte-optimize-letX
* lisp/emacs-lisp/byte-opt.el (byte-optimize-letX): Clarify comments.
Po Lu [Tue, 2 Jan 2024 02:31:42 +0000 (10:31 +0800)]
; Update copyright years in more files
Po Lu [Tue, 2 Jan 2024 02:30:05 +0000 (10:30 +0800)]
; Add 2024 to copyright years
Po Lu [Tue, 2 Jan 2024 02:28:14 +0000 (10:28 +0800)]
Merge from savannah/emacs-29
dc4e6b13296 ; Update copyright years in more files
64b37776318 ; Run set-copyright from admin.el
8e1c56ae467 ; Add 2024 to copyright years
# Conflicts:
# doc/misc/modus-themes.org
# doc/misc/texinfo.tex
# etc/NEWS
# etc/refcards/ru-refcard.tex
# etc/themes/modus-operandi-theme.el
# etc/themes/modus-themes.el
# etc/themes/modus-vivendi-theme.el
# lib/alloca.in.h
# lib/binary-io.h
# lib/c-ctype.h
# lib/c-strcasecmp.c
# lib/c-strncasecmp.c
# lib/careadlinkat.c
# lib/cloexec.c
# lib/close-stream.c
# lib/diffseq.h
# lib/dup2.c
# lib/filemode.h
# lib/fpending.c
# lib/fpending.h
# lib/fsusage.c
# lib/getgroups.c
# lib/getloadavg.c
# lib/gettext.h
# lib/gettime.c
# lib/gettimeofday.c
# lib/group-member.c
# lib/malloc.c
# lib/md5-stream.c
# lib/md5.c
# lib/md5.h
# lib/memmem.c
# lib/memrchr.c
# lib/nanosleep.c
# lib/save-cwd.h
# lib/sha1.c
# lib/sig2str.c
# lib/stdlib.in.h
# lib/strtoimax.c
# lib/strtol.c
# lib/strtoll.c
# lib/time_r.c
# lib/xalloc-oversized.h
# lisp/auth-source-pass.el
# lisp/emacs-lisp/lisp-mnt.el
# lisp/emacs-lisp/timer.el
# lisp/info-look.el
# lisp/jit-lock.el
# lisp/loadhist.el
# lisp/mail/rmail.el
# lisp/net/ntlm.el
# lisp/net/webjump.el
# lisp/progmodes/asm-mode.el
# lisp/progmodes/project.el
# lisp/progmodes/sh-script.el
# lisp/textmodes/flyspell.el
# lisp/textmodes/reftex-toc.el
# lisp/textmodes/reftex.el
# lisp/textmodes/tex-mode.el
# lisp/url/url-gw.el
# m4/alloca.m4
# m4/clock_time.m4
# m4/d-type.m4
# m4/dirent_h.m4
# m4/dup2.m4
# m4/euidaccess.m4
# m4/fchmodat.m4
# m4/filemode.m4
# m4/fsusage.m4
# m4/getgroups.m4
# m4/getloadavg.m4
# m4/getrandom.m4
# m4/gettime.m4
# m4/gettimeofday.m4
# m4/gnulib-common.m4
# m4/group-member.m4
# m4/inttypes.m4
# m4/malloc.m4
# m4/manywarnings.m4
# m4/mempcpy.m4
# m4/memrchr.m4
# m4/mkostemp.m4
# m4/mktime.m4
# m4/nproc.m4
# m4/nstrftime.m4
# m4/pathmax.m4
# m4/pipe2.m4
# m4/pselect.m4
# m4/pthread_sigmask.m4
# m4/readlink.m4
# m4/realloc.m4
# m4/sig2str.m4
# m4/ssize_t.m4
# m4/stat-time.m4
# m4/stddef_h.m4
# m4/stdint.m4
# m4/stdio_h.m4
# m4/stdlib_h.m4
# m4/stpcpy.m4
# m4/strnlen.m4
# m4/strtoimax.m4
# m4/strtoll.m4
# m4/time_h.m4
# m4/timegm.m4
# m4/timer_time.m4
# m4/timespec.m4
# m4/unistd_h.m4
# m4/warnings.m4
# nt/configure.bat
# nt/preprep.c
# test/lisp/register-tests.el
Po Lu [Tue, 2 Jan 2024 02:19:48 +0000 (10:19 +0800)]
Merge from origin/emacs-29
3204825f560 Fix mangled Subject header field when forwarding (Bug#67360)
7591acfe38e Update to Org 9.6.15
240b4594f11 ; * etc/TODO: Add an item about 'Info-hide-note-references'.
01be4fe39d7 * doc/emacs/custom.texi (Modifier Keys): Fix markup (bug#...
55555a6a0d1 org-protocol: Minor copy-edits to Commentary
4696869d3d5 Improve syntax highlighting for python-ts-mode
Po Lu [Tue, 2 Jan 2024 02:17:39 +0000 (10:17 +0800)]
; Update copyright years in more files
Po Lu [Tue, 2 Jan 2024 01:53:43 +0000 (09:53 +0800)]
; Run set-copyright from admin.el
Po Lu [Tue, 2 Jan 2024 01:47:10 +0000 (09:47 +0800)]
; Add 2024 to copyright years
João Távora [Mon, 1 Jan 2024 21:12:28 +0000 (15:12 -0600)]
Eglot: filter by prefix in narrow-scope eglot-code-actions
Github-reference: https://github.com/joaotavora/eglot/issues/847
Servers like typescript-language-server, when asked for {"only" :
"source.organizeImports"}, return actions with the
"source.organizeImports.ts" kind. Eglot rejected these actions, but
according to the spec:
Kinds are a hierarchical list of identifiers separated by `.` [...]
The set of kinds is open.
So I guess we can use string-prefix-p
* lisp/progmodes/eglot.el (eglot-code-actions): Use string-prefix-p.
Aaron Jensen [Sat, 30 Dec 2023 23:06:45 +0000 (18:06 -0500)]
Avoid race condition in parallel native-compilation
* lisp/emacs-lisp/comp.el (comp-delete-or-replace-file): Avoid
race condition by relying on 'rename-file' being an atomic
operation on Posix filesystems. (Bug#68083)
Vincent Belaïche [Mon, 1 Jan 2024 18:49:29 +0000 (19:49 +0100)]
SES manual clean-up any « ignore »'d text to be translated
Remove from the English version any ignore'd chunk of text that has
been contributed yet only in the French version, and let only the
comment indicating re-alignment is needed.
Mike Kupfer [Sun, 31 Dec 2023 17:11:23 +0000 (09:11 -0800)]
Fix mangled Subject header field when forwarding (Bug#67360)
* lisp/mh-e/mh-comp.el (mh-forward): Overwrite subject when
forwarding.
Kjetil Orbekk [Fri, 29 Dec 2023 13:59:23 +0000 (08:59 -0500)]
Fix vg-hg-annotate-time bug
* lisp/vc/vc-hg.el (vc-hg-annotate-time): Fix extraction of timestamp
from string.
* test/lisp/vc/vc-hg-tests.el (vc-hg-annotate-time): Test that the
correct timestamp is found.
Copyright-paperwork-exempt: yes
Kyle Meyer [Mon, 1 Jan 2024 17:47:27 +0000 (12:47 -0500)]
Update to Org 9.6.15
Vincent Belaïche [Mon, 1 Jan 2024 15:53:43 +0000 (16:53 +0100)]
SES manual: fix explanation why B1 remains displayed empty
* doc/lang/fr/misc/ses-fr.texi (Quick Tutorial): Fix explanation
why B1 remains empty
* doc/misc/ses.texi (Quick Tutorial):
* doc/lang/fr/misc/ses-fr.texi (Quick Tutorial): @samp{...} cell
references.
Vincent Belaïche [Mon, 1 Jan 2024 12:06:07 +0000 (13:06 +0100)]
Typoes in SES manual.
Also @samp{...}-ify cell/row/column reference given as in-line examples.
Po Lu [Mon, 1 Jan 2024 03:27:59 +0000 (11:27 +0800)]
Bring GX point interpolation further into standards compliance
* src/sfnt.c (sfnt_infer_deltas_2): New function; factor much of
sfnt_infer_deltas_1 into this function, then modify its
treatment of untouched points positioned at their reference
points to align with standard GX treatment.
(sfnt_infer_deltas_1): Remove all code not concerning anchor
point discovery.
(main): Adjust tests.
Vincent Belaïche [Fri, 22 Dec 2023 18:21:22 +0000 (19:21 +0100)]
Translate SES manual to French
F. Jason Park [Fri, 29 Dec 2023 04:20:55 +0000 (20:20 -0800)]
Use advertised PREFIX when formatting nicks in ERC
* lisp/erc/erc-speedbar.el (erc-speedbar-insert-user): Run
`erc-get-channel-membership-prefix' in associated buffer if possible.
* lisp/erc/erc.el (erc-get-channel-membership-prefix): Use known
prefix mappings when determining status chars.
* test/lisp/erc/erc-tests.el (erc--parsed-prefix): Use common helpers
for initializing buffers, and use a more realistic example for PREFIX
value.
(erc--update-channel-modes): Add current buffer to `erc-server-user'
object to maintain essential invariant, even though this doesn't
affect the test's outcome.
(erc-tests--equal-including-properties): Move to `erc-tests-common'
and rename `erc-tests-common-equal-with-props'.
(erc--merge-prop, erc--remove-from-prop-value-list,
erc--remove-from-prop-value-list/many): Use new name for
`erc-tests-common-equal-with-props'.
(erc-get-channel-membership-prefix): New test.
(erc--determine-speaker-message-format-args,
erc--determine-speaker-message-format-args/queries-as-channel,
erc--determine-speaker-message-format-args/queries): Use new name
for `erc-tests-common-equal-with-props'.
* test/lisp/erc/resources/erc-tests-common.el
(erc-tests-common-equal-with-props): New macro, originally
`erc-tests--equal-including-properties' from erc-tests.el.
(erc-tests-common-make-server-buf): Initialize tables and make NAME
argument optional. (Bug#67677)