Commit graph

9427 commits

Author SHA1 Message Date
Stefan Monnier
2e7af2fc53 * lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete
* lisp/emacs-lisp/cl-preloaded.el: Emit a message before enabling
`cl-old-struct-compat-mode`.

See bug#63282.
2023-09-05 12:56:24 -04:00
Stefan Monnier
98f7665677 * lisp/emacs-lisp/pp.el (pp-28): Fix typo
Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.
2023-09-05 12:29:44 -04:00
Stefan Monnier
8ef1933a04 * lisp/emacs-lisp/edebug.el (edebug-list-form): Don't gate so eagerly
The `edebug-gate` is fairly heavy handed, so don't activate it
just because we seem to have found what looks like a valid form.
2023-09-05 11:54:55 -04:00
Stefan Monnier
defa5a9571 * lisp/emacs-lisp/cl-macs.el (cl-flet): Remove &name for (SYM EXP) case
The new/current Edebug spec gives the name `SYM@cl-flet@NN` to the
expression building that function rather than to the body of that
function as would be expected, leading to misleading code coverage.

This basically reverts 999de2a5ea, cc0f546825, and 18c85306ac :-(
2023-09-04 17:13:45 -04:00
Stefan Monnier
9e05453a8c Merge remote-tracking branch 'refs/remotes/origin/master' 2023-09-04 16:42:15 -04:00
Stefan Monnier
d5e7d9e257 Move setf substring to cl-lib since it relies on it (bug#60102)
* lisp/emacs-lisp/cl-lib.el (substring): Move gv-expander here...
* lisp/emacs-lisp/gv.el (substring): ...from here.
2023-09-04 16:39:55 -04:00
Stefan Kangas
62f7760e61 Add skip-when macro to ert-deftest
This can help avoid some awkward test skip conditions.

For example, this triple negation:
    (skip-unless (not noninteractive))

Can be written as the simpler:
    (skip-when noninteractive)

* lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro.
(ert--skip-when): New internal function.
* doc/misc/ert.texi (Tests and Their Environment): Document above
new macro.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.
2023-09-04 18:25:18 +02:00
Philipp Stephani
c799ad42f7 Fix Edebug specification for 'cl-define-compiler-macro'.
* lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro): Give the
instrumented name a suffix to make it unique.  Otherwise it will clash
with the name of the main function.
2023-09-03 16:56:18 +02:00
Stefan Kangas
6e1ee57c8e checkdoc: Don't warn for () in cl-defmacro args
Seen with, for example:

    (cl-defmacro foo (bar () &body baz) ...)

* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Improve support for `cl-defmacro' by ignoring "nil" in parameter list.
2023-09-03 15:39:16 +02:00
Jim Blandy
2ed99b6aa9 Fix indentation in `syntax-ppss'
* lisp/emacs-lisp/syntax.el: Fix indentation in
`syntax-ppss'.  (Bug#58665)
2023-09-03 12:42:49 +02:00
Joseph Turner
94431c0d2f Don't native compile lock files
* lisp/emacs-lisp/package.el (package--delete-directory):
Exclude lock files in regex.  (Bug#65666)
2023-09-03 09:02:22 +02:00
Joseph Turner
335631506d Log org export errors to package-vc doc buffer
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Wrap the org-export logic in condition-case, allowing package
installation to continue while preserving error messages.  (Bug#65649)
2023-09-03 09:02:22 +02:00
Joseph Turner
7b37710984 Include package name in package-vc documentation log buffer name
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Modify buffer name generation.  (Bug#65649)
2023-09-03 09:02:22 +02:00
Stefan Kangas
610105ee81 Update selected packages when deleting last package
* lisp/emacs-lisp/package.el (package--save-selected-packages): Allow
setting 'package-selected-packages' to a nil value.  (bug#65475)
2023-09-02 18:26:03 +02:00
Alan Mackenzie
1d46bca1c9 Output better error messages on certain edebug spec errors
This fixes bug#65620.  The error thrown up to now was "Void
function edebug-after".  This has been replaced by "Invalid
call to `edebug-before'.  Is the edebug spec for `foo'
correct?".

* lisp/emacs-lisp/edebug.el (edebug-b/a-error): New function
which throws the new friendlier error message.
(edebug-before, edebug-after): Replace the defalias's to nil
with actual functions which just call edebug-b/a-error.

* doc/lispref/edebug.texi (Specification List): In the entry
for `sexp', warn against mistakenly using `form' for an
2023-09-02 13:50:03 +00:00
Eli Zaretskii
7395123479 Merge from origin/emacs-29
dbbcf4a659 Fix fontification of " in edit-kbd-macro
2137fdfd55 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete ...
e660ee88e3 ; Remove incorrect example from ELisp Reference manual
c32fd92d67 Add documentation to plstore.el
57760f585e * lisp/help.el (substitute-quotes): Improve docstring.
60dcea7658 Fix two defcustom :types
890a4c209a Fix `image-auto-resize-on-window-resize' custom :type
369f2eea10 Add "terraform-ls" LSP server to Eglot
5cbe96d17f ; Improve documentation of 'char-table-range'
a219ee8c31 Fix minor bugs in vc-git and vc-hg on Windows uncovered b...
3f7598806e Add syntax-propertize-function to js-ts-mode
18b292140e ; * src/treesit.c: Add ts function boilerplate
ec4d29c449 Improve performance of treesit_cursor_helper_1

# Conflicts:
#	lisp/vc/vc-git.el
#	src/treesit.c
2023-09-02 04:33:44 -04:00
Eli Zaretskii
ec3ea8c036 Merge from origin/emacs-29
648a5e33e8 Update to Org 9.6.8-3-g21171d
458442fe78 Escape percent character in treesit--inspect-name (bug#65...
bc0426ce8e Don't add an extraneous slash in remote PATH list in Eshell
34f7a47c9c Fix Tramp on MS Windows
ea5fd6c96b * Fix native disassemble on Windows platforms (bug#65455)
91d2d8439b * Handle missing eln file when trying to disassble (bug#6...
e7ac50a153 * lisp/emacs-lisp/comp.el (comp--native-compile): Fix OUT...
45cf3a0ced Update to Transient v0.4.3
31d3808fb9 Adapt Eshell manual
0c50af054f Fix applying patches with Git on MS-Windows

# Conflicts:
#	doc/misc/transient.texi
#	test/lisp/eshell/esh-util-tests.el
2023-09-02 04:28:17 -04:00
Eli Zaretskii
2137fdfd55 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete (bug#65555). 2023-09-02 10:44:50 +03:00
Stefan Kangas
7d60d1652f Make checkdoc warn if not using lexical-binding
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Warn if there is no lexical-binding cookie.  (Bug#59920)
(checkdoc-lexical-binding-flag): New user option.
2023-09-01 22:05:35 +02:00
Eshel Yaron
b2ba4cb870 Rename 'package-vc-allow-side-effects' to better fit its use
* lisp/emacs-lisp/package-vc.el (package-vc-allow-side-effects):
Rename to 'package-vc-allow-build-commands'.
(package-vc--unpack-1): Use new name.
* doc/emacs/package.texi (Fetching Package Sources): Use new name.
* etc/NEWS: Adapt accordingly.  (Bug#65386)
2023-08-29 10:41:53 +02:00
Eshel Yaron
72ab5dc0b4 ; Refine 'defcustom' types in 'package-vc'
Only include VC backends that support cloning in the ':type' of
'package-vc-heuristic-alist' and 'package-vc-default-backend', and
compute the list of relevant on demand to keep it fresh.

* lisp/emacs-lisp/package-vc.el (package-vc--backend-type): New constant.
(package-vc-heuristic-alist, package-vc-default-backend): Use it.  (Bug#65386)
2023-08-29 10:41:53 +02:00
Eshel Yaron
82b13f0d1c ; Refine some 'package-vc' docstrings
* lisp/emacs-lisp/package-vc.el (package-vc-heuristic-alist)
(package-vc-install-dependencies, package-vc-upgrade)
(package-vc-install, package-vc-install-from-checkout)
(package-vc-prepare-patch, package-vc-upgrade-all)
(package-vc-allow-side-effects)
(package-vc-default-backend): Refine docstrings.  (Bug#65386)
2023-08-29 10:41:51 +02:00
Stefan Kangas
967fa846fc Use ensure-list in many more places
* lisp/align.el (align-region):
* lisp/auth-source-pass.el (auth-source-pass--build-result-many):
* lisp/auth-source.el (auth-source-ensure-strings):
* lisp/calendar/appt.el (appt-disp-window):
* lisp/cedet/mode-local.el (mode-local-map-mode-buffers):
* lisp/cus-edit.el (custom-prompt-variable)
(custom-variable-menu-create):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info):
* lisp/emacs-lisp/eieio.el (object-add-to-list):
* lisp/emulation/cua-base.el (cua--M/H-key):
* lisp/epg.el (epg--list-keys-1):
* lisp/faces.el (read-face-name):
* lisp/format.el (format-decode):
* lisp/gnus/gnus-score.el (gnus-home-score-file)
(gnus-all-score-files):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-articles):
* lisp/gnus/message.el (message-make-forward-subject):
* lisp/gnus/nnmairix.el (nnmairix-create-search-group):
* lisp/gnus/spam.el (spam-copy-or-move-routine):
* lisp/help-fns.el (describe-face):
* lisp/ibuf-macs.el (define-ibuffer-filter):
* lisp/international/mule-cmds.el (select-safe-coding-system):
* lisp/net/imap.el (imap-send-command):
* lisp/printing.el (pr-menu-get-item):
* lisp/speedbar.el (speedbar-add-supported-extension)
(speedbar-add-ignored-directory-regexp):
* lisp/textmodes/rst.el (rst-forward-line-looking-at):
* lisp/vc/ediff-util.el (ediff-other-buffer):
* lisp/vc/diff.el (diff-no-select):
* lisp/vc/vc-dir.el (vc-dir-mark-state-files):
* lisp/wid-edit.el (widget-prompt-value):
* lisp/windmove.el (windmove-default-keybindings)
(windmove-display-default-keybindings)
(windmove-delete-default-keybindings)
(windmove-swap-states-default-keybindings):
* lisp/window.el (display-buffer-reuse-mode-window):
* lisp/woman.el (woman-expand-directory-path): Prefer ensure-list.
2023-08-27 21:45:30 +02:00
Andrea Corallo
ea5fd6c96b * Fix native disassemble on Windows platforms (bug#65455)
* lisp/emacs-lisp/disass.el (disassemble-internal): Improve regexp.
2023-08-27 19:03:48 +02:00
Andrea Corallo
91d2d8439b * Handle missing eln file when trying to disassble (bug#65455)
* lisp/emacs-lisp/disass.el (disassemble-internal): Handle missing
eln file.
2023-08-27 17:04:08 +02:00
Andrea Corallo
e7ac50a153 * lisp/emacs-lisp/comp.el (comp--native-compile): Fix OUTPUT for non abs paths 2023-08-27 16:41:35 +02:00
Stefan Kangas
6426912515 ; Delete redundant defvars; font-lock is preloaded 2023-08-25 23:54:51 +02:00
Stefan Kangas
1c0fb3de47 ; Delete code commented out since 1992 2023-08-25 17:43:59 +02:00
Gerd Möllmann
999de2a5ea Revert "; Reverse debug spec of cl-flet (bug#65344)"
This reverts commit cc0f546825.
2023-08-23 13:06:03 +02:00
Gerd Möllmann
cc0f546825 ; Reverse debug spec of cl-flet (bug#65344) 2023-08-22 10:16:40 +02:00
Jim Porter
357c2fba98 Merge from origin/emacs-29
3296031ad7 ; Another improvement for documentation of pixelwise scro...
baeb2d71ae Support defun navigation for DEFUN in c-ts-mode (bug#64442)
781ddd7e7d Fix touchpad scrolling on MS-Windows
c125bd060e Fix order in which package-vc dependencies are resolved
500ced133a Fix building of VC package manuals with relative org link...
456ecabe9e Fix the documentation of 'cl-flet'
f6ebd1ef0d ; * src/treesit.c (Ftreesit_node_parent): Improve comment...
fac0e2d533 Avoid false "wrong passphrase" messages in EPA
8f683b51d8 Fix jsx font-lock in older tree-sitter-js grammars
d9af79ae39 Fix cloning 'face-remapping-alist' for indirect buffers
636fb267c4 Improve documentation of case transfer in replacement com...
7856d51436 Fix horizontal scrolling of images with C-f
8cf5659ec2 ; Fix defcustom in completion.el
a8c8a4e368 ; * src/fns.c (Fcopy_sequence): Doc fix.  (Bug#64960)
205d87cdca Fix unpacking ZIP archives on MS-Windows
3712e8bc38 ; Fix typos in lisp/keymap.el doc strings (bug#65329).
21b2ecee66 Fix command example in Eshell manual
26949819df ; lisp/progmodes/csharp-mode.el (treesit-query-capture): ...
221ed70b90 ; Improve documentation of 'define-alternatives'
32280205e2 Add user options mentioned in the Eshell manual to the va...
cf3145a486 * Add missing alias to `native-comp-enable-subr-trampolin...
922b649028 * Add missing alias to `native-comp-enable-subr-trampolin...
6962823c83 ; * etc/PROBLEMS: Fix typo and clarify wording.

# Conflicts:
#	doc/misc/eshell.texi
2023-08-21 18:23:11 -07:00
Mattias Engdegård
c21103bb76 Explicitly disallow named-let in code using dynamic binding
There is no point in permitting named-let to be used in dynbound code;
our code transforms are simply not valid in that context, and it's not
worth the trouble to make it work (to the extent that it is at all
possible). (Bug#59576)

* lisp/emacs-lisp/subr-x.el (named-let):
Error if used with dynamic binding.
* doc/lispref/variables.texi (Local Variables): Amend manual.
2023-08-21 14:17:03 +02:00
Gerd Möllmann
18c85306ac Fix debug spec of cl-flet (bug#65344)
* lisp/emacs-lisp/cl-macs.el (cl-flet): Fix debug spec.
(cl-defun): Allow only symbols as function names in debug spec.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-flet/edebug): New test
case.
2023-08-21 09:27:49 +02:00
Philip Kaludercic
41ff369917 Add command to start Emacs with specific packages
* lisp/emacs-lisp/package.el (package--dependencies): Extend function
to handle and return package descriptors.
(package-isolate): Add new command.
* etc/NEWS: Announce new command.
2023-08-19 12:08:10 +02:00
Philip Kaludercic
c125bd060e Fix order in which package-vc dependencies are resolved
* lisp/emacs-lisp/package-vc.el (package-vc-install-dependencies):
Avoid a type-mismatch when comparing two packages.  (Bug#65283)
2023-08-19 11:39:50 +02:00
Joseph Turner
500ced133a Fix building of VC package manuals with relative org links/includes
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Ensure that default-default is the docs-directory around
org-export-to-file to ensure that links to relative files work
correctly.  (Bug#65243)
2023-08-19 11:39:50 +02:00
Mattias Engdegård
5b87950133 Remedy wrong-looking \(:?...\) regexp constructs
When we see \(:?...\) in a regexp it very much looks like a typo
for a \(?:...\) construct and often is, so do something about
all of these (one of which being another mistake).
Doing so silences an optional relint check.

* lisp/comint.el (comint-replace-by-expanded-history-before-point):
* lisp/term.el (term-replace-by-expanded-history-before-point):
Move :? out from capturing group where it does not need to be,
to avoid confusion.
* lisp/emacs-lisp/cl-indent.el (common-lisp-loop-part-indentation):
A capturing group isn't needed here; turn it into simple bracketing.
* lisp/progmodes/sql.el (sql--completion-table):
Change :? into ?: which was clearly meant here.
2023-08-16 16:55:38 +02:00
Eli Zaretskii
dfe68f2a42 ; Fix byte-compiler warnings in comp.el
* lisp/emacs-lisp/comp.el: Declare functions and variables defined
in comp.c, to avoid byte-compiler warnings.  (Bug#65250)
2023-08-16 16:10:55 +03:00
Stefan Monnier
eba0f091d9 * lisp/emacs-lisp/pp.el (pp-fill): Fix bug#65159 2023-08-14 23:11:27 -04:00
Stefan Monnier
be5917c2ea cl-generic.el: Fix docstring for methods with cl-call-next-method
* lisp/emacs-lisp/cl-generic.el (cl--generic-method-info):
Fix docstring extraction for "curried" methods (bug#65270).
2023-08-14 22:38:01 -04:00
Mattias Engdegård
33bcd4f2d2 Ignore ert-deftest body value
* lisp/emacs-lisp/ert.el (ert-deftest):
Since the return value of the body isn't going to be used, ignore
it explicitly so that the compiler can warn if we try to return
something anyway.  In particular, this exposes some comparisons
whose result weren't actually checked.
2023-08-14 17:03:44 +02:00
Mattias Engdegård
dcaf424cb6 Revert "* lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Inhibit interaction"
This reverts commit bb9133f09d,
because it inadvertently made many tests fail.
2023-08-14 10:16:32 +02:00
Stefan Monnier
bb9133f09d * lisp/emacs-lisp/ert.el (ert-run-tests-batch-and-exit): Inhibit interaction 2023-08-13 15:21:52 -04:00
Mattias Engdegård
c51d1bce1e equal is not error-free
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns)
(side-effect-and-error-free-fns)
(byte-compile-side-effect-and-error-free-ops)
(byte-compile-side-effect-free-ops):
Demote `equal` and `equal-including-properties` from error-free to
merely side-effect-free since they may in fact signal error on
circularity.
2023-08-13 11:51:03 +02:00
Mattias Engdegård
163e7dac5f ; * lisp/emacs-lisp/rx.el: slight modernisation of internal rx usage 2023-08-13 10:38:29 +02:00
Eli Zaretskii
08bf8533bb Avoid unexpected implicit completion in find-func.el
* lisp/emacs-lisp/find-func.el (find-function-read): Don't allow
implicit completion, which could produce unexpected results.
Patch by Jens Schmidt <jschmidt4gnu@vodafonemail.de>.  (Bug#65058)
2023-08-13 09:34:20 +03:00
Stefan Monnier
f789cb4640 * lisp/emacs-lisp/cl-macs.el (cl--labels-convert): Remove outdated fixme
This was fixed in commit 44d7fd3805.
2023-08-12 14:20:59 -04:00
Eli Zaretskii
3fc9793a26 Merge from origin/emacs-29
842dbf500e * Fix `batch-byte+native-compile' target directory.
8dbd5aa1ee Avoid crashes in 'display_count_lines' when current buffe...
47b4f4cf78 ; * doc/emacs/mini.texi (Completion Commands): Fix a typo...
78999d5213 Update csharp tree-sitter support due to upstream changes
556cb01b48 Substitute command keys in 'ielm-header' at use time
99367078e5 ; * etc/PROBLEMS: Add entry about XIM problems (bug#65205).
03e897c08f Fix rare crashes in redisplay due to problems with fontsets
b1ba06a1e4 Fix a typo in 'leuven-dark-theme.el'
e80a9dcabb ; * admin/git-bisect-start: Update failing commits
9091f42784 ; * admin/git-bisect-start: Update failing commits
344ac529ca ; * etc/PROBLEMS: Fix typo.
bccf848b26 Adapt Tramp test
71bc060e40 Properly expand the JSX indentation rules in 'js-ts-mode'
889cfb42ed * Add `emacs-lisp-native-compile' to easy-menu.
4535aafa8a * lisp/progmodes/elisp-mode.el (emacs-lisp-mode-menu): Si...
173af0cad5 * Introduce `emacs-lisp-native-compile'.
063d7d89d7 Fix the -x switch in non-X builds
5a7fb0b39b Document that `set-mouse-color' does not work everywhere
d06fc72496 ; * doc/emacs/dired.texi (Misc Dired Features): Fix last ...
97b8ac376b Fix the effects and documentation of 'dired-free-space'
75c72e59f6 ; Fix typo
6d11b7b300 Fix cross-reference to eldoc in eglot manual
913e50aba6 Add native-compilation to Emacs Lisp mode menu
b93107c20b Fix emacs-lisp-native-compile-and-load eln target directo...
2023-08-12 13:50:38 -04:00
Eli Zaretskii
b289f0769f Merge from origin/emacs-29
4767f5eaee Better fix for bug#65156
dd1d8414b3 Fix insert-file-contents with pipes and /dev/stdin
50649a6d1a ; * etc/PROBLEMS: Fix wording.
f0dda682ff ; * etc/NEWS.28: Add deletion of levents.el.
f4acae842c Fix bug#65042
e1874c4e8b * configure.ac (HAVE_TREE_SITTER): Set NEED_DYNLIB=yes (b...
ef8838c3a5 * etc/NEWS: Mention tramp-show-ad-hoc-proxies.
495bee253f * test/lisp/net/tramp-tests.el (tramp-test42-utf8): Skip ...
de1effd73b ; Fix last change
7c7966862b * test/lisp/net/tramp-tests.el (tramp-test10-write-region...
16205e8db6 ; Improve help-echo in package.el
a95e700698 ; Filter packages available for upgrade via menu bar
adff72dd1d Fix reverting Rmail buffers
2023-08-12 13:42:14 -04:00
Andrea Corallo
842dbf500e * Fix `batch-byte+native-compile' target directory.
* lisp/emacs-lisp/comp.el (batch-native-compile): Don't shadow
`native-compile-target-directory' unless necessary.
2023-08-12 18:51:45 +02:00