Commit graph

9476 commits

Author SHA1 Message Date
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
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
Stefan Kangas
94b1de2774 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)
2023-09-16 14:36:24 +02:00
Stefan Kangas
826d383c92 Fix describing packages where maintainer lacks email
* lisp/emacs-lisp/package.el (describe-package-1): Fix describing
packages with one maintainer without an email address.  (Bug#65987)
2023-09-15 09:49:26 +02:00
Stefan Kangas
32ded573cc ; Fix bootstrap
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Don't use void variable.
2023-09-13 18:22:51 +02:00
Damien Cassou
1f7113e689 Shorten docstrings generated by cl-defstruct
* lisp/emacs-lisp/cl-macs.el (cl-defstruct): Split the first line of
generated docstrings if either the struct name or a field name is very
long.  This reduces the likelihood of "docstring wider than 80
characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Damien Cassou
f045750fa5 Shorten docstrings generated by cl-defsubst
* lisp/emacs-lisp/cl-macs.el (cl-defsubst): Split the first line of
the docstring into 2 lines if the function name is very long.
Additionally, remove the word "inlining" in the generated docstring as
it is not very useful and increases the likelihood of "docstring wider
than 80 characters" errors.  (Bug#65790)
2023-09-13 16:34:45 +02:00
Po Lu
c0400151f8 Correct many instances of ``allows to''
Refer to:
lists.gnu.org/archive/html/emacs-devel/2016-01/msg01598.html

* doc/emacs/frames.texi (Tab Bars):

* doc/emacs/maintaining.texi (Tag Syntax):

* doc/lispref/compile.texi (Native Compilation):

* doc/lispref/control.texi (Destructuring with pcase Patterns):

* doc/lispref/display.texi (Overlay Properties, Glyphless Chars):

* doc/lispref/frames.texi (Size Parameters, Layout Parameters)
(Child Frames):

* doc/lispref/minibuf.texi (Minibuffer Windows):

* doc/lispref/processes.texi (Asynchronous Processes):

* doc/lispref/windows.texi (Precedence of Action Functions)
(Mouse Window Auto-selection):

* doc/misc/autotype.texi (Autoinserting):

* doc/misc/efaq.texi (New in Emacs 28):

* doc/misc/idlwave.texi (Examining Variables):

* doc/misc/ses.texi (Quick Tutorial, Standard formula functions):

* doc/misc/tramp.texi (External methods, FUSE-based methods):

* lisp/comint.el (comint-insert-previous-argument-from-end):

* lisp/emacs-lisp/rmc.el (read-multiple-choice):

* lisp/gnus/gnus-util.el:

* lisp/mail/rmailsum.el (rmail-summary-progressively-narrow):

* lisp/mouse.el (mouse-drag-track):

* lisp/net/tramp-sudoedit.el:

* lisp/obsolete/landmark.el:

* lisp/org/org.el (org-startup-truncated, org-file-apps):

* lisp/pixel-scroll.el (pixel-scroll-precision-mode):

* lisp/progmodes/cperl-mode.el (cperl-praise):

* lisp/simple.el (yank-from-kill-ring, kill-visual-line):

* lisp/window.el (delete-window-choose-selected):

* src/ChangeLog.11:

* src/xdisp.c (syms_of_xdisp):

* src/xterm.c (handle_one_xevent): The construct ``allows to
<infinitive>'' is not English inasmuch as no direct object to
``allows'' is provided.  Correct and rephrase each instance of such a
construct within our documentation and commentary.
2023-09-10 09:33:50 +08:00
Mattias Engdegård
c137b5195b Add byte-compiler warning about useless trailing cond clauses
Warn about clauses after the default clause, as in

    (cond ((= x 0) (say "none"))
          (t (say "some"))
          (say "goodbye"))

because they are very much an indicator of a mistake (such as
misplaced brackets), and since they are deleted by the optimiser, any
other warnings there are lost and the user wouldn't know that
something is wrong otherwise.

* lisp/emacs-lisp/macroexp.el (macroexp--expand-all): Add warning.
* etc/NEWS: Announce.
* test/lisp/emacs-lisp/bytecomp-tests.el
(bytecomp-test--with-suppressed-warnings): Add test case.
2023-09-09 13:24:31 +02:00
Eli Zaretskii
0273914921 Merge from origin/emacs-29
bc56da92d8 ; Fix error in 'tex-recenter-output-buffer'
d17c5adc05 Fix regexp for recognizing PBM images
9e9f61866e Improve wording in ELisp manual
7427efa033 Fix typo (Bug#65764)
59c6624408 ; * lisp/ido.el (ido-completion-buffer): Fix :type (bug#6...
4ec4b18c2a Fix libgccjit build on Haiku
80bdcf8f35 (regexp-tests-backtrack-optimization): Mark it as failing
8a9e653cc8 ; Add regression test for bug#65726
6fad73d7cc * src/regex-emacs.c (mutually_exclusive_p): Fix inf-loop ...
1d3d419607 ; * lisp/files.el (save-some-buffers-functions): Doc fix ...
42b14c6e5b Bump seq version to 2.24
ff5190a174 Add note on ELPA to admin/notes/bug-triage
f1e4cbe72a ; * etc/PROBLEMS: Minor wording fix.
fd5593c7f2 * etc/PROBLEMS: Mention bug#65432 and its remedy.
dd896ea1e6 Ignore errors when checking for object initializers (bug#...
3550f44c17 ; Fix typos
5b246b9b81 * CONTRIBUTE: Document making ChangeLogs with Magit.
0bd4661941 Doc fixes for obsolete functions and variables
524c0c34f2 ; * lisp/ffap.el (ffap-rfs-regexp): Fix :type (bug#65698).
f48dccc467 Merge branch 'emacs-29' of git.savannah.gnu.org:/srv/git/...
71a85e2266 A revision to the Widget manual
dbbcf4a659 Fix fontification of " in edit-kbd-macro

# Conflicts:
#	test/src/regex-emacs-tests.el
2023-09-09 04:32:45 -04:00
Stefan Monnier
4785a63ab7 * lisp/emacs-lisp/cl-macs.el (cl--parse-loop-clause): Fix bug#65833
For some reason the intervals case failed to push the var to
`loop-for-bindings` before pushing to `loop-for-sets`.
AFAICT this was the only place where we made that mistake.
2023-09-08 22:17:43 -04:00
Stefan Kangas
802a54ad62 Error when trying to make nil or t obsolete
* lisp/emacs-lisp/byte-run.el (make-obsolete, make-obsolete-variable):
Signal error if the symbol to make obsolete is nil or t.  (Bug#62248)
(byte-run--constant-obsolete-warning): New function.
* test/lisp/emacs-lisp/byte-run-tests.el: New file.
2023-09-08 01:01:16 +02:00
Stefan Kangas
331dee7e4a Add note regarding seq on GNU ELPA
* lisp/emacs-lisp/seq.el: Add note regarding seq on GNU ELPA.

Co-authored-by: Stefan Monnier <monnier@iro.umontreal.ca>
2023-09-07 23:57:20 +02:00
Lämppi Lütti
55c2180d2c Fix detection of vtable start and end
* lisp/emacs-lisp/vtable.el (vtable-beginning-of-table)
(vtable-end-of-table): Fix detection of vtable limits.  (Bug#58712)

Copyright-paperwork-exempt: yes
2023-09-07 22:23:24 +02:00
Stefan Monnier
2e7af2fc53 * lisp/emacs-lisp/cl-lib.el (cl-old-struct-compat-mode): Mark as obsolete
* lisp/emacs-lisp/cl-preloaded.el: Emit a message before enabling
`cl-old-struct-compat-mode`.

See bug#63282.
2023-09-05 12:56:24 -04:00
Stefan Monnier
98f7665677 * lisp/emacs-lisp/pp.el (pp-28): Fix typo
Reported by Mattias Engdegård <mattias.engdegard@gmail.com>.
2023-09-05 12:29:44 -04:00
Stefan Monnier
8ef1933a04 * lisp/emacs-lisp/edebug.el (edebug-list-form): Don't gate so eagerly
The `edebug-gate` is fairly heavy handed, so don't activate it
just because we seem to have found what looks like a valid form.
2023-09-05 11:54:55 -04:00