1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 00:01:33 -08:00
Commit graph

176822 commits

Author SHA1 Message Date
Robert Pluim
b967891088 Correct docstrings describing "Re" alternatives.
* lisp/mail/mail-utils.el (mail-re-regexps): Use "Re", not "Re:".
* lisp/mail/rmail.el (rmail-re-abbrevs): Here also.
2025-02-14 16:22:05 +01:00
Stefan Kangas
7c22f13ba3 ; * doc/misc/message.texi (Message Headers): Improve wording.
(Bug#72442)
2025-02-14 16:18:46 +01:00
Basil L. Contovounesios
2b68e3f48b ; Suppress obsoletion warning in package-x tests. 2025-02-14 15:42:52 +01:00
Basil L. Contovounesios
ac143186c0 Document cl-n... set operations consistently
The docstrings of cl-nintersection and cl-nset-difference have been
inconsistent with their manual entries since the beginning of
emacs.git history (bug#76017).  This patch settles on the weaker and
thus backward-compatible requirement that only their first argument
be safe to mutate.

* lisp/emacs-lisp/bytecomp.el: Include only first argument in
mutates-arguments property.
* lisp/emacs-lisp/cl-seq.el (cl-nintersection, cl-nset-difference):
Make docstring consistent with manual in that the second argument is
not modified.
* test/lisp/emacs-lisp/cl-seq-tests.el (cl-nintersection-test)
(cl-nset-difference-test): Simplify.
(cl-nset-difference): Pass fresh list as second argument, otherwise
destructive modifications to it could go undetected.
2025-02-14 15:42:52 +01:00
Basil L. Contovounesios
0edf094e54 Consolidate some cl-lib tests
For discussion, see bug#75633#16 and the following thread:
https://lists.gnu.org/r/emacs-devel/2025-02/msg00053.html

* test/lisp/emacs-lisp/cl-extra-tests.el (cl-lib-test-remprop)
(cl-lib-test-coerce-to-vector, cl-parse-integer): Move here from
cl-lib-tests.el.
(cl-extra-test-remprop): Remove duplicate test, folding body...
(cl-get): ...into this test.
(cl-extra-test-concatenate): Remove duplicate test, folding body...
(cl-concatenate): ...into this test.
* test/lisp/emacs-lisp/cl-lib-tests.el: Update historic commentary.
(cl-lib-test-remprop, cl-lib-test-coerce-to-vector)
(cl-parse-integer): Move to cl-extra-tests.el.
(cl-lib-test-remove-if-not, cl-lib-test-remove)
(cl-lib-test-set-functions, cl-lib-test-string-position)
(cl-lib-test-mismatch, cl-nset-difference): Move to cl-seq-tests.el.
(cl-lib-test-gensym, cl-lib-keyword-names-versus-values)
(cl-lib-empty-keyargs, mystruct, cl-lib-struct-accessors)
(cl-lib-struct-constructors, cl-lib-arglist-performance, cl-the)
(cl-flet-test, cl-lib-test-typep, cl-lib-symbol-macrolet)
(cl-lib-symbol-macrolet-4+5, cl-lib-symbol-macrolet-2)
(cl-lib-symbol-macrolet-hide, cl-lib-defstruct-record): Move to
cl-macs-tests.el.
(cl-lib-test-endp): Remove duplicate test, folding body into
cl-seq-endp-test.
(cl-lib-set-difference): Remove duplicate test, folding body into
cl-set-difference-test.
* test/lisp/emacs-lisp/cl-macs-tests.el: Do not require cl-macs and
pcase.
(mystruct, cl-lib-struct-accessors, cl-lib-struct-constructors)
(cl-lib-arglist-performance, cl-lib-defstruct-record)
(cl-lib-symbol-macrolet, cl-lib-symbol-macrolet-4+5)
(cl-lib-symbol-macrolet-2, cl-lib-symbol-macrolet-hide, cl-flet-test)
(cl-lib-keyword-names-versus-values, cl-lib-empty-keyargs)
(cl-lib-test-gensym, cl-the, cl-lib-test-typep): Move here from
cl-lib-tests.el.
(cl-case-error, cl-case-warning): Fix indentation.
* test/lisp/emacs-lisp/cl-seq-tests.el: Require cl-lib rather than
cl-seq.
(cl-seq-endp-test): Absorb body of cl-lib-test-endp.
(cl-lib-test-remove, cl-lib-test-remove-if-not)
(cl-lib-test-string-position, cl-lib-test-mismatch)
(cl-lib-test-set-functions, cl-nset-difference): Move here from
cl-lib-tests.el.
(cl-set-difference-test): Absorb body of cl-lib-set-difference.
2025-02-14 15:42:52 +01:00
Michael Albinus
9ded6fd73e Adapt PuTTY integration into Tramp
* doc/misc/tramp.texi (Inline methods, External methods):
PuTTY must be at least version 0.82.

* lisp/net/tramp-cache.el (with-tramp-saved-connection-property)
(with-tramp-saved-connection-properties): Add traces.

* lisp/net/tramp-sh.el (tramp-methods) <plink, plinkx, pscp, psftp>:
Adapt `tramp-login-args' and `tramp-copy-args' arguments.  (Bug#75746)
2025-02-14 15:21:30 +01:00
Pip Cet
608113628c Avoid crashes in lread.c when invalid characters are read
* src/lread.c (readchar): Don't crash for non-fixnum return values.
(read_filtered_event): Don't crash for invalid symbol properties.
(Fread_char):
(Fread_char_exclusive):
(character_name_to_code): Check 'FIXNUMP' before using 'XFIXNUM'.
(read_char_escape): Crash on invalid Lisp-supplied data when
ENABLE_CHECKING; otherwise, signal an error.
2025-02-14 13:51:28 +00:00
Po Lu
4d6f40dfc9 * lisp/x-dnd.el (x-dnd-do-direct-save): Remove redundant stmts. 2025-02-14 17:56:38 +08:00
Yuan Fu
7ac578c57c
Use a heuristic to support method chaining in c-ts-common
Test for "." at the beginning of a line to detect chained method.

* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-predicate): New function.
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Use the new heuristic.
2025-02-13 21:59:00 -08:00
Yuan Fu
34f90bf2ca
Allow treesit-simple-indent-standalone-predicate to return anchor
* lisp/treesit.el:
(treesit-simple-indent-standalone-predicate): Allow it to return
an anchor instead of t.
(treesit-simple-indent-presets): Supports number.
* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Supports number.
2025-02-13 20:47:23 -08:00
Yuan Fu
adabee8873
; Fix standalone-parent preset for tree-sitter
* lisp/treesit.el (treesit-simple-indent-presets): Fix typo.
2025-02-13 20:30:09 -08:00
Yuan Fu
4b020b936c
Add treesit-simple-indent-standalone-predicate (bug#74386)
* lisp/treesit.el:
(treesit-simple-indent-standalone-predicate): New variable.
(treesit-simple-indent-presets): Use the predicate.
(treesit-simple-indent-presets): Update docstring.
* lisp/progmodes/c-ts-common.el:
(c-ts-common--standalone-parent):
(c-ts-common--prev-standalone-sibling): Use the predicate if
non-nil.  Also, handle method chaining by default.
* doc/lispref/modes.texi (Parser-based Indentation): Add
documentation.
2025-02-13 20:18:02 -08:00
Basil L. Contovounesios
b8c8ae92db Fix uncaught cl-nreconc on constant list
* test/lisp/emacs-lisp/cl-extra-tests.el (cl-extra-test-isqrt):
Expect most specific error type.
(cl-extra-test-nreconc): Pass fresh list as first argument to
cl-nreconc.  The usual mutates-arguments warning was not emitted,
possibly in relation to bug#74920 and cl-nreconc being proclaimed
inline.
(cl-extra-test-list-length): Simplify using nconc.
2025-02-13 18:40:26 +01:00
Basil L. Contovounesios
52034675a2 Fix cl-seq-tests.el
None of the tests using the macro cl-seq--with-side-effects were
being evaluated (since bug#24264), and other tests were not robust
against destructive operations or optimizations (since bug#24264 and
bug#75633).  For further discussion, see:
https://lists.gnu.org/r/emacs-devel/2025-02/msg00053.html

* test/lisp/emacs-lisp/cl-seq-tests.el: Fit first line within 80
columns.  Remove empty Commentary section.
(cl-union-test-00): Use bug#N reference in place of URL.
(cl-seq-test-bug24264): Ditto.  Use nconc in place of append.
(cl-seq--test-list, cl-seq--test-list2, cl-seq--with-side-effects):
Remove.
(cl-seq-tests--relet*): New convenience macro replacing the need for
cl-seq--with-side-effects.
(cl-seq-fill-test, cl-seq-replace-test, cl-seq-delete-test): Use
cl-seq-tests--relet* to actually evaluate tests.  Avoid mutating
quoted literals.
(cl-seq-nsubstitute-test): Ditto.  Actually call cl-nsubstitute, not
cl-substitute.  Avoid comparing mutated argument to itself; compare
to its original copy instead.  Avoid calling cl-position on list
that is being mutated in :if predicate; use original copy instead.
(cl-seq-remove-test, cl-remove-if-not-test, cl-delete-if-not-test)
(cl-delete-duplicates-test, cl-seq-remove-duplicates-test)
(cl-seq-substitute-test, cl-seq-substitute-if-test)
(cl-seq-position-test, cl-count-if-test, cl-count-if-not-test)
(cl-member-if-test, cl-member-if-not-test, cl-assoc-if-test)
(cl-assoc-if-not-test, cl-rassoc-if-test, cl-subsetp-test):
Simplify.
(cl-remove-if-test, cl-seq-substitute-if-not-test, cl-find-if-test)
(cl-find-if-not-test, cl-position-if-test, cl-member-test)
(cl-assoc-test, cl-rassoc-test): Quote function symbols, not
lambdas.
(cl-delete-if-test): Use cl-seq-tests--relet*.  Check result of
cl-delete-if to avoid relying on its side effects, and to pacify
byte-compiler warning.
(cl-seq-mismatch-test): Avoid 'easy to misread' hidden argument.
(cl-seq-search-test): Break long line.
(cl-sort-test, cl-stable-sort-test, cl-merge-test): Avoid mutating
quoted literals.
(cl-intersection-test): Avoid comparing eql-ity of string literals.
(cl-nintersection-test, cl-nset-difference-test)
(cl-nset-exclusive-or-test): Avoid mutating quoted literals.  Don't
compare initial and final values of arguments, since they may have
been mutated.
(cl-set-difference-test, cl-set-exclusive-or-test): Use fresh
arguments to check for absence of mutation.
2025-02-13 18:40:26 +01:00
Basil L. Contovounesios
9746fbc264 ; Fix last change to cl-extra.el. 2025-02-13 18:40:26 +01:00
Stefan Kangas
7d9e67be13 Inline side-effect-free declarations in cl-lib.el
* lisp/emacs-lisp/cl-macs.el: Move side-effect-free declarations from
here...
* lisp/emacs-lisp/cl-extra.el (cl-gcd, cl-lcm, cl-isqrt, cl-floor)
(cl-ceiling, cl-truncate, cl-round, cl-mod, cl-rem, cl-signum)
(cl-subseq, cl-list-length, cl-get, cl-getf):
* lisp/emacs-lisp/cl-lib.el (cl-plusp, cl-minusp, cl-oddp, cl-evenp)
(cl-fifth, cl-sixth, cl-seventh, cl-eighth, cl-ninth, cl-tenth)
(cl-ldiff, cl-pairlis):
* lisp/emacs-lisp/cl-seq.el (cl-endp): ...to have them inline here.

* lisp/emacs-lisp/cl-macs.el: Move side-effect-and-error-free
declarations from here...
* lisp/emacs-lisp/cl-extra.el (cl-equalp, cl-random-state-p):
* lisp/emacs-lisp/cl-lib.el (cl-list*, cl-acons): ...to have them inline
here.  (Bug#76247)
2025-02-13 17:50:40 +01:00
Robert Pluim
745847ba8e Support non-ascii SMTP user and password strings
The user and more importantly the password used when
authenticating SMTP connections MUST be encoded in utf-8, and
'base64-encode-string' requires unibyte strings, so call
'encode-coding-string' on them before base64 encoding them in
case they are multibyte strings.

This applies to the CRAM-MD5, LOGIN, and PLAIN auth methods.
XOAUTH2 access tokens are specified to contain only characters
in the range #x20-#x7E (SPC through ~), so utf-8 encoding is not
necessary.

See RFC 4616 and RFC 4954 (or their later updates).

* lisp/mail/smtpmail.el (smtpmail-try-auth-method): Encode user
and password using utf-8 before base64 encoding.

(Bug#75628)
2025-02-13 14:30:38 +01:00
Robert Pluim
315519fa7c Teach gnus/message about international Re: variants
* lisp/mail/mail-utils.el (mail-re-regexps): New defcustom,
contains the components used to construct 'rmail-re-abbrevs' and
'message-subject-re-regexp'.
* lisp/gnus/message.el (message-subject-re-regexp): Derive from
'mail-re-regexps'.
(message-strip-subject-re): Make the match case-insensitive.
* lisp/mail/rmail.el (rmail-re-abbrevs): Derive from
'mail-re-regexps'.  Update 'rmail-reply-regexp' when it changes.
(rmail-reply-regexp): Set to nil, 'rmail-re-abbrevs' will set
it.

* doc/emacs/rmail.texi (Rmail Reply): Describe
'mail-re-regexps'.
* doc/misc/message.texi (Message Headers): Describe
'mail-re-regexps'.

(Bug#72442)
2025-02-13 14:20:28 +01:00
Robert Pluim
2f8c2e64e0 Use 'const' instead of 'symbol' in 'c-ts-mode-indent-style
The 'symbol' widget is for when the user is expected to enter a
symbol; when using a definite symbol, 'const' is preferred.

* lisp/progmodes/c-ts-mode.el (c-ts-mode-indent-style): Use
'const' to define the options for a 'choice' widget.
2025-02-13 14:19:04 +01:00
Michael Albinus
167157fc21 * lisp/net/tramp-archive.el (tramp-archive-all-gvfs-methods): Use `cdadr'. 2025-02-13 11:21:30 +01:00
Björn Bidar
6967587dae Bind sieve-refresh-scriptlist to 'g' in sieve-mode
* lisp/net/sieve.el (sieve-manage-mode-map): Bind
`sieve-refersh-scriptlist' to 'g' to refresh buffer.
(sieve-refresh-scriptlist): Highlight in docstring that the function
updates the current sieve buffer.  (Bug#75956)

* doc/misc/sieve.texi (Managing Sieve): Document new keybinding and the
existing `sieve-refresh-scriptlist` function.
2025-02-13 10:31:01 +01:00
Björn Bidar
c5bfaf1ae3 Add missing documentation strings in sieve.el
* lisp/net/sieve.el (sieve-activate, sieve-deactivate-all)
(sieve-remove, sieve-edit-script, sieve-refersh-scriptlist)
(sieve-upload, sieve-upload-and-burry, sieve-upload-and-kill):
Add documentation strings.  (Bug#75956)
2025-02-13 10:30:31 +01:00
Björn Bidar
07d1fdb1ea Make sieve-manage prompt also for port number
(sieve-manage): Optionally read port number when called interactively.
Add documentation string.  (Bug#75956)
2025-02-13 10:30:30 +01:00
Stefan Kangas
d06606ff42 Avoid cl-caaar etc. compatibility aliases in Tramp
* lisp/net/tramp-gvfs.el (tramp-gvfs-handler-askquestion):
(tramp-gvfs-handler-mounted-unmounted):
(tramp-gvfs-connection-mounted-p):
* lisp/net/tramp-sh.el (tramp-sh-gio-monitor-process-filter):
(tramp-sh-inotifywait-process-filter): Don't use cl-caaar
etc. compatibility aliases.  (Bug#76249)
2025-02-13 09:51:50 +01:00
Stefan Kangas
2dad63cac3 Fix defcustom :type of gnus-logo-colors
* lisp/gnus/gnus.el (gnus-logo-colors): Fix defcustom :type.
2025-02-13 09:25:12 +01:00
Stefan Kangas
069c8ff6d5 Improve read-directory-name docstring
* lisp/files.el (read-directory-name): Improve docstring to be more
similar to that of 'read-file-name', and refer back to it where
appropriate.
2025-02-13 08:47:10 +01:00
Joseph Turner
3f1d84d593 Add optional PREDICATE argument to read-directory-name
* lisp/files.el (read-directory-name): Add optional PREDICATE argument.
* doc/lispref/minibuf.texi (Reading File Names): Document above change.
(Bug#66224)
2025-02-13 08:32:28 +01:00
Stefan Kangas
2e9413255f Increase recentf-max-saved-items to 25
* lisp/recentf.el (recentf-max-saved-items): Increase default to 25.
2025-02-13 07:08:07 +01:00
Stefan Kangas
ab43d956ca ; Properly quote some functions in cl-lib as such 2025-02-13 03:59:30 +01:00
Ship Mints
6077bbfc3d project-(remember|forget)-projects-under: Improve docstrings
* lisp/progmodes/project.el (project-forget-projects-under)
(project-remember-projects-under): Clarify docstrings (bug#76234).
2025-02-13 02:14:57 +02:00
shipmints
86e17fbcbd Change the project-switch-project prompt to include the dir name
* lisp/progmodes/project.el:
(project--switch-project-command): Add new argument DIR.
Change the prompt to "Command in `xxx': ..." (bug#76235).
(project-switch-project): Pass DIR to the above function.
2025-02-13 00:35:53 +02:00
Stefan Kangas
b93cdeb047 Consolidate side-effect-free decls in cl-lib
* lisp/emacs-lisp/cl-macs.el: Consolidate two identical loops with
side-effect-free declarations into one.
2025-02-12 21:30:47 +01:00
Stefan Kangas
a669e6a376 Avoid cl-caaar etc. compatibility macros in Org
* lisp/org/ob-core.el (org-babel-process-params):
* lisp/org/org-agenda.el (org-agenda-span-to-ndays):
* lisp/org/org-capture.el (org-capture-set-target-location):
* lisp/org/org.el (org-set-effort): Don't use cl-caaar, cl-caadr,
etc. compatibility macros in Org.  We don't need to use them, since Org
requires Emacs 26.1.
2025-02-12 21:30:47 +01:00
Stefan Kangas
d5f788e016 ; * etc/symbol-releases.eld: Add caaar, caadr, etc. 2025-02-12 21:30:47 +01:00
Stefan Kangas
816b9b4a0b Delete comments about obsolete cl--compiler-macro-cXXr
* lisp/emacs-lisp/cl-macs.el:
* lisp/subr.el: Delete obsolete comments about compatibility alias
cl--compiler-macro-cXXr.
2025-02-12 21:30:47 +01:00
Stefan Kangas
f478d2d1b9 Declare caar, cadr, etc. as side-effect-free
* lisp/subr.el (caar, cadr, cdar, cddr, caaar, caadr, cadar, caddr)
(cdaar, cdadr, cddar, cdddr, caaaar, caaadr, caadar, caaddr, cadaar)
(cadadr, caddar, cadddr, cdaaar, cdaadr, cdadar, cdaddr, cddaar)
(cddadr, cdddar, cddddr): Declare side-effect-free.
* lisp/emacs-lisp/cl-macs.el: Remove redundant declarations of
compatibility aliases for the above functions as side-effect-free.
2025-02-12 21:30:30 +01:00
Stefan Kangas
31381f982d Add compiler macros for cl-oddp and cl-evenp
* lisp/emacs-lisp/cl-lib.el (cl-oddp, cl-evenp): Add compiler macros.
2025-02-12 21:30:30 +01:00
Juri Linkov
44c11cd424 Fix treesit-outline related settings
* lisp/treesit.el (treesit-outline-level): Use level 1 by default
since treesit-outline--at-point now always returns the current node.

* lisp/progmodes/ruby-ts-mode.el (ruby-ts-mode):
Use 'bos' instead of 'bol'.  Add "singleton_class" to
'treesit-outline-predicate'.  Use new condition 'named' in
'treesit-outline-predicate' (bug#74963).
2025-02-12 20:31:22 +02:00
Juri Linkov
b514ec87b6 ; * lisp/treesit.el: Remove TODO for integration with thing-at-point.
At this point, thing-at-point with all standard things
is already supported by treesit, for example:
"(thing-at-point 'defun)" by treesit-beginning-of-defun,
"(thing-at-point 'sexp)" by treesit-forward-sexp,
"(thing-at-point 'list)" by treesit-up-list,
"(thing-at-point 'sentence)" by treesit-forward-sentence,
"(thing-at-point 'comment)" by treesit-forward-comment.
https://lists.gnu.org/archive/html/emacs-devel/2025-02/msg00384.html
2025-02-12 19:42:35 +02:00
Dmitry Gutov
82da362862 New command project-find-matching-file
* lisp/progmodes/project.el (project--read-project-list):
Ensure that the directory has a trailing '/' (bug#75983).
2025-02-12 19:18:46 +02:00
Stefan Kangas
b9552ad844 Fix recently introduced test failure
* test/lisp/progmodes/go-ts-mode-tests.el
(go-mod-ts-mode-test-indentation): Fix test.
2025-02-12 17:41:37 +01:00
Stefan Kangas
5d4927192a Mark package-x.el as obsolete
* lisp/obsolete/package-x.el: Add "Obsolete-since" header.  (Bug#76194)
* doc/lispref/package.texi (Package Archives): Don't document package-x.
2025-02-12 17:41:37 +01:00
Stefan Kangas
f7867e6856 Move package-x.el to lisp/obsolete
* lisp/emacs-lisp/package-x.el: Move from here...
* lisp/obsolete/package-x.el: ...to here.  (Bug#76194)
2025-02-12 17:41:36 +01:00
Stefan Kangas
cdf9f3ae19 ; Fix indentation to appease git hooks
* lisp/emacs-lisp/package-x.el (package-upload-buffer-internal):
Fix indentation.
2025-02-12 17:41:36 +01:00
Ship Mints
2bb38cc46d Make reading project--list safer
* lisp/progmodes/project.el (project--read-project-list):
Ensure that each directory has a trailing '/' (bug#75983).
2025-02-12 18:03:54 +02:00
Martin Rudalics
8eef890739 Handle negative frame position values in xterm.c (Bug#76190)
* src/xterm.c (x_calc_absolute_position): Always handle negative
positions when XNegative or YNegative were set (Bug#76190).
2025-02-12 10:54:28 +01:00
Tassilo Horn
b5404a205c Allow URL-FORMAT as string and function in bug-reference-setup-from-vc-alist
That's a slight simplification resulting from bug#72735.

* lisp/progmodes/bug-reference.el (bug-reference-setup-from-vc-alist):
Rename URL-FORMAT-FN to URL-FORMAT and mention it may be string or
function.
* (bug-reference-maybe-setup-from-vc): Handle the new case where
bug-url-fmt is just a string rather than a function.
2025-02-12 10:41:54 +01:00
Stefan Kangas
2254f71598 ; Fix up last commit
* lisp/emulation/cua-base.el (cua--copy-or-cut-handler): Extract
function from...
(cua-cut-handler, cua-copy-handler): ...here.
(cua-cut-to-global-mark, cua-copy-to-global-mark): Declare.
2025-02-12 09:25:45 +01:00
Siyuan Chen
1fdfcad924 Fix 'C-x C-c' with cua-prefix-override-inhibit-delay nil
* lisp/emulation/cua-base.el (cua-cut-handler, cua-copy-handler): New
functions to fix cut and paste when 'cua-prefix-override-inhibit-delay'
is nil.  (Bug#71230)

Copyright-paperwork-exempt: yes
2025-02-12 09:25:45 +01:00
Po Lu
fa4260594f X11 drag-and-drop corrections
* lisp/x-dnd.el (x-dnd-handle-drag-n-drop-event): Take cdddr of
client-message, skipping the selection information.
(x-dnd-do-direct-save): Do not erase the local copy of a remote
file if it was not in fact copied on behalf of the recipient.
(x-dnd-handle-xds-drop): Return proper action.

* src/xterm.c (x_term_init): Remove unused variable on non-GTK
builds.
2025-02-12 15:51:39 +08:00