Commit graph

8698 commits

Author SHA1 Message Date
Yuan Fu
cea1e95d38
Merge branch 'master' into feature/tree-sitter 2022-10-06 11:06:07 -07:00
Matt Armstrong
e24f276f8a Fix calling `package-reinstall' just after quick initialization.
* lisp/emacs-lisp/package.el (package-reinstall): call
`package--archives-initialize', just like `package-install' does.
This populates `package-alist', and so fixes calling
`package-reinstall' as the first thing done after package "quick
init" (Bug#53527).
2022-10-06 14:08:20 +02:00
Yuan Fu
7ebbd4efc3
Merge branch 'master' into feature/tree-sitter 2022-10-05 14:22:03 -07:00
Lars Ingebrigtsen
92df7cd923 Add 'seq-keep'
* doc/lispref/sequences.texi (Sequence Functions): Document it.
* lisp/emacs-lisp/seq.el (seq-keep): New function (bug#58278).
2022-10-04 21:44:52 +02:00
Lars Ingebrigtsen
79d9f3b845 Make `eq' obsolete as a generalized variable
* lisp/emacs-lisp/gv.el (eq): Make obsolete as a generalized
variable.
2022-10-04 14:11:13 +02:00
Lars Ingebrigtsen
9fb0aaa1ce Make loaddefs-generate more resilient
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Don't bug
out when there's an existing loaddefs file that's not formatted
properly (bug#58280).
2022-10-04 13:04:16 +02:00
Lars Ingebrigtsen
535eec3bca Don't bug out in advice--make-docstring when there's not doc string
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Don't bug
out on functions with no documentation (bug#58284).
2022-10-04 12:50:17 +02:00
Jim Porter
43eaa05ff2 ; Fix logic of $HOME adjustment for 'ert-remote-temporary-file-directory'
* lisp/emacs-lisp/ert-x.el (ert-remote-temporary-file-directory): Only
adjust $HOME when it doesn't exist (bug#58265).
2022-10-03 17:42:37 -07:00
Lars Ingebrigtsen
f97993ee66 Rename to inhibit-automatic-native-compilation
* src/comp.c (maybe_defer_native_compilation):
(syms_of_comp):
* lisp/subr.el (native-comp-deferred-compilation):
* lisp/startup.el (inhibit-native-compilation):
(normal-top-level):
* lisp/progmodes/elisp-mode.el (emacs-lisp-native-compile-and-load):
* lisp/emacs-lisp/comp.el (comp-trampoline-compile):
* etc/NEWS:
* doc/lispref/compile.texi (Native-Compilation Variables): Rename
inhibit-native-compilation to inhibit-automatic-native-compilation.
2022-10-03 19:50:03 +02:00
Lars Ingebrigtsen
5fec9182db Add new variable 'inhibit-native-compilation'
* doc/lispref/compile.texi (Native-Compilation Variables):
Document it.

* lisp/startup.el (normal-top-level): Set
inhibit-native-compilation from environment variable.

* lisp/subr.el (native-comp-deferred-compilation): Make obsolete.

* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Don't write
trampolines to disk.

* lisp/progmodes/elisp-mode.el
(emacs-lisp-native-compile-and-load): Adjust.

* src/comp.c (syms_of_comp): New variable
inhibit-native-compilation.
(maybe_defer_native_compilation): Use it.
2022-10-03 15:26:13 +02:00
Stefan Kangas
655c92ce4a Fix more overly long docstrings in eieio
* lisp/emacs-lisp/eieio.el (defclass): Fix more overly long
docstrings.  (Bug#58252)
2022-10-03 00:04:23 +02:00
Stefan Kangas
0a40120b40 Fix overly wide docstrings generated by eieio
* lisp/emacs-lisp/eieio-core.el (eieio-make-class-predicate)
(eieio-make-child-predicate, eieio-defclass-internal): Don't generate
overly wide docstrings.  (Bug#58252)
2022-10-02 17:28:04 +02:00
Stefan Kangas
423bdd5f7f ; Fix typos (prefer American spelling) 2022-09-29 15:20:07 +02:00
Lin Sun
ec121e035b package-update would always re-install package
* lisp/emacs-lisp/package.el (package--updateable-packages): fix
version comparison between available packages and archived
packages (bug#58129).
2022-09-28 13:05:26 +02:00
Richard Hansen
29b7d74000 ert-x: Improve realism of `ert-with-test-buffer-selected'
* lisp/emacs-lisp/ert-x.el (ert-with-test-buffer-selected): Set
`inhibit-read-only' and `buffer-read-only' to nil when executing the
body to provide a more realistic test environment.
2022-09-27 13:43:53 +02:00
Lars Ingebrigtsen
e2f2f6b9e8 Fix percentage width computation in vtable
* lisp/emacs-lisp/vtable.el (vtable--compute-width): Fix
percentage computation (bug#58067).
2022-09-26 13:28:30 +02:00
Eli Zaretskii
76b7a59367 ; Clarify wording of some doc strings in shortdoc.el
* lisp/emacs-lisp/shortdoc.el (shortdoc-next, shortdoc-previous)
(shortdoc-next-section, shortdoc-previous-section): Clarify
wording.
2022-09-25 22:49:32 +03:00
Mattias Engdegård
b55b2f1c31 Boolean constant detection additions
* lisp/emacs-lisp/byte-opt.el (byte-opt--bool-value-form):
`set` is boolean identity in its second argument.
(byte-compile-trueconstp): `set-marker` is always true.
2022-09-25 18:05:13 +02:00
Stefan Kangas
f761869a56 Add :buffer argument to ert-with-temp-file
* lisp/emacs-lisp/ert-x.el (ert-with-temp-file): Add new keyword
argument :buffer SYMBOL to visit the file with `find-file-literally'
before running the body, and cleaning up after.
2022-09-25 16:16:30 +02:00
Stefan Kangas
489bca19b7 Improve shortdoc documentation
* doc/emacs/help.texi (Name Help):
* doc/lispref/help.texi (Documentation Groups): Refer to
'shortdoc' convenience alias instead of 'shortdoc-display-group'.
* lisp/emacs-lisp/shortdoc.el: Add Commentary.
(shortdoc-next, shortdoc-previous)
(shortdoc-next-section, shortdoc-previous-section): Doc fixes.
2022-09-25 14:35:10 +02:00
Stefan Kangas
971566e88a Fix shortdoc movement commands
* lisp/emacs-lisp/shortdoc.el (shortdoc--goto-section): Don't skip
over current function or section when searching.
2022-09-25 14:27:44 +02:00
Stefan Kangas
e589690781 Add new command 'shortdoc-copy-function-as-kill'
* lisp/emacs-lisp/shortdoc.el
(shortdoc-copy-function-as-kill): New command.
(shortdoc-mode-map): Bind above new command to "w".
2022-09-25 13:48:52 +02:00
Stefan Kangas
3af2f9cce3 Bind "N"/"P" to next/prev section in shortdoc
* lisp/emacs-lisp/shortdoc.el (shortdoc-mode-map): Bind "N" and
"P" to 'shortdoc-next-section' and 'shortdoc-previous-section'.
2022-09-25 13:38:22 +02:00
Juri Linkov
8574ae625e * lisp/emacs-lisp/icons.el (icons--create): Use default rotation 0 (bug#57813) 2022-09-24 20:17:28 +03:00
Lars Ingebrigtsen
b7fb82bc41 Remove "manual" package--builtin-versions updates
* lisp/emacs-lisp/nadvice.el:
* lisp/emacs-lisp/cl-generic.el: Don't push to
package--builtin-versions "manually", because loaddefs-gen does
this correctly now.
2022-09-24 16:51:53 +02:00
Lars Ingebrigtsen
06de788529 Tweak how :override advice is formatted in *Help*
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Format
:overrides specially (bug#57974).
(advice--make-docstring): Put overrides at the front.
2022-09-24 14:06:26 +02:00
Lars Ingebrigtsen
bbd7059da4 Rename file-name-directory
* lisp/emacs-lisp/shortdoc.el (file-name):
* doc/lispref/files.texi (Directory Names): Adjust.
* lisp/files.el (file-name-parent-directory): Rename from
`file-name-directory' (bug#58039).
2022-09-24 12:44:44 +02:00
Stefan Kangas
8a224e5124 * lisp/emacs-lisp/shortdoc.el (file-name): Improve examples. 2022-09-24 11:26:06 +02:00
Stefan Monnier
40bc027bf4 * lisp/emacs-lisp/eieio.el (defclass): Fix bug#51068
Accept (defclass <class> <superclasses> (.. <slotname> ..)) without
having to wrap the slot name within parentheses.
2022-09-23 17:42:55 -04:00
Stefan Monnier
c244d4af57 cconv.el: Fix interactive closure bug#51695
Make cconv.el detect when a closure's interactive form needs to
capture variables from the context and tweak the code accordingly
if so.

* lisp/emacs-lisp/cconv.el (cconv--interactive-form-funs): New var.
(cconv-convert): Handle the case where the interactive form captures
vars from the surrounding context.  Remove left over handling of
`declare` which was already removed from the cconv-analyze` phase.
(cconv-analyze-form): Adjust analysis of interactive forms accordingly.

* lisp/emacs-lisp/oclosure.el (cconv--interactive-helper): New type and
function.
* lisp/simple.el (function-documentation, oclosure-interactive-form):
Add methods for it.

* test/lisp/emacs-lisp/cconv-tests.el
(cconv-tests-interactive-closure-bug51695): New test.
2022-09-23 16:36:16 -04:00
Lars Ingebrigtsen
212e94c3f4 Make loaddefs-gen register parent :groups from defcustom
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Also register parent :groups from
`defgroup' entries (bug#58015).
2022-09-23 17:58:41 +02:00
Mattias Engdegård
e4964de952 Don't rewrite set to setq of lexical variables
Only perform the rewrite

   (set 'VAR X) -> (setq VAR X)

for dynamic variables, as `set` isn't supposed to affect
lexical vars (and never does so when interpreted).

* lisp/emacs-lisp/byte-opt.el (byte-optimize-set):
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--xx): New.
(bytecomp-tests--test-cases): Add test cases.
* test/lisp/emacs-lisp/bytecomp-resources/warn-variable-set-nonvariable.el:
Remove obsolete test.
2022-09-22 14:54:15 +02:00
Eli Zaretskii
5f6e1c059c ; * lisp/emacs-lisp/gv.el (gv-synthetic-place): Doc fix. 2022-09-21 17:18:40 +03:00
Stefan Kangas
9b14e312f4 Merge from origin/emacs-28
478b786d5a ; * doc/lispref/windows.texi (Window Hooks): Fix a typo (b...
5085351645 * lisp/text-modes/tex-mode.el (tex-mode): Fix AUCTeX regre...
ee6f8598ca Add vc-annotate-switches to manual
616dcf27e5 ; Fix typos in Lisp symbols
5405852541 Remove mention of non-existent `annotate-switches'
191505b8a3 Mention that src/macuvs.h sometimes needs committing
10373c4b68 ; More comment fixes in font.h (bug#57935)
c2595b8dcc ; * src/font.h (struct font_driver): Comment fix.
97b928ce09 MacOS ld warning from native compilation (bug#57849)
2022-09-21 10:25:06 +02:00
Lars Ingebrigtsen
a498e5f830 Get fewer false positives for :keyword and &options
* lisp/emacs-lisp/lisp-mode.el (lisp-mode--search-key): New
function to check more carefully for start of :keywords and
&options (bug#51574).
(lisp-fdefs): Use it.
2022-09-20 13:34:42 +02:00
Stefan Kangas
e5de29aa47 Obsolete unused variable in debug.el
* lisp/emacs-lisp/debug.el (debugger-previous-backtrace): Make
unused variable obsolete.
2022-09-20 12:40:14 +02:00
Stefan Kangas
616dcf27e5 ; Fix typos in Lisp symbols 2022-09-20 12:21:40 +02:00
Stefan Monnier
bd40ec5d57 * lisp/emacs-lisp/cl-generic.el (cl--generic-lambda): Fix bug#57903
Fall back to old slower calling convention in dynbound code (bug#56596).
2022-09-19 16:20:01 -04:00
Juri Linkov
0a15956f49 * lisp/outline.el (outline-minor-mode-use-margins): New user option.
(outline--use-margins, outline--use-buttons, outline--use-rtl):
New buffer-local internal variables.
(outline-open, outline-close): Move :ascent center to default of define-icon.
Use ASCII-art for text.  Fix docstring and help-echo.
(outline-close-rtl, outline-open-in-margins)
(outline-close-in-margins, outline-close-rtl-in-margins): New icon
definitions.
(outline-minor-mode-highlight-buffer): Remove outline--insert-open-button
since initial outline--fix-up-all-buttons is added now to outline-minor-mode.
(outline-minor-mode): Set buffer-local outline--use-buttons,
outline--use-margins and outline--use-rtl.  Show/hide margins for
outline--use-margins.  Add hook after-change-functions for editable buffers.
Move outline--fix-up-all-buttons for both cases: font-lock and non-font-lock.
(outline--use-buttons-p): Remove function.
(outline--make-button-overlay): Use outline--use-rtl icon outline-close-rtl.
(outline--make-margin-overlay): New function.
(outline--insert-open-button, outline--insert-close-button): Add optional
arg 'use-margins'.
(outline--fix-up-all-buttons): Call outline--insert-close-button
and outline--insert-open-button with arg outline--use-margins.
(outline-cycle-buffer): Remove outline--fix-up-all-buttons
that is already called from outline-flag-region.

* lisp/emacs-lisp/icons.el (icons--create): Handle keywords :rotation
and :ascent with the default value 'center (bug#57813).

* doc/emacs/text.texi (Outline Mode): Mention outline-minor-mode-use-margins.
2022-09-19 22:35:51 +03:00
Mattias Engdegård
60102016e4 Abolish max-specpdl-size (bug#57911)
The max-lisp-eval-depth limit is sufficient to prevent unbounded stack
growth including the specbind stack; simplify matters for the user by
not having them to worry about two different limits.  This change
turns max-specpdl-size into a harmless variable with no effects,
to keep existing code happy.

* lisp/subr.el (max-specpdl-size):
Define as an ordinary (but obsolete) dynamic variable.
* admin/grammars/Makefile.in:
* doc/lispintro/emacs-lisp-intro.texi (Loops & Recursion):
* doc/lispref/control.texi (Cleanups):
* doc/lispref/edebug.texi (Checking Whether to Stop):
* doc/lispref/eval.texi (Eval):
* doc/lispref/variables.texi (Local Variables):
* doc/misc/calc.texi (Recursion Depth):
Update documentation.
* etc/NEWS: Announce.
* src/eval.c
(FletX): Use safe iteration to guard against circular bindings list.
(syms_of_eval): Remove old max-specpdl-size definition.
(init_eval_once, restore_stack_limits, call_debugger)
(signal_or_quit, grow_specpdl_allocation):
* leim/Makefile.in:
* lisp/Makefile.in:
* lisp/calc/calc-stuff.el (calc-more-recursion-depth)
(calc-less-recursion-depth):
* lisp/calc/calc.el (calc-do):
* lisp/cedet/semantic/ede-grammar.el (ede-proj-makefile-insert-rules):
* lisp/cedet/semantic/grammar.el (semantic-grammar-batch-build-one-package):
* lisp/cus-start.el (standard):
* lisp/emacs-lisp/comp.el (comp--native-compile):
* lisp/emacs-lisp/edebug.el (edebug-max-depth):
(edebug-read-and-maybe-wrap-form, edebug-default-enter):
* lisp/emacs-lisp/regexp-opt.el (regexp-opt):
* lisp/eshell/esh-mode.el (eshell-mode):
* lisp/loadup.el (max-specpdl-size):
* lisp/mh-e/mh-e.el (mh-invisible-headers):
* lisp/net/shr.el (shr-insert-document, shr-descend):
* lisp/play/hanoi.el (hanoi-internal):
* lisp/progmodes/cperl-mode.el:
* src/fileio.c (Fdo_auto_save):
Remove references to and modifications of max-specpdl-size.
2022-09-19 19:30:03 +02:00
Philipp Stephani
a71de4b52d Improve check for misleading 'cl-case' cases (Bug#57915).
* lisp/emacs-lisp/cl-macs.el (cl-case): Check that the case is of the
form (quote FOO), not just (quote).
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-case-no-warning): New unit test.
2022-09-19 13:34:51 +02:00
Gerd Möllmann
97b928ce09 MacOS ld warning from native compilation (bug#57849)
* lisp/emacs-lisp/comp.el (native-comp-driver-options): Add "-Wl,-w"
on Darwin systems.
* etc/NEWS: Describe change.
2022-09-19 07:14:58 +02:00
Michael Heerdegen
baf1a7a4a0 Turn gv-synthetic-place into a function
This fixes Bug#57397.

* lisp/emacs-lisp/gv.el (gv-synthetic-place): Make a function and add
trivial compiler macro to avoid decreasing efficiency.
2022-09-18 15:48:50 +02:00
Lars Ingebrigtsen
84801d468a Autoload string-join
* lisp/emacs-lisp/subr-x.el (string-join): Autoload since it's
being used more now.
2022-09-17 12:31:24 +02:00
Stefan Kangas
6938a2ddd2 Accept more wide function signatures in docstrings
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-wide-docstring-ignore-function-signature.el"): New test.
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Make regexp more allowing to silence warning.
* test/lisp/emacs-lisp/bytecomp-resources/warn-wide-docstring-ignore-function-signature.el:
New file.
2022-09-16 22:28:46 +02:00
Lars Ingebrigtsen
7be7ad279e Don't use autoloaded functions for safe-local-variable
* doc/lispref/symbols.texi (Standard Properties): Clarify how
safe-local-variable should look.

* lisp/emacs-lisp/checkdoc.el (checkdoc-ispell-lisp-words)
(checkdoc-symbol-words): Use list-of-strings-p.
(checkdoc-list-of-strings-p): Obsolete.

* lisp/vc/vc-git.el (vc-git-annotate-switches): Remove.
(vc-git-annotate-switches): Open-code the check.
2022-09-16 12:36:15 +02:00
Juri Linkov
8b29b29693 Add outline open/close images (bug#57813)
* etc/images/outline-open.svg:
* etc/images/outline-close.svg: New files.

* lisp/outline.el (outline-open, outline-close): Use images
outline-open.svg and outline-close.svg.

* lisp/emacs-lisp/icons.el (icons--create): Add :ascent 'center'.
2022-09-16 10:09:20 +03:00
Mattias Engdegård
824ae5faee Use eql or eq instead of = in some places
For a switch op to be generated, comparisons must be made using `eq`,
`eql` or `equal`, not `=`.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-lapcode):
* lisp/files.el (file-modes-char-to-who, file-modes-char-to-right):
* lisp/international/titdic-cnv.el (tit-process-header):
* lisp/language/ethio-util.el (ethio-input-special-character)
(ethio-fidel-to-tex-buffer):
* lisp/language/lao.el (consonant):
Use `eq` or `eql` instead of `=`.

In these cases either `eq` or `eql` would do and the choice does not
affect the resulting code.  We compare numbers with `eql` and
characters with `eq` as a matter of style.
2022-09-15 09:42:53 +02:00
Eli Zaretskii
48d8543ff1 ; Fix doc string of 'loaddefs-generate'
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate): Doc fix.
(Bug#57815)
2022-09-15 09:16:41 +03:00
Eli Zaretskii
52a3ba102c Revert "; Fix doc string of 'loaddefs-generate'"
This reverts commit 5fe9a1a85a.
It included unrelated changes.
2022-09-15 09:14:59 +03:00