Commit graph

9491 commits

Author SHA1 Message Date
Dmitry Gutov
70e25298f1 Tweak the DOI URL and the description
* lisp/emacs-lisp/smie.el: Use a friendlier (HTTPS) DOI URL.  And
fix the year in the description.
2023-10-26 02:39:12 +03:00
Mattias Engdegård
a3db503351 Move lexical-binding warning from checkdoc to byte-compiler
This warning is much more appropriate for the compiler, since lexical
binding affects what it can reason and warn about, than for checkdoc
as the warning has no bearing to documentation at all.
The move also improves the reach of the warning.

* etc/NEWS: Update.
* lisp/emacs-lisp/checkdoc.el (checkdoc-lexical-binding-flag)
(checkdoc-file-comments-engine): Move warning from here....
* lisp/emacs-lisp/bytecomp.el (byte-compile-file): ...to here.
* test/lisp/emacs-lisp/bytecomp-resources/no-byte-compile.el:
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-tests--unescaped-char-literals)
(bytecomp-tests-function-put, bytecomp-tests--not-writable-directory)
(bytecomp-tests--target-file-no-directory):
Update tests.
(bytecomp-tests--log-from-compilation)
(bytecomp-tests--lexical-binding-cookie): New test.
2023-10-21 15:12:55 +02:00
Eli Zaretskii
a8b14b77ff ; * lisp/emacs-lisp/comp-cstr.el: Fix punctuation. 2023-10-20 15:46:20 +03:00
Stefan Monnier
d7c91d74b6 (cl--typeof-types): Complete last change
* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types):
Add `integer-or-marker` in the hierarchy as well.
2023-10-19 10:21:22 -04:00
Andrea Corallo
a567faf4c2 Add two missing 'number-or-marker' entries to the cl machinery (bug#66615)
Assuming 'number-or-marker' is a type (as present multiple times in
cl--typeof-types) adding some missing entries for coherency.

* lisp/emacs-lisp/cl-preloaded.el (cl--typeof-types): Add
'number-or-marker' as supertype of 'number' in the 'float' branch.

* lisp/emacs-lisp/cl-macs.el (cl-deftype-satisfies): Add
'number-or-marker'.

* test/lisp/emacs-lisp/comp-cstr-tests.el (comp-cstr-typespec-tests-alist):
Update test.

* test/src/comp-tests.el (comp-tests-type-spec-tests): Update two testes.
2023-10-19 13:59:57 +02:00
Andrea Corallo
3e193edd68 Improve cstr typeset normalization
* test/lisp/emacs-lisp/comp-cstr-tests.el
(comp-cstr-typespec-tests-alist): Add four tests.

* lisp/emacs-lisp/comp-cstr.el (comp--sym-lessp)
(comp--direct-supertype, comp--normalize-typeset0): New functions.
(comp-normalize-typeset): Rework to make use of
'comp--normalize-typeset0'.
(comp--direct-subtypes): New function.
2023-10-19 13:58:46 +02:00
Michael Albinus
2071904d51 Merge from origin/emacs-29
07c45f20fd Fix test in files-tests
5d3f3288d2 ; * doc/emacs/search.texi (Regexp Backslash): Improve ind...
9525315c11 Add missing :version to two defcustoms
9044d4d94b Fix a defcustom :type in eldoc.el
8141d73ea7 Document 'M-x align' in the Emacs manual
2023-10-16 09:02:39 +02:00
Stefan Kangas
9525315c11 Add missing :version to two defcustoms
* lisp/emacs-lisp/eldoc.el (eldoc-print-after-edit)
(eldoc-echo-area-prefer-doc-buffer): Add missing custom :version.
2023-10-14 21:00:00 +02:00
Mauro Aranda
9044d4d94b Fix a defcustom :type in eldoc.el
* lisp/emacs-lisp/eldoc.el (eldoc-echo-area-prefer-doc-buffer): Make
:type a choice, to allow for the value 'maybe'.  (Bug##66539)
2023-10-14 20:54:04 +02:00
Mattias Engdegård
1f95f91d85 Simplify and describe docstrings-wide check
* lisp/emacs-lisp/bytecomp.el
(byte-compile--wide-docstring-substitution-len): Remove.
* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width):
Add back explanatory comments lost in a previous change.
2023-10-14 13:26:20 +02:00
Mattias Engdegård
fbbe40cf50 Make the docstrings-wide check 70x faster
Instead of performing a number of expensive transformations on the
original doc string and then use a dynamically-created regexp to find
wide lines, step through the lines in the unmodified string and only
perform the transformations on lines that exceed the limit.
This is sound because the transformations are contractive.

The new check will usually not cons nor perform any regexp matching.

* lisp/emacs-lisp/bytecomp.el (bytecomp--docstring-line-width): New.
(byte-compile--wide-docstring-p): Cheaper implementation.
2023-10-14 12:15:33 +02:00
Mattias Engdegård
548bc3e3d1 Sort byte compiler warnings in alphabetic order
* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types):
Rearrange.  Add a few missing ones.
2023-10-14 10:34:10 +02:00
Jens Schmidt
115a940a4b Fix beginning-of-defun not jumping to BOF
In batch mode or when font-lock and some other niceties are switched
off, function `syntax-ppss' can modify match data held by function
`beginning-of-defun-raw'.  In that case, `beginning-of-defun' can jump
to some seemingly arbitrary position, and not the actual BOF.

* lisp/emacs-lisp/lisp.el (beginning-of-defun-raw): Save match data
around a call to `syntax-ppss'. (Bug#66218)
2023-10-14 11:01:52 +03:00
Michael Albinus
bbccef3ceb Merge from origin/emacs-29
c8ea14e782 Handle quoted tilde in Tramp
30239759ee ; Set maintainer for elint.el to emacs-devel
eedd9db619 Update to Org 9.6.10

# Conflicts:
#	lisp/net/tramp-gvfs.el
2023-10-13 16:18:06 +02:00
Mattias Engdegård
77daafbb36 Add convenience wrapper for regexp disassembly
* lisp/emacs-lisp/disass.el (re-disassemble): New.
* etc/NEWS: Describe the new function instead of the internal
`re--describe-compiled`.
2023-10-13 15:24:10 +02:00
Mattias Engdegård
a52d627b37 Separate docstrings-wide warning identifier
This allows the docstring line width warning to be disabled without
also disabling the one checking for curly quotes etc.

* lisp/emacs-lisp/bytecomp.el (byte-compile-warning-types)
(byte-compile-warnings, byte-compile-docstring-style-warn):
Add `docstrings-wide`.
* etc/NEWS: Annonuce.
2023-10-13 14:31:18 +02:00
Stefan Kangas
30239759ee ; Set maintainer for elint.el to emacs-devel
* lisp/emacs-lisp/elint.el: Set maintainer to emacs-devel.
2023-10-12 13:25:31 +02:00
Alan Mackenzie
aa45ea8a33 In cl-prin1, enable raw printing for a byte-compiled function
* lisp/emacs-lisp/cl-print.el (cl-print-compiled): document the
new option `raw'.
(cl-print-object/compiled-function): when cl-print-compiled is
`raw', just print the function using `prin1'.  Apply a button
to this output which, when activated disassembles the function.

* etc/NEWS (cl-print): Add an entry for this new feature.
2023-10-11 13:26:01 +00:00
Joseph Turner
35205f19ca Make package-vc-install-from-checkout NAME argument optional
* lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout):
Allow nil NAME; update documentation.  (Bug#66393)
2023-10-08 23:29:23 +02:00
Philip Kaludercic
68318dfd16 Do not scrape :ignored-files for dependencies
* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1): If a file
matches the ignored packages in :ignored-files, do not install any
dependencies it lists.
2023-10-08 23:20:32 +02:00
Eli Zaretskii
1c9ddf3948 Merge from origin/emacs-29
e9b88f61cc Fix a defcustom :type
3216cd9695 Fix pulse-flag :type
2065ab5562 Fix defcustoms in timeclock.el
bdd3013249 ; * lisp/image-mode.el (image-mode-to-text, image-mode-as...
5c2d9ae48e ; * lisp/image-mode.el: Fix typos in doc strings (bug#663...
fa0d3f45ae ; Improve wording of last change
3ef259e28a Improve documentation of `ns-use-proxy-icon`
712505a82b Document assigning libraries to packages in make-tarball.txt
6bdc5cfe38 Doc fix; more consistently refer to "text terminals"
d210d761b1 ; Fix doc strings of overlay-arrow variables
4fd00ff1f7 Fix defcustoms in type-break.el (Bug#66210)
47770b0eca Fix term-scroll-to-bottom-on-output :type
f8bdc8dff0 ; Normalize GNU ELPA :core package statements
63ec6d998d ; * doc/emacs/custom.texi (Early Init File): Improve inde...
a4185f87bd ; Silence macOS 14 warning
d9d6e14a69 ; * lisp/vc/vc.el (vc-next-action): Improve commentary.
d558f38fe5 ; * lisp/emacs-lisp/let-alist.el (let-alist): Fix quoting...
71feee7930 Doc fix in let-alist for keys with nil value
72cc9cf2cd ; Fix typos
2023-10-07 03:46:48 -04:00
Jens Schmidt
86e8f31505 Silence macro expansion during completion at point
* lisp/emacs-lisp/macroexp.el (macroexp-inhibit-compiler-macros): Add
variable.
(macroexp--compiler-macro): Inspect that new variable and, if it is
non-nil, return the input form unchanged.
* lisp/progmodes/elisp-mode.el (elisp--local-variables): Silence
messages.  Avoid compiler macros.  (Bug#58148)
2023-10-05 14:00:36 -04:00
Eli Zaretskii
511acc2ed8 ; * lisp/emacs-lisp/cl-print.el (cl-print-to-string-with-limit): Typo. 2023-10-04 20:04:53 +03:00
Alan Mackenzie
849de5aa1a Correct the `cond' forms in cl-print-string-with-limit
In this function, calling with limit bound to t will cause an
error in any of the cond forms which set print-length, etc.
Correct them!

* lisp/emacs-lisp/cl-print.el (cl-print-string-with-limit):
Amend the doc string.  In the cond forms in the bindings for
print-length, etc., test the value t first.  Amend those for
print-length and print-level also to test for a zero value of
limit.
2023-10-03 10:22:26 +00:00
Stefan Kangas
3df581972f ; Simplify recent change in cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Use bound-and-true-p.
Suggested by Robert Pluim <rpluim@gmail.com>.
2023-10-01 18:45:36 +02:00
Ivan Sokolov
a96dc984dd Sort package-selected-packages on save 2023-10-01 14:25:13 +02:00
Stefan Kangas
f8bdc8dff0 ; Normalize GNU ELPA :core package statements
* lisp/emacs-lisp/let-alist.el:
* lisp/progmodes/project.el: Normalize GNU ELPA :core package
statement.
2023-10-01 01:35:23 +02:00
Stefan Kangas
820deac94b ; Add missing GNU ELPA :core package statements
* lisp/bind-key.el:
* lisp/emacs-lisp/map.el:
* lisp/erc/erc.el:
* lisp/external-completion.el:
* lisp/net/ntlm.el:
* lisp/net/soap-client.el:
* lisp/progmodes/python.el:
* lisp/svg.el:
* lisp/use-package/use-package.el: Add GNU ELPA :core package
statements.
2023-10-01 00:09:05 +02:00
Alan Mackenzie
01229fe009 Stop truncating strings too much in cl-print-string-with-limit
This fixes bug#65680, by introducing a new variable limiting
the length of a printed string, rather than abusing
print-length for that purpose.

* lisp/emacs-lisp/cl-print.el (cl-print-string-length): New
variable.
(cl-print-object <string>, cl-print--string-props): Use
cl-print-string-length rather than print-length here.
(cl-print-string-with-limit): bind cl-print-string-length based
on argument `limit'.  Decrement it by a quarter at each trial
iteration of printing.
2023-09-29 16:14:04 +00:00
Mattias Engdegård
6e4432673c Small clean-up of byte-compile-docstring-style-warn
* lisp/emacs-lisp/bytecomp.el (byte-compile-docstring-style-warn):
Make the code slightly cheaper.  It's still dominated by the
huge cost of `byte-compile--wide-docstring-p`, though.
2023-09-29 17:59:50 +02:00
Mattias Engdegård
5959a28cce Include all in byte-compile-warnings defcustom type
* lisp/emacs-lisp/bytecomp.el (byte-compile-warnings):
Let "All" mean `all`, not `t`.
2023-09-29 17:59:50 +02:00
Eli Zaretskii
d558f38fe5 ; * lisp/emacs-lisp/let-alist.el (let-alist): Fix quoting in doc string. 2023-09-29 08:41:42 +03:00
Stefan Kangas
71feee7930 Doc fix in let-alist for keys with nil value
* lisp/emacs-lisp/let-alist.el (let-alist): Clarify that keys with a
nil value will give the same result as if they were missing.
2023-09-29 00:28:28 +02:00
Eshel Yaron
8a635ac849 ; Substitute quotes in obsoletion notice in 'C-h f'
* lisp/help-fns.el (help-fns--obsolete): Substitute quotes in string
arguments to 'obsolete' declarations.

* lisp/emacs-lisp/advice.el (defadvice): Markup symbols in 'obsolete'
declaration.  (Bug#66240)
2023-09-28 21:44:09 +02:00
Alan Mackenzie
6956382033 Revert "Don't use ellipses while cl-printing strings."
This reverts commit 761f8901ff.
2023-09-27 09:54:33 +00:00
Mattias Engdegård
215bfb24dd ; checkdoc.el: remove unnecessary regexp groups
* lisp/emacs-lisp/checkdoc.el (checkdoc-message-text-next-string):
Remove remains from when the regexp was not written in rx.
2023-09-26 13:33:54 +02:00
Basil L. Contovounesios
ff2a02afa6 Address defcustom :type warnings
* lisp/calendar/diary-lib.el (diary-display-function):
* lisp/calendar/icalendar.el (icalendar-export-alarms):
* lisp/emacs-lisp/elint.el (elint-ignored-warnings):
* lisp/mail/sendmail.el (send-mail-function):
* lisp/net/gnutls.el (gnutls-verify-error):
* lisp/gnus/mm-decode.el (mm-text-html-renderer):
* lisp/gnus/message.el (message-send-mail-function): Fix misplaced
defcustom :tags (bug#66196).
(message-tool-bar): Remove duplicate, overwritten, and nonexistent
defcustom :type gmm-tool-bar-list-item.
* lisp/progmodes/idlwave.el (idlwave-begin-line-comment): Strip
excessive defcustom :type quoting.
* lisp/progmodes/ps-mode.el (ps-mode-paper-size): Consolidate paper
sizes with same dimensions into a single defcustom menu entry.
* lisp/textmodes/glyphless-mode.el (glyphless-mode-types): Remove
duplicate defcustom :type choice.
2023-09-26 09:29:39 +02:00
Mattias Engdegård
f616edb4cc macroexp-parse-body: correct parsing of empty body (bug#66136)
* lisp/emacs-lisp/macroexp.el (macroexp-parse-body):
Return an empty body even when there are declarations present.
Previously, the last declaration was considered part of the body,
which is only correct if the input consists of a single string.

Reported by Jens Schmidt.
2023-09-25 15:04:17 +02:00
Eli Zaretskii
c79a4c49ca Merge from origin/emacs-29
71a1f0fdc9 Add more missing builtin package declarations
94705f8300 ; Fix last change in shell-command-to-string
2023-09-23 09:32:56 -04:00
Philip Kaludercic
24b8d13fc1 ; Handle edge-case when deleting the last package
* lisp/emacs-lisp/package.el (package-delete): Rebind 'package-alist'
while calling 'package--used-elsewhere-p'.  (bug#65475)
2023-09-21 18:28:30 +02:00
Alan Mackenzie
f931cebce7 Insert symbol `debug' into two condition-case handlers
This fixes bug#65622.  Also correct a mismatch between a
function to which advice is added, and that from which it is
removed.

* lisp/emacs-lisp/macroexp.el (internal-macroexpand-for-load):
Add a `debug' to the condition-case handler for `error', so
that a useful backtrace will be produced on a macro expansion
error.

* lisp/progmodes/elisp-mode.el (elisp--local-variables): Add
`debug' to a condition-case handler, as above.  In the
advice-remove call, give the same function, macroexpand-1, as
in the corresponding advice-add call.
2023-09-20 15:51:17 +00:00
Andrea Corallo
ea12230039 * lisp/emacs-lisp/comp.el (comp-compute-dominator-tree): Simplify. 2023-09-20 12:09:15 +02:00
Mattias Engdegård
b03338c70d Warn about duplicated :tag strings in defcustom choices
It is bad user experience when two menu items have identical labels.

* lisp/emacs-lisp/bytecomp.el (bytecomp--check-cus-type): Add check.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test-defcustom-type): Add test case.
2023-09-19 15:21:03 +02:00
Alan Mackenzie
761f8901ff Don't use ellipses while cl-printing strings.
This fixes bug#65680.  The former use of print-length as a
bound on the length of the printed string was erroneous,
causing error messages preceding backtracees to get
unnecessarily truncated to 50 characters.

* lisp/emacs-lisp/cl-print.el (cl-print-object <string>):
Remove the substitution of ellipses for long strings.

* test/lisp/emacs-lisp/cl-print-tests.el
(cl-print-tests-ellipsis-string): Remove this test.
2023-09-19 10:25:34 +00:00
Andrea Corallo
ea5ae08b06 * lisp/emacs-lisp/comp.el (comp-final1): Clean-up unused form. 2023-09-19 11:46:19 +02:00
Andrea Corallo
438d71e83b * lisp/emacs-lisp/comp.el (comp-op-to-fun): Use `string-replace'. 2023-09-19 11:46:19 +02:00
Andrea Corallo
991bf3f0f5 * Fix comp-function-type-spec for non symbol input (bug#66021)
* lisp/emacs-lisp/comp.el (comp-function-type-spec): Make it robust
against closures (bug#66021).
2023-09-18 10:15:38 +02:00
Stefan Kangas
9aab258b80 Add missing builtin package declarations
* lisp/finder.el (finder--builtins-alist): Add new package
directories 'leim' and 'obsolete' as part of the 'emacs' package.
Add new package directory 'use-package' as part of the
'use-package' package.
* lisp/net/eudc-capf.el:
* lisp/net/eudcb-ecomplete.el:
* lisp/net/eudcb-macos-contacts.el:
* lisp/net/eudcb-mailabbrev.el: Declare library as part of the
'eudc' package.
* lisp/mail/ietf-drums-date.el: Declare library as part of the
'ietf-drums' package.
* lisp/image/image-dired-dired.el:
* lisp/image/image-dired-external.el:
* lisp/image/image-dired-tags.el:
* lisp/image/image-dired-util.el: Declare library as part of the
'image-dired' package.
* lisp/emacs-lisp/oclosure.el:
* lisp/keymap.el:
* lisp/progmodes/c-ts-common.el: Declare library as part of the
'emacs' package.  (Bug#62751)

(cherry picked from commit 94b1de2774)
2023-09-18 01:55:28 +02:00
Stefan Kangas
71a1f0fdc9 Add more missing builtin package declarations
* lisp/emacs-lisp/shorthands.el: Declare library as part of the
'emacs' package.
* lisp/epa-ks.el: Declare library as part of the 'epa'
package.  (Bug#55388)
2023-09-18 01:14:01 +02:00
Mattias Engdegård
f8ea47ebf4 Expanded defcustom type byte-compilation warnings (bug#65852)
Warn about more kinds of mistakes in :type arguments of `defcustom`
and `define-widget`.  These include:

- misplaced keyword args, as in (const red :tag "A reddish hue")
- missing subordinate types, as in (repeat :tag "List of names")
  or (choice list string)
- duplicated values, as in (choice (const yes) (const yes))
- misplaced `other` member, as in
  (choice (const red) (other nil) (const blue))
- various type name mistakes, as in (vector bool functionp)

* lisp/emacs-lisp/bytecomp.el (byte-compile--defcustom-type-quoted)
(byte-compile-nogroup-warn): Remove.
(byte-compile-normal-call): Remove call to the above.
(bytecomp--cus-warn, bytecomp--check-cus-type)
(bytecomp--custom-declare): New.
2023-09-17 17:16:35 +02:00