1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-14 23:40:39 -08:00
Commit graph

180016 commits

Author SHA1 Message Date
Martin Rudalics
2c4e7a99cc Handle resizing of fullscreen frames more consistently (Bug#79704)
* src/frame.c (adjust_frame_size): Honor new option
'alter-fullscreen-frames'.
(syms_of_frame) <alter-fullscreen-frames>: New option to
maintain consistent state when attempting to resize fullscreen
frames.  Default to 'inhibit' for NS builds because these
resized the frame while leaving the 'fullscreen' parameter alone
(Bug#79704).
(syms_of_frame) <Qinhibit>: Define symbol.
* lisp/cus-start.el (standard): Add customization options for
'alter-fullscreen-frames'
* doc/lispref/frames.texi (Frame Size): Describe new option
'alter-fullscreen-frames'.
* etc/NEWS: Call out new option 'alter-fullscreen-frames'.
2025-11-02 09:24:05 +01:00
Juri Linkov
fae5ced1ac * lisp/simple.el (previous-line-or-history-element): Fix off-by-one error.
(bug#79746)
2025-11-02 09:41:05 +02:00
Ahmed Khanzada
dd9d1df4fa Automatically toggle between dark and light mode PGTK widgets
* src/gtkutil.h: Declare 'xg_set_gtk_theme_dark_mode',
'xg_update_dark_mode_for_all_displays',
'xg_set_initial_dark_mode'.
* src/gtkutil.c (xg_set_gtk_theme_dark_mode): Toggle PGTK dark mode.
(xg_update_dark_mode_for_all_displays): Toggle PGTK dark mode for all
displays.
(xg_set_initial_dark_mode): Determine PGTK dark mode preference and set.
(xg_create_frame_widgets): Set PGTK dark mode preference for widgets.
(xg_create_frame_outer_widgets): Set PGTK dark mode preference for outer
widgets.
* src/xsettings.h: Declare 'xg_get_system_dark_mode'.
* src/xsettings.c (something_changed_gsettingsCB): Update PGTK dark mode
setting.
(xg_get_system_dark_mode): Determine PGTK dark mode preference.
GSETTINGS_COLOR_SCHEME: Defined and set to "color-scheme".
* etc/NEWS: Document automatic dark mode toggling.
(Bug#79689)
2025-11-02 08:01:41 +02:00
Eli Zaretskii
0c6aee3021 ; * doc/lispref/commands.texi (Reading One Event): Fix wording. 2025-11-02 07:41:08 +02:00
Philip Kaludercic
2777178dc6
Fix markup toggling in rcirc
(rcirc-markup-attributes): Delete markup codes straight after
processing it, to correctly handle toggling codes.  E.g. when
processing the message "one ^Btwo^B three", we previously
recognised the first interval "^Btwo^B" and moved over the ^B.
Searching for the next range to markup, we would now falsely
recognise "^B three" to be another markup range, instead of it
being the negative toggle.  By removing the processed codes, we
avoid this issue.  This reverts the functionality removed in
946ceca2, and therefore also re-adds the check to make an
exception to removing a ^O as that code can terminate multiple
markup sequences.  (Bug#57383)
2025-11-01 20:52:05 +01:00
Philip Kaludercic
da3e3756c2
; * lisp/emacs-lisp/cond-star.el (match*): Fix ` in docstring 2025-11-01 20:52:05 +01:00
Philip Kaludercic
3dacd8b41a
Check if 'hash-table-contains-p' is available in map.el
* lisp/emacs-lisp/map.el (map-contains-key): Hide old
implementation prior to f60fc128 behind a `fboundp', as the
package is distributed on ELPA and should be backwards
compatible to Emacs 26.  (Bug#79711)
2025-11-01 20:52:05 +01:00
Spencer Baugh
fbb7eb5686 * test/lisp/emacs-lisp/map-ynp-tests.el: New file (bug#67836). 2025-11-01 20:40:20 +02:00
Juri Linkov
2447188a69 'map-y-or-n-p' now uses the minibuffer to read a char (bug#79664)
* lisp/emacs-lisp/map-ynp.el (map-y-or-n-p): Use the 'read-key'
branch only when the variable 'y-or-n-p-use-read-key' is non-nil.
Add a new cond-branch to read from the minibuffer.
Add a special case when def is nil in a kmacro in batch mode (bug#67836).

* test/lisp/files-tests.el (files-tests--with-buffer-offer-save):
Let-bind 'y-or-n-p-use-read-key' to t.
2025-11-01 20:27:45 +02:00
Juri Linkov
ab4a616b0b 'read-multiple-choice' now uses the minibuffer to read a char (bug#79664)
* doc/lispref/commands.texi (Reading One Event): Mention
'read-char-choice-use-read-key'.

* lisp/emacs-lisp/rmc.el (rmc--show-help): Show non-selected
resized Help window at bottom.  Inhibit useless message.
Remove unnecessary call to 'pop-to-buffer'.
(read-multiple-choice): Call 'read-multiple-choice--from-minibuffer'
when 'read-char-choice-use-read-key' is nil.
(read-multiple-choice--from-minibuffer): New function.

* test/lisp/emacs-lisp/rmc-tests.el (test-rmc--with-minibuffer-setup):
New macro.
(test-read-multiple-choice, test-read-multiple-choice-help):
Test both values of 'read-char-choice-use-read-key'.
2025-11-01 20:21:09 +02:00
Eli Zaretskii
d2b0c78366 ; * doc/misc/cl.texi (Derived Types): Fix a typo. 2025-11-01 12:44:23 +02:00
Eli Zaretskii
e1b64c8b12 Merge from origin/emacs-30
0974418f2a Improve and correct documentation of 'font-lock-keywords-...
2025-11-01 05:28:54 -04:00
Michael Albinus
a7417c47fa ; Minor Tramp changes
* doc/misc/tramp.texi (Frequently Asked Questions): Don't mention
Windows 7/8, they are obsolete now.  Improve "speed up" item.

* lisp/net/tramp-sh.el (tramp-expand-script): Handle "%%" format
specifier better.
2025-11-01 10:01:43 +01:00
Gautier Ponsinet
126493735f Fix a typo in newst-backend.el
* lisp/net/newst-backend.el (newsticker--parse-text-container): Fix a
typo in the docstring.  (Bug#79747)
2025-11-01 09:25:44 +02:00
Eli Zaretskii
a730cb59ee ; * etc/NEWS (Speedbar): Fix a typo (bug#79748). 2025-11-01 09:23:16 +02:00
Protesilaos Stavrou
a9bac6585f
Update to modus-themes version 5.0.0
The release notes: <https://protesilaos.com/codelog/2025-11-01-emacs-modus-themes-5-0-0/>.
2025-11-01 07:40:13 +02:00
Po Lu
1d8b75f4b8 Restore compatibility with Texinfo 4.13
* doc/emacs/vc1-xtra.texi (Other Working Trees): Remove
@indentedblock; after reading the node twice I could not
understand why the paragraphs so formatted must have been thus.

* doc/misc/cl.texi (Derived types): Rename node to Derived
Types, and insert the same into the menu.
2025-11-01 13:02:34 +08:00
Sean Whitton
63ea5e5b3a ; * lisp/vc/vc-hg.el (vc-hg--reset-back-to): Fix docstring. 2025-10-31 18:53:09 +00:00
Sean Whitton
902f4e7166 ; * lisp/vc/vc-hg.el (vc-hg--reset-back-to): Reflow. 2025-10-31 18:50:41 +00:00
Sean Whitton
1fd4d3e070 New *-revisions-from-end VC backend API functions (bug#79408)
* lisp/vc/vc-git.el (vc-git-delete-revisions-from-end)
(vc-git-uncommit-revisions-from-end):
* lisp/vc/vc-hg.el (vc-hg--assert-rev-on-current-branch)
(vc-hg--reset-back-to, vc-hg-delete-revisions-from-end)
(vc-hg-uncommit-revisions-from-end): New functions.
* lisp/vc/vc.el: Specify delete-revisions-from-end and
uncommit-revisions-from-end backend API functions (bug#79408).
2025-10-31 18:49:19 +00:00
David Ponce
1e47f7492a lisp/emacs-lisp/cl-*.el: Minor changes accumulated during new API design
* lisp/emacs-lisp/cl-macs.el (cl-deftype): Support dispatch on
types that take arguments, as long as they can be used without arguments.

* lisp/emacs-lisp/cl-generic.el (cl--generic-derived-mode-specializers):
Rename from `cl--generic-derived-specializers` to clarify it's about
derived modes and not derived types.
(cl--generic-derived-mode-generalizer): Adjust accordingly and rename
from `cl--generic-derived-generalizer` for the same reason.
Ignore additional args in the tagcode function.
(cl-generic-generalizers) <derived-mode>: Adjust accordingly.

* lisp/emacs-lisp/macroexp.el (macroexp--dynamic-variable-p): Simplify.
2025-10-31 13:49:49 -04:00
David Ponce
13ec843352 cl-extra.el: Use the new API to speed up dispatch on derived types
* lisp/emacs-lisp/cl-extra.el (cl--types-of-memo): Delete var.
(cl--derived-type-specializers-memo): New var.
(cl-types-of): Delete function.
(cl--derived-type-specializers): New function.
(cl--derived-type-dispatch-list): Delete var.
(cl--derived-type-generalizer): Use the `:need-specializers` API instead.
(cl--derived-type-generalizers): Don't fill
`cl--derived-type-dispatch-list` any more.

* lisp/emacs-lisp/cl-preloaded.el (cl--derived-type-list): Delete var.
(cl--define-derived-type): Don't add type to `cl--derived-type-list`.

* test/lisp/emacs-lisp/cl-extra-tests.el (cl-types-test): Adjust.
2025-10-31 13:49:14 -04:00
Stefan Monnier
194b10b6ad (cl-generic-define-generalizer): Add new API
Sometimes, the computation of the tag (or the computations of
the list of specializers corresponding to a tag) can be sped up
if we know the set of specializers we're looking for.

So we add a new API for both the TAGCODE-FUNCTION and SPECIALIZERS-FUNCTION
that lets them receive the set of specializers they need to consider (or any
information they can precompute from that), i.e. the set of specializers
handled by the same generalizer currently used by the generic function
for the the specific argument on which we're currently dispatching.

* lisp/emacs-lisp/cl-generic.el (cl-generic-define-generalizer):
Document new API.
(cl--generic-collect-specializers, cl--generic-filter-specializers)
(cl--generic--tagcode-with-specializers): New helper functions.
(cl--generic-get-dispatcher): Use them to support new API.
2025-10-31 13:49:14 -04:00
Eli Zaretskii
1930598225 Avoid infinite recursion in 'face_inheritance_cycle'
* src/xfaces.c (face_inheritance_cycle)
(Finternal_set_lisp_face_attribute): Prevent infinite recursion if
a face is defined to inherit from itself (whaaat? how??!).
2025-10-31 17:24:58 +02:00
Martin Rudalics
7da7b246cf Fix a bug in Fcombine_windows
* src/window.c (window_set_parent_and_normal_sizes): New function.
(Fcombine_windows): Improve doc-string.  Use wset_... functions.
Call window_set_parent_and_normal_sizes to fix a bug where it
failed to assign new normal sizes.
(Funcombine_window): Call window_set_parent_and_normal_sizes.
2025-10-31 09:17:38 +01:00
Eli Zaretskii
55d4596dd0 ; * src/lisp.h (MAX_ALLOCA): Comment on enlarging the value. 2025-10-31 08:39:36 +02:00
Yuan Fu
b5c290cfbd
Revert "Use cached compiled tree-sitter queries for range settings"
This reverts commit e28ec76271.

* lisp/treesit.el (treesit-range-rules): Use treesit-query-compile.
2025-10-30 19:15:40 -07:00
Steven Allen
b0eaaf7366 More reliably check if a frame is the daemon's initial frame
Frames created when Emacs is running as a daemon may not have the
"client" frame parameter set, e.g., when:

1. Created from the user's init file.
2. Created via "emacsclient -e" (e.g., "emacsclient -e '(make-frame)'").

The "client" parameter simply indicates that the frame was created by
emacsclient directly (or recursively from another emacsclient frame).

Instead, this commit checks if (a) Emacs is running as a daemon and (b)
the target frame is the "terminal frame".  When run as a daemon, Emacs's
terminal frame is always the daemon's initial frame.

* lisp/desktop.el (desktop-clear):
(desktop-restoring-frameset-p):
* lisp/display-fill-column-indicator.el
(display-fill-column-indicator--turn-on):
* lisp/frame.el (frame-notice-user-settings):
* lisp/obsolete/linum.el (linum-on):
* lisp/progmodes/flymake.el (flymake-start):
* lisp/tab-bar.el (tab-bar--update-tab-bar-lines): Fix the "is this the
initial daemon-frame" checks.  (Bug#79686)
2025-10-30 20:27:19 +02:00
Spencer Baugh
97d2a659e8 Optimize PCM regex to not contain adjacent wildcards
When multiple wildcards occur in a PCM pattern,
completion-pcm--pattern->regex previously would generate one
instance of [^z-a]* for each of those wildcards, even if the
wildcards were adjacent and could therefore be matched by a
single [^z-a]*.  This can make regex matching performance much
worse.  For example, with a minibuffer containing "*/" with
point at the start, completion-pcm-all-completions would take
several seconds to match in project-find-file in the Emacs repo.

Now, we run completion-pcm--pattern->segments on the pattern
first, which adds additional structure to the pattern, including
consolidating adjacent regexes into a single sublist.  Then
completion-pcm--segments->regex generates a single regex
wildcard for each of those pattern wildcards.  As a consequence,
we need to update the callers of completion-pcm--pattern->regex
which pass non-nil GROUP.  This provides a substantial
performance improvement in various edge cases.

* lisp/minibuffer.el (completion-pcm--pattern->segments)
(completion-pcm--segments->regex): Add.  (bug#79693)
(completion-pcm--pattern->regex)
(completion-pcm--merge-completions): Call pattern->segments and
segments->regex.
(completion-pcm--pattern-point-idx): Delete.
(completion-pcm--segments-point-idx): Add.
(completion-pcm--hilit-commonality): Call
completion-pcm--segments-point-idx to find the submatch
containing point.
* test/lisp/minibuffer-tests.el (completion-pcm-test-5): Add
more tests of highlighting the first difference.
(completion-pcm-test-pattern->regex): Add tests showing the
regex form of PCM patterns.
2025-10-30 19:24:51 +02:00
Eli Zaretskii
1f00179df9 ; Document how to search for raw bytes
* doc/emacs/search.texi (Regexps):
* doc/lispref/searching.texi (Regexp Special): Document how to
search for raw bytes.  (Bug#79724)
2025-10-30 16:39:43 +02:00
Mattias Engdegård
aeac24349a ; * lisp/subr.el (version-to-list): Completely wrong indentation. 2025-10-30 13:29:32 +01:00
Mattias Engdegård
8da4072344 * lisp/emacs-lisp/range.el (range-add-list): Don't mutate argument.
It's clear from the doc strings that this function isn't meant
to mutate its arguments.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
676ee88eea Faster constant pool string searching
* lisp/emacs-lisp/bytecomp.el (byte-compile-get-constant):
No reason not to use 'assoc' to search for strings as well.
Previously we kept searching even after having found the string!
2025-10-30 12:12:35 +01:00
Mattias Engdegård
305744fdfc Define compiler macros for /=, atom and nlistp
Calls to these functions were previously rewritten in terms of other
functions both in the optimiser and during codegen, for no good reason.

This also resulted in poor diagnostics: wrong-arity calls to 'atom' and
'nlistp' produced doubled but slightly-different warnings, and no
warnings at all for '/='.

Using compiler macros fixes the problems.  The generated code is the same.

* lisp/emacs-lisp/bytecomp.el (byte-compile-negated)
(byte-compile-negation-optimizer): Replace with...
(bytecomp--define-negated): ...this compiler macro defining macro.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
85e1a64943 Fix numeric comparison bug when optimisation is disabled
* lisp/emacs-lisp/bytecomp.el (byte-compile-cmp):
Don't assume that N-ary comparisons have been normalised, which is done
in the optimiser.  Reported by Pip Cet.
2025-10-30 12:12:35 +01:00
Mattias Engdegård
0fb8ed8c71 Remove unused byte-compile-eval-before-compile
* lisp/emacs-lisp/bytecomp.el (byte-compile-eval-before-compile):
This function has been unused since 2012 (e703069f9c).
2025-10-30 12:12:35 +01:00
Eli Zaretskii
cb3962138f ; Fix typos and wording of recently-modified doc strings
* lisp/treesit.el (treesit-query-range-by-language)
(treesit-range-rules): Doc fixes.
2025-10-30 08:35:29 +02:00
Protesilaos Stavrou
06b3f11cb8
Make 'link' not inherit 'button' in modus-themes.el (bug#79672)
* etc/themes/modus-themes.el (modus-themes-faces): Apply the
  font attributes directly.
2025-10-30 07:51:19 +02:00
Yuan Fu
9e8557fe85
Skip unknown language for code block in markdown-ts-mode (bug#79670)
* lisp/textmodes/markdown-ts-mode.el:
(markdown-ts--convert-code-block-language): Return nil if the
langauge doesn't have a corresponding major mode in
markdown-ts-code-block-source-mode-map.
2025-10-29 21:25:23 -07:00
Yuan Fu
9f468fd6eb
Tree-sitter range language function can return nil (bug#79670)
* lisp/treesit.el (treesit-query-range-by-language): Allow
LANGUAGE-FN to return nil.
(treesit-range-rules): Update docstring.
2025-10-29 21:09:46 -07:00
Yuan Fu
e28ec76271
Use cached compiled tree-sitter queries for range settings
* lisp/treesit.el (treesit-range-rules): Use
treesit--compile-query-with-cache.
2025-10-29 21:09:32 -07:00
Stefan Monnier
905f3d0a8a lisp/custom.el (custom-set-minor-mode): Load the mode more lazily 2025-10-29 14:35:24 -04:00
Eli Zaretskii
96cde6cdd4 Merge branch 'master' of git.savannah.gnu.org:/srv/git/emacs 2025-10-29 19:27:37 +02:00
Eli Zaretskii
1472f8241d ; * src/xfaces.c (face_inheritance_cycle): More defensive code. 2025-10-29 19:26:40 +02:00
Eshel Yaron
330aa07f00
; elisp-scope.el: Improve face specification handling.
Replace the use of 'elisp-scope-face(-1)' for analyzing face
specifications with 'elisp-scope-1' calls with an
appropriate OUTSPEC argument.  This allows us to analyze
face specifications even when they are not passed directly
to relevant functions, but rather appear in a tail position
of a form that evaluates to a face specification.

* lisp/emacs-lisp/elisp-scope.el
(elisp-scope--match-spec-to-arg): Add new 'face' spec.
Use it instead of...
(elisp-scope-face, elisp-scope-face-1): ...these functions.
Remove them, no longer used.

* test/lisp/progmodes/elisp-mode-resources/semantic-highlighting.el:
Add test.
2025-10-29 17:20:03 +01:00
Eshel Yaron
b9aa420bc4
; elisp-scope.el: Simplify 'custom-declare-face' analyzer. 2025-10-29 16:32:14 +01:00
Michael Albinus
8c7b4391a5 Adapt `tramp-test49-external-backend-function'
* test/lisp/net/tramp-tests.el (tramp-test49-external-backend-function):
Extend test.
2025-10-29 09:19:58 +01:00
Michael R. Mauger
f0f6fa3b68 lisp/comint.el: Fix `comint-write-input-ring' context
(comint-write-input-ring): Use `comint-input-ring-separator' in the
context of the caller, not the output buffer
2025-10-28 23:44:44 -04:00
F. Jason Park
44cdb65cf3 Fix regression involving erc-channel-user accessors
* etc/ERC-NEWS: New section for ERC 5.6.2 and new entry mentioning
slight change in `erc-channel-user' accessor behavior.
* lisp/erc/erc-common.el (erc-channel-user): Change type for status slot
to natnum from integer.
* lisp/erc/erc.el (erc-channel-user-signal-if-status-unknown): New
variable.
(erc--define-channel-user-status-compat-getter): Only use fallback in
Non-ERC buffers because "obviously" a status flag is unusable if the
server doesn't advertise it or, rather, advertises nonsupport via its
absence.  This regression was introduced in ERC 5.6.
(erc-channel-begin-receiving-names): Sharp-quote function name.
(erc--get-prefix-flag): Mention in doc that a return value of nil can
also mean the status flag is not supported by the server.
* test/lisp/erc/erc-tests.el (erc--parsed-prefix): Show that it returns
nil in a non-ERC buffer.
(erc-tests--make-combinations)
(erc-tests--with-channel-user-status-accessors): New functions.
(erc-channel-user/status-accessors/solo/default)
(erc-channel-user/status-accessors/solo/ov)
(erc-channel-user/status-accessors/multi/default)
(erc-channel-user/status-accessors/multi/ov): New tests.
(Bug#67220)
2025-10-27 19:29:44 -07:00
F. Jason Park
2fa768dd4b Change ERC version to 5.6.2-git
* doc/misc/erc.texi: Change ERCVER to 5.6.2.
* lisp/erc/erc.el (erc-version): Change working version to 5.6.2-git.
Do the same for the package Version header and the
`customize-package-emacs-version-alist' mapping.
2025-10-27 19:28:43 -07:00