Vincent Belaïche [Fri, 29 Dec 2023 11:11:51 +0000 (12:11 +0100)]
Fix 13 years old bug#5852 !
Sometimes recalculating a cell does not change its value, however it
still have to be written to the data area when the reference list is
changed
* lisp/ses.el (ses-cell-set-formula): Fix bug#5852, at last !
* test/lisp/ses-tests.el
(ses-set-formula-write-cells-with-changed-references): Rename test
from ses-bug5852, do not expect failure, and update description.
Vincent Belaïche [Fri, 29 Dec 2023 11:29:20 +0000 (12:29 +0100)]
Simplify test ses-bug5852
* test/lisp/ses-tests.el (ses-bug5852): Siumplify test to
demonstrate that the bug is not connected to yanking, but has to
do with ses-cell-set-formula.
Stefan Kangas [Fri, 29 Dec 2023 10:24:48 +0000 (11:24 +0100)]
Don't recommend using `cperl-hairy`
Enabling `cperl-hairy` makes cperl-mode break many Emacs conventions
and can be confusing to new users. Let's not say that this is the
"recommended mode of use", instead leaving it up to the user.
* lisp/progmodes/cperl-mode.el (cperl-mode): Don't recommend using
`cperl-hairy'.
Po Lu [Fri, 29 Dec 2023 06:58:19 +0000 (14:58 +0800)]
Obey USE_MY_METRICS in compound glyphs
* src/sfnt.c (struct sfnt_compound_glyph_context): New fields
holding the positions of both phantom points.
(sfnt_decompose_compound_glyph): New argument METRICS_RETURN;
return the metrics of components with USE_MY_METRICS within this
field.
(sfnt_decompose_glyph): New argument METRICS_RETURN, which
serves the same purpose.
(sfnt_build_glyph_outline): Apply glyph advance and origin
distortion to METRICS, and return the metrics as altered by
compound glyphs in there.
(sfnt_lookup_glyph_metrics): Trim away two unused parameters,
PIXEL_SIZE and HEAD, whose functionality has been superseeded by
sfnt_scale_metrics and the implicit scaling the interpreter
performs.
(sfnt_interpret_compound_glyph_2): Save phantom points within
fields provided to that end in CONTEXT.
(sfnt_interpret_compound_glyph_1): Save and source phantom
points for each glyph to and from the context.
(sfnt_test_get_metrics, main): Adjust tests correspondingly.
* src/sfnt.h: Update prototypes.
* src/sfntfont.c (sfntfont_get_metrics): Remove obsolete
parameters.
(sfntfont_get_glyph_outline): Don't change temp by the metrics
distortions, which is now the task of sfnt_decompose_glyph.
F. Jason Park [Thu, 28 Dec 2023 02:44:29 +0000 (18:44 -0800)]
Sideline implied invisible-intangible coupling in ERC
* etc/ERC-NEWS: Add entry explaining removal of automatic `intangible'
propertizing of t-valued `invisible' messages.
* lisp/erc/erc.el (erc--insert-invisible-as-intangible-p): New flag
variable, a temporary escape hatch to regain pre-5.6 behavior
involving the modification of certain `invisible' messages.
(erc--insert-line): Gate unfavorable behavior behind
`erc--insert-invisible-as-intangible-p' flag. Add comment clarifying
deferred initialization of `insert-position', which was part of the
many changes introduced as part of bug#60936.
F. Jason Park [Sun, 24 Dec 2023 20:21:49 +0000 (12:21 -0800)]
Move ERC test utilities to common file
* lisp/erc/erc-common.el (erc--define-catalog): Update name of
reference to convenience command now located in `erc-tests-common'.
* test/lisp/erc/erc-button-tests.el: Require common test-util library
`erc-tests-common', located under test/lisp/erc/resources.
; (erc-button-alist--url,
; erc-button-tests--erc-button-alist--function-as-form,
; erc-button-tests--erc-button-alist--nil-form,
; erc-button--display-error-notice-with-keys): Use common helper
; `erc-tests-common-init-server-proc' from test-utils library.
* test/lisp/erc/erc-fill-tests.el: Require `erc-tests-common'.
(erc-fill-tests--wrap-populate): Use helper
`erc-tests-common-init-server-proc'.
(erc-fill-tests--save-p): Remove. See replacement
`erc-tests-common-snapshot-save-p' in erc-tests-common.
(erc-fill-tests--graphic-dir): Add trailing slash.
(erc-fill-tests--compare): Move body to generalized utility
`erc-tests-common-snapshot-compare' in erc-tests-common.
* test/lisp/erc/erc-goodies-tests.el: Require `erc-tests-common'.
(erc--get-inserted-msg-beg/readonly,
erc--get-inserted-msg-end/readonly,
erc--get-inserted-msg-bounds/readonly): Move here from erc-tests.el.
* test/lisp/erc/erc-networks-tests.el: Load `erc-tests-common'.
(erc-networks-tests--create-live-proc): Defer to
`erc-tests-common-init-server-proc' and drop optional buffer param.
(erc-networks-tests--clean-bufs): Defer to
`erc-tests-common-kill-buffers'.
(erc-networks--rename-server-buffer--existing--live): Call
`erc-networks-tests--create-live-proc' in server buffer.
* test/lisp/erc/erc-scenarios-internal.el: Load `erc-tests-common'.
(erc-scenarios-internal--run-graphical-all): Use
`erc-tests-common-create-subprocess' to create process.
* test/lisp/erc/erc-scenarios-sasl.el
(erc-scenarios-sasl--plain-fail): Silence error message.
* test/lisp/erc/erc-stamp-tests.el: Require `erc-tests-common'.
(erc-stamp-tests--insert-right, erc-timestamp-intangible--left): Use
`erc-tests-common-init-server-proc'.
(erc-tests--assert-get-inserted-msg/stamp,
erc-stamp-tests--assert-get-inserted-msg/stamp): Move from
erc-tests.el, renaming to latter.
(erc--get-inserted-msg-beg/stamp,
erc--get-inserted-msg-beg/readonly/stamp,
erc--get-inserted-msg-end/stamp,
erc--get-inserted-msg-end/readonly/stamp,
erc--get-inserted-msg-bounds/stamp,
erc--get-inserted-msg-bounds/readonly/stamp): Move here from
erc-tests.el.
* test/lisp/erc/erc-tests.el: Require `erc-tests-common'.
(erc-with-server-buffer): Use renamed test-helper utility
`erc-tests-common-init-server-proc'.
(erc-tests--send-prep, erc-tests--set-fake-server-process): Move to
`erc-tests-common' library and rename to
`erc-tests-common-prep-for-insertion' and
`erc-tests-common-init-server-proc', respectively.
; (erc-hide-prompt, erc--refresh-prompt,
; erc-setup-buffer--custom-action, erc--parsed-prefix,
; erc--update-channel-modes, erc--channel-modes,
; erc--channel-modes/graphic-p, erc-ring-previous-command): Use
; `erc-tests-common-prep-for-insertion' instead of
; `erc-tests--send-prep', and use `erc-tests-common-init-server-proc'
; instead of `erc-tests--set-fake-server-process'.
(erc-tests--with-process-input-spy): Move to `erc-tests-common' and
rename `erc-tests-common-with-process-input-spy'.
; (erc--check-prompt-input-functions, erc-send-current-line,
; erc--check-prompt-input-for-multiline-blanks,
; erc-send-whitespace-lines): Use renamed
; `erc-tests-common-with-process-input-spy' and
; `erc-tests-common-init-server-proc'.
; (erc-process-input-line): Use renamed
; `erc-tests-common-init-server-proc'.
(erc-tests--get-inserted-msg-setup,
erc-tests--assert-get-inserted-msg,
erc-tests--assert-get-inserted-msg/basic,
erc-tests--assert-get-inserted-msg-readonly-with): Move to
`erc-tests-common' and rename with "common" prefix, using single
instead of double hyphen.
(erc-tests--assert-get-inserted-msg/stamp): Move to `erc-stamp-tests'
and rename with "stamp" prefix.
(erc--get-inserted-msg-beg/stamp,
erc--get-inserted-msg-beg/readonly/stamp,
erc--get-inserted-msg-end/stamp,
erc--get-inserted-msg-end/readonly/stamp,
erc--get-inserted-msg-bounds/stamp,
erc--get-inserted-msg-bounds/readonly/stamp): Move to
`erc-stamp-tests'.
(erc--get-inserted-msg-beg/readonly,
erc--get-inserted-msg-end/readonly,
erc--get-inserted-msg-bounds/readonly): Move to `erc-goodies-tests'.
; (erc--get-inserted-msg-beg/basic,
; erc--get-inserted-msg-end/basic,
; erc--get-inserted-msg-bounds/basic): Use common helpers.
; (erc--route-insertion): Use renamed helper functions
; `erc-tests-common-with-process-input-spy' and
; `erc-tests-common-init-server-proc'.
(erc-tests--make-server-buf): Move to `erc-common-tests' and rename
with "common" prefix.
(erc-tests--make-client-buf): Remove unused function without supplying
replacement.
; (erc-handle-irc-url): Use renamed `erc-tests-common-make-server-buf'
; utility function.
; (erc-tests--assert-printed-in-subprocess): Use helper from common lib
; `erc-tests-common-create-subprocess code' to do the heavy lifting.
(erc-tests--string-to-propertized-parts,
erc-tests-pp-propertized-parts): Move to `erc-tests-common' and rename
with "common" prefix.
* test/lisp/erc/resources/erc-tests-common.el: New file containing
helper utilities and fixtures used by multiple files in test/lisp/erc.
F. Jason Park [Sat, 23 Dec 2023 23:23:44 +0000 (15:23 -0800)]
Allow selecting graphical ERC tests manually
* test/lisp/erc/erc-fill-tests.el
(erc-fill-wrap--monospace, erc-fill-wrap--merge,
erc-fill-wrap-tests--merge-action,
erc-fill-wrap-tests--merge-action/indicator-pre,
erc-fill-wrap-tests--merge-action/indicator-post,
erc-fill-line-spacing, erc-fill-wrap-visual-keys--body,
erc-fill-wrap-visual-keys--prompt, erc-fill--left-hand-stamps): Tag as
:erc--graphcial.
* test/lisp/erc/erc-scenarios-internal.el
(erc-scenarios-internal--run-interactive-all): New test to assist ERC
contributors in -jN parallel runs.
* test/lisp/erc/erc-scenarios-scrolltobottom-relaxed.el
(erc-scenarios-scrolltobottom--relaxed): Tag as :erc--graphical.
* test/lisp/erc/erc-scenarios-scrolltobottom.el
(erc-scenarios-scrolltobottom--normal,
erc-scenarios-scrolltobottom--all): Tag as :erc--graphical.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-scenarios-status-sidebar--nickbar): Tag as :erc--graphical.
* test/lisp/erc/erc-tests.el (erc--channel-modes/graphic-p): Tag as
:erc--graphical.
* test/lisp/erc/resources/base/local-modules/first.eld: Timeouts.
* test/lisp/erc/resources/erc-scenarios-common.el
(erc-scenarios-common--graphical-p): New variable.
(erc-scenarios-common--make-bindings): Don't enable
`inhibit-interaction' when interactive. Set
`erc-scenarios-common--graphical-p' flag when
`:erc--graphical' tag present and running interactively.
(erc-scenarios-common-with-cleanup): Account for variable
`erc-scenarios-common--graphical-p'.
(erc-scenarios-common-scrolltobottom--normal): Turn off
`erc-scrolltobottom-mode' when test finishes so as not to pollute when
running multiple interactive tests.
; * test/lisp/erc/resources/join/network-id/barnet.eld: Timeouts.
F. Jason Park [Sun, 24 Dec 2023 19:49:26 +0000 (11:49 -0800)]
Replace erc--get-inserted-msg-bounds with functions
* lisp/erc/erc-fill.el (erc-fill--wrap-rejigger-region): Call
`erc--get-inserted-msg-end' instead of `erc--get-inserted-msg-bounds'
with `end' arg.
* lisp/erc/erc-truncate.el (erc-truncate-buffer-to-size): Call
`erc--get-inserted-msg-beg' with `point' instead of
`erc--get-inserted-msg-bounds' with `beg' arg.
* lisp/erc/erc.el (erc--get-inserted-msg-beg-at,
erc--get-inserted-msg-end-at): New macros.
(erc--get-inserted-msg-beg, erc--get-inserted-msg-end): New functions.
(erc--get-inserted-msg-bounds): Convert to function with different
signature, and refactor. This was introduced for the yet unreleased
5.6 (Emacs 30) by bug#60936.
(erc--get-inserted-msg-prop): Use `erc--get-inserted-msg-beg' instead
of `erc--get-inserted-msg-bounds' with `beg' arg.
(erc--delete-inserted-message): Update call site of
`erc--get-inserted-msg-bounds' to match new signature.
(erc-cmd-CLEAR): Use `erc--get-inserted-msg-beg' instead of
`erc--get-inserted-msg-bounds' with `beg' arg.
* test/lisp/erc/erc-scenarios-match.el
(erc-scenarios-match--stamp-right-fools-invisible): Call
`erc--get-inserted-msg-end' instead of `erc--get-inserted-msg-bounds'.
* test/lisp/erc/erc-tests.el (erc-tests--get-inserted-msg-setup,
erc-tests--assert-get-inserted-msg,
erc-tests--assert-get-inserted-msg/basic,
erc-tests--assert-get-inserted-msg/stamp,
erc-tests--assert-get-inserted-msg-readonly-with): New helper
functions.
(erc--get-inserted-msg-beg/basic, erc--get-inserted-msg-beg/readonly,
erc--get-inserted-msg-beg/stamp,
erc--get-inserted-msg-beg/readonly/stamp,
erc--get-inserted-msg-end/basic, erc--get-inserted-msg-end/stamp,
erc--get-inserted-msg-end/readonly,
erc--get-inserted-msg-end/readonly/stamp,
erc--get-inserted-msg-bounds/readonly,
erc--get-inserted-msg-bounds/stamp,
erc--get-inserted-msg-bounds/readonly/stamp): New tests.
(erc--get-inserted-msg-bounds, erc--get-inserted-msg-bounds/basic):
Move `beg' and `end' cases to separate test variants and rename former
to latter.
* lisp/erc/erc-goodies.el (erc-keep-place-indicator-follow): Describe
condition causing an indicator update.
(erc--keep-place-indicator-on-window-configuration-change,
erc--keep-place-indicator-on-window-buffer-change): Rename former to
latter, add required WINDOW parameter, and don't move indicator if
buffer appears in multiple windows. Also, don't bother checking
whether either buffer is a mini because the manual says window change
functions don't run for minibuffer replacements.
(erc--keep-place-indicator-setup): Hook on
`window-buffer-change-functions' instead of
`window-configuration-change-hook'.
(erc-keep-place-mode, erc-keep-place-disable): Remove member from
`window-buffer-change-functions' instead of
`window-configuration-change-hook'.
(erc-keep-place): Use `visible' FRAME arg of `get-buffer-window'.
Don't twiddle `window-prev-buffers' when
`erc-keep-place-indicator-mode' is non-nil. This feature was
originally introduced by bug#59943.
* test/lisp/erc/erc-goodies-tests.el
(erc-goodies-tests--assert-kp-indicator-on,
erc-goodies-tests--assert-kp-indicator-off): Update hook name.
* test/lisp/erc/erc-scenarios-keep-place-indicator.el: New file.
* test/lisp/erc/resources/keep-place/follow.eld: New file.
It's not correct, breaks tests. I declare it impossible to make C-M-i
use of 'try-completion' behave sanely with LSP in its current state.
YMMV. Use a completion tooltip, like Company.
João Távora [Tue, 26 Dec 2023 13:47:29 +0000 (07:47 -0600)]
Eglot: Make 'try-completion' less broken
The 'try-completion' completion operation, used mostly in vanilla
'completion-at-point' invoked with C-M-i is close to impossible to get
right in LSP because of the arbitrary edits handled in
':exit-function'.
When this operation is invoked on the table, returning the pattern
argument unchanged somehow (TM) makes a sole completion show the
*Completions* buffer, where selecting it will recover context
necessary for `:exit-function' and call that function. It doesn't
break any other cases I know, and that's good enough for now.
https://github.com/joaotavora/eglot/issues/1339
* lisp/progmodes/eglot.el (eglot-completion-at-point): Return pattern
when 'try-completion' is invoked.
Po Lu [Tue, 26 Dec 2023 06:07:58 +0000 (14:07 +0800)]
Consistently round glyph advances in the SFNT font backend
* src/sfnt.h (SFNT_ROUND_FIXED): New macro.
* src/sfntfont.c (sfntfont_get_glyph_outline): Don't apply
advance width distortion before the glyph is instructed or
decomposed. Round advance width as measured between both
phantom points subsequent to instruction code execution.
(sfntfont_draw): Don't take the advance's ceiling when advancing
origin point.
then completion still fails, because the 'try-completion' call in
eglot-completion-at-point will just return complete to "count_ones"
and Emacs doesn't consider this a completion "exit", so it'll
completely ignore the exit function.
I think 'try-completion' (and 'test-completion') simply can't be used
here (for one, they obey styles, and styles are off-limits in LSP),
but I'll leave that for another commit.
Vincent Belaïche [Sun, 24 Dec 2023 12:02:14 +0000 (13:02 +0100)]
Fix ses-formula-record
* lisp/ses.el (ses-is-cell-sym-p): Tighten test with checking
argument is a local variable.
(ses-formula-record): Fix definition.
(ses-rename-cell): Loosen test on new-name, conversely to
'ses-is-cell-sym-p' tightening.
Vincent Belaïche [Sun, 24 Dec 2023 21:05:54 +0000 (22:05 +0100)]
Fix test about need for explicit printing inserted lines
* lisp/ses.el (ses--blank-line-needs-printing-p): New
function. Does not consider that printer `nil' produces a non
empty string, as `ses-print-cell' removes nil printer by oring to
fallback.
(ses-insert-row): Replace the complex and erroneous test about
blank newline needing printing by a call to
'ses--blank-line-needs-printing-p'.
Stefan Monnier [Sun, 24 Dec 2023 15:13:22 +0000 (10:13 -0500)]
* src/eval.c (signal_or_quit): Fix naming inconsistency with docs
The var's docstring and etc/NEWS refer to "*Redisplay-trace*",
so better use that (which is also more in line with usual practice
of Emacs buffer names).
Stefan Kangas [Sun, 24 Dec 2023 13:27:48 +0000 (14:27 +0100)]
checkdoc: Avoid false positive for keybinding in docstring
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Avoid false positive when a variable contains a keybinding (for
example, "C-g"). (Bug#68002)
* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-docstring-avoid-false-positive-ok): New test.
* lisp/vc/log-edit.el (log-edit-menu): Insert a menu item for
"Generate ChangeLog".
(log-edit-tool-bar-map): New keymap.
(log-edit-mode): Install this keymap as the tool bar map.
F. Jason Park [Sat, 23 Dec 2023 02:18:20 +0000 (18:18 -0800)]
Optionally continue on error in erc-auth-source-search
* doc/misc/erc.texi (auth-source): Add new "Troubleshooting"
subsection.
* lisp/erc/erc.el (erc-open): Initialize markers before determining
session parameters. Otherwise, functions that rely on
`erc-inset-marker' being non-nil, like `erc-check-text-conversion',
may fail during auth-source lookups.
(erc-auth-source-search): When non-interactive, ask the user whether
to continue connecting anyway. (Bug#67978)
F. Jason Park [Wed, 20 Dec 2023 06:33:48 +0000 (22:33 -0800)]
Fix overlapping logs from erc-truncate-buffer-on-save
* lisp/erc/erc-button.el (erc-button--display-error-notice-with-keys):
Currently, internal "error notices" do not have timestamps. However,
this causes alignment issues for non-`fill-wrap' users of left-sided
stamps. The heuristic used by this change for detecting such stamps
is weak and prone to false negatives.
* lisp/erc/erc-log.el (erc-log-mode, erc-log-enable): Set explicit
depth for `erc--pre-clear-functions' to 50.
(erc-save-buffer-in-logs): Fix partial regression in which redundant
text would appear in logs that have undergone truncation via an
interactive call to this command when the deprecated option
`erc-truncate-on-save' is non-nil.
* lisp/erc/erc-stamp.el (erc-stamp-mode, erc-stamp-enable): Set
depth for `erc--pre-clear-functions' to 40.
(erc-stamp--reset-on-clear): Only add `erc-stamp--insert-date-hook'
when `erc-stamp--date-mode' is active.
* lisp/erc/erc.el (erc-cmd-CLEAR): Rework to honor but improve upon
the old behavior when called from lisp. Do this by attempting to find
the beginning of the current message and excluding it from the
truncated portion of the buffer. A NEWS entry describing this
behavior already exists for 5.6.
* test/lisp/erc/erc-scenarios-log.el
(erc-scenarios-log--save-buffer-in-logs/truncate-on-save): New test.
These changes originate from bug#60936.
F. Jason Park [Tue, 19 Dec 2023 04:50:26 +0000 (20:50 -0800)]
Replace some uses of erc-error
* lisp/erc/erc-button.el
(erc-button--display-error-notice-with-keys-and-warn): Use
`erc--lwarn' so the warnings buffer is overridable for testing.
* lisp/erc/erc-sasl.el (erc-sasl-mode, erc-sasl-enable): Signal an
`error' instead of calling `erc-error', which continues execution. In
this special case, the session cannot continue initializing, since
connection registration can't reasonably be expected to complete
successfully.
(erc-sasl--destroy): Don't run `erc-quit-hook', and issue a warning of
level `:error' to get users' attention instead of calling `ding'.
* lisp/erc/erc-speedbar.el
(erc-speedbar--emulate-sidebar-set-window-preserve-size): Don't set
window parameters. Doing this basically made
`erc-speedbar-toggle-nicknames-window-lock' unusable.
(erc-speedbar--toggle-nicknames-sidebar): Manually unlock the window
after toggling.
(erc-nickbar-mode, erc-nickbar-enable, erc-nickbar-disable): Don't
`ding' when called in a non-ERC buffer, and make sure to call
`erc-speedbar--ensure' from an ERC buffer. Also, don't disable
minor-mode var when speedbar buffer doesn't exist because that doesn't
ensure it'll be created the next time around, and users may count on
the activation state remaining consistent.
(erc-speedbar-toggle-nicknames-window-lock): Make usable from lisp
with explicit numeric arg.
* lisp/erc/erc-status-sidebar.el (erc-bufbar-mode, erc-bufbar-enable):
Only create the side window from an erc-mode buffer to ensure the
ratio is preserved when burying the current buffer, e.g., with
`custom-buffer-done'.
* lisp/erc/erc.el (erc--warnings-buffer-name, erc--lwarn): New
function, an analog of `lwarn', that allows for overriding the
warnings buffer with the new variable `erc--warnings-buffer-name'.
(erc-cmd-SERVER): Add comment.
* test/lisp/erc/erc-scenarios-sasl.el
(erc-scenarios-sasl--plain-fail): Expect warning instead of error.
* test/lisp/erc/erc-scenarios-status-sidebar.el
(erc-scenarios-status-sidebar--bufbar): Refresh when interactive as
well.
* test/lisp/erc/resources/sasl/plain-failed.eld: Expect EOF instead of
"CAP END". (Bug#63595)
F. Jason Park [Mon, 18 Dec 2023 05:49:13 +0000 (21:49 -0800)]
Populate erc--msg-prop-overrides for CTCP replies
* lisp/erc/erc-backend.el (erc-server-PRIVMSG): Don't set string
intended for insertion to the undefined return value of
`erc-process-ctcp-reply' and `erc-process-ctcp-query'. Rework control
flow slightly for clarity.
* lisp/erc/erc.el (erc-process-ctcp-reply): Bind
`erc--msg-prop-overrides' and populate with `erc--ctcp' and `erc--cmd'
"msg props" for the benefit of `erc-display-message' calls made by
the various CTCP reply handlers. (Bug#67677)
F. Jason Park [Tue, 19 Dec 2023 03:38:30 +0000 (19:38 -0800)]
; Fix some doc strings in ERC
* lisp/erc/erc-networks.el: Lose some unneeded forward declarations.
* lisp/erc/erc.el (erc-open-socks-tls-stream): Don't conflate SOCKS
with TOR by mentioning a ".onion" address for the `host' parameter.
* test/lisp/erc/erc-tests.el
(erc--check-prompt-input-for-multiline-blanks): Extend timeout.
Visuwesh [Tue, 12 Dec 2023 15:44:12 +0000 (21:14 +0530)]
Make ffap correctly guess remote file names at point
* lisp/ffap.el (ffap-lax-url): Set it to nil so that remote file
names may be matched.
(ffap-fixup-email): New function.
(ffap-guesser): Specially handle email addresses now that
'ffap-lax-url' is nil, as user@host fails to be matched as an
email address with that setting. (Bug#67688)
* etc/NEWS: Announce the new value of the defcustom.
Denis Zubarev [Sat, 11 Nov 2023 22:42:42 +0000 (01:42 +0300)]
Fix treesit test (bug#67117)
* test/src/treesit-tests.el (treesit-search-subtree-forward-1):
(treesit-search-subtree-backward-1): Replace treesit--thing-at with
treesit-query-capture (treesit--thing-at isn't available in Emacs 29).
Stefan Monnier [Sat, 23 Dec 2023 05:25:46 +0000 (00:25 -0500)]
Split safe_call between redisplay and non-redisplay versions
The `safe_call/eval` family of functions started its life in `xdisp.c`
for the needs of redisplay but quickly became popular outside of it.
This is not ideal because despite their name, they are somewhat
specific to the needs of redisplay.
So we split them into `safe_call/eval` (in `eval.c`) and `dsafe_call/eval`
(in `xdisp.c`). We took this opportunity to slightly change their
calling convention to be friendly to the CALLN-style macros.
While at it, we introduce a new `calln` macro as well which does
all that `call[1-8]` used to do.
* src/eval.c (safe_eval_handler, safe_funcall, safe_eval): New functions,
Copied from `xdisp.c`. Don't obey `inhibit_eval_during_redisplay` any more.
Adjust error message to not claim it happened during redisplay.
* src/lisp.h (calln): New macro.
(call1, call2, call3, call4, call5, call6, call7, call8): Turn them
into aliases of `calln`.
(safe_funcall): Declare.
(safe_calln): New macro.
(safe_call1, safe_call2): Redefine as compatibility macros.
(safe_call, safe_call1, safe_call2): Delete.
Replace all callers with calls to `safe_calln`.
* src/xdisp.c (dsafe_eval_handler): Rename from `safe_eval_handler`.
Adjust all users.
(dsafe__call): Rename from `safe_call` and change calling convention to
work with something like CALLMANY. Adjust all users.
(safe_call, safe__call1, safe_call2): Delete functions.
(SAFE_CALLMANY, dsafe_calln): New macros.
(dsafe_call1, dsafe_eval): Rename from `safe_call1` and `safe_eval`,
and rewrite using them. Adjust all users.
(clear_message, prepare_menu_bars, redisplay_window): Use `dsafe_calln`.
(run_window_scroll_functions): Don't let-bind `Qinhibit_quit`
since `safe_run_hooks_2` does it for us.
Po Lu [Sat, 23 Dec 2023 03:22:21 +0000 (11:22 +0800)]
Respect glyph metrics modified by instruction code
* src/sfnt.c (sfnt_read_glyph): Clear advance and origin
distortion returning an empty glyph.
(sfnt_build_instructed_outline): New parameter *ADVANCE_WIDTH,
in which the glyph's advance width is saved.
(sfnt_interpret_compound_glyph_1): Refine commentary.
(sfnt_verbose, main): Adjust tests.
* src/sfnt.h: Update prototypes correspondingly.
* src/sfntfont.c (sfntfont_get_glyph_outline): If an instructed
outline is available, derive the advance and lbearing from the
measurements within.
(sfntfont_probe_widths): Call sfntfont_measure_pcm to establish
average widths.
(sfntfont_open): Do so after instruction code initialization
completes.
(sfntfont_measure_pcm): Revise commentary.
Stefan Kangas [Sat, 23 Dec 2023 00:50:18 +0000 (01:50 +0100)]
Drop footer line warning for packages requiring Emacs 30.1
The reason for warning about a missing footer line (";;; foo.el ends
here") is that package.el up until version 27.1 would refuse to
install a package without it. Emacs 27.1 or later will install such
packages, but will issue a warning, the purpose of which is to
encourage package authors not to break backwards-compatibility.
However, if the minimum required Emacs version for a package is 30.1,
we do not need to worry about compatibility with earlier versions of
Emacs -- the package author has already explicitly said that the
package will not work on earlier versions. For such packages, there
is no need to warn about a missing footer line.
In the future, this warning could be removed, but it is premature to
do that now. (See Bug#26490.) Thus, for packages that does not
specify a minimum version of Emacs, we continue to issue the warning.
We will also continue to warn for packages requiring Emacs 27 to 29,
since those versions will themselves warn if the footer is missing.
* lisp/emacs-lisp/package.el (package-buffer-info): Don't warn if the
footer line is missing for packages requiring Emacs 30.1 or later.
Stefan Kangas [Fri, 22 Dec 2023 22:41:36 +0000 (23:41 +0100)]
Introduce new function lm-package-requires
* lisp/emacs-lisp/package.el (package--prepare-dependencies): Move
from here...
* lisp/emacs-lisp/lisp-mnt.el (lm--prepare-package-dependencies):
...to here.
(lm-package-requires): New function.
(package-buffer-info): Use above new function.
* test/lisp/emacs-lisp/lisp-mnt-tests.el
(lm--tests-lm-package-requires): New test.
Stefan Kangas [Fri, 22 Dec 2023 21:36:37 +0000 (22:36 +0100)]
Recommend customizing eglot for python-base-mode
* doc/misc/eglot.texi (Project-specific configuration): Recommend
setting directory local variables for 'python-base-mode' instead of
'python-mode'. This makes any customizations effective also for
'python-ts-mode'.
Michael Albinus [Fri, 22 Dec 2023 18:58:32 +0000 (19:58 +0100)]
Tramp's direct asynchronous processes use 'tramp-remote-path'
* doc/misc/tramp.texi (Remote processes): Remove item about
tramp-remote-path.
* etc/NEWS: Direct asynchronous processes use 'tramp-remote-path'.
* lisp/net/tramp-sh.el (tramp-get-remote-pipe-buf): New defun.
(tramp-set-remote-path): Use it.
(tramp-get-remote-path): Add ;;;###tramp-autoload cookie.
* lisp/net/tramp.el (tramp-handle-make-process):
Use `tramp-remote-path' for setting PATH environment.
* test/lisp/net/tramp-tests.el (tramp-test35-exec-path-direct-async)
(tramp-test35-remote-path-direct-async): New tests.
* 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).
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.
* 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.
Po Lu [Fri, 22 Dec 2023 02:25:36 +0000 (10:25 +0800)]
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.
Stefan Monnier [Thu, 21 Dec 2023 15:24:29 +0000 (10:24 -0500)]
doc/lispintro: Don't mention `set` (bug#67734)
* doc/lispintro/emacs-lisp-intro.texi (Using set): Delete.
(Using setq): Adjust accordingly.
(setq): Rename from "set & setq" and don't refer to `set` any more.
(Review): Don't mention `set` any more.
Po Lu [Thu, 21 Dec 2023 08:31:30 +0000 (16:31 +0800)]
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.