Commit graph

178062 commits

Author SHA1 Message Date
Po Lu
e790873be1 Address typos in MIPS executable loader
* exec/loader-mipsel.s (rest_of_exec): Delete redundant nop.
(skip_environ): Correct stack space test.  Don't jump into
the label for the sp preserving case's delay slot.
2025-04-15 11:14:14 +08:00
Po Lu
b455133450 Avoid performance regressions in unoptimized builds
* src/alloc.c (lisp_malloc): Declare val register.
2025-04-15 09:53:32 +08:00
Stefan Kangas
a7f5d183a8 Remove unused XMALLOC_BLOCK_INPUT_CHECK debug facility
The compile-time option XMALLOC_BLOCK_INPUT_CHECK was added in
2012 (commit 4d7e6e51dd) to allow blocking input during
malloc-family calls, in case any issues arose from related
changes in Emacs 24.3.  However, it has not been referenced on
emacs-devel or the bug tracker in over a decade.

It is clear that we do not need it, as our signal handlers do not
allocate memory.  Removing it simplifies the allocation function
wrappers and eliminates dead debug code.

Ref: https://debbugs.gnu.org/12450

* src/alloc.c [XMALLOC_BLOCK_INPUT_CHECK]
(malloc_block_input, malloc_unblock_input): Delete functions.
(MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Delete macros.  Update
all callers.
2025-04-14 20:40:49 +02:00
Po Lu
74df372398 Port recent changes to mipsel systems
* exec/exec.c (exec_0): Don't disable AT_EXECFN substitution on
MIPS systems.

* exec/loader-aarch64.s (skip_environ): Correct typo in
commentary.

* exec/loader-mips64el.s: Add a disclaimer that this file is
currently inoperable.

* exec/loader-mipsel.s (__start): Move environment and argument
vectors and produce and replace AT_EXECFN.  Clear stack before
proceeding to circumvent an oversight in glibc.
2025-04-14 21:31:07 +08:00
Eli Zaretskii
4918de1699 Support file:// URIs and readonly DB in 'sqlite-open'
* src/sqlite.c (Fsqlite_open): Two new optional arguments,
READONLY and DISABLE-URI.  Doc fix.

* etc/NEWS:
* doc/lispref/text.texi (Database): Document the new optional
arguments to 'sqlite-open'.  (Bug#65274)
2025-04-14 12:42:28 +03:00
Eli Zaretskii
f7ca720e2d ; * etc/NEWS: Move tree-sitter related items. 2025-04-14 11:42:26 +03:00
Po Lu
462bd149cd Fix typos in executable loaders
* exec/loader-aarch64.s (skip_environ, cleanup): Minor thinkos.

* exec/loader-x86_64.s (skip_environ): Insert missing label.
2025-04-14 09:10:14 +08:00
Dmitry Gutov
f7e34d52dc Fix help-customize in describe-symbol buffers
* lisp/help-fns.el (describe-symbol):
Protect help-mode--current-data from being modified inside the
help-setup-xref call (bug#77510).
2025-04-14 03:35:37 +03:00
Stefan Monnier
19913b1567 (cl-generic-define-method): Try and fix bug#77464
* lisp/emacs-lisp/cl-generic.el (cl-generic-define-method): Don't set
the function to `dummy`, even temporarily.
2025-04-13 12:45:54 -04:00
Stefan Monnier
1dee377bad lisp/gnus/gnus-start.el (gnus-dribble-eval-file): Ignore lexbind warning 2025-04-13 10:59:47 -04:00
Stefan Monnier
9dfd4c6bd3 (calc-save-modes): Add a lexical-binding cookie
* lisp/calc/calc-mode.el (calc-save-modes): Add a `lexical-binding`
cookie when it is safe.  Use `pcase-dolist` and `pp`.
2025-04-13 10:33:47 -04:00
Eli Zaretskii
e0c7b6e31e Fix warning messages about lexbind cookie in subdirs.el
* lisp/files.el (internal--get-default-lexical-binding): Don't log
a warning message when lexbind warning is disabled, and
'display-warning' is unavailable or signals an error.
2025-04-13 16:35:49 +03:00
Eshel Yaron
ebaf424126
; Fix recently broken test (bug#77777).
* test/lisp/emacs-lisp/find-func-tests.el
(find-func-tests--locate-macro-generated-symbols): bind
'trusted-content' to names of files in which we want to
expand macros during this test.
2025-04-13 13:55:37 +02:00
Po Lu
74e25c9413 Fix file descriptor leaks on arm Android
* exec/loader-aarch64.s (_start):

* exec/loader-armeabi.s (_start): Fix thinko.
Do not merge to master.
2025-04-13 19:02:04 +08:00
Po Lu
7a01350624 Replace AT_EXECFN in auxiliary vectors of programs executed on Android
* exec/exec.c (insert_args, exec_0): On non-MIPS systems, copy
NAME and its length to the loader area.  State that MIPS support
is not yet available (though it will be pending the availability
of a functioning emulator).

* exec/loader-aarch64.s (_start):

* exec/loader-armeabi.s (_start):

* exec/loader-x86.s (_start):

* exec/loader-x86_64.s (_start): Displace auxv, environ, and
argv to create sufficient space for the provided file name, and
copy the file name there.  Replace AT_EXECFN to refer to this
space.
2025-04-13 18:51:49 +08:00
Eli Zaretskii
f5b59a8a73 ; Fix last change
* lisp/progmodes/elisp-mode.el (elisp-eldoc-docstring-length-limit):
* etc/NEWS: Fix documentation of last change.  (Bug#77628)
2025-04-13 13:03:03 +03:00
Elías Gabriel Pérez
53bd9f54c6 Add variable for control docstring length in elisp eldoc functions
* etc/NEWS: Announce new variable.
* lisp/progmodes/elisp-mode.el (elisp-eldoc-docstring-length-limit):
New user option.
(elisp-eldoc-funcall-with-docstring): Add "Undocumented" as
docstring if the function has no docstring.
(elisp-eldoc-var-docstring-with-value): Use
`elisp-eldoc-docstring-length-limit'.  (Bug#77628)
2025-04-13 13:02:41 +03:00
Eli Zaretskii
22b646efe3 ; Fix a typo in proced.el
* lisp/proced.el (proced-filter): Fix a typo.  Reported by Armin
Darvish <armindarvish@gmail.com>.  (Bug#77713)

(cherry picked from commit 3a13fb2069)
2025-04-13 12:39:13 +03:00
Eli Zaretskii
3a13fb2069 ; Fix a typo in proced.el
* lisp/proced.el (proced-filter): Fix a typo.  Reported by Armin
Darvish <armindarvish@gmail.com>.  (Bug#77713)
2025-04-13 12:38:04 +03:00
Eli Zaretskii
c4012904fd ; (url-generic-parse-url/ms-windows-file-uri-hanlding): Fix test. 2025-04-13 12:14:27 +03:00
Eli Zaretskii
c76892edd2 ; Fix last change
* test/lisp/url/url-parse-tests.el
(url-generic-parse-url/ms-windows-file-uri-hanlding): Reformat and
fix the test on MS-Windows.
2025-04-13 12:12:13 +03:00
Sebastián Monía
fec6e16f14 Special treatment for file:// URIs on Windows
* lisp/url/url-parse.el (url-generic-parse-url): Remove prefix /
when a file URI's filename starts with a single letter followed
by a colon and a slash or backslash.
(url-recreate-url): Mirror the change applied when parsing, so
the URL is recreated properly on MS-Windows.
* test/lisp/url/url-parse-tests.el
(url-generic-parse-url/ms-windows-file-uri-hanlding): New test.
(Bug#76982)
2025-04-13 11:59:24 +03:00
Pengji Zhang
6f494d74f6 New user option to hide minor mode lighters (bug#77361)
* lisp/bindings.el (mode-line-collapse-minor-modes): New user
option.
(mode-line-minor-modes): New variable to hold mode line
constructs for minor modes.
(mode-line--make-lighter-menu): New helper function to generate
the menu for hidden minor modes.
(mode-line--minor-modes): New helper function to computer mode
line constructs for minor mode lighters.
(mode-line-modes): Use the new variable 'mode-line-minor-modes',
and adjust the order of elements so the indicator for hidden
minor modes is shown towards the end.

* doc/lispref/modes.texi (Mode Line Basics): Move the paragraph
for 'mode-line-compact' from here...
* doc/emacs/display.texi (Optional Mode Line): ...to here, and
document the new user option.
* etc/NEWS: Annouce the new user option.
2025-04-13 11:43:33 +03:00
Jens Schmidt
e82989757f Use a pristine copy of argv to restart Emacs
argv as left after main has proccessed the command-line can differ
both in order and contents of the original command-line arguments,
which can lead to surprising results when restarting emacs on the
cooked argv through `kill-emacs'.

Starting from that observation, consistenly use variables
'initial_cmdline' on Windows, 'initial_argc', 'initial_argv' on
non-Windows, and 'initial_argv0' in all ports.

* src/lisp.h: Declare 'initial_argv0', limit declaration of
'initial_argv' and 'initial_argc' to non-Windows ports.
* src/emacs.c: Likewise, but for the definitions.
(init_cmdargs): Move initialization of 'initial_argv' and
'initial_argc' ...
(copy_args) [!WINDOWSNT]: ... to this new function ...
(main): ... and call that in 'main', also initializing
'initial_argv0' before the command-line processing.
* src/emacs.c (Fkill_emacs):
* src/pgtkterm.c (pgtk_term_init):
* src/sysdep.c (emacs_perror):
* src/xterm.c (x_term_init): Use 'initial_argv0' where only that
is required.  (Bug#77389)
2025-04-13 11:33:30 +03:00
Asher Copeland
5665b446b7 Fix 'backward-delete-char-untabify'
* lisp/simple.el (backward-delete-char-untabify): Fix
behavior when there's an active region.  (Bug#75042)

Copyright-paperwork-exempt: yes
2025-04-13 11:24:31 +03:00
Eli Zaretskii
d9ad0c953b ; Fix a typo in last change. 2025-04-13 11:13:36 +03:00
Elías Gabriel Pérez
4c6b1712a4 Add block-comment-start and block-comment-end to supported modes
* lisp/emacs-lisp/lisp-mode.el (lisp-mode-variables):
Add block-comment-start and block-comment-end from here...
* lisp/newcomment.el (block-comment-start, block-comment-end):...
* lisp/nxml/nxml-mode.el (nxml-mode):...
* lisp/progmodes/c-ts-common.el (c-ts-common-comment-setup):...
* lisp/progmodes/go-ts-mode.el (go-work-ts-mode):...
* lisp/progmodes/js.el (js--mode-setup):...
* lisp/progmodes/json-ts-mode.el (json-ts-mode):...
* lisp/progmodes/lua-ts-mode.el (lua-ts-mode):...
* lisp/progmodes/opascal.el (opascal-mode):...
* lisp/progmodes/pascal.el (pascal-mode):...
* lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode):...
* lisp/textmodes/css-mode.el (css-base-mode, scss-mode):...
* lisp/textmodes/sgml-mode.el (sgml-mode): ... to here.
(Bug#77424)
2025-04-13 11:12:59 +03:00
Stephane Zermatten
158cf528c4 Fix term.el bug with very short multibyte character chunk
Before this change, a chunk containing only a part
of a multibyte character would be discarded and
displayed undecoded on the terminal.
* lisp/term.el (term-emulate-terminal): Fix handling chunks
with part of a multibyte character.  (Bug#77410)

* test/lisp/term-tests.el (term-decode-partial)
(term-undecodable-input): Fix and enhance tests.

Copyright-paperwork-exempt: yes
2025-04-13 11:05:25 +03:00
Eli Zaretskii
b0d6fe1449 Disable clearing echo-area when 'inhibit-message' is non-nil
* src/xdisp.c (clear_message): Don't clear echo-area if
'inhibit-message' is non-nil.

* etc/NEWS:
* doc/lispref/display.texi (Displaying Messages): Document the
above change.  (Bug#77257)
2025-04-13 10:44:55 +03:00
Eli Zaretskii
7b36d7295e ; * src/editfns.c (Freplace_region_contents): Doc fix (bug#76313). 2025-04-13 10:34:46 +03:00
Sean Whitton
9f6eb6cebb ; Fix replacements of old vc-annotate-parent-file
* lisp/vc/vc-annotate.el (vc-annotate-working-revision)
(vc-annotate-extract-revision-at-line)
(vc-annotate-revision-at-line, vc-annotate-warp-revision)
(vc-annotate-goto-line): Fix extracting the file name from
vc-buffer-overriding-fileset.
2025-04-13 14:39:12 +08:00
Stefan Monnier
f3e0bdf1b9 lisp/subr.el (setq-local): Make local after evaluating the new value
In case the evaluation needs to look at the variable's value,
make sure we make it buffer-local afterwards.
2025-04-12 23:00:08 -04:00
Stefan Monnier
b99893af1e (replace-buffer-contents): Mark as obsolete, again.
* lisp/subr.el (replace-buffer-contents): Mark as obsolete, again.
* src/editfns.c (Freplace_region_contents): Add interactive form.
2025-04-12 22:58:22 -04:00
Stefan Monnier
356178c8e7 savehist.el: Unbreak tests
* lisp/savehist.el (savehist-loaded): Fix typo.
(savehist--reload): Add compatibility with test case.
2025-04-12 22:49:48 -04:00
Stefan Monnier
bfeb755e03 savehist.el: Handle concurrent access to savehist-file
* lisp/savehist.el (savehist--manage-timer): Minor simplification.
(savehist-coding-system): Use `utf-8-emacs-unix` so it works even if
some history entries contain chars that aren't in Unicode.
(savehist-loaded): Mark it obsolete.
(savehist--file-sync-modtime): New var to replace it.
(savehist--file-modtime, savehist--merge): New functions.
(savehist--reload): New function, extracted from `savehist-mode`.
Make it merge the old history and the newly loaded one.
Remember the time of sync in `savehist--file-sync-modtime`.
(savehist-mode): Use it.
(savehist-save): Use it as well, and set `savehist--file-sync-modtime`.
(savehist--last-autosave): New var.
(savehist-autosave): Use it to skip saves when not enough time has passed.
2025-04-12 22:43:20 -04:00
Paul Eggert
3169aeb421 ; Fix typo in comment. 2025-04-12 12:30:58 -07:00
Stefan Monnier
1741812535 lisp/help.el (help-form-show): Improve last change (bug#77118)
Fill the buffer from within the `with-output-to-temp-buffer`, as before.
2025-04-12 11:11:38 -04:00
Eli Zaretskii
2b3763e955 Merge from origin/emacs-30
d3c39fb522 Fix display of keys in 'help-form' buffers (bug#77118)
6509cc20a9 Improve documentation of 'user-emacs-directory'
3f06059730 Update remarks on name prefixes in coding conventions
e966ff9759 ; * doc/emacs/files.texi (Image Mode): Fix a typo (bug#77...
378bea99b1 ; Fix doc strings of a few Dired commands
30fb2ac07a ; * CONTRIBUTE: Clarify single-line commit should end wit...
417d14a95e ; * admin/MAINTAINERS: Complete the handover of VC
bb756b195a ; Fix typo in Tramp
2025-04-12 08:57:38 -04:00
Eli Zaretskii
6221e9a66d ; Merge from origin/emacs-30
The following commit was skipped:

684adc07c2 ; Fix a recent backport
2025-04-12 08:57:38 -04:00
Visuwesh
bf7bcbaa3d Limit fontification of "customize" in setopt suggestion
* lisp/help-fns.el (help-fns--customize-variable): Limit the
fontification to newly inserted text to avoid spurious
fontification of other instances of the word "customize."
2025-04-12 14:22:55 +03:00
Eli Zaretskii
50531a00b5 ; * etc/NEWS: Fix wording and punctuation in last added entry. 2025-04-12 14:12:05 +03:00
Spencer Baugh
861e7f8b60 flymake: fall back to margins on text terminals
Previously, flymake-indicator-type defaulted to either fringes
or margins.  But fringes should be used on graphical frames, and
margins on TTY frames.  So default to fringes instead, and
simply fall back to margins automatically on text frames.

* lisp/progmodes/flymake.el (flymake-indicator-type): Set to
fringes.  (bug#77313)
(flymake-mode): Fallback to margins if there's no fringes.
* doc/misc/flymake.texi (Customizable variables): Mention
fallback behavior.
* etc/NEWS: Announce fallback behavior.
2025-04-12 14:10:19 +03:00
Stephen Berman
d3c39fb522 Fix display of keys in 'help-form' buffers (bug#77118)
* lisp/help.el (help-form-show): Use 'insert' instead of 'princ'
so that keys in 'help-form' are displayed with 'help-key-binding' face.
2025-04-12 12:01:50 +02:00
Eli Zaretskii
6509cc20a9 Improve documentation of 'user-emacs-directory'
* doc/emacs/custom.texi (Find Init): Document the effect of
'user-emacs-directory' on native compilation.  Advise against
changing the value of 'user-emacs-directory' in init files.
(Bug#77745)
2025-04-12 09:52:04 +03:00
Sean Whitton
3f06059730 Update remarks on name prefixes in coding conventions
* doc/lispref/tips.texi (Coding Conventions): Say that it's okay
to put the name prefix later for defining constructs, rather
than explicitly instructing the reader to do so.  Condense the
recommendation to err on the side of prepending the name prefix.
2025-04-12 11:05:45 +08:00
Sean Whitton
3b841700a8 vc-do-async-command: Ellipse later lines in multiline arguments
* lisp/emacs-lisp/cl-print.el (cl-print-expand-ellipsis): Bind
inhibit-read-only to t.
* lisp/vc/vc-dispatcher.el (require): Require cl-print at
compile time.
(vc-do-async-command): When printing command arguments that
contain multiple lines, use cl-prin1 with cl-print-string-length
bound in order to ellipse lines other than the first.
Switch the outer quotation marks to single quotation marks.
2025-04-12 10:05:57 +08:00
Sean Whitton
cc232bd7a1 ; * etc/NEWS: Move new variables only for Lisp programmers downwards. 2025-04-12 10:05:29 +08:00
Juri Linkov
695edc5b55 Rename treesit-toggle-sexp-type to treesit-cycle-sexp-type.
* lisp/treesit.el (treesit-cycle-sexp-type):
Rename from 'treesit-toggle-sexp-type'.  Fix docstring.
https://lists.gnu.org/archive/html/emacs-devel/2025-04/msg00291.html
2025-04-11 19:34:29 +03:00
Sean Whitton
53058e15c3 ; * etc/NEWS: Expand description of vc-buffer-overriding-fileset. 2025-04-11 18:46:37 +08:00
Michael Albinus
1be9007c0d ; * etc/NEWS: Fix typos. 2025-04-11 11:58:40 +02:00