Commit graph

9887 commits

Author SHA1 Message Date
F. Jason Park
0a50019308 Indent ERT failure explanations rigidly
This also affects the listing of `should' forms produced by hitting
the L key on a test button in an ERT buffer.

* lisp/emacs-lisp/ert.el (ert--pp-with-indentation-and-newline):
Indent the pretty-printed result to match the caller's current column
as a reference indentation.
* test/lisp/emacs-lisp/ert-tests.el
(ert--pp-with-indentation-and-newline): New test.  (Bug#72561)
2024-08-25 09:01:02 -07:00
Eshel Yaron
44c26140b6
; Fix infloop in checkdoc-next-docstring
* lisp/emacs-lisp/checkdoc.el (checkdoc-next-docstring): Use
'beginning-of-defun-raw' instead of 'beginning-of-defun', as the latter
always moves back to beginning of line and thus is not guaranteed to
advance point when 'open-paren-in-column-0-is-defun-start' is non-nil.
(Bug#72759)
2024-08-23 17:18:32 +02:00
Andrea Corallo
acfd91bc0c ; * lisp/emacs-lisp/compat.el: Fix header style. 2024-08-18 11:47:38 +02:00
Eli Zaretskii
4f3e8c3b4e Improve documentation of ERT
* doc/misc/ert.texi (Running Tests Interactively)
(Test Selectors):
* lisp/emacs-lisp/ert.el (ert-select-tests)
(ert-run-tests-interactively, ert-run-tests-batch): Improve and
clarify the documentation of the main ERT functions.
2024-08-15 11:30:48 +03:00
Visuwesh
ed8904937e Disambiguate minor-mode variable in its function docstring
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring)
(easy-mmode--mode-docstring): Add "the variable" before the
GETTER if it is a symbol to properly link to minor-mode variable
in the *Help* buffer in the common case.  (bug#72405)
2024-08-15 10:37:36 +03:00
Spencer Baugh
341e5795d5 Support minibuffer-visible-completions in completing-read-multiple
All that's required is to add minibuffer-visible-completions-map on
top of the completing-read-multiple map; this is the same thing that
minibuffer-visible-completions does in completing-read-default.

* lisp/emacs-lisp/crm.el (completing-read-multiple): Add
minibuffer-visible-completions-map (bug#69189)
2024-08-07 19:52:36 +03:00
Philip Kaludercic
367c0490a8
; * admin/MAINTAINERS: Note what I maintain 2024-07-27 11:01:36 +02:00
Stefan Kangas
af527051cd ; * admin/MAINTAINERS: Remove Nicolas Petton.
Change agreed with Nicolas Petton <nico@petton.fr>.
2024-07-25 16:15:52 +02:00
Stefan Kangas
a6cab228d4 ; Fix typos 2024-07-18 11:46:50 +02:00
Stefan Kangas
ef7364b070 Checkdoc fixes in emacs-lisp/*.el
* lisp/emacs-lisp/bytecomp.el (byte-compile-free-vars-warn)
(byte-compile-out):
* lisp/emacs-lisp/eldoc.el (eldoc-documentation-functions):
* lisp/emacs-lisp/find-func.el (find-ert-deftest-regexp):
* lisp/emacs-lisp/macroexp.el (byte-compile-form-stack):
Checkdoc fixes.
2024-07-08 14:30:37 +02:00
Eli Zaretskii
c193a702dc ; Improve a recent change to the documentation
* lisp/emacs-lisp/comp.el (native-comp-debug):
* doc/lispref/compile.texi (Native-Compilation Variables): Improve
wording.
2024-07-08 14:48:25 +03:00
Stefan Kangas
84552ff395 Revert "Fix link to major mode variable in docstring"
This reverts commit 73c1252bb6.

This will sometimes say
"the variable `(default-value 'global-auto-revert-mode)'".
Problem reported by Eshel Yaron <me@eshelyaron.com>.
2024-07-08 12:28:05 +02:00
Andrea Corallo
7668385390 ; Improve 'native-comp-debug' documentation
* lisp/emacs-lisp/comp.el (native-comp-debug): Improve doc.
* doc/lispref/compile.texi (Native-Compilation Variables): Likewise.
2024-07-08 11:06:35 +02:00
Stefan Kangas
9fcee3c1d1 Clarify checkdoc-max-keyref-before-warn docstring
* lisp/emacs-lisp/checkdoc.el (checkdoc-max-keyref-before-warn): Clarify
and reflow docstring.  Fix warning about overly long docstring.
2024-07-07 12:45:03 +02:00
Stefan Kangas
48f4c9cbbc ; Reflow "Commentary" in lisp-mnt.el
* lisp/emacs-lisp/lisp-mnt.el: Reflow "Commentary" section.
2024-07-06 19:35:28 +02:00
Eli Zaretskii
22155753a4 ; * lisp/emacs-lisp/comp-run.el (native--compile-async): Improve warning. 2024-07-06 20:32:49 +03:00
Stefan Kangas
235b9e85a6 package-buffer-info: Move 'require' earlier
* lisp/emacs-lisp/package.el (package-buffer-info):
Move 'require' earlier, before it is needed.
2024-07-06 15:22:20 +02:00
Eli Zaretskii
a3e57a29be ; Fix doc string of 'string-fill'
* lisp/emacs-lisp/subr-x.el (string-fill): Rename LENGTH to WIDTH
and update the doc string accordingly.  (Bug#71856)
2024-07-06 11:28:39 +03:00
Eli Zaretskii
814710067f Improve warnings from native compiler
* src/comp.c (syms_of_comp) <native-compiler>: Rename from 'comp'.

* src/lread.c (maybe_swap_for_eln):
* lisp/emacs-lisp/comp.el (comp--fwprop):
* lisp/emacs-lisp/comp-run.el
(comp--accept-and-process-async-output, native--compile-async):
Adjust to the new symbol.
2024-07-05 22:00:08 +03:00
Stefan Monnier
334d513220 (edebug--called-interactively-skip): Fix bug#71934
* lisp/emacs-lisp/edebug.el (edebug--called-interactively-skip):
Adjust to new interpreted functions.
2024-07-04 11:47:01 -04:00
Stefan Kangas
d64396b8e4 Autoload some string functions
These functions are documented in both `(elisp) Creating Strings' and
'M-x shortdoc RET string RET', so users will expect them to be available
without having to require 'subr-x'.

* lisp/emacs-lisp/subr-x.el (string-fill, string-limit, string-pad)
(string-chop-newline): Autoload.
2024-07-03 02:08:19 +02:00
Stefan Kangas
45a20d781a ; Fix typos in symbols 2024-06-29 17:29:38 +02:00
Stefan Kangas
a65b6aac6b Silence warning with global minor mode :predicate
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Silence byte-compiler warning when :predicate is used.
2024-06-29 14:39:35 +02:00
Stefan Kangas
73c1252bb6 Fix link to major mode variable in docstring
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Fix link to
major mode variable in docstring.  (Bug#71815)
2024-06-28 12:18:04 +02:00
Po Lu
c4ec905c9a Correct ommissions in rmc.el
* lisp/emacs-lisp/rmc.el (touch-screen-scroll)
(touch-screen-pinch): Declare functions.
(read-multiple-choice--short-answers): Call the same functions
directly and prevent the on-screen keyboard from being
deactivated immedately before it is reopened.
2024-06-28 14:44:28 +08:00
Mattias Engdegård
923aad81d4 Don't hide not and null arity errors
* lisp/emacs-lisp/byte-opt.el (byte-optimize-not):
Don't silently convert incorrect `not` and `null` applications to nil.
2024-06-17 13:14:08 +02:00
Po Lu
6aa5068ac7 Improve treatment of touch screen input by rmc and its callers
* lisp/emacs-lisp/rmc.el (read-multiple-choice--short-answers):
Run touch screen event translation on touch screen events
received, and respond to pinch, tap and scrolling gestures.

* lisp/net/nsm.el (nsm-query-user): Disable use-dialog-box in
the details window.

* lisp/touch-screen.el (touch-screen-translate-touch): Autoload.
2024-06-17 17:45:48 +08:00
Philip Kaludercic
1980624816 Add new command 'package-vc-log-incoming'
* lisp/emacs-lisp/package-vc.el (package-vc-log-incoming):
Implement it.
* etc/NEWS: Mention it.
2024-06-09 12:39:47 +02:00
Stefan Monnier
e9a0256a55 (pcase--app-subst-match): Try and fix performance regression (bug#71398)
* lisp/emacs-lisp/pcase.el (pcase--app-subst-match): Optimize matches
against (quote VAL).
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-quote-optimization):
Add new test case.
2024-06-08 17:34:56 -04:00
Juri Linkov
9cd182dae8 * lisp/buff-menu.el (Buffer-menu-group-sort-by): New defcustom.
(list-buffers--refresh): Use Buffer-menu-group-sort-by instead of the
hard-coded function (bug#70150).
(Buffer-menu-group-sort-alphabetically): New function as an option for
'Buffer-menu-group-sort-by'.
(list-buffers-noselect): Remove setting	outline-minor-mode-use-buttons
to 'in-margins' that it not required for this feature to work correctly.

* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups-sort):
Add optional argument 'level'.
2024-06-07 19:57:07 +03:00
Mattias Engdegård
32bfc825a7 Format string warnings for more functions (bug#71379)
* lisp/emacs-lisp/bytecomp.el (byte-compile-format-like):
Add message-box, message-or-box, warn and user-error.
2024-06-06 10:10:16 +02:00
Juri Linkov
ec8c0b0d0d Allow multi-level outlines in tabulated-list-groups used by list-buffers
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups)
(tabulated-list-groups-categorize, tabulated-list-groups-sort)
(tabulated-list-groups-flatten): New functions (bug#70150).

* lisp/buff-menu.el (Buffer-menu-group-by): Change type from a function
to a list of functions.
(list-buffers--refresh): Use the function 'tabulated-list-groups' where
:path-function uses a list of functions from 'Buffer-menu-group-by', and
:sort-function is hard-coded to sort groups by name.
(Buffer-menu-group-by-mode, Buffer-menu-group-by-root): Remove prefix "*".
2024-06-05 20:07:28 +03:00
Paul Eggert
3dcac22dd4 Spelling fixes 2024-06-04 22:16:28 -07:00
Stefan Monnier
16fc5b6c0c pcase.el (\`): Try and handle large patterns better
Large backquote patterns tend to lead to very large and deeply
nested expansions, but they also tend to contain a lot of
"constant" subpatterns that can be compiled to quote patterns.
This patch does just that.  See discussion at
https://lists.gnu.org/archive/html/emacs-devel/2024-05/msg01140.html

* lisp/emacs-lisp/pcase.el (pcase--split-pred):
Improve the handling of pred-vs-quote so it also works with
quoted objects like cons cells, vectors, and strings.
Simplify the `pcase--mutually-exclusive-p` branch accordingly.
(pcase--expand-\`): New function, extracted from the \` pcase macro.
Make it recurse internally, and optimize backquote patterns to `quote`
patterns where possible.
(\`): Use it.

* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-vectors): Add tests
that were broken by a more naïve version of the optimization.
(pcase-tests-quote-optimization): New test.
2024-06-03 13:40:39 -04:00
Andrea Corallo
2ae6451ec1 Add 'message' to 'comp-primitive-type-specifiers'
* lisp/emacs-lisp/comp-common.el (comp-primitive-type-specifiers): Add
message.
2024-06-03 17:55:16 +02:00
Andrea Corallo
e39e96c9b9 * lisp/emacs-lisp/comp.el (native-compile): Type declare. 2024-06-03 17:55:16 +02:00
Stefan Monnier
436b344be3 track-changes.el: Keep a bit more info when logging an error
* lisp/emacs-lisp/track-changes.el (track-changes--recover-from-error):
Add arg `info`.
(track-changes-fetch, track-changes--after): Use it to preserve a bit
more information about errors.
2024-05-30 19:00:23 -04:00
Stefan Monnier
2e16bcd8ed ad-activate-advised-definition: Use proper function objects
* lisp/emacs-lisp/advice.el (ad-activate-advised-definition):
Use interpreted functions rather than lambda lists.
2024-05-30 18:57:56 -04:00
Davide Pola
fd61cf3976 Rename comp-run.el and comp-cstr.el private functions
* lisp/emacs-lisp/comp-run.el (native-compile-async-skip-p)
(comp-async-runnings, comp-effective-async-max-jobs)
(comp-accept-and-process-async-output, comp-run-async-workers)
(comp-trampoline-search): rename using '--' separator convention for
private functions.
* lisp/emacs-lisp/comp-cstr.el
(comp-cstr-copy, comp-cstrs-homogeneous, comp-split-pos-neg)
(comp-normalize-valset, comp-union-valsets)
(comp-intersection-valsets, comp-normalize-typeset)
(comp-union-typesets, comp-intersect-two-typesets)
(comp-intersect-typesets, comp-range-union)
(comp-range-intersection, comp-range-negation, comp-cstr-add-2)
(comp-cstr-sub-2, comp-cstr-union-homogeneous-no-range)
(comp-cstr-union-homogeneous, comp-cstr-union-1-no-mem)
(comp-cstr-union-1, comp-cstr-union-make)
(comp-cstr-intersection-make): Likewise.
2024-05-29 17:43:23 +02:00
Stefan Monnier
fde8dc9287 Redirect calls to subr-native-elisp-p to native-comp-function-p
* test/src/comp-tests.el (comp-tests-bootstrap, lambda-return)
(lambda-return2, free-fun, free-fun2, free-fun-silly-name, speed--1)
(compile-forms, comp-test-defsubst, primitive-redefine-compile-44221)
(48029-1, 61917-1, tco, fw-prop-1, pure):
* test/lisp/help-fns-tests.el (help-fns-test-lisp-defun):
* lisp/subr.el (subr-primitive-p, primitive-function-p, symbol-file):
* lisp/help-fns.el (find-lisp-object-file-name):
* lisp/emacs-lisp/disass.el (disassemble-internal):
* lisp/emacs-lisp/comp.el (comp--call-optim-form-call):
* lisp/emacs-lisp/comp-run.el (comp-warn-primitives):
* lisp/emacs-lisp/comp-common.el (comp-function-type-spec):
* lisp/emacs-lisp/byte-opt.el (side-effect-free-fns):
* lisp/emacs-lisp/bytecomp.el (<trailer>): Rename `subr-native-elisp-p`
to `native-comp-function-p`.
2024-05-28 20:53:25 -04:00
Stefan Monnier
1a1170cde7 Rename subr-native-elisp to native-comp-function (bug#71123)
Now that this type name is displayed in *Help*, it is more
important to use a name that is less weird for the unsuspecting user.

* lisp/emacs-lisp/cl-preloaded.el (cl-functionp): Adjust to new name of
native function's type.
(subr-native-elisp-p): Redefine as an obsolete alias.
(native-comp-function): Rename from `subr-native-elisp`

* src/data.c (Fcl_type_of): Return `Qnative_comp_function` i.s.o
`Qsubr_native_elisp`.
(Fnative_comp_function_p): Rename from `Fsubr_native_elisp_p`.
(syms_of_data): Adjust accordingly.

* src/doc.c (Fsubr_documentation): Use new `Fnative_comp_function_p` name.
2024-05-28 20:52:40 -04:00
Andrea Corallo
509e7f877b * Rework 'comp-normalize-valset' (bug#71116)
* lisp/emacs-lisp/comp-cstr.el (comp-normalize-valset): Rework to
improve consistency.
2024-05-27 20:41:06 +02:00
Michael Heerdegen
804f36d5ab Don't let pp fall back to prin1 for conses
* lisp/emacs-lisp/pp.el (pp--insert-lisp): Don't `prin1' non-list
conses; use our pp function for cons and list printing
`pp--format-list' instead.
2024-05-27 19:51:39 +02:00
Michael Heerdegen
3580dc155c Don't try to pretty-print non-lists as binding list
* lisp/emacs-lisp/pp.el (pp--format-definition): Ensure that what we try
to print as a list of bindings has an appropriate format.  This avoids
raising an error for SEXPs like (let X Y) inside `pcase' forms where our
heuristic expects a binding list in the X position.
2024-05-27 18:44:48 +02:00
Michael Heerdegen
34fc71c004 Further tweak pp code printing
This fixes an aspect of Bug#70868.

* lisp/emacs-lisp/pp.el (pp--insert-lisp): Print characters with
`prin1-char'.  In all other cases consistently print with `prin1'.
2024-05-26 14:17:21 +02:00
Po Lu
74ceb6922c Address compilation errors and warnings on x86 Solaris 10 systems
* doc/misc/ede.texi (Extending EDE):

* doc/misc/flymake.texi (Top, Using Flymake): Insert punctuation
after xrefs.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Print
number of files being scraped.

* src/dired.c (directory_files_internal):

* src/eval.c (Fmake_interpreted_closure, Fdefvaralias):

* src/fns.c (Fassoc): Work around optimizer failures.
2024-05-26 11:50:45 +08:00
Dmitry Gutov
2a12f39ffe Improve navigation to cl-defgeneric uses
* lisp/emacs-lisp/cl-generic.el
(cl--generic-find-defgeneric-regexp):
Use "symbol end" boundary (bug#71068).
2024-05-26 05:56:14 +03:00
Stefan Monnier
d8af7c99bb * lisp/emacs-lisp/pcase.el (pcase--subtype-bitsets): Fix bootstrap failure
`rm lisp/emacs-lisp/cl-preloaded.elc src/bootstrap-emacs`
followed by `make` ended up loading right after defining
`built-in-class-p` but before actually defining the
built-in-classes so the computation of bitsets failed.
2024-05-22 13:27:50 -04:00
Andrea Corallo
931663f123 Silence 3 warnings for non sqlite builds
* lisp/emacs-lisp/multisession.el (sqlite-commit)
(sqlite-transaction, sqlite-rollback): Declare.
2024-05-19 14:54:10 +02:00
Joost Kremers
4f27d763bb Make 'vtable-insert-object' more versatile
* lisp/emacs-lisp/vtable.el (vtable-insert-object): Rename
argument AFTER-OBJECT to LOCATION; allow use of index to
refer to the insertion position; add argument BEFORE.
(Bug#70664).

* etc/NEWS:
* doc/misc/vtable.texi (Interface Functions): Document the
change.

* test/lisp/emacs-lisp/vtable-tests.el
(test-vtable-insert-object): New test.
2024-05-18 11:52:33 +03:00