Commit graph

7796 commits

Author SHA1 Message Date
Eli Zaretskii
83e3d8d879 Improve doc strings of a recent commit
* lisp/emacs-lisp/generator.el (iter-defun):
* lisp/emacs-lisp/comp.el (comp-clean-up-stale-eln):
* lisp/emacs-lisp/bytecomp.el (byte-compile-lapcode):
* lisp/emacs-lisp/autoload.el (autoload-insert-section-header):
Include description of arguments in the doc string's first line.
2021-09-18 14:56:55 +03:00
Stefan Kangas
dd1220b969 ; More stylistic docfixes in emacs-lisp/*.el found by checkdoc 2021-09-18 13:14:50 +02:00
Stefan Kangas
c1356d3a05 * lisp/emacs-lisp/checkdoc.el: Doc fix; mention flymake. 2021-09-18 11:24:31 +02:00
Stefan Kangas
00b6a56f0a Do interactive mode tagging for checkdoc.el 2021-09-18 11:21:32 +02:00
Stefan Kangas
6084c7e0f4 checkdoc: Only look for commonly used modifier keys
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Search for the modifier key "s-", but not the modifier key "A-".
The latter is very uncommon and leads to false positives.
2021-09-18 10:44:32 +02:00
Stefan Kangas
b6bff3ba79 checkdoc: 'y-or-n-p' no longer needs space
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine):
Change 'y-or-n-p' check to accept prompt ending with both "? " or "?",
that is, it no longer needs the space.  (Bug#50621)
(checkdoc--fix-y-or-n-p): New helper function.
* test/lisp/emacs-lisp/checkdoc-tests.el (checkdoc-tests-fix-y-or-n-p)
(checkdoc-tests-fix-y-or-n-p/no-change)
(checkdoc-tests-fix-y-or-n-p/with-space): New tests.
2021-09-17 22:24:12 +02:00
Stefan Kangas
3e5298fc96 Improve performance of seq-union
* lisp/emacs-lisp/seq.el (seq-union): Improve performance by using
nreverse instead of seq-reverse.
2021-09-17 14:01:20 +02:00
Stefan Kangas
fb9df9b883 Make ediff-union into obsolete alias for seq-union
* lisp/emacs-lisp/seq.el (seq-union): Autoload.
* lisp/vc/ediff-util.el (ediff-union): Make into obsolete function
alias for 'seq-union'.
* lisp/vc/ediff-mult.el (ediff-intersect-directories): Update single
caller.
2021-09-17 11:05:06 +02:00
Stefan Kangas
0cf0a2b986 Add new sequence function 'seq-union'
* lisp/emacs-lisp/seq.el (seq-union): New function.
* doc/lispref/sequences.texi (Sequence Functions):
* lisp/emacs-lisp/shortdoc.el (sequence): Document above new
function.
* test/lisp/emacs-lisp/seq-tests.el (test-seq-union): New test.
2021-09-17 11:03:39 +02:00
Stefan Kangas
63f419f133 ; Minor stylistic fixes found by checkdoc 2021-09-16 19:37:07 +02:00
Eli Zaretskii
a38675ca88 Support '...' quoting in Lisp files
* lisp/emacs-lisp/lisp-mode.el (lisp-el-font-lock-keywords-2):
Support quoting 'like this'.
2021-09-16 17:10:49 +03:00
Stefan Kangas
bcf59b99f4 Prefer "website" to "homepage"
These days, a "home page" is understood to be only "the main web page
of a website" or "landing page", whereas a "website" is "a collection
of web pages and related content" (Wikipedia).

* doc/emacs/emacs.texi (Top):
* doc/emacs/package.texi (Package Menu):
* doc/lispintro/emacs-lisp-intro.texi (Top):
* doc/lispref/elisp.texi (Top):
* doc/lispref/tips.texi (Documentation Tips):
* doc/misc/ede.texi (ede-project):
* doc/misc/efaq-w32.texi (More information):
* doc/misc/gnus-faq.texi (FAQ 5-7):
* doc/misc/gnus.texi (About mairix):
* doc/misc/mairix-el.texi (About):
* doc/misc/reftex.texi (AUCTeX, Imprint):
* lisp/cedet/ede/base.el (ede-project):
* lisp/cedet/ede/system.el (ede-web-browse-home):
* lisp/emacs-lisp/package.el (package-menu-mode-menu)
(package-browse-url):
* lisp/erc/erc-button.el (erc-emacswiki-url):
* lisp/filesets.el (filesets-goto-homepage):
* lisp/net/mairix.el:
* lisp/net/webjump.el (webjump-sample-sites):
* lisp/obsolete/vc-arch.el:
* lisp/progmodes/idlw-shell.el (idlwave-shell-mode):
* lisp/progmodes/idlwave.el (idlwave, idlwave-mode):
* lisp/textmodes/reftex-vars.el (reftex):
Prefer "website" to "home page".

* doc/lispref/tips.texi (Documentation Tips):
Sort the "URL" header comment before "Homepage".

* lisp/emacs-lisp/lisp-mnt.el
(lm-website): Rename from 'lm-homepage'.
(lm-homepage): Make into alias for 'lm-website'.
2021-09-16 15:42:44 +02:00
Stefan Kangas
b049f373ef Various minor checkdoc tweaks
* lisp/emacs-lisp/checkdoc.el (checkdoc-symbol-words): Add more
"good" words that are used a lot in practice, and where using them
doesn't really hurt the quality of the documentation.
(checkdoc-proper-noun-list): Add "dired", remove "ispell"; the
latter should not always be capitalized.
(checkdoc-common-verbs-wrong-voice): Add some more common words.
Don't check for "matches" as it leads to too many false positives and
almost no fixes in practice.
(checkdoc-this-string-valid-engine): Clarify comment.
(checkdoc-in-abbreviation-p): Ignore some less common or non-standard
abbreviations.
2021-09-16 11:36:26 +02:00
Stefan Kangas
0762c7c67f checkdoc: Don't warn about command substitutions by default
* lisp/emacs-lisp/checkdoc.el (checkdoc-max-keyref-before-warn):
Add new valid value nil meaning to never warn about too many command
substitutions, and use this value as the default.  This is no longer a
performance problem on modern machines.  (Bug#50599)
(checkdoc-this-string-valid-engine): Respect above new valid value
nil.
2021-09-15 20:35:35 +02:00
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