Commit graph

9450 commits

Author SHA1 Message Date
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
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
Stefan Monnier
defa5a9571 * lisp/emacs-lisp/cl-macs.el (cl-flet): Remove &name for (SYM EXP) case
The new/current Edebug spec gives the name `SYM@cl-flet@NN` to the
expression building that function rather than to the body of that
function as would be expected, leading to misleading code coverage.

This basically reverts 999de2a5ea, cc0f546825, and 18c85306ac :-(
2023-09-04 17:13:45 -04:00
Stefan Monnier
9e05453a8c Merge remote-tracking branch 'refs/remotes/origin/master' 2023-09-04 16:42:15 -04:00
Stefan Monnier
d5e7d9e257 Move setf substring to cl-lib since it relies on it (bug#60102)
* lisp/emacs-lisp/cl-lib.el (substring): Move gv-expander here...
* lisp/emacs-lisp/gv.el (substring): ...from here.
2023-09-04 16:39:55 -04:00
Stefan Kangas
62f7760e61 Add skip-when macro to ert-deftest
This can help avoid some awkward test skip conditions.

For example, this triple negation:
    (skip-unless (not noninteractive))

Can be written as the simpler:
    (skip-when noninteractive)

* lisp/emacs-lisp/ert.el (ert-deftest): Add new 'skip-when' macro.
(ert--skip-when): New internal function.
* doc/misc/ert.texi (Tests and Their Environment): Document above
new macro.
* test/lisp/emacs-lisp/ert-tests.el (ert-test-skip-when): New test.
2023-09-04 18:25:18 +02:00
Stefan Kangas
42b14c6e5b Bump seq version to 2.24
* lisp/emacs-lisp/seq.el: Bump version to 2.24.  (Bug#60990)
2023-09-04 17:29:04 +02:00
Philipp Stephani
c799ad42f7 Fix Edebug specification for 'cl-define-compiler-macro'.
* lisp/emacs-lisp/cl-macs.el (cl-define-compiler-macro): Give the
instrumented name a suffix to make it unique.  Otherwise it will clash
with the name of the main function.
2023-09-03 16:56:18 +02:00
Stefan Kangas
6e1ee57c8e checkdoc: Don't warn for () in cl-defmacro args
Seen with, for example:

    (cl-defmacro foo (bar () &body baz) ...)

* lisp/emacs-lisp/checkdoc.el (checkdoc-this-string-valid-engine):
Improve support for `cl-defmacro' by ignoring "nil" in parameter list.
2023-09-03 15:39:16 +02:00
Jim Blandy
2ed99b6aa9 Fix indentation in `syntax-ppss'
* lisp/emacs-lisp/syntax.el: Fix indentation in
`syntax-ppss'.  (Bug#58665)
2023-09-03 12:42:49 +02:00
Joseph Turner
94431c0d2f Don't native compile lock files
* lisp/emacs-lisp/package.el (package--delete-directory):
Exclude lock files in regex.  (Bug#65666)
2023-09-03 09:02:22 +02:00
Joseph Turner
335631506d Log org export errors to package-vc doc buffer
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Wrap the org-export logic in condition-case, allowing package
installation to continue while preserving error messages.  (Bug#65649)
2023-09-03 09:02:22 +02:00
Joseph Turner
7b37710984 Include package name in package-vc documentation log buffer name
* lisp/emacs-lisp/package-vc.el (package-vc--build-documentation):
Modify buffer name generation.  (Bug#65649)
2023-09-03 09:02:22 +02:00
Stefan Kangas
610105ee81 Update selected packages when deleting last package
* lisp/emacs-lisp/package.el (package--save-selected-packages): Allow
setting 'package-selected-packages' to a nil value.  (bug#65475)
2023-09-02 18:26:03 +02:00
Alan Mackenzie
1d46bca1c9 Output better error messages on certain edebug spec errors
This fixes bug#65620.  The error thrown up to now was "Void
function edebug-after".  This has been replaced by "Invalid
call to `edebug-before'.  Is the edebug spec for `foo'
correct?".

* lisp/emacs-lisp/edebug.el (edebug-b/a-error): New function
which throws the new friendlier error message.
(edebug-before, edebug-after): Replace the defalias's to nil
with actual functions which just call edebug-b/a-error.

* doc/lispref/edebug.texi (Specification List): In the entry
for `sexp', warn against mistakenly using `form' for an
2023-09-02 13:50:03 +00:00
Stefan Kangas
0bd4661941 Doc fixes for obsolete functions and variables
* admin/notes/multi-tty:
* doc/emacs/building.texi (Debugger Operation):
* doc/misc/efaq-w32.texi (Line ends by file system):
* doc/misc/gnus.texi (Hashcash):
* lisp/emacs-lisp/eieio.el (eieio-class-parents)
(eieio-class-children):
* lisp/progmodes/perl-mode.el:
* lisp/textmodes/ispell.el (ispell-lookup-words):
* src/buffer.h: Update or delete references to variables and functions
made obsolete in Emacs 24.4.
2023-09-02 15:37:08 +02:00
Eli Zaretskii
7395123479 Merge from origin/emacs-29
dbbcf4a659 Fix fontification of " in edit-kbd-macro
2137fdfd55 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete ...
e660ee88e3 ; Remove incorrect example from ELisp Reference manual
c32fd92d67 Add documentation to plstore.el
57760f585e * lisp/help.el (substitute-quotes): Improve docstring.
60dcea7658 Fix two defcustom :types
890a4c209a Fix `image-auto-resize-on-window-resize' custom :type
369f2eea10 Add "terraform-ls" LSP server to Eglot
5cbe96d17f ; Improve documentation of 'char-table-range'
a219ee8c31 Fix minor bugs in vc-git and vc-hg on Windows uncovered b...
3f7598806e Add syntax-propertize-function to js-ts-mode
18b292140e ; * src/treesit.c: Add ts function boilerplate
ec4d29c449 Improve performance of treesit_cursor_helper_1

# Conflicts:
#	lisp/vc/vc-git.el
#	src/treesit.c
2023-09-02 04:33:44 -04:00
Eli Zaretskii
ec3ea8c036 Merge from origin/emacs-29
648a5e33e8 Update to Org 9.6.8-3-g21171d
458442fe78 Escape percent character in treesit--inspect-name (bug#65...
bc0426ce8e Don't add an extraneous slash in remote PATH list in Eshell
34f7a47c9c Fix Tramp on MS Windows
ea5fd6c96b * Fix native disassemble on Windows platforms (bug#65455)
91d2d8439b * Handle missing eln file when trying to disassble (bug#6...
e7ac50a153 * lisp/emacs-lisp/comp.el (comp--native-compile): Fix OUT...
45cf3a0ced Update to Transient v0.4.3
31d3808fb9 Adapt Eshell manual
0c50af054f Fix applying patches with Git on MS-Windows

# Conflicts:
#	doc/misc/transient.texi
#	test/lisp/eshell/esh-util-tests.el
2023-09-02 04:28:17 -04:00
Eli Zaretskii
2137fdfd55 * lisp/emacs-lisp/gv.el (buffer-local-value): Unobsolete (bug#65555). 2023-09-02 10:44:50 +03:00
Stefan Kangas
7d60d1652f Make checkdoc warn if not using lexical-binding
* lisp/emacs-lisp/checkdoc.el (checkdoc-file-comments-engine):
Warn if there is no lexical-binding cookie.  (Bug#59920)
(checkdoc-lexical-binding-flag): New user option.
2023-09-01 22:05:35 +02:00
Eshel Yaron
b2ba4cb870 Rename 'package-vc-allow-side-effects' to better fit its use
* lisp/emacs-lisp/package-vc.el (package-vc-allow-side-effects):
Rename to 'package-vc-allow-build-commands'.
(package-vc--unpack-1): Use new name.
* doc/emacs/package.texi (Fetching Package Sources): Use new name.
* etc/NEWS: Adapt accordingly.  (Bug#65386)
2023-08-29 10:41:53 +02:00
Eshel Yaron
72ab5dc0b4 ; Refine 'defcustom' types in 'package-vc'
Only include VC backends that support cloning in the ':type' of
'package-vc-heuristic-alist' and 'package-vc-default-backend', and
compute the list of relevant on demand to keep it fresh.

* lisp/emacs-lisp/package-vc.el (package-vc--backend-type): New constant.
(package-vc-heuristic-alist, package-vc-default-backend): Use it.  (Bug#65386)
2023-08-29 10:41:53 +02:00
Eshel Yaron
82b13f0d1c ; Refine some 'package-vc' docstrings
* lisp/emacs-lisp/package-vc.el (package-vc-heuristic-alist)
(package-vc-install-dependencies, package-vc-upgrade)
(package-vc-install, package-vc-install-from-checkout)
(package-vc-prepare-patch, package-vc-upgrade-all)
(package-vc-allow-side-effects)
(package-vc-default-backend): Refine docstrings.  (Bug#65386)
2023-08-29 10:41:51 +02:00
Stefan Kangas
967fa846fc Use ensure-list in many more places
* lisp/align.el (align-region):
* lisp/auth-source-pass.el (auth-source-pass--build-result-many):
* lisp/auth-source.el (auth-source-ensure-strings):
* lisp/calendar/appt.el (appt-disp-window):
* lisp/cedet/mode-local.el (mode-local-map-mode-buffers):
* lisp/cus-edit.el (custom-prompt-variable)
(custom-variable-menu-create):
* lisp/dired-x.el (dired-mark-extension, dired-mark-suffix):
* lisp/emacs-lisp/checkdoc.el (checkdoc-defun-info):
* lisp/emacs-lisp/eieio.el (object-add-to-list):
* lisp/emulation/cua-base.el (cua--M/H-key):
* lisp/epg.el (epg--list-keys-1):
* lisp/faces.el (read-face-name):
* lisp/format.el (format-decode):
* lisp/gnus/gnus-score.el (gnus-home-score-file)
(gnus-all-score-files):
* lisp/gnus/gnus-uu.el (gnus-uu-grab-articles):
* lisp/gnus/message.el (message-make-forward-subject):
* lisp/gnus/nnmairix.el (nnmairix-create-search-group):
* lisp/gnus/spam.el (spam-copy-or-move-routine):
* lisp/help-fns.el (describe-face):
* lisp/ibuf-macs.el (define-ibuffer-filter):
* lisp/international/mule-cmds.el (select-safe-coding-system):
* lisp/net/imap.el (imap-send-command):
* lisp/printing.el (pr-menu-get-item):
* lisp/speedbar.el (speedbar-add-supported-extension)
(speedbar-add-ignored-directory-regexp):
* lisp/textmodes/rst.el (rst-forward-line-looking-at):
* lisp/vc/ediff-util.el (ediff-other-buffer):
* lisp/vc/diff.el (diff-no-select):
* lisp/vc/vc-dir.el (vc-dir-mark-state-files):
* lisp/wid-edit.el (widget-prompt-value):
* lisp/windmove.el (windmove-default-keybindings)
(windmove-display-default-keybindings)
(windmove-delete-default-keybindings)
(windmove-swap-states-default-keybindings):
* lisp/window.el (display-buffer-reuse-mode-window):
* lisp/woman.el (woman-expand-directory-path): Prefer ensure-list.
2023-08-27 21:45:30 +02:00
Andrea Corallo
ea5fd6c96b * Fix native disassemble on Windows platforms (bug#65455)
* lisp/emacs-lisp/disass.el (disassemble-internal): Improve regexp.
2023-08-27 19:03:48 +02:00
Andrea Corallo
91d2d8439b * Handle missing eln file when trying to disassble (bug#65455)
* lisp/emacs-lisp/disass.el (disassemble-internal): Handle missing
eln file.
2023-08-27 17:04:08 +02:00
Andrea Corallo
e7ac50a153 * lisp/emacs-lisp/comp.el (comp--native-compile): Fix OUTPUT for non abs paths 2023-08-27 16:41:35 +02:00
Stefan Kangas
6426912515 ; Delete redundant defvars; font-lock is preloaded 2023-08-25 23:54:51 +02:00