* 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.
Eshel Yaron [Tue, 5 Dec 2023 20:04:43 +0000 (21:04 +0100)]
; Hide completion preview when switching windows
* lisp/completion-preview.el
(completion-preview--window-selection-change): New function.
(completion-preview-active-mode): Add it to
'window-selection-change-functions'. (Bug#67650)
Remove old VC packages from 'package-alist' after installing
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): Wait for all
system operations to have been completed, before proceeding to remove
old package descriptors from 'package-alist'. This avoids loosing a
package if an error occurs during upgrades.