1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-07 15:00:34 -08:00
Commit graph

10356 commits

Author SHA1 Message Date
Eshel Yaron
409abfe96e
; (elisp-scope-define-symbol-type): Cease autoloading it. 2025-09-30 19:05:21 +02:00
Eshel Yaron
3ebd0efd09
; elisp-scope.el: Update multiple function handlers.
Update all remaining function handlers to use
'elisp-scope-define-func-analyzer' instead of
'elisp-scope-define-function-analyzer'.  The difference is
that the former handles all arguments explicitly, while the
latter analyzes all arguments as evaluated forms
automatically.  By handling the arguments explicitly, we get
a chance to specify the expected type of different arguments.
Lastly, since 'elisp-scope-define-function-analyzer' is now
unused, rename 'elisp-scope-define-func-analyzer' to
'elisp-scope-define-function-analyzer'.
2025-09-30 18:58:23 +02:00
Eshel Yaron
c6ee775cb2
; Rename scope.el to elisp-scope.el
* scope.el: Rename it to...
* elisp-scope: New file.
* lisp/progmodes/elisp-mode.el: Update accordingly.
2025-09-29 17:02:25 +02:00
Eshel Yaron
761e706505
; scope.el: Mark 'static-when/unless' as unsafe.
* lisp/emacs-lisp/scope.el: Add handlers for 'static-when'
and 'static-unless'.
(scope-unsafe-macros): Also add them to list of unsafe macros.
2025-09-29 16:42:35 +02:00
Eshel Yaron
136c39438f
Add optional semantic highlighting for Emacs Lisp.
* lisp/emacs-lisp/scope.el: New file.

* lisp/progmodes/elisp-mode.el (elisp): New 'defgroup'.
(elisp-add-help-echo, elisp-fontify-semantically)
(elisp-fontify-symbol-precedence-function): New options.
(elisp-symbol-at-mouse, elisp-free-variable, elisp-condition)
(elisp-major-mode-name, elisp-face, elisp-symbol-type)
(elisp-symbol-type-definition, elisp-function-reference)
(elisp-non-local-exit, elisp-unknown-call, elisp-macro-call)
(elisp-special-form, elisp-throw-tag, elisp-feature)
(elisp-rx, elisp-theme, elisp-binding-variable)
(elisp-bound-variable, elisp-shadowing-variable)
(elisp-shadowed-variable, elisp-variable-at-point)
(elisp-warning-type, elisp-declaration, elisp-thing)
(elisp-slot, elisp-widget-type, elisp-type, elisp-group)
(elisp-nnoo-backend, elisp-ampersand, elisp-constant)
(elisp-defun, elisp-defmacro, elisp-defvar, elisp-defface)
(elisp-icon, elisp-deficon, elisp-oclosure)
(elisp-defoclosure, elisp-coding, elisp-defcoding)
(elisp-charset, elisp-defcharset, elisp-completion-category)
(elisp-completion-category-definition): New faces.
(elisp-local-references, elisp-highlight-variable)
(elisp-unhighlight-variable, elisp-cursor-sensor)
(elisp--function-help-echo, elisp--help-echo-1)
(elisp--help-echo, elisp--annotate-symbol-with-help-echo)
(elisp-extend-region-to-whole-defuns, elisp-fontify-symbol)
(elisp-fontify-region-semantically, elisp-fontify-region):
New functions.
(emacs-lisp-mode): Set 'font-lock-extra-managed-props',
'font-lock-fontify-region-function' and
'font-lock-extend-region-functions'.

* etc/NEWS: Announce new feature.
2025-09-29 15:30:35 +02:00
Stefan Monnier
2c7b08d417 Revert "Fix generation of defvars defined by easy-mmode and company in loaddefs.el"
This reverts commit e9800cabff.
AFAICT that commit had no effect but it re-introduces some magic constants
in the code that we'd like to eliminate.
We presume it was a misunderstanding, trying to fix
a transient problem which a bootstrap would have fixed.
See https://lists.gnu.org/archive/html/emacs-devel/2025-08/msg00716.html
and https://lists.gnu.org/archive/html/emacs-devel/2025-09/msg00109.html
2025-09-16 10:50:14 -04:00
Eli Zaretskii
83b623ea3a Fix 'define-globalized-minor-mode' when :variable is used
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Fix a typo (bug#79412).
2025-09-13 22:23:12 +03:00
Eli Zaretskii
d02181e39f ; * lisp/emacs-lisp/ring.el (ring-convert-sequence-to-ring): Bug#79330. 2025-09-13 12:06:35 +03:00
Philip Kaludercic
4c27866df9
; * lisp/emacs-lisp/timeout.el: Bump version header to 2.1
This is done to reflect the same version as in the upstream
repository, thus avoiding accidental upgrades:

6d31046c5b
2025-09-12 12:35:56 +02:00
Philip Kaludercic
0bf5898f20
Update timeout to 2f3ebb53
See https://github.com/karthink/timeout/commit/f3ebb5.
2025-09-11 23:25:46 +02:00
Mattias Engdegård
f4d0a2560a Remove unused and broken source inline code path
* lisp/emacs-lisp/byte-opt.el (byte-compile-inline-expand): We can
assume that non-compiled functions are from another file at this point
and remove an unused code branch which didn't actually work with
interpreted function objects anyway.
2025-09-10 12:11:53 +02:00
Stefan Monnier
82f6c16514 Allow use of \N{...} earlier to help fix bug#79353
* lisp/emacs-lisp/shorthands.el (hack-read-symbol-shorthands):
Avoid inf-loops during bootstrap.
E.g. this can occur while loading `uni-special-lowercase.el` where
`hack-local-variables--find-variables` uses `downcase` which triggers
loading `uni-special-lowercase.el`, ...

* lisp/international/mule-cmds.el (ucs-names): Explicitly require
`charprop`.

* src/Makefile.in ($(lispsource)/loaddefs.el): Depend on `charprop`.
2025-09-09 18:01:24 -04:00
Stefan Monnier
4c74b68fb1 (cl--make-usage-args): Try and fix bug#79353
* lisp/emacs-lisp/cl-macs.el (cl--make-usage-args): Don't depend on
`cl-extra` when `take` does the job.
2025-09-08 12:39:48 -04:00
Mattias Engdegård
a4ea22d998 * lisp/emacs-lisp/cl-lib.el (cl-copy-list): Not error-free, bug#79396 2025-09-07 17:47:51 +02:00
Eli Zaretskii
4ac9e93e5e Merge from origin/emacs-30
aad5b676d1 ; * lisp/emacs-lisp/ring.el (ring-convert-sequence-to-rin...
ddd63891a4 ; * doc/misc/flymake.texi (Troubleshooting): Fix typo (bu...
8dcb802046 ; vc-hooks.el: Standardize terminology in header.
2025-09-06 05:53:08 -04:00
Eli Zaretskii
aad5b676d1 ; * lisp/emacs-lisp/ring.el (ring-convert-sequence-to-ring): Doc fix. 2025-09-06 11:36:21 +03:00
Stefan Monnier
f97abe6200 (macroexp--obsolete-warning): Prefer %s
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): `instead`
can be a list.
* lisp/dom.el (dom-text, dom-texts): Fix obsolescence declaration.
2025-09-02 15:10:25 -04:00
Spencer Baugh
f1a18e8411 Allow any thread to run native compilations
* lisp/emacs-lisp/comp-run.el (comp--run-async-workers): Don't
lock the native compilation process to a thread (bug#79228).
2025-09-02 18:06:37 +03:00
Philip Kaludercic
d2532a4ef0
Add new library 'timeout'
* lisp/emacs-lisp/timeout.el: Add the file.
* etc/NEWS: Mention the library.

See https://mail.gnu.org/archive/html/emacs-devel/2025-07/msg00520.html.
2025-09-01 22:31:01 +02:00
Mattias Engdegård
b52ccb997d ; * lisp/emacs-lisp/bytecomp.el (featurep): mistake in last change 2025-09-01 16:50:10 +02:00
Mattias Engdegård
7c6de4fe73 * lisp/emacs-lisp/bytecomp.el (featurep): Safer comp-time evaluation 2025-09-01 12:09:50 +02:00
Jens Schmidt
fdc6bb2caf Add edebug-bounce-to-previous-value
Command edebug-bounce-to-previous-value uses the previous value
observed while single-stepping or evaluating an expression to
bounce point in the outside current buffer to the buffer
position corresponding to that value.

* lisp/emacs-lisp/edebug.el (edebug-previous-value): Add
variable.
(edebug-compute-previous-result, edebug-eval-expression): Update
it.
(edebug-bounce-to-previous-value): Add command.
(edebug-mode-map): Add keybinding for the new command, replacing
the binding of "P" to edebug-view-outside.
(edebug-mode-menus): Add menu entry for the new command.
* doc/lispref/edebug.texi (Edebug Views): Add documentation.
* test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el
(edebug-test-code-bounce-point): Add test code.
* test/lisp/emacs-lisp/edebug-tests.el
(edebug-tests-bounce-outside-buffer)
(edebug-tests-bounce-outside-point)
(edebug-tests-bounce-outside-mark)
(edebug-tests-bounce-record-outside-environment)
(edebug-tests-should-have-bounced-to): Add infrastructure to
test bounces.
(edebug-tests-check-keymap): Update tests to new key bindings.
(edebug-tests-bounce-point)
(edebug-tests-bounce-to-previous-value)
(edebug-tests-bounce-to-previous-non-position): Add tests.
(edebug-tests-evaluation-of-current-buffer-bug-19611): Clean up
side effects.  (Bug#79288)
2025-08-30 12:30:21 +03:00
Mattias Engdegård
8c71ef0f8e ; use modern sort calls in more places
* lisp/emacs-lisp/regexp-opt.el (regexp-opt, regexp-opt-group):
* lisp/emacs-lisp/rx.el (rx--parse-any): New-style calls, also faster.
2025-08-29 19:24:50 +02:00
Mattias Engdegård
230ed1f9b6 * lisp/emacs-lisp/bytecomp.el (mutating-fns): cl-fill and cl-replace 2025-08-24 10:28:27 +02:00
Rahguzar
1a549762ed Correctly document the format of tabulated-list-groups
* lisp/emacs-lisp/tabulated-list.el (tabulated-list-groups):
Correct format in doc string (bug#79220).

* doc/lispref/modes.texi (Tabulated List Mode):
Correct format in manual.
2025-08-21 19:44:48 +03:00
Mattias Engdegård
3b80b706e5 Free tar-mode helper buffers after use in package.el (bug#79280)
The auxiliary buffer used by tar-mode is normally destroyed when the
parent buffer is, but package.el uses tar-mode in temporary buffers
which inhibit kill-buffer-hook and this made package installation leave
orphaned buffers behind.

* lisp/emacs-lisp/package.el (package-untar-buffer)
(package-install-file): Switch away from tar-mode before the buffer is
killed, triggering a tar-data buffer purge.
2025-08-21 15:11:13 +02:00
Dmitry Gutov
c6bf09d5c3 ; Fix typo (wrong-type-argument not wrong-argument-type) 2025-08-21 04:06:44 +03:00
Philipp Stephani
d40c754929 Clarify that sequence/map functions don't alter their argument
* lisp/emacs-lisp/seq.el (seq-sort, seq-sort-by, seq-reverse)
(seq-concatenate, seq-into-sequence, seq-into, seq-filter, seq-remove)
(seq-remove-at-position, seq-reduce, seq-find, seq-uniq, seq-mapcat)
(seq-partition, seq-union, seq-intersection, seq-difference)
(seq-group-by, seq-split, seq-keep):
* lisp/emacs-lisp/map.el (map-filter, map-remove, map-merge)
(map-merge-with): Clarify that these functions don't modify their
sequence/map arguments.
2025-08-19 11:11:51 +02:00
Philipp Stephani
8747657dd8 Catch all non-local exits when running ERT tests.
See discussion in https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76447.

* lisp/emacs-lisp/ert.el (ert--run-test-internal): Catch all non-local
exits in 'handler-bind'.
2025-08-18 11:24:29 +02:00
Michael Albinus
839f416de7 Merge from origin/emacs-30
49d64bfb1a ; * etc/NEWS: Update for Emacs 30.2.
4b90b6e7ce ; * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Doc fi...
2025-08-16 13:35:00 +02:00
Eli Zaretskii
01e351de60 Reject non-nil non-number REPEAT in 'run-with-timer'
* lisp/emacs-lisp/timer.el (run-at-time, run-with-timer): Reject
non-nil REPEAT if it is not a non-negative number.  (Bug#79227)
Doc fixes.

* test/lisp/emacs-lisp/timer-tests.el (timer-test-repeat-arg): New
test.
2025-08-16 10:53:12 +03:00
Po Lu
e9800cabff Fix generation of defvars defined by easy-mmode and company in loaddefs.el
* lisp/emacs-lisp/loaddefs-gen.el
(loaddefs-generate--make-autoload): Restore previously existing
conditions for recursing on macroexpansions when processing
easy-mmode and related macros.
2025-08-14 19:34:28 +08:00
JD Smith
a15a4fa94b Do not include interactive args in autoload files
(Bug#78995)

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Do not include `interactive' ARG-DESCRIPTOR in generated autoload forms
for function-defining macros, but only modes.
2025-08-10 18:14:43 -04:00
JD Smith
7486e5c368 Implement new autoload macro expansion declare form
Currently, a hard-coded set of macros is automatically expanded
during generation of autoloads.  To allow user macros to request
such expansion, this implements a new declare form
`autoload-macro' (Bug#78995), with supported value `expand'.
For example, macros which wrap `define-minor-mode', can declare
`(autoload-macro expand)' to request that ;;;###autoload-adorned
calls to the macro are expanded during generation, such that an
autoload for the resulting function is created.

* lisp/emacs-lisp/byte-run.el (byte-run--set-autoload-macro):
Handle autoload-macro declare forms.
(macro-declarations-alist) Add handler for 'autoload-macro
declare forms.
(defmacro, defun):
* lisp/emacs-lisp/cl-generic.el (cl-defgeneric, cl-defun)
(cl-iter-defun, cl-defmacro, cl-defstruct):
* lisp/emacs-lisp/easy-mmode.el
(define-minor-mode, define-globalized-minor-mode, iter-defun):
* lisp/emacs-lisp/inline.el (define-inline):
* lisp/emacs-lisp/pcase.el (pcase-defmacro):
Declare (autoload-macro expand) to request expansion of the
macro during autoload generation.

* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Handle the `autoload-macro=expand' property for macros.  Load
the ;;;###autoload-containing file if an unknown symbol is
encountered in the car of the following form, to give packages a
chance to define their macros and request expansion.  Factor
list of special function-defining macros out as a constant
variable: `loaddefs--defining-macros'.

* doc/lispref/functions.texi (Declare Form):
* doc/lispref/loading.texi (Autoload): Document `autoload-macro'.
2025-08-10 18:14:23 -04:00
Sean Whitton
3aab8a72dc ; define-globalized-minor-mode: Simplify a binding. 2025-08-10 10:52:47 +01:00
Eli Zaretskii
4b90b6e7ce ; * lisp/emacs-lisp/cl-generic.el (cl-defgeneric): Doc fix (bug#79206). 2025-08-10 11:45:31 +03:00
Sean Whitton
c05ea64d82 define-globalized-minor-mode: Use unique MODE-major-mode (bug#79198)
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode)
<MODE-set-explicitly>: Make this an internal variable using '--'.
<MODE-major-mode>: Make this an internal variable using '--'.
Use the name of the global mode not the local mode (bug#79198).
2025-08-09 10:43:26 +01:00
Daniel Mendler
84f1080f67 (completing-read-multiple): Set missing buffer-local variables
* lisp/emacs-lisp/crm.el (completing-read-multiple): Set missing
buffer-local variables `minibuffer--require-match` and
`minibuffer--original-buffer`, which are set by `completing-read` in
the minibuffer setup hook.  (bug#79110)
2025-08-02 12:29:23 -04:00
Robert Pluim
38557cac74 * lisp/emacs-lisp/shortdoc.el (sequence): Add 'seq-doseq'. 2025-07-31 10:33:11 +02:00
Stefan Monnier
6eb6cdfbe5 (define-globalized-minor-mode): Remove left-over code
* lisp/emacs-lisp/easy-mmode.el (define-globalized-minor-mode):
Delete the code managing `<MODE>-buffers`, since it's not used any more.
Prefer `%S` over `%S` to print arbitrary sexps.
(define-minor-mode): Make sure we use the same test to distinguish
old-style and new-style.
2025-07-29 15:52:26 -04:00
Madhu
39566b7337 (cl-nsubstitute): Fix regression in commit 8c8ff13e
lisp/emacs-lisp/cl-seq.el (cl-nsubstitute): restore a variable names that
were incorrectly replaced in commit 8c8ff13e, so nsubstitute on a string
returns a string instead of a vector.
2025-07-27 09:19:42 -04:00
Stefan Monnier
f6d314dfe5 bytecomp.el: Rework the message when the macro is not recognized
The "Macro %s unrecognized, won't work in file" message
happened only for macros defined to `nil`, and the code handling
"unrecognized" code was split with the function part is
`byte-compile-file-form-defmumble` and the macro part in
`byte-compile-file-form-defalias`, so straighten it out
and simplify a bit.

* lisp/emacs-lisp/bytecomp.el (byte-compile-file-form-defmumble):
Don't modify `byte-compile-*-environment` here.
(byte-compile-file-form-defalias): Do it here instead.
Use `macroexp-quote`.  Merge the two "unrecognized macro" warnings.
2025-07-26 18:35:00 -04:00
Eli Zaretskii
ccc3068dae Merge from origin/emacs-30
a44e9139c2 loaddefs-generate--rubric: Note about committing ldefs-bo...
e4908623f2 ; Fix documentation of 'other-window'
5f3cbd62b1 ; * lisp/international/quail.el (quail-insert-kbd-layout)...
47deb38f21 ; face-font-family-alternatives, fixed-pitch: Comments.
dd29b0ab66 Fix Eshell call to 'string-suffix-p' when checking for tr...
cbfc095ed4 * etc/PROBLEMS: Describe how to work around screen reader...
8f00d36b63 (gnus)Scoring Tips: New tip regarding header continuation...
2025-07-26 06:58:12 -04:00
Sean Whitton
a44e9139c2 loaddefs-generate--rubric: Note about committing ldefs-boot.el
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--rubric):
Note that ldefs-boot.el should be committed on its own.
2025-07-26 10:22:09 +01:00
Eli Zaretskii
fa61deda32 Merge from origin/emacs-30
3b2bfdfef6 ; Fix last change (bug#79042)
740138b113 ; Fix last change
e675d5ba64 ; Update doc strings of Dired functions due to 'marked' v...
a05be41af7 ; * lisp/battery.el (battery-bsd-apm): Explain a FIXME (b...
fe3ac1575a Fix :box attribute of faces in Leuven themes.
86e32aed4a ; define-globalized-minor-mode: Fix capitalization.
2025-07-19 06:56:58 -04:00
Stefan Monnier
f8b9d80ec6 comp.el: Fix minor corner-case annoyances
* lisp/emacs-lisp/comp.el (comp--native-compile): Avoid `%s`
on objects that may not have names.
* src/data.c (Ffset): Don't compute trampoline for no-op `fset`.
2025-07-17 12:36:57 -04:00
Sean Whitton
86e32aed4a ; define-globalized-minor-mode: Fix capitalization. 2025-07-16 11:20:08 +01:00
Sean Whitton
94b2a0b2fc Merge from origin/emacs-30
24db9b7962 ; * lisp/vc/diff-mode.el (diff-mode): Scare-quote 'normal'.
756e7e5243 ; * lisp/window.el (window-state-put): Fix a typo (bug#79...
0fb20adf8e ; define-globalized-minor-mode: Fix info node link in doc...
2025-07-16 11:18:41 +01:00
Jonas Bernoulli
105ae06031
Allow trivially autoloading transient-define-group
* lisp/emacs-lisp/loaddefs-gen.el (loaddefs-generate--make-autoload):
Allow uses of transient-define-group to be autoloaded using just
";;;autoload".
2025-07-15 12:45:05 +02:00
Stefan Monnier
7f1cae9637 (cl--class-allparents): Fix bug#78989
Give more control over ordering when linearizing the
parent graph and avoid pathological misbehavior (such as
placing `t` in the middle of the linearization instead of the
end) when we can't "do it right".

* lisp/subr.el (merge-ordered-lists): Degrade more gracefully in case
of inconsistent hierarchies and don't do it silently.

* lisp/emacs-lisp/cl-preloaded.el (cl--class-allparents): Use the local
ordering to break ties, as in the C3 algorithm.
2025-07-14 12:37:11 -04:00