Commit graph

7782 commits

Author SHA1 Message Date
Glenn Morris
89068554d7 * lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Fix type. 2021-09-14 08:05:29 -07:00
Lars Ingebrigtsen
159dbd5eb2 Make `find-function-source-path' into obsolete alias
* lisp/finder.el (finder-commentary): Adjust usage.

* lisp/emacs-lisp/find-func.el (find-function-source-path): Made
into obsolete alias (bug#50508).
(find-library-source-path): New name.
(find-library-name, find-library, find-function-noselect)
(find-variable-noselect, find-definition-noselect): Adjust usage
and update doc strings.
2021-09-14 13:44:20 +02:00
Stefan Kangas
5cd5cc5dd8 ; * lisp/emacs-lisp/checkdoc.el: Fix typo in previous commit. 2021-09-14 08:15:15 +02:00
Stefan Kangas
25ebb9374b ; More minor docfixes found by checkdoc 2021-09-14 07:57:14 +02:00
Stefan Kangas
cf2fa6c87f Add user option to avoid checkdoc warning for unescaped left paren
* lisp/emacs-lisp/checkdoc.el
(checkdoc-column-zero-backslash-before-paren): New user option to
avoid warning on unescaped left parenthesis in column zero.
(checkdoc-this-string-valid-engine): Respect above new option.
2021-09-14 07:56:06 +02:00
Stefan Kangas
269c8a0b63 Minor improvements to checkdoc
* lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Add ignored
values.
(checkdoc-proper-noun-list): Remove XEmacs from list of words to
capitalize; there is little need to insist on consistency here.
(checkdoc-in-abbreviation-p): Add abbreviation "etc." and sort entries
alphabetically.
2021-09-14 07:56:06 +02:00
Lars Ingebrigtsen
08540a29e3 package-menu-execute doc string clarification
* lisp/emacs-lisp/package.el (package-menu-execute): Say what
happens to upgrade-marked packages (bug#50551).
2021-09-13 10:35:22 +02:00
Lars Ingebrigtsen
d15c430a84 Mention get-byte in shortdoc
* lisp/emacs-lisp/shortdoc.el (buffer): Mention `get-byte' here.
2021-09-13 09:20:21 +02:00
Stefan Kangas
2110973351 Improve checkdoc abbreviation handling
* lisp/emacs-lisp/checkdoc.el
(checkdoc-in-abbreviation-p): New helper function.
(checkdoc-sentencespace-region-engine): Fix handling abbreviations
after escaped parenthesis.

* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-tests-in-abbrevation-p)
(checkdoc-tests-in-abbrevation-p/with-parens)
(checkdoc-tests-in-abbrevation-p/with-escaped-parens): New tests.
2021-09-13 06:44:52 +02:00
Eli Zaretskii
ff4de1bd88 Fix quoting style in Lisp comments
* lisp/textmodes/rst.el:
* lisp/progmodes/elisp-mode.el (elisp--xref-find-definitions):
* lisp/org/org.el:
* lisp/org/org-list.el (org-list-to-generic):
* lisp/org/org-compat.el:
* lisp/hexl.el (hexl-ascii-region):
* lisp/emacs-lisp/lisp-mode.el:
* lisp/calendar/calendar.el: In comments, quote 'like this'.
2021-09-12 19:51:06 +03:00
Stefan Kangas
fc4b956c7c ; Fix symbol quoting typos 2021-09-12 18:36:49 +02:00
Mattias Engdegård
09ae3f9f65 Remove obsolete variable
* lisp/emacs-lisp/byte-opt.el
(byte-optimize--vars-outside-condition): Remove.
(byte-optimize-form-code-walker): Remove bindings.
2021-09-11 17:17:33 +02:00
Mattias Engdegård
020a408eda Propagate aliased lexical variables in byte compiler
Replace uses of a variable aliasing another variable with that aliased
variable, to allow for variable removal when possible.  This also
enables opportunities for other optimisations.  Example:

 (let ((y x)) (f y)) => (f x)

The optimisation is only performed if both aliased and aliasing
variables are lexically bound.  Shadowing bindings are α-renamed when
necessary for correctness.  Example:

   (let* ((b a) (a EXPR)) (f a b))
=> (let* ((a{new} EXPR)) (f a{new} a))

* lisp/emacs-lisp/byte-opt.el (byte-optimize--aliased-vars): New.
(byte-optimize-form-code-walker): Cancel aliasing upon mutation.
(byte-optimize--rename-var-body, byte-optimize--rename-var): New.
(byte-optimize-let-form): Add the optimisation.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add relevant test cases.
2021-09-11 17:17:33 +02:00
Eli Zaretskii
bfd5e268a8 ; * lisp/emacs-lisp/comp.el (native-comp-compiler-options): Doc fix. 2021-09-11 10:22:06 +03:00
Arthur Miller
dea67939b6 Add support for GCC compiler command-line options
* lisp/emacs-lisp/comp.el ('native-comp-compiler-options): New option.
* lisp/emacs-lisp/bytecomp.el (byte-compile-from-buffer): Add support
for new 'native-comp-compiler-options'.
* src/comp.c (Fcomp_native_compiler_options_effective_p): New function.
(add_compiler_options): New function.
(Fcomp__compile_ctxt_to_file): Call 'add_compiler_options'.
2021-09-10 21:04:41 +02:00
Mattias Engdegård
c4724add00 Normalise nested progn forms in byte-code optimiser
* lisp/emacs-lisp/byte-opt.el (byte-optimize-body): Flatten body.
This simplifies the source tree and reduces the number of different
cases that other optimisations need to take into account.
2021-09-06 16:47:13 +02:00
Mattias Engdegård
bba48d6ee5 More robust optimisation of ignore
Treat `ignore` as any other function during source-level optimisation,
to avoid having its warning-suppression effects cancelled by repeated
passes.  Instead, define a custom code generation function.

* lisp/emacs-lisp/byte-opt.el (byte-optimize-form-code-walker):
Don't treat `ignore' specially here.
(side-effect-free-fns): Don't mark `ignore` as side-effect-free
or error-free (although it is), since that would allow the optimiser
to elide calls.
* lisp/emacs-lisp/bytecomp.el (ignore, byte-compile-ignore):
Define and register a code-gen function.
2021-09-06 16:47:13 +02:00
Mattias Engdegård
fab1e220db Optimise member and assoc (etc) with constant empty list
* lisp/emacs-lisp/byte-opt.el
(byte-optimize-assq): New.
(byte-optimize-member, byte-optimize-assoc, byte-optimize-memq):
When the list argument is constant nil, the result is always nil.
* test/lisp/emacs-lisp/bytecomp-tests.el (bytecomp-tests--test-cases):
Add test cases.
2021-09-06 16:47:13 +02:00
martin rudalics
9680994d3a Restore the debugging window size more reliably
* lisp/emacs-lisp/debug.el (debug): Restore the debugging window
size more reliably (bug#12921).
2021-09-06 12:48:07 +02:00
Lars Ingebrigtsen
c5b654b3f1 Autoload cl-struct-slot-info
* lisp/emacs-lisp/cl-macs.el (cl-struct-slot-info): Autoload
(bug#50301).

* test/lisp/emacs-lisp/memory-report-tests.el: Don't require cl-macs.
2021-09-05 16:52:14 +02:00
Stefan Monnier
c78969d31b * lisp/emacs-lisp/timer.el (timer-create): Don't inline it 2021-09-04 12:52:16 -04:00
Lars Ingebrigtsen
d0eaf7a3cf Fix `describe-function' for autoloaded adviced functions
* lisp/emacs-lisp/nadvice.el (advice--make-single-doc): Factor
out.
(advice--make-docstring): From here (bug#23523).  Also include
advices for autoloads.
2021-09-03 13:48:44 +02:00
Stefan Kangas
0cabf8bc36 ; Fix typos 2021-09-03 13:05:32 +02:00
Lars Ingebrigtsen
d1f3247666 Make recent timer changes more backwards-compatible
* lisp/emacs-lisp/timer.el (timerp, timer-event-handler): Make
backwards-compatible with old .elc files that have their own
versions of `timer-create'd structures.
2021-09-03 10:40:21 +02:00
Lars Ingebrigtsen
d7fb11b6d7 Reformat up-list and backward-up-list doc strings
* lisp/emacs-lisp/lisp.el (backward-up-list): Reformat the doc
string into several paragraphs (bug#31349).
(up-list): Ditto and fix the "start" to be "end".
2021-09-02 10:22:52 +02:00
Yikai Zhao
d8d5dc4565 memory-report: support calculating size for structures
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1): Add
support for cl-defstruct types (bug#50301).
2021-09-02 09:37:06 +02:00
Lars Ingebrigtsen
fffcc7ab25 Fix (setf (map-elt map key) (my-func))
* lisp/emacs-lisp/map.el (map-elt): Ensure that the value isn't
referenced more than once (bug#50290).
2021-09-01 10:32:49 +02:00
Lars Ingebrigtsen
50765f3f51 Make run-at-time try harder to run at integral multiples
* lisp/emacs-lisp/timer.el (timer): Add new slot integral-multiple.
(timerp): Adjust.
(timer-event-handler): Recompute the delay if requested
(bug#39099).
(run-at-time): Mark the timer as recomputable if given a t
parameter.

* src/keyboard.c (decode_timer): Adjust.
2021-08-31 03:04:22 +02:00
Lars Ingebrigtsen
e26d628a4e Don't overly truncate tabulated-list headers
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-init-header):
Don't overly truncate headers that are before a right-aligned
column (bug#44594).
(tabulated-list--available-space): Separated out into own
function...
(tabulated-list-print-col): ... from here.
2021-08-27 18:41:42 +02:00
Lars Ingebrigtsen
61323c6d76 Put advice documentation at the end of the displayed doc string
* lisp/emacs-lisp/nadvice.el (advice--make-docstring): Put the
advice things at the end of the documentation (bug#50222).  It's
important to have the first line of the original documentation
remain the first line, because it's used when doing one-line
summaries of the function.
2021-08-27 17:15:17 +02:00
Andrea Corallo
f7da671493 * Forward `comp-file-preloaded-p' to async workers
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Forward
`comp-file-preloaded-p' to async workers.
2021-08-27 15:30:20 +02:00
Shitikanth Kashyap
f09ee98e68 tabulated-list-print delete excess lines
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-print): Ensure
that we delete remaining lines if the list has gotten shorter
(bug#50194).

Copyright-paperwork-exempt: yes
2021-08-25 13:34:45 +02:00
Mattias Engdegård
4281e5b34d Add example of advanced user-defined Rx form to manual
* doc/lispref/searching.texi (Extending Rx): Add example illustrating
how to define a user-defined Rx form that performs computation,
from a discussion with Michael Herdeegen (bug#50136).
* lisp/emacs-lisp/rx.el (rx): Clarify evaluation time for `eval`.
2021-08-23 19:57:17 +02:00
Lars Ingebrigtsen
4015fb6e69 Improve byte-compile-warnings doc string
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings): Mention
'byte-compile-docstring-max-column'.
2021-08-23 02:04:55 +02:00
Eli Zaretskii
654e096b09 ; * lisp/emacs-lisp/comp.el (native-comp-async-cu-done-functions): Doc fix. 2021-08-22 11:42:05 +03:00
Lars Ingebrigtsen
a0023661a4 Clarify cl-defstruct doc string and manual entry somewhat
* doc/misc/cl.texi (Structures): Rename the slot "name" in the
examples to "first-name", since we're talking about the names of
slots a lot here, and having a slot with the name "name" makes the
examples somewhat confusing.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Clarify certain
things about slots (bug#14278).
2021-08-21 16:50:20 +02:00
Andrea Corallo
7fa5dec86e * Fix `native-compile-target-directory' effectiveness for async compilation.
* lisp/emacs-lisp/comp.el (comp-run-async-workers): Forward to async
workers `native-compile-target-directory'.
2021-08-17 23:47:05 +02:00
Lars Ingebrigtsen
b9243b034b Minor clarification for define-minor-mode :variable
* lisp/emacs-lisp/easy-mmode.el (define-minor-mode):
* doc/lispref/modes.texi (Defining Minor Modes): Clarify what the
setter function should do (bug#14875).
2021-08-16 14:24:53 +02:00
Lars Ingebrigtsen
751f1707f0 Add new functions to replace strings/regexp in a region
* doc/lispref/searching.texi (Search and Replace): Document them.
* lisp/subr.el (replace-string-in-region)
(replace-regexp-in-region): New functions.

* lisp/emacs-lisp/shortdoc.el (regexp, buffer): Mention them.
2021-08-16 13:20:35 +02:00
Masahiro Nakamura
e2eb58c487 Mark up commands in shortdoc.el for modes
* lisp/emacs-lisp/shortdoc.el: Add command mode tagging
(bug#50064).
2021-08-15 11:55:34 +02:00
Stefan Monnier
bf55b5ac17 * lisp/emacs-lisp/easymenu.el (easy-menu-do-define): Fix bug#50051
This corrects the quite confused conversion to closure done in
commit a070bd1c8b.
2021-08-14 12:22:57 -04:00
Lars Ingebrigtsen
22d8e71d04 Make lm-crack-address less strict
* lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Use
mail-header-parse-address-lax (bug#50049).
2021-08-14 15:23:29 +02:00
Lars Ingebrigtsen
e91b574bf8 Add new functions for lax mail address splitting
* lisp/emacs-lisp/subr-x.el (string-clean-whitespace): Autoload.
* lisp/mail/mail-parse.el (mail-header-parse-addresses-lax)
(mail-header-parse-address-lax): New functions.
2021-08-14 15:20:59 +02:00
Earl Hyatt
c58f8dda2b Add macro seq-setq.
* doc/lispref/sequences.texi (seq-setq): Document this macro.

* lisp/emacs-lisp/seq.el (seq-setq): New macro.

* test/lisp/emacs-lisp/seq-tests.el (test-seq-setq):
Test this macro (bug#50053).
2021-08-14 14:17:12 +02:00
Yikai Zhao
adb6c3f1a4 Fix memory-report counting of vector/hash table sizes
* lisp/emacs-lisp/memory-report.el (memory-report--object-size-1):
Count element values in vectors and hash tables.

Copyright-paperwork-exempt: yes
2021-08-14 13:46:37 +02:00
Basil L. Contovounesios
37d48edf6d Fix merging of ambiguous nil maps
* lisp/emacs-lisp/map.el: Bump version to 3.1.
(map--merge): New merging subroutine that uses a hash table in place
of lists, for both efficiency and avoiding ambiguities (bug#49848).
(map-merge): Rewrite in terms of map--merge.
(map-merge-with): Ditto.  This ensures that FUNCTION is called
whenever two keys are merged, even if they are not eql (which could
happen until now).  It also makes map-merge-with consistent with
map-merge, thus achieving greater overall predictability.
* etc/NEWS: Announce this weakening of guarantees.
* test/lisp/emacs-lisp/map-tests.el (test-map-merge)
(test-map-merge-with): Don't depend on specific orderings.  Test
that nil is correctly merged into a plist.
2021-08-14 11:24:54 +01:00
Lars Ingebrigtsen
8fbb870083 Make debug' reset inhibit-read-only' while running
* lisp/emacs-lisp/debug.el (debug): Bind `inhibit-read-only' to
nil in case we're in a context that has bound it to t (bug#26947).
2021-08-13 15:50:14 +02:00
Stefan Monnier
5809728bc5 * lisp/emacs-lisp/lisp-mnt.el (lm-crack-address): Handle multi-addresses
(lm-authors, lm-maintainers): Adjust accordingly.
2021-08-12 13:55:38 -04:00
Stefan Monnier
96d83a8546 * lisp/emacs-lisp/pcase.el (pcase-setq): Align its semantics with pcase-let
* test/lisp/emacs-lisp/pcase-tests.el (pcase-tests-setq): Rename from
pcase-setq and ajust accordingly.
2021-08-12 11:04:30 -04:00
Lars Ingebrigtsen
368c9f5e84 Clarify smie-indent-forward-token doc string
* lisp/emacs-lisp/smie.el (smie-indent-forward-token): Doc string
clarification (bug#31948).
2021-08-12 15:39:36 +02:00