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

179675 commits

Author SHA1 Message Date
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
Elías Gabriel Pérez
06d87e44cb (electric-indent-actions): Add missing NEWS
* lisp/electric.el (electric-indent-actions): Fix docstring.
2025-09-25 13:40:27 -04:00
Sean Whitton
9a86a093bc vc-git--checkin: Ignore 'git apply --3way' exiting 1
This is expected to happen in some cases.

* lisp/vc/vc-git.el (vc-git--with-apply-temp): New OKSTATUS
parameter.
(vc-git--checkin): Use it to ignore 'git apply --3way' exiting
1.
2025-09-25 18:19:38 +01:00
Eli Zaretskii
69ac58b5d2 ; Avoid byte-compiler warnings in python.el
* lisp/progmodes/python.el (treesit-node-prev-sibling)
(treesit-node-field-name-for-child): Declare.
2025-09-25 20:06:12 +03:00
Sean Whitton
b2e35d1d2c vc-git--checkin: Avoid passing --ours to git-apply
* lisp/vc/vc-git.el (vc-git--with-apply-temp): New BUFFER param.
(vc-git--checkin): Avoid passing --ours to git-apply.
2025-09-25 17:44:30 +01:00
Michael Albinus
3536f1aa33 Adapt tramp-tests.el
* test/lisp/net/tramp-tests.el
(tramp-test26-interactive-file-name-completion): Adapt test.
2025-09-25 15:02:50 +02:00
Juri Linkov
e719f62a50 * lisp/minibuffer.el (minibuffer--nonselected-check): Simplify condition. 2025-09-25 09:50:39 +03:00
Yuan Fu
202425f934
Fix infloop in python-ts-mode string fontification (bug#79457)
* lisp/progmodes/python.el (python--treesit-fontify-string):
Make sure there's no infloop.
2025-09-24 19:59:05 -07:00
Alcor
77921ce458 (dabbrev-capf): Improve last fix for bug#61274
Copyright-paperwork-exempt: yes

* lisp/dabbrev.el (dabbrev-completion): Don't call
`dabbrev--reset-global-variables` any more.
(dabbrev-capf): Call it here, unconditionally, instead.
2025-09-24 16:58:08 -04:00
Juri Linkov
cef3f8f11d * lisp/minibuffer.el (minibuffer--nonselected-check): Fix condition.
To detect the completions buffer check for the buffer-local value of
'completion-reference-buffer' in the newly selected window.
2025-09-24 20:46:14 +03:00
Daniel Mendler
d924520187 Improve minibuffer-nonselected-mode
Use private names.  Use hashed function symbols.  Do not restrict the
overlay to the miniwindow, since the minibuffer can be displayed by
other windows, for example by packages using child frames or by
vertico-buffer-mode (bug#79490).

* lisp/minibuffer.el (minibuffer-nonselected-setup): Rename to
minibuffer--nonselected-setup.  Use hashed function symbols.
Add docstring.
(minibuffer-nonselected-check): Rename to
minibuffer--nonselected-check. Use hashed function symbols.
Do not restrict overlay to miniwindow.
(minibuffer-nonselected-overlay): Rename to
minibuffer--nonselected-overlay.
(minibuffer-nonselected-mode): Use hashed function symbol for
custom-initialize-delay.
2025-09-24 20:32:05 +03:00
Juri Linkov
5e396874a9 * lisp/hl-line.el: Rename global-hl-line-modes to global-hl-line-buffers.
(global-hl-line-buffers): Rename from recently added 'global-hl-line-modes',
use :type 'buffer-predicate' and change the default value to a condition
to not match completion-list-mode.
(global-hl-line-highlight): Use 'buffer-match-p' instead of
'easy-mmode--globalized-predicate-p' (bug#79481).
2025-09-24 20:14:03 +03:00
Juri Linkov
d769bae814 * lisp/wid-edit.el (buffer-predicate): Implement complete specification.
Support all conditions of 'buffer-match-p' in the Customization UI,
including recursive 'not', 'or' and 'and' (bug#79481).
2025-09-24 20:07:22 +03:00
Sean Whitton
19426ea56c VC: New cherry-pick-comment API function
* lisp/vc/vc-git.el (vc-git-cherry-pick-comment):
* lisp/vc/vc-hg.el (vc-hg-cherry-pick-comment):
* lisp/vc/vc.el (vc-default-cherry-pick-comment):
New functions (bug#79408).
2025-09-24 17:24:41 +01:00
Sean Whitton
8368fcb38c vc-git--checkin: Apply PATCH-STRING to working tree
* lisp/vc/vc-git.el
(vc-git--with-apply-temp-to-staging): Rename ...
(vc-git--with-apply-temp): ... to this.  New ARGS parameter.
All uses changes.
(vc-git--checkin): In POST function, apply PATCH-STRING to the
working tree with 'git apply --3way --ours'.
* lisp/vc/vc-hg.el (vc-hg--checkin): Document what the call to
'hg update' is for.
* test/lisp/vc/vc-tests/vc-tests.el (vc-test--checkin-patch):
Delete completed FIXME and workaround.
2025-09-24 16:07:51 +01:00
Sean Whitton
190450f4f0 vc-git--checkin: Restore dropping stash of staged changes
* lisp/vc/vc-git.el (vc-git--checkin): Restore dropping stash of
staged changes after applying it.  This was accidentally lost
when factoring out vc-git--with-apply-temp-to-staging.
2025-09-24 15:00:42 +01:00
Eli Zaretskii
db3d6f06c3 * lisp/window.el (display-buffer-alist): Fix :key-type (bug#79496). 2025-09-24 08:56:37 +03:00
Stefan Monnier
d0b81f5d80 (electric-indent-actions): Fix corner case and refine setup
* lisp/electric.el (electric-indent--activate-indent-actions):
Rename from `electric-indent-toggle-indent-actions`.  Adjust callers.
Make its result less dependent on the input state.  Support `yank` and
`before-save` at the same time.
(electric-indent-actions): Use it instead if `electric-indent-mode`.
2025-09-23 16:38:49 -04:00