F. Jason Park [Tue, 28 Nov 2023 03:41:09 +0000 (19:41 -0800)]
Clarify warning for process-dependent input in ERC
* lisp/erc/erc.el (erc--check-prompt-input-for-running-process):
Resolve dissonance between content of ancient `user-error' message and
condition that triggered it by favoring the former because it's
supported by the underlying mechanism, which revolves around the
`process-not-needed' symbol property.
* test/lisp/erc/erc-tests.el (erc--check-prompt-input-functions):
Revise expected output for error assertion. (Bug#66073, originally
from bug#54536, and included for discussion in bug#67677)
F. Jason Park [Sat, 19 Aug 2023 01:04:22 +0000 (18:04 -0700)]
Add erc-server-396 response handler
* lisp/erc/erc-backend.el (erc-server-396, erc-server-396-functions):
Define response handler for 396 numeric. For now, always display the
message in the active buffer rather than bother with something like
`erc-once-with-server-event' to try and suss out when this is a
response to something client-initiated, like a /VHOST. Do this
despite most users probably wanting the message to appear in the
server buffer alone when the response is server-initiated. The
`labeled-response' extension will hopefully make dealing with such
matters less of a crapshoot.
* lisp/erc/erc.el (erc--parse-user-regexp-pedantic): Tweak slightly to
allow null groups and favor host.
(erc--parse-user-regexp-legacy, erc--parse-user-regexp): Remove the
first variable but preserve its value as that of the second.
(erc--parse-nuh): New function. The behavior is nuanced and complex
and so not easily described in a doc string.
(erc-message-english-396): Define format template for 396 response.
* test/lisp/erc/erc-scenarios-misc-commands.el
(erc-scenarios-misc-commands--VHOST): New test.
* test/lisp/erc/erc-tests.el (erc-parse-user): Move "pedantic" section
to new test.
(erc--parse-nuh): New test.
* test/lisp/erc/resources/commands/vhost.eld: New test data file.
(Bug#67677)
F. Jason Park [Fri, 1 Dec 2023 21:54:12 +0000 (13:54 -0800)]
Make erc-input's refoldp slot conditionally available
* etc/ERC-NEWS: Fix entry regarding `erc-input-refoldp'.
* lisp/erc/erc-common.el (erc-input): Remove `refoldp' slot, which was
to be new in 5.6, in order to reduce churn in the extremely unlikely
event that third-party code uses the read-syntax of these objects or
ones subclassed from it for some other purpose, outside of
`erc-pre-send-functions'.
(erc--input-split) Add `refoldp' slot here instead.
* lisp/erc/erc.el (erc-pre-send-functions): Amend doc string to stress
that `refoldp' is not a real slot.
(erc--input-ensure-hook-context, erc-input-refoldp): New function, an
impostor accessor for the nonexistent `refoldp' slot of `erc-input',
and a helper function for asserting a valid context at runtime.
(erc--run-send-hooks): Don't copy over `refoldp' from the
`erc--input-lines' object to the working `erc-insert' object. Check
the insertion context's `erc--input-split' object instead of the
hook's `erc-insert' object when deciding whether to resplit.
* test/lisp/erc/erc-tests.el: Adjust test environment to satisfy
assertion. (Bug#62947)
F. Jason Park [Mon, 4 Dec 2023 03:19:37 +0000 (19:19 -0800)]
Add utility for iterating over arrays in ERC
* lisp/erc/erc-common.el (erc--doarray): Add macro for mapping over
arrays. ERC has the uncommon requirement of having to repeatedly
traverse strings that contain flags for advertised server features.
It doesn't make sense to translate these meanings into enums or
dynamically generate variables for each flag. Hash tables and lists
require additional setup and aren't as compact to inspect.
* lisp/erc/erc-dcc.el (erc-dcc-handle-ctcp-send): Use `string-search'
instead of `seq-contains-p' even though performance doesn't matter
here.
* lisp/erc/erc.el (erc--channel-mode-types): Use `erc--doarray'
instead of `dolist'.
(erc--process-channel-modes): Use `erc--doarray' instead of `dolist',
and don't create a string from current char until needed.
(erc--parse-user-modes): Use `erc--doarray' instead of `dolist'.
* test/lisp/erc/erc-tests.el (erc--doarray): New test. (Bug#67677)
F. Jason Park [Mon, 27 Nov 2023 02:24:48 +0000 (18:24 -0800)]
Sequester some special-variable declarations in ERC
* lisp/erc/erc-backend.el (erc-log-p): Remove declaration entirely.
(erc-server-reconnect): Move declaration for `erc-reuse-buffers' here.
(erc-process-sentinel-1): Move `erc-kill-server-buffer-on-quit'
declaration here.
(erc--conceal-prompt): Move `erc-prompt-hidden' declaration here.
(erc-server-INVITE): Move `erc-invitation' declaration here.
(erc-server-PART): Move `erc-kill-buffer-on-part' declaration here.
(erc-server-PRIVMSG): Move declarations for `erc-minibuffer-ignored',
`erc-receive-query-display', `erc-receive-query-display-defer',
`erc--cmem-from-nick-function', `erc-format-nick-function', and
`erc-format-query-as-channel-p' here.
(erc-server-401): Move `erc-whowas-on-nosuchnick' declaration here.
(erc-server-475): Move `erc--called-as-input-p' and
`erc-prompt-for-channel-key' declarations here.
* lisp/erc/erc-common.el (erc-log-p): Remove declaration for
`erc-log-p' and replace with actual definition.
(erc-log-aux): Move `erc-dbuf' declaration from top level into
function body.
* lisp/erc/erc-fill.el (erc-fill--wrap-continued-message-p): Note in
the doc string that this function produces side effects.
* lisp/erc/erc-networks.el (erc-determine-network,
erc-networks--copy-server-buffer-functions): Move some variable
declarations to function body.
(erc-settings, erc-get): Deprecate for now and explain why in doc
strings. We could deprecate them unconditionally, but they never
provided usable code, and their names are short and valuable.
* lisp/erc/erc.el (tabbar--local-hlf, motif-version-string,
gtk-version-string): Prefer moving these single-serving declarations
to function bodies, if only to make closures from this library less
cluttered when debugging. This should also help avoid stray
declarations.
(erc-hooks, erc-timer-hook): Revise doc strings.
(erc-log-p): Move definition to erc-common.el.
(erc-cmd-SV): Mimic `emacs-version' and stick with `featurep', here in
combination with special-variable declarations, instead of `boundp' or
similar.
(erc-header-line-uses-tabbar-p): Explain that this has nothing to do
with `tab-bar'.
(erc-update-mode-line-buffer): Only assign when bound. This has been
verified to work with version 2.0 on EmacsWiki.
* test/lisp/erc/erc-scenarios-base-reconnect.el: Timeouts.
* test/lisp/erc/erc-scenarios-base-renick.el: Timeouts.
* test/lisp/erc/resources/join/network-id/foonet-again.eld: Timeouts.
F. Jason Park [Wed, 29 Nov 2023 00:51:36 +0000 (16:51 -0800)]
Define ERC message-formatting templates with defvar
* etc/ERC-NEWS: Mention convenience macro being preferred means of
defining message templates. Mention renaming of `notify' formatting
templates.
* lisp/erc/erc-common.el (erc--define-catalog,
erc-define-message-format-catalog): New macro and internal variant to
replace `erc-define-catalog-entry'. The internal variant allows us to
defer reindenting existing definitions until meaningfully edited.
* lisp/erc/erc-dcc.el (erc-message-english-dcc-chat-discarded,
erc-message-english-dcc-chat-ended,
erc-message-english-dcc-chat-no-request,
erc-message-english-dcc-chat-offered,
erc-message-english-dcc-chat-offer,
erc-message-english-dcc-chat-accept,
erc-message-english-dcc-chat-privmsg, erc-message-english-dcc-closed,
erc-message-english-dcc-command-undefined,
erc-message-english-dcc-ctcp-errmsg,
erc-message-english-dcc-ctcp-unknown,
erc-message-english-dcc-get-bytes-received,
erc-message-english-dcc-get-complete,
erc-message-english-dcc-get-failed,
erc-message-english-dcc-get-cmd-aborted,
erc-message-english-dcc-get-file-too-long,
erc-message-english-dcc-get-notfound,
erc-message-english-dcc-list-head, erc-message-english-dcc-list-line,
erc-message-english-dcc-list-item, erc-message-english-dcc-list-end,
erc-message-english-dcc-malformed,
erc-message-english-dcc-privileged-port,
erc-message-english-dcc-request-bogus,
erc-message-english-dcc-send-finished,
erc-message-english-dcc-send-offered,
erc-message-english-dcc-send-offer): Define at top level using
`defvar'.
* lisp/erc/erc-netsplit.el (erc-netsplit-mode, erc-netsplit-enable):
Don't call `erc-netsplit-install-message-catalogs'.
(erc-netsplit-install-message-catalogs): Deprecate function.
(erc-message-english-netsplit, erc-message-english-netjoin,
erc-message-english-netjoin-done, erc-message-english-netsplit-none,
erc-message-english-netsplit-wholeft): Define at top level using
`defvar'.
* lisp/erc/erc-notify.el (erc-notify-install-message-catalogs):
Deprecate, and rename all format templates with hyphens instead of
underscores.
(erc-notify-timer, erc-notify-JOIN, erc-notify-NICK, erc-notify-QUIT):
Use hyphenated template names.
(erc-cmd-NOTIFY): Use hyphenated template names. Load the module when
necessary and emit a warning. Otherwise, people who discover this
autoloaded command without being aware of the module's existence may
think it's "broken".
(pcomplete/erc-mode/NOTIFY): Replace top-level autoload with `require'
in function body. Include `erc-notify-list' in list of completions,
which makes removal easier if you don't share any channels with a
person, and they're not in `erc-server-users'. A better long-term
solution might be to WHOIS folks we're unsure about when they're
listed in a 303.
(erc-message-english-notify_current, erc-message-english-notify_list,
erc-message-english-notify_on, erc-message-english-notify_off): Define
at top level using `defvar'. Replace nonstandard underscores with
hyphens. Alias obsolete names.
* lisp/erc/erc-page.el (erc-message-english-CTCP-PAGE): Define at top
level using `defvar'.
* lisp/erc/erc-sasl.el (erc-message-english-s902,
erc-message-english-s904, erc-message-english-s905,
erc-message-english-s906, erc-message-english-s907,
erc-message-english-s908): Define at top level using `defvar'.
* lisp/erc/erc-sound.el (erc-message-english-CTCP-SOUND): Define using
`defvar'.
* lisp/erc/erc.el (erc--make-message-variable-name): New function to
replace `erc-make-message-variable-name' internally, where most uses
previously checked whether the returned variable was bound. This
helper now does that conditionally, when asked.
(erc-make-message-variable-name): Defer to internal variant,
`erc--make-message-variable-name'.
(erc-define-catalog-entry, erc-define-catalog): Deprecate.
(erc-retrieve-catalog-entry): Refactor to favor
`default-toplevel-value' of `erc-current-message-catalog' before
falling back to `english'. Not doing this was arguably a bug.
(erc-message-english-bad-ping-response,
erc-message-english-bad-syntax, erc-message-english-incorrect-args,
erc-message-english-cannot-find-file,
erc-message-english-cannot-read-file, erc-message-english-connect,
erc-message-english-country, erc-message-english-country-unknown,
erc-message-english-ctcp-empty, erc-message-english-ctcp-request,
erc-message-english-ctcp-request-to,
erc-message-english-ctcp-too-many, erc-message-english-flood-ctcp-off,
erc-message-english-flood-strict-mode,
erc-message-english-disconnected,
erc-message-english-disconnected-noreconnect,
erc-message-english-reconnecting,
erc-message-english-reconnect-canceled, erc-message-english-finished,
erc-message-english-terminated, erc-message-english-login,
erc-message-english-nick-in-use, erc-message-english-nick-too-long,
erc-message-english-no-default-channel,
erc-message-english-no-invitation, erc-message-english-no-target,
erc-message-english-ops, erc-message-english-ops-none,
erc-message-english-undefined-ctcp,
erc-message-english-user-mode-redundant-add,
erc-message-english-user-mode-redundant-drop,
erc-message-english-variable-not-bound, erc-message-english-ACTION,
erc-message-english-CTCP-CLIENTINFO, erc-message-english-CTCP-ECHO,
erc-message-english-CTCP-FINGER, erc-message-english-CTCP-PING,
erc-message-english-CTCP-TIME, erc-message-english-CTCP-UNKNOWN,
erc-message-english-CTCP-VERSION, erc-message-english-ERROR,
erc-message-english-INVITE, erc-message-english-JOIN,
erc-message-english-JOIN-you, erc-message-english-KICK,
erc-message-english-KICK-you, erc-message-english-KICK-by-you,
erc-message-english-MODE, erc-message-english-MODE-nick,
erc-message-english-NICK, erc-message-english-NICK-you,
erc-message-english-PART, erc-message-english-PING,
erc-message-english-PONG, erc-message-english-QUIT,
erc-message-english-TOPIC, erc-message-english-WALLOPS,
erc-message-english-s004, erc-message-english-s221,
erc-message-english-s252, erc-message-english-s253,
erc-message-english-s254, erc-message-english-s275,
erc-message-english-s301, erc-message-english-s303,
erc-message-english-s305, erc-message-english-s306,
erc-message-english-s307, erc-message-english-s311,
erc-message-english-s312, erc-message-english-s313,
erc-message-english-s314, erc-message-english-s317,
erc-message-english-s317-on-since, erc-message-english-s319,
erc-message-english-s320, erc-message-english-s321,
erc-message-english-s322, erc-message-english-s324,
erc-message-english-s328, erc-message-english-s329,
erc-message-english-s330, erc-message-english-s331,
erc-message-english-s332, erc-message-english-s333,
erc-message-english-s341, erc-message-english-s352,
erc-message-english-s353, erc-message-english-s367,
erc-message-english-s367-set-by, erc-message-english-s368,
erc-message-english-s379, erc-message-english-s391,
erc-message-english-s396, erc-message-english-s401,
erc-message-english-s402, erc-message-english-s403,
erc-message-english-s404, erc-message-english-s405,
erc-message-english-s406, erc-message-english-s412,
erc-message-english-s421, erc-message-english-s431,
erc-message-english-s432, erc-message-english-s442,
erc-message-english-s445, erc-message-english-s446,
erc-message-english-s451, erc-message-english-s461,
erc-message-english-s462, erc-message-english-s463,
erc-message-english-s464, erc-message-english-s465,
erc-message-english-s471, erc-message-english-s473,
erc-message-english-s474, erc-message-english-s475,
erc-message-english-s481, erc-message-english-s482,
erc-message-english-s483, erc-message-english-s484,
erc-message-english-s485, erc-message-english-s491,
erc-message-english-s501, erc-message-english-s502,
erc-message-english-s671): Define at top level using `defvar'.
* test/lisp/erc/erc-tests.el (erc-tests--string-to-propertized-parts,
erc-tests-pp-propertized-parts, erc--make-message-variable-name,
erc-retrieve-catalog-entry): New tests along with utility functions
and a convenience command for manipulating catalogs. (Bug#67677)
Po Lu [Mon, 18 Dec 2023 03:10:40 +0000 (11:10 +0800)]
Enable the new font scaler
* src/sfnt.c (sfnt_curve_is_flat): Tighten threshold for flat
curves.
(sfnt_insert_raster_step): Rewrite loop for clarity.
(sfnt_poly_set_steps): New function; fill small spans with a
plain unexceptional loop rather than memset.
(sfnt_poly_steps): Call that function.
(sfnt_verbose, main): Adjust tests such that the scaler can be
selected at runtime.
* src/sfnt.h: Update prototypes.
* src/sfntfont.c (sfntfont_get_glyph_raster)
(syms_of_sfntfont) <sfnt_raster_glyphs_exactly>: New variable.
* lisp/thingatpt.el (thing-at-point-email-regexp): Allow for
a (thing-at-point 'email) query to match addresses with slashes, as
used by Sourcehut. (Bug#67600)
Stefan Kangas [Sun, 17 Dec 2023 08:45:05 +0000 (09:45 +0100)]
Never send user email address in HTTP requests
It used to be possible to customize 'url-privacy-level' so that the
user's email address was sent along in HTTP requests. Since
'url-privacy-level' is also a blocklist, rather than an allowlist,
this meant that a mere misconfiguration of Emacs risked exposing the
user's email address. This is a serious privacy risk, and it is thus
better if we remove this dangerous feature altogether.
* lisp/url/url-http.el (url-http-create-request): Never send the
user email address.
* lisp/url/url-vars.el (url-personal-mail-address): Make obsolete.
* lisp/url/url-privacy.el (url-setup-privacy-info): Don't set
above obsolete variable.
* doc/misc/url.texi (Customization):
* lisp/url/url-vars.el (url-privacy-level): Update documentation
to reflect the above changes.
Eric Abrahamsen [Fri, 15 Dec 2023 14:59:38 +0000 (06:59 -0800)]
; Remove out-of-date documentation about Gnus delayed articles
* doc/misc/gnus.texi (Delayed Articles): As of commit 7725fbc5b this
paragraph is no longer true; the "Date" header is not included in
`message-draft-headers' by default.
Stefan Monnier [Sat, 9 Dec 2023 23:38:35 +0000 (18:38 -0500)]
(display-buffer): New `pop-up-frames` action alist entry
Allow overriding the `pop-up-frames` variable from `display-buffer-alist`
so as to provide a worthy replacement for the old `same-frame`
parameter of `special-display-*` (bug#67249).
* lisp/window.el (special-display-popup-frame): Declare obsolete;
that was apparently forgotten back when `special-display-*` variables
were declared obsolete.
Use the new `pop-up-frames` action alist entry instead of the variable.
(display-buffer): Document new alist entry.
(window--pop-up-frames): New function.
(display-buffer--maybe-pop-up-frame, display-buffer-in-previous-window)
(display-buffer-reuse-window, display-buffer-reuse-mode-window): Use it.
* doc/lispref/windows.texi (Choosing Window Options): Mention that
`pop-up-frames` is also an action alist entry.
(Buffer Display Action Alists): Add `pop-up-frames` entry.
Eli Zaretskii [Sat, 16 Dec 2023 14:17:51 +0000 (09:17 -0500)]
Merge from origin/emacs-29
bf4ccb0be07 ; * lisp/term.el (term--xterm-paste): Fix last change. 0d9e2e448d9 ; * doc/lispref/functions.texi (Function Documentation): ... 791cc5065da Fix shaping of Sinhala text efcbf0b5abf Add use cases of (fn) documentation facility. c3331cb3659 Fix pasting into terminal-mode on term.el 5be94e2bce5 Fix opening directory trees from Filesets menu 6b6e770a1f5 Eglot: Add ruff-lsp as an alternative Python server ed8a8a5ba16 Fix symbol name in Multisession Variables examples 400ef15bdc3 js-ts-mode: Fix font-lock rules conflict c165247c300 Add indentation rules for bracketless statements in js-ts... 7f1bd69cd19 Fix c-ts-mode bracketless indentation for BSD style (bug#... e23068cb9a1 Add missing indent rules in c-ts-mode (bug#66152) d2c4b926ac2 Fix treesit-default-defun-skipper (bug#66711) 9874561f39e Fix treesit-node-field-name and friends (bug#66674) eace9e11226 python-ts-mode: Highlight default parameters 23c06c7c308 Update to Org 9.6.13
Eli Zaretskii [Sat, 16 Dec 2023 13:33:02 +0000 (15:33 +0200)]
Fix shaping of Sinhala text
* lisp/language/sinhala.el (composition-function-table): Allow
U+200D U+0DCA as well as U+0DCA U+200D between consonants.
Suggested by Richard Wordingham <richard.wordingham@ntlworld.com>.
(Bug#67828)
Eli Zaretskii [Sat, 16 Dec 2023 11:25:58 +0000 (13:25 +0200)]
Fix opening directory trees from Filesets menu
In bug#976, the code was fixed, but the cautious condition in
the original author's code, which catered to invoking
'filelists-open' from the menu-bar menu, was omitted, which made
that invocation, which did work before, broken.
* lisp/filesets.el (filesets-get-filelist): Fix opening directory
trees from the Filesets menu-bar menu. (Bug#67658)
Niall Dooley [Fri, 24 Nov 2023 15:52:36 +0000 (16:52 +0100)]
Eglot: Add ruff-lsp as an alternative Python server
ruff-lsp [1] is an LSP server for Ruff [2], [3], a fast Python linter
and code formatter.
It supports surfacing Ruff diagnostics and providing Code Actions to
fix them, but is intended to be used alongside another Python LSP in
order to support features like navigation and autocompletion.
Dmitry Gutov [Sat, 16 Dec 2023 02:57:44 +0000 (04:57 +0200)]
ruby-syntax-methods-before-regexp: Drop this whitelist
* lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re):
Match only based on keywords and operators.
(ruby-syntax-methods-before-regexp): Delete.
(ruby-syntax-propertize): Use the new heuristic based on spaces
instead of checking for method names before (bug#67569).
* test/lisp/progmodes/ruby-mode-tests.el
(ruby-regexp-not-division-when-only-space-before):
Use non-whitelisted method name.
* test/lisp/progmodes/ruby-mode-resources/ruby.rb:
Adjust two examples.
Dmitry Gutov [Fri, 15 Dec 2023 23:48:29 +0000 (01:48 +0200)]
(vc-print-log-setup-buttons): Start "previous" history with specified revision
* lisp/vc/vc-git.el (vc-git-file-name-changes-switches): Remove
the comment above the option. Seems unnecessary now.
* lisp/vc/vc.el (vc-print-log-setup-buttons): Start the "previous"
change history buffer with the specified revision, rather than
have the sentinel jump to it. Apparently in some cases the
history of the old name can't be found. In others, the log just
shows faster. But note the caveat described in the second new
comment (bug#55871).
Dmitry Gutov [Fri, 15 Dec 2023 23:36:47 +0000 (01:36 +0200)]
Show buttons below vc-log even when REVISION is specified
E.g. in the vc-print-branch-log which specifies start revision.
* lisp/vc/vc.el (vc-print-log-internal): Remove outdated comment.
(vc-print-log-setup-buttons): Only special-case non-nil
IS-START-REVISION when LIMIT=1. We often do need buttons for logs
that start with a particular revision, because those are still limited
by vc-log-show-limit.
Dmitry Gutov [Fri, 15 Dec 2023 20:26:59 +0000 (22:26 +0200)]
Support viewing VC change history across renames (Git, Hg)
* lisp/vc/vc.el (vc-print-log-setup-buttons):
When the log ends at a rename, add a button to jump to the
previous names. Use the new backend action 'file-name-changes'.
João Távora [Thu, 14 Dec 2023 22:56:33 +0000 (22:56 +0000)]
Jsonrpc: add new jsonrpc-autoport-bootstrap helper
This will help Eglot and some other extensions connect to network
servers that are started with a call to a local program.
* lisp/jsonrpc.el (jsonrpc--process-sentinel): Also delete inferior.
(jsonrpc-process-connection): Add -autoport-inferior slot.
(initialize-instance jsonrpc-process-connection): Check
process-creating function arity. Use jsonrpc-forwarding-buffer
(jsonrpc-autoport-bootstrap): New helper.
(Version): Bump to 1.0.20.
João Távora [Thu, 14 Dec 2023 16:32:54 +0000 (16:32 +0000)]
Eglot: beware activation in fundamental-mode
In the specific situation of visiting a buffer via M-. with
eglot-extend-to-xref set to t, it was found that buffer was first
visited in fundamental mode, running after-change-major-mode-hook, and
then again in the proper major mode for the file. The call to
eglot-current-server of the first visit returned non-nil which cause
two didOpen notifications to be issued for the same file.
Furthermore, in the first call, eglot--languageId to returned nil,
prompting an error from servers such as rust-analyzer.
See also: https://github.com/joaotavora/eglot/discussions/1330
* lisp/progmodes/eglot.el (eglot-current-server): Watch out for
fundamental-mode.
Po Lu [Thu, 14 Dec 2023 05:24:42 +0000 (13:24 +0800)]
Respect Language & Input preferences under Android
* doc/emacs/android.texi (Android Environment):
* doc/emacs/cmdargs.texi (General Variables): Mention the manner
in which the default language environment is selected on
Android.
* lisp/startup.el (normal-top-level): If android and
initial-window-system, call android-locale-for-system-language
for the default locale name.
* lisp/term/android-win.el (android-locale-for-system-language):
New function.
* src/androidfns.c (syms_of_androidfns_for_pdumper): New
function.
(syms_of_androidfns) <Vandroid_os_language>: New variable.
Call syms_of_androidfns_for_pdumper both now and after
loading the dump image.
João Távora [Mon, 11 Dec 2023 00:01:03 +0000 (00:01 +0000)]
Jsonrpc: rework fix for bug#60088
Try to decouple receiving text and processing messages in the event
loop. This should allow for requests within requests in both Eglot
and the Dape extension (https://github.com/svaante/dape).
jsonrpc-connection-receive is now called from timers after the process
filter finished. Because of this, a detail is that any serialization
errors are now thrown from timers instead of the synchronous process
filter, and there's no good way to test this in ert, so a test has
been deleted.
Dmitry Gutov [Tue, 12 Dec 2023 22:00:38 +0000 (00:00 +0200)]
js-ts-mode: Fix font-lock rules conflict
* lisp/progmodes/js.el (js--treesit-font-lock-settings): Move
'property' to after 'jsx'. Stop using predicate (bug#67684).
(js--treesit-property-not-function-p): Delete.
Eric Abrahamsen [Fri, 8 Dec 2023 17:39:58 +0000 (09:39 -0800)]
Provide option to forward Gnus messages with all (most) headers
Bug#67520
* lisp/gnus/gnus-msg.el (gnus-summary-mail-forward): Accept symbolic
prefix to let-bind message-forward-included-headers to nil, which will
include most original message headers in the forwarded copy.
(gnus-summary-post-forward): Corresponding arglist update.
Noah Peart [Sun, 10 Dec 2023 22:58:31 +0000 (14:58 -0800)]
Add indentation rules for bracketless statements in js-ts-mode
* lisp/progmodes/js.el (js--treesit-indent-rules): Add indentation
rules to handle bracketless statements (bug#67758).
* test/lisp/progmodes/js-tests.el (js-ts-mode-test-indentation):
New test for js-ts-mode indentation.
* test/lisp/progmodes/js-resources/js-ts-indents.erts: New file
with indentation tests for js-ts-mode.
Yuan Fu [Mon, 11 Dec 2023 02:24:27 +0000 (18:24 -0800)]
Fix c-ts-mode bracketless indentation for BSD style (bug#66152)
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--indent-styles): Make sure the BSD rules only apply to
opening bracket (compound_statement), then bracketless statements will
fallback to common rules.
* test/lisp/progmodes/c-ts-mode-resources/indent-bsd.erts: Copy the
bracketless test from indent.erts to here.
Yuan Fu [Mon, 11 Dec 2023 00:23:44 +0000 (16:23 -0800)]
Fix treesit-node-field-name and friends (bug#66674)
So turns out ts_node_field_name_for_child takes a named node index,
but we were passing it normal index that counts both named and
anonymous nodes. That's what makes the field name all wrong in
treesit explorer.
* doc/lispref/parsing.texi:
(Accessing Node Information): Update docstring.
* lisp/treesit.el (treesit-node-index): Add some unrelated comment.
(treesit-node-field-name): Get named node index rather than all node
index.
* src/treesit.c (Ftreesit_node_field_name_for_child): Update
docstring, use ts_node_named_child_count.
Stefan Kangas [Sun, 10 Dec 2023 21:06:54 +0000 (22:06 +0100)]
Mark `;#@` as :safe for asm-comment-char
* lisp/progmodes/asm-mode.el (asm--safe-comment-char-p): New function
that returns true for characters #, @, and ;.
(asm-comment-char): Use new function as :safe predicate.
Stefan Kangas [Sun, 10 Dec 2023 21:04:51 +0000 (22:04 +0100)]
; Use ?c instead of integer in local variables
* exec/loader-armeabi.s (timespec):
* exec/loader-mips64el.s (__start):
* exec/loader-mipsel.s (__start): Use ?c instead of integer in local
variables.
Yuan Fu [Sun, 10 Dec 2023 09:24:25 +0000 (01:24 -0800)]
Fix c-ts-mode indent heuristic (bug#67417)
This is a continuation of the first two patches for bug#67417. The
c-ts-mode--prev-line-match heuristic we added is too broad, so for now
we are just adding a very specific heuristic for the else case.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--prev-line-match): Remove function.
(c-ts-mode--else-heuristic): New function.
(c-ts-mode--indent-styles): Use c-ts-mode--else-heuristic.
nverno [Wed, 22 Nov 2023 00:33:04 +0000 (16:33 -0800)]
Fix c-ts-mode indentation (bug#67357)
1. In a compund_statement, we indent the first sibling against the
parent, and the rest siblings against their previous sibling. But
this strategy falls apart when the first sibling is not on its own
line. We should regard the first sibling that is on its own line as
the "first sibling"", and indent it against the parent.
2. In linux style, in a do-while statement, if the do-body is
bracket-less, the "while" keyword is indented to the same level as the
do-body. It should be indented to align with the "do" keyword
instead.
* lisp/progmodes/c-ts-mode.el:
(c-ts-mode--no-prev-standalone-sibling): New function.
(c-ts-mode--indent-styles): Use
c-ts-mode--no-prev-standalone-sibling. Add while keyword indent rule.
* test/lisp/progmodes/c-ts-mode-resources/indent.erts: New tests.
Dmitry Gutov [Sat, 9 Dec 2023 17:04:55 +0000 (19:04 +0200)]
ruby-mode: Better detect regexp vs division (bug#67569)
* lisp/progmodes/ruby-mode.el (ruby-syntax-before-regexp-re):
Add grouping around methods from the whitelist.
(ruby-syntax-propertize): Also look for spaces around the slash.
Manuel Giraud [Sat, 9 Dec 2023 12:02:19 +0000 (13:02 +0100)]
Fix desktop-save for dired buffers (bug#66697)
* lisp/dired.el (dired-desktop-save-p): Move all logic here. Carry on
when 'desktop-files-not-to-save' is nil.
(dired-desktop-buffer-misc-data): Use it.