Commit graph

7880 commits

Author SHA1 Message Date
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Stefan Kangas
fef3e60061 * lisp/emacs-lisp/edebug.el (edebug-eval-defun): Minor doc fix. 2021-12-04 13:23:35 +01:00
Lars Ingebrigtsen
a6905e90cc Fix problem with temp buffer killing in package-install-file
* lisp/emacs-lisp/package.el (package-install-file): Allow killing
the temporary buffer without querying (bug#51769).
2021-11-12 04:44:09 +01:00
Eli Zaretskii
20ebd91a73 Improve documentation of string truncation APIs
* doc/lispref/display.texi (Size of Displayed Text):
* lisp/international/mule-util.el (truncate-string-to-width):
Document caveats of using 'truncate-string-to-width' when
character composition is involved.

* lisp/emacs-lisp/subr-x.el (string-limit):
* doc/lispref/strings.texi (Creating Strings): Improve the
documentation of 'string-limit'.
2021-10-30 10:26:38 +03:00
Lars Ingebrigtsen
91e7df281e Move lisp/shorthands.el to lisp/emacs-lisp/shorthands.el 2021-10-29 14:37:08 +02:00
Martin Rudalics
d2849cc645 Fix 'calculate-lisp-indent' when "[" starts containing sexp (Bug#51312)
* lisp/emacs-lisp/lisp-mode.el (calculate-lisp-indent): Handle
arbitrary paren syntax after skipping whitespace backwards within
containing sexp (Bug#51312).
2021-10-22 10:16:17 +02:00
Andrea Corallo
2971a6890f * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix target dir. 2021-10-16 10:56:50 +02:00
Andrea Corallo
ced72b6e4c * Fix `native-compile-target-directory' effectiveness on trampolines
* lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix
`native-compile-target-directory' effectiveness on trampoline
compilation.
2021-10-15 09:32:20 +02:00
Andrea Corallo
1af45ad04e ; * lisp/emacs-lisp/comp.el (comp-trampoline-compile): Fix comment. 2021-10-15 09:18:54 +02:00
Stefan Kangas
4e9452a399 Improve shortdoc for vector
* lisp/emacs-lisp/shortdoc.el (vector): Improve shortdoc with titles.
Add mapc.  Fix typo where 'seq-reduce' is incorrectly written as
'reduce'.
2021-10-13 05:04:34 +02:00
Lars Ingebrigtsen
07edc28bdb Fix ert errors when there's a test that binds `debug-on-error'
* lisp/emacs-lisp/ert.el (ert--run-test-internal): Don't infloop
on errors when signalling errors (bug#51131).
2021-10-11 11:14:26 +02:00
Paul Eggert
96278de8ac New function num-processors
This addresses a FIXME comment in lisp/emacs-lisp/comp.el,
relating to the number of subsidiary processes used by
comp-run-async-workers in native compilation.
* admin/merge-gnulib (GNULIB_MODULES): Add nproc.
* doc/lispref/processes.texi (Process Information), etc/NEWS:
Document num-processors.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/nproc.c, lib/nproc.h, m4/nproc.m4:
New files, copied from Gnulib by admin/merge-gnulib.
* lisp/emacs-lisp/comp.el (w32-get-nproc): Remove decl.
(comp-effective-async-max-jobs): Use num-processors.
* src/process.c: Include nproc.h.
(Fnum_processors): New function.
(syms_of_process): Define ‘all’, ‘current’, ‘num-processors’.
* src/w32proc.c (Fw32_get_nproc): Add FIXME comment.
* test/src/process-tests.el (process-num-processors): New test.
2021-10-10 14:00:26 -07:00
Stefan Kangas
1d1e96377c ; * lisp/emacs-lisp/shortdoc.el: Fix typo. 2021-10-10 13:53:55 +02:00
Stephen Gildea
d86b2e59c7 native-comp-available-p is the definitive test
* doc/lispref/compile.texi (Native Compilation): Document
native-comp-available-p as the way to test for native compilation.
* lisp/emacs-lisp/package.el (package--native-compile-async):
* test/lisp/mh-e/mh-utils-tests.el (mh-ensure-native-trampolines):
Test for native compilation with native-comp-available-p.

Thank you to Andrea Corallo for reviewing this patch.
2021-10-05 09:24:11 -07:00
Augusto Stoffel
90575a6c0c Disable 'nobreak-char-display' in Eldoc buffers
* lisp/emacs-lisp/eldoc.el (eldoc--format-doc-buffer): Set
'nobreak-char-display' to nil in Eldoc buffers (bug#50989).
2021-10-05 11:12:05 +02:00
Stefan Kangas
0a7bab689c ; Minor stylistic fixes found by checkdoc 2021-10-05 02:06:57 +02:00
Andrea Corallo
e606cc6f40 * Fix `batch-native-compile' not to spawn a subprocess
* lisp/emacs-lisp/comp.el (comp-running-batch-compilation): New var.
(comp-final): Use it.
(batch-native-compile): Bind `comp-running-batch-compilation' it.
2021-10-04 21:55:57 +02:00
Lars Ingebrigtsen
7fb2789509 Fix substitution of pretty quotes in code in easy-mmode
* lisp/emacs-lisp/easy-mmode.el (easy-mmode--arg-docstring): Adjust.
(easy-mmode--mode-docstring): Avoid making quotes into pretty
quotes in code (bug#50968).
2021-10-03 11:35:28 +02:00
Stefan Kangas
6c01a21365 Clarify the purpose of internal--format-docstring-line
* test/lisp/subr-tests.el (subr-test-internal--format-docstring-line):
* lisp/subr.el (internal--format-docstring-line): Make it more clear
that this function is not intended for the first line of a docstring.
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Add comment explaining
why we use 'internal--format-docstring-line'.
Problem pointed out by Stefan Monnier <monnier@iro.umontreal.ca>.
2021-10-03 01:59:52 +02:00
Nikolay Kudryavtsev
8477d3b339 Make checkdoc's docstring substitution consistent with other docs
* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
In error text, say "mapvar" instead of "keymap", and "command"
instead of "function", to be consistent with the ELisp manual.
(Bug#50903)
2021-09-30 19:24:35 +03:00
Mattias Engdegård
41723a329e Revert "Indent bodies of local function definitions properly in elisp-mode"
This reverts commit 38037e04cb.
2021-09-30 16:52:16 +02:00
Mattias Engdegård
be493ea67a Revert "Fix regressions in cl-flet indentation"
This reverts commit c42af5aee7.
2021-09-30 16:52:16 +02:00
akater
c42af5aee7 Fix regressions in cl-flet indentation
* lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p):
Rename (from -p-less form) and fix indentation regression
introduced by 38037e04cb
(bug#9622).  Also add cl-macrolet cl-flet* cl-symbol-macrolet.
2021-09-30 08:33:14 +02:00
Lars Ingebrigtsen
b4b4cc98ac Revert "Obsolete local set difference functions in favor of seq-difference"
This reverts commit 20f7fa691b.

gnus-set-difference is orders of magnitude faster than seq-difference
(on these sets), and using seq-difference makes nnimap too
slow.
2021-09-29 17:28:02 +02:00
Lars Ingebrigtsen
c4866ad1ac Tweak the whitespace before "This is a generic function"
* lisp/emacs-lisp/cl-generic.el (cl--generic-describe): Make the
number of blank lines before this section consistent (whether
there's an indented section before it or not).
2021-09-29 08:25:14 +02:00
Stefan Kangas
7cc6e1dda7 Add shortdoc for text properties
* lisp/emacs-lisp/shortdoc.el (text-properties): New shortdoc.

e for your changes. Lines starting
2021-09-28 20:45:08 +02:00
Stefan Kangas
ccb35fb8fb Mention describe-symbol in cl-defstruct docstring
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Mention 'describe-symbol'
in docstring.
2021-09-28 18:38:10 +02:00
Stefan Kangas
b9611e9c7e Mention cl-describe-type in cl-defstruct docstring
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Mention
'cl-describe-type' in docstring.
2021-09-28 18:09:36 +02:00
Stefan Monnier
fa92b040c6 * lisp/emacs-lisp/map.el: Restore compatibility with Emacs-26
Don't use the new `eql` syntax.
2021-09-28 10:29:27 -04:00
Stefan Kangas
a5b8140d4e Improve docstrings of ert-resource-{directory,file}
* lisp/emacs-lisp/ert-x.el (ert-resource-directory)
(ert-resource-file): Improve docstrings.
2021-09-28 14:32:06 +02:00
Stefan Kangas
b27a8f1554 Signal error on newline in internal--format-docstring-line
* lisp/subr.el (internal--format-docstring-line): Signal error
when trying to fill a line containing a newline.

* lisp/cedet/semantic/decorate/mode.el
(define-semantic-decoration-style):
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Don't pass newlines to 'internal--format-docstring-line'.
2021-09-28 14:15:00 +02:00
Eli Zaretskii
73b2b9f67a ; * lisp/emacs-lisp/comp.el (batch-native-compile): Don't use non-ASCII. 2021-09-28 15:03:38 +03:00
Eli Zaretskii
90655e4bc0 Make the build of source tarball produce *.eln files
* lisp/emacs-lisp/comp.el (batch-native-compile): Accept an
optional argument; if non-nil, place the .eln file as appropriate
for building a source tarball.

* doc/lispref/compile.texi (Native-Compilation Functions):
Document the new optional argument of 'batch-native-compile'.

* lisp/Makefile.in (.PHONY, $(THEFILE)n) [HAVE_NATIVE_COMP]: New
targets.

* src/Makefile.in (%.eln) [HAVE_NATIVE_COMP]: New recipe.
(all) [HAVE_NATIVE_COMP]: Add ../native-lisp to prerequisites.
(elnlisp) [HAVE_NATIVE_COMP]: New list of *.eln files.
(../native-lisp) [HAVE_NATIVE_COMP]: New recipe.

* src/verbose.mk.in (AM_V_ELN): New macro.
2021-09-28 15:00:50 +03:00
Eli Zaretskii
b02a7ad263 ; * lisp/emacs-lisp/comp.el (batch-native-compile): Doc fix. 2021-09-28 11:18:17 +03:00
Stefan Kangas
3cabf64131 checkdoc: Allow Lisp symbols to start a message
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-engine): Allow
Lisp symbols to start a message.
(checkdoc--error-bad-format-p): New helper function.

* test/lisp/emacs-lisp/checkdoc-tests.el
(checkdoc-test-error-format-is-good)
(checkdoc-test-error-format-is-bad): New helper functions.
(checkdoc-tests-error-message-bad-format-p)
(checkdoc-tests-error-message-bad-format-p/defined-symbols)
(checkdoc-tests-error-message-bad-format-p/not-capitalized):
New tests.
2021-09-28 01:12:36 +02:00
Stefan Kangas
3d2d7e8ea2 Fix automatic filling of docstring in cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Fix bug where a paragraph
was filled as if it were a single line, which led to garbled
output in the docstring.  (Bug#50839)

* test/lisp/subr-tests.el
(subr-test-internal--format-docstring-line): New test.
2021-09-27 11:47:55 +02:00
Stefan Kangas
77494628e2 checkdoc: Don't add "Commentary" header to test files
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Don't add "Commentary:" header if it looks like a test file.
2021-09-26 20:23:59 +02:00
Stefan Kangas
b8b1d8dee7 Add fast-path to ert--explain-string-equal
* lisp/emacs-lisp/ert.el (ert--explain-string-equal): Add fast-path to
avoid doing extra work.
Problem reported by Mattias Engdegård <mattiase@acm.org>.
2021-09-26 15:30:40 +02:00
Stefan Kangas
3bab1476f6 Rename "Homepage" field to "Website" in package description
* lisp/emacs-lisp/package.el (describe-package-1): Rename
"Homepage" field to "Website".

* test/lisp/emacs-lisp/package-tests.el
(package-test-describe-package)
(package-test-describe-installed-multi-file-package)
(package-test-describe-non-installed-package)
(package-test-describe-non-installed-multi-file-package): Update tests.
2021-09-26 14:55:19 +02:00
Stefan Kangas
8ea1765fea Prefer https for other domains than gnu.org in package URL
* lisp/emacs-lisp/package.el (describe-package-1): Prefer https for
some other common domains in the package URL.
2021-09-26 14:55:19 +02:00
Stefan Kangas
a0d5de4fb9 Add test for lm-website
* lisp/emacs-lisp/lisp-mnt.el (lm-website): Use rx.
* test/lisp/emacs-lisp/lisp-mnt-tests.el
(lm--tests-lm-website): New test.
2021-09-26 14:55:19 +02:00
Stefan Kangas
c51b1c02db Warn about overly long docstring in lambda
* lisp/emacs-lisp/bytecomp.el
(byte-compile-docstring-length-warn): Warn about overly long
docstring in lambda.  (Bug#44858)

(byte-compile--wide-docstring-p): Improve comment.
* test/lisp/emacs-lisp/bytecomp-tests.el
("warn-wide-docstring-defun.el"): Update to test for the above new
warning.
2021-09-26 13:33:29 +02:00
Stefan Kangas
8c3ec4e3cc Fill some auto-generated docstring lines
* lisp/cedet/mode-local.el (define-mode-local-override):
* lisp/cedet/semantic/decorate/mode.el (define-semantic-decoration-style):
* lisp/cedet/semantic/idle.el (define-semantic-idle-service):
* lisp/emacs-lisp/derived.el (derived-mode-make-docstring):
* lisp/emacs-lisp/eieio.el (defclass): Fill auto-generated docstring
lines.
2021-09-26 13:23:57 +02:00
Stefan Kangas
f3a6fe2c7d Avoid false positives in bytecomp docstring width warning
* lisp/emacs-lisp/bytecomp.el (byte-compile--wide-docstring-p):
Ignore more function argument lists.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests-byte-compile--wide-docstring-p): New test.
2021-09-26 13:23:57 +02:00
Stefan Kangas
c78e16962e ; Adjust overly long docstrings to fit 80 characters 2021-09-26 13:23:57 +02:00
Stefan Kangas
f4ea15907a ert: Add basic explainer for string-equal
* lisp/emacs-lisp/ert.el (ert--explain-string-equal): Add basic
explainer for 'string-equal' based on 'ert--explain-equal'.
2021-09-26 13:21:53 +02:00
Stefan Kangas
90948eb9d7 checkdoc: Library footer must match package.el requirement
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Don't accept footer format unless it matches the requirement in
package.el.
2021-09-26 11:37:29 +02:00
Lars Ingebrigtsen
50798267f2 Expand the ` doc string slightly
* lisp/emacs-lisp/backquote.el (backquote): Note that ` is used
for other things in some macros (bug#25462).
2021-09-26 08:47:08 +02:00
Stefan Kangas
c92444b4ba ; Bump seq version to 2.23 2021-09-25 21:44:55 +02:00
Stefan Kangas
822625fde5 Revert part of previous doc fix
* lisp/emacs-lisp/derived.el (define-derived-mode): Revert part of
previous doc fix.  This change made the text confusing.  (Bug#17567)
2021-09-25 21:27:11 +02:00