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

179692 commits

Author SHA1 Message Date
Eshel Yaron
90e65c2abe
; (elisp-scope-gen-id-alist): Remove, unused. 2025-10-03 19:15:15 +02:00
Eshel Yaron
c412bd83ff
; elisp-scope.el: Fix 'custom-declare-face' analyzer. 2025-10-03 19:11:26 +02:00
Eshel Yaron
320df8ad35
; elisp-scope.el: Improve 'oclosure-define' 'slots' analysis 2025-10-03 19:10:51 +02:00
Eshel Yaron
bde38ef480
; Rename 'elisp-scope-output-type' to 'elisp-scope-output-spec'.
* lisp/emacs-lisp/elisp-scope.el: Change all references to
this notion of "type" to say "spec" instead.
2025-10-03 18:24:35 +02:00
Eshel Yaron
22327f58bb
; elisp-scope.el: Improve 'defclass' slots analysis.
Extend the "type" system (to be renamed to "spec" in
subsequent commit) of elisp-scope.el with a plist spec.
This allows us to define a spec for the 'slots' argument of
'eieio-defclass-internal'.  Also add a 'cl-type' spec,
describing the type specifications used by 'cl-typep', and
replace the 'equal' spec with a more general 'member' spec,
like we have in 'cl-typep'.
2025-10-03 18:17:34 +02:00
Eshel Yaron
5339cf0010
; Rename 'elisp-scope--output-type' to make it public
* lisp/emacs-lisp/elisp-scope.el (elisp-scope--output-type):
Add docstring and rename to...
(elisp-scope-output-type): this.  Update all references.
* lisp/emacs-lisp/elisp-scope.el (elisp-scope-analyze-form):
Add example 'elisp-scope-analyzer' to docstring.
2025-10-02 16:44:32 +02:00
Eshel Yaron
ceeeb390f0
; (elisp-scope-1): Analyze macros with (debug t) as progn
Take an Edebug spec of t as an indication that all of the
macro's arguments are evaluated, and analyze them as such.
Only do so as a fallback for macros that we cannot expand,
because expanding can lead to more accurate analysis,
e.g. with regards to the output type of the form.
2025-10-02 15:22:51 +02:00
Eshel Yaron
cfc58025cd
; Expand ELisp semantic highlighting documentation
* lisp/emacs-lisp/elisp-scope.el
(elisp-scope-get-symbol-role-property)
(elisp-scope-set-symbol-role-property)
(elisp-scope-safe-macro-p, elisp-scope-report-s)
(elisp-scope-1, elisp-scope-n): Add docstring.
(elisp-scope-analyze-form):
* lisp/progmodes/elisp-mode.el (elisp-fontify-semantically):
Expand docstring.
* etc/NEWS: Refer to 'elisp-fontify-semantically' for
documentation.
2025-10-02 14:41:45 +02:00
Eshel Yaron
f0cab9d27e
; Use 'font-lock-keywords' for ELisp semantic highlighting
Hook semantic highlighting into 'font-lock-keywords' instead
of 'font-lock-fontify-region-function'.  See discussion at
https://yhetil.org/emacs/jwvseg2mnkx.fsf-monnier+emacs@gnu.org/T/#t

* lisp/progmodes/elisp-mode.el (elisp-fontify-region)
(elisp-fontify-region-semantically): Remove, no longer used.
(elisp-fontify-symbols): New function.
(elisp-semantic-font-lock-keywords): New 'defconst'.
(emacs-lisp-mode): Use it as the new highest
'font-lock-keywords' level.
2025-10-02 09:24:31 +02:00
Eshel Yaron
e82620a360
; elisp-scope.el: Rename 'variable' role to 'free-variable'. 2025-10-01 13:18:55 +02:00
Eshel Yaron
737d99e4ed
; Fix recent small mistake in recent refactor. 2025-10-01 12:58:31 +02:00
Eshel Yaron
c2d01dda42
; elisp-scope.el: Simplify 'eval' analyzer. 2025-10-01 08:56:55 +02:00
Eshel Yaron
3cff47ec75
; elisp-scope.el: Rename 'declaration' role.
* lisp/emacs-lisp/elisp-scope.el (declaration): Rename to
'function-property-declaration'.
(elisp-scope-lambda):
* lisp/progmodes/elisp-mode.el
(elisp-function-property-declaration): Update accordingly.
2025-10-01 08:42:40 +02:00
Eshel Yaron
a7c1b126fa
; elisp-scope.el: Remove unused 'undefined-macro' role. 2025-10-01 08:37:44 +02:00
Eshel Yaron
7217350e85
; elisp-scope.el: Fix 'define-completion-category' handler. 2025-10-01 08:34:58 +02:00
Eshel Yaron
23ba18037b
; (elisp-scope-define-symbol-role): Add docstring. 2025-10-01 08:31:20 +02:00
Eshel Yaron
2447c1486e
; Call it "symbol role" instead of "symbol type".
Change the terminology used in elisp-scope.el to call the
symbols we use to categorizes the use of (other) symbols
"symbol roles" instead of "symbol types".

* lisp/emacs-lisp/elisp-scope.el:
* lisp/progmodes/elisp-mode.el: Change all occurrences of
"symbol type" say "role" instead.
2025-10-01 08:09:06 +02:00
Eshel Yaron
8c2f783591
(elisp-scope-get-symbol-type-property): Revise inheritance handling. 2025-10-01 07:48:58 +02:00
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
Eli Zaretskii
98b2516f6e Fix 'mm-copy-to-buffer' when original text is multibyte
* lisp/gnus/mm-decode.el (mm-copy-to-buffer): Always return a
unibyte buffer.  If the original text was multibyte, encode it
while inserting it into the copy buffer.  (Bug#79376)
2025-09-29 15:13:49 +03:00
Robert Pluim
6992d0e3bb ; Fix typos
* lisp/mail/mail-utils.el (mail-fetch-field, mail-mbox-from):
'headers', not 'header'.
2025-09-29 11:26:53 +02:00
Po Lu
752894ef54 ; * configure.ac: Document why AC_CONFIG_SUBDIRS is not suitable for `exec'. 2025-09-29 09:48:04 +08:00
Liu Hui
52ed675063 Fix etags-regen-mode for remote projects (bug#79358)
* lisp/progmodes/etags-regen.el
(etags-regen--process-file-region): New function.
(etags-regen--tags-generate, etags-regen--append-tags): Use the
new helper function to run the program, and use relative file
name if TAGS file is in the project root.
(etags-regen--update-file): Use relative file name if possible.
2025-09-29 02:40:28 +03:00
Eli Zaretskii
38c658de7d Make textsec descriptive texts more user-friendly
* lisp/international/textsec.el (textsec-domain-suspicious-p)
(textsec-local-address-suspicious-p, textsec-name-suspicious-p)
(textsec-suspicious-nonspacing-p): Clarify descriptive texts.
2025-09-28 15:35:17 +03:00
Eli Zaretskii
3f230d8465 Detect suspicious email addresses in Rmail and Sendmail
* lisp/mail/rmail.el (rmail-detect-suspicious-headers): New user
option.
(rmail-check-suspicious-from): New function, highlights suspicious
"From" addresses.
(rmail-show-message-1): Call 'rmail-check-suspicious-from' if
'rmail-detect-suspicious-headers' is non-nil.
* lisp/mail/sendmail.el (mail-send): Detect suspicious addresses
before sending.

* etc/NEWS: Announce the new features.
2025-09-28 14:35:46 +03:00
Eli Zaretskii
ae4878c53b Revert "Fix bug#79518 with 'windmove-mode' in "C-h m" display"
This reverts commit bf750adc4e.
It caused windmove to be loaded unconditionally.
The correct "fix" for bug#79518 is to load the package or
to toggle the mode.
2025-09-28 08:19:48 +03:00
Stefan Monnier
b9573f8f1a peg.el: Fix bug#79502 a bit more
* lisp/progmodes/peg.el (peg--detect-cycles): Accept args.
(peg--detect-cycles) <funcall>: New method.
2025-09-27 22:57:02 -04:00
Stefan Monnier
021b7065bb peg.el: Fix bug#79502
* lisp/progmodes/peg.el (peg--merge-error): Provide a default method.
(peg--merge-error) <call>: Handle calls with arguments.
(peg--merge-error) <any, not>: Remove methods, now redundant with the
default method.
(peg--merge-error) <guard>: Delegate to the default method if we can't
do better.
2025-09-27 18:20:37 -04:00
Sean Whitton
4e7cb37b84 VC prepare-patch: New :patch-start & :patch-end plist entries
* lisp/vc/vc.el (prepare-patch): Specify :patch-start and
:patch-end plist entries.
* lisp/vc/vc-git.el (vc-git-prepare-patch): Use -n1 to avoid
passing a revision range to git-format-patch, which is a bit
simpler.  Catch search-failed errors and signal an error with a
more helpful message.  Properly handle Subject: header by
looking for continuation lines.  Return :patch-start and
:patch-end entries in the plist.
* lisp/vc/vc-hg.el (vc-hg-prepare-patch): Always pass --git to
'hg export' for consistency.  Catch search-failed errors and
signal an error with a more helpful message.  Return a
:patch-start entry in the plist.
2025-09-27 21:36:51 +01:00
Sean Whitton
1d03eb590c vc-test--checkin-patch: Restore alternative revert code path
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
For the last stage of the test, restore alternative code path
for Git, though this time limited to when running the test on
MS-Windows.  Cf. subthread starting from
<https://lists.gnu.org/archive/html/emacs-devel/2025-09/msg00785.html>.
2025-09-27 21:31:38 +01:00
Paul Eggert
50ab62ad75 Use up-to-date time in wait_reading_process_output
In “Avoid duplicate calls to current_timespec” (2015-07-05)
we started caching current_timespec results in NOW.
However, this was buggy: we updated NOW only when the timeout was
nonzero, but the timeout can be set temporarily to zero in several
places in wait_reading_process_output (such as when checking for
process status changes), which would cause us to never update NOW
and therefore never detect that a timeout happened.

Also, this caching was wrong even in principle: since we call
Lisp code from wait_reading_process_output, substantial amounts
of time can pass, and we can be left using an outdated NOW and
incorrectly not time out.  Also, nowadays we can use
monotonic_coarse_timespec which is fast, and which is better
anyway because it’s immune to manual clock changes.

Co-authored-by: Spencer Baugh <sbaugh@janestreet.com>
* src/process.c (wait_reading_process_output):
Stop caching the current realtime.
Instead, use the coarse monotonic clock without caching.
2025-09-27 12:26:24 -07:00
Paul Eggert
5e06aa209b Prefer coarse timestamps when using X sync
They are good enough for this purpose, and are cheaper to get.
* src/timefns.c (monotonic_coarse_timespec): New function.
* src/xterm.c [HAVE_XSYNC && !USE_GTK && HAVE_CLOCK_GETTIME]:
(x_sync_current_monotonic_time): Use it.
(CLOCK_MONOTONIC): Remove; no longer uneeded here.
2025-09-27 12:26:24 -07:00
Juri Linkov
3cdc615218 Improve documentation and customization of 'derived-mode' in buffer predicate
* doc/lispref/buffers.texi (Buffer List):
* lisp/subr.el (buffer-match-p):
Document that 'derived-mode' can be a list (bug#79481).

* lisp/wid-edit.el (buffer-predicate): Support a list for 'derived-mode'.
2025-09-27 20:56:54 +03:00
Paul Eggert
830272b306 Document coding system issues with system-*-locale 2025-09-27 09:31:41 -07:00
Eshel Yaron
32b9902603
; (read-string-from-buffer): Fix thinko and typo. 2025-09-27 16:00:41 +02:00
Eli Zaretskii
48fc9f67b7 Merge from origin/emacs-30
6d35c807e5 ; Improve documentation of globalized minor modes
704fab0452 ; Improve documentation of handling errors
307f465f7b ; * doc/lispref/text.texi (Suspicious Text): Fix suspicio...
6bedbafc7a ; * doc/lispref/text.texi (Suspicious Text): Indexing fix.
2025-09-27 05:56:48 -04:00
Eli Zaretskii
ade511e316 ; Improve documentation of 'defcustom' types
* doc/lispref/customize.texi (Simple Types): Document the
'buffer-predicate' type.  (Bug#79496)
2025-09-27 12:34:25 +03:00
Eli Zaretskii
6d35c807e5 ; Improve documentation of globalized minor modes
* doc/lispref/modes.texi (Defining Minor Modes): Document the
subtlety with ':init-value t' for globalized modes.
2025-09-27 12:22:42 +03:00
Martin Rudalics
b60e0f4294 Restore mouse line dragging in character increments (Bug#79351)
* lisp/mouse.el (mouse-drag-line): Restore dragging in character
increments and make it the default (Bug#79351).
* etc/NEWS: Mention restored behavior of mouse line dragging.
2025-09-27 10:07:14 +02:00
Sean Whitton
6eaa1d279b ; * lisp/vc/vc-git.el (vc-git-cherry-pick-comment): Fix logic. 2025-09-26 17:25:07 +01:00
Sean Whitton
398b4f96ce vc-test--checkin-patch: Use {author} not {user}
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
Use Mercurial template '{author}' not '{user}' for
compatibility.
2025-09-26 15:10:13 +01:00
Jakub Ječmínek
d3333cb1b2 nnmbox-read-mbox: fix Xref header parsing
* lisp/gnus/nnmbox.el (nnmbox-read-mbox): Use the 'mail-fetch-field'
function instead of a broken regexp which matched Date-like headers.

(Bug#79167)
2025-09-26 16:03:11 +02:00
Eli Zaretskii
bf750adc4e Fix bug#79518 with 'windmove-mode' in "C-h m" display
* lisp/windmove.el (windmove-mode): Make sure "C-h m" mentions it.
2025-09-26 14:55:34 +03:00
Eli Zaretskii
0fe5113fa3 Fix dunnet when played on terminals which don't support UTF-8
* lisp/play/dunnet.el (dun-rooms, dun-endgame-question, dun-help)
(dun-physobj-desc, dun-endgame-questions): Don't use non-ASCII
characters.  (Bug#79520)
2025-09-26 14:24:00 +03:00
Eli Zaretskii
704fab0452 ; Improve documentation of handling errors
* doc/lispref/control.texi (Processing of Errors): Document that
pending input is discarded upon errors.  (Bug#79510)
2025-09-26 09:13:10 +03:00
Stefan Monnier
fa8e32f757 (dabbrev-completion): Try and fix the test regressions
* lisp/dabbrev.el (dabbrev-completion): Revert this part of last
change, but additionally set `dabbrev--last-abbrev-location` so we know
what the vars were reset for.
(dabbrev-capf): Be more careful about when and how to reset the vars.
(dabbrev--abbrev-at-point): Don't set `dabbrev--last-abbrev-location`,
so it doesn't mess with the marker we set it to in
`dabbrev-capf` or `dabbrev-completion`.
2025-09-25 15:24:53 -04:00