1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-02-07 16:10:46 -08:00
Commit graph

174247 commits

Author SHA1 Message Date
Theodor Thornhill
cdca1ba2e9
; Fix typo
* lisp/treesit.el (treesit-ready-p): Minor typo fix.
2024-07-21 12:51:42 +02:00
Michael Albinus
5c08fd80d2 * lisp/progmodes/go-ts-mode.el (go-ts-mode-build-tags): Fix :version. 2024-07-21 11:13:35 +02:00
Ankit R Gadiya
f249c81f86 Add commands to run unit tests in 'go-ts-mode'
* lisp/progmodes/go-ts-mode.el (go-ts-mode-build-tags): New variable.
(go-ts-mode-map): Add new bindings.
(go-ts-mode--get-build-tags-flag, go-ts-mode--compile-test)
(go-ts-mode--find-defun-at, go-ts-mode--get-function-regexp)
(go-ts-mode--get-functions-in-range)
(go-ts-mode--get-test-regexp-at-point)
(go-ts-mode-test-function-at-point, go-ts-mode-test-this-file)
(go-ts-mode-test-this-package): New functions.

* etc/NEWS: Mention the change.

(Bug#70939)
2024-07-21 09:03:18 +03:00
Eli Zaretskii
e63fa29b98 ; Fix recent changes in pdumper.c
* src/pdumper.c (dump_treesit_compiled_query, dump_vectorlike):
Minor copyedits.
2024-07-21 07:27:38 +03:00
Paul Eggert
515e5ad0de Fix bool vector length overflow
* src/alloc.c (make_clear_bool_vector): It’s now the caller’s
responsibility to make sure the bool vector length is in range.
Add an eassert to double-check this.  This lets some locals be
ptrdiff_t not EMACS_INT.
(Fmake_bool_vector, Fbool_vector):
Check that bool vector lengths are in range.
* src/lisp.h (BOOL_VECTOR_LENGTH_MAX): New macro.
(bool_vector_words, bool_vector_bytes): Avoid undefined
behavior if size == EMACS_INT_MAX - (BITS_PER_BITS_WORD - 1).
This is mostly theoretical but it’s easy to do it right.
* src/lread.c (read_bool_vector): Use EMACS_INT, not just ptrdiff_t.
Check that length doesn’t exceed BOOL_VECTOR_LENGTH_MAX.
This fixes an unlikely integer overflow where the calculated size
went negative.
2024-07-20 16:16:22 -07:00
Paul Eggert
76497a0142 Change list-length intptr_t to ptrdiff_t
* src/fns.c (list_length, Fsafe_length, Fproper_list_p):
Use ptrdiff_t not intptr_t for accumulator, since result is ptrdiff_t.
This fixes a minor glitch in 2019-01-11T05:35:31!eggert@cs.ucla.edu
where I removed unnecessary overflow checks but forgot to change types.
This change should alter generated code only on oddball platforms where
ptrdiff_t is narrower than intptr_t, e.g., CheriBSD.
2024-07-20 16:16:22 -07:00
Jim Porter
55fefe06ef ; * lisp/eshell/esh-io.el (eshell-close-handles): Fix version annotation. 2024-07-20 14:46:14 -07:00
Yuan Fu
1abf3bdd7e
Support dumping tree-sitter query (bug#69952)
Previous commit allows Emacs to dump tree-sitter queries by simply
dumping the query string and language symbol, and left the query object
and cursor object as NULL.  This commit makes sure Emacs doesn't crash
when loading the dumped query, by make sure Emacs can handle the case
where the cursor is NULL.

* src/treesit.c (make_treesit_query): Initialize query with null cursor.
(treesit_ensure_query_cursor): New function.
(treesit_initialize_query): Ensure cursor is non-null.
* src/treesit.h (Lisp_TS_Query): Update documentation.
2024-07-20 14:00:47 -07:00
Sergey Vinokurov
1eca867e1b
Support compiled queries in pdump by dumping source (bug#69952)
* src/pdumper.c (dump_vectorlike): Dump compiled queries.
* src/pdumper.c (dump_treesit_compiled_query): New function.
2024-07-20 14:00:36 -07:00
Paul Eggert
101ec14301 SAFE_ALLOCA fixes
* src/comp.c (declare_imported_func, emit_simple_limple_call)
(declare_lex_function, compile_function):
* src/emacs-module.c (funcall_module):
* src/fns.c (Fstring_distance):
* src/font.c (font_sort_entities):
* src/haikumenu.c (digest_menu_items, haiku_menu_show):
* src/pgtkselect.c (Fpgtk_register_dnd_targets):
* src/xfns.c (Fx_begin_drag):
* src/xmenu.c (x_menu_show):
* src/xterm.c (x_dnd_compute_toplevels, handle_one_xevent)
(x_term_init):
Prefer SAFE_NALLOCA to doing size multiplication by hand, to catch
unlikely integer overflows.
* src/comp.c (emit_simple_limple_call): Fix bug where
SAFE_FREE was called too early, leading to unlikely
use of freed storage.
* src/xterm.c (handle_one_xevent): Remove side effects
from SAFE_ALLOCA args, as the args are evaluated twice.
2024-07-20 08:55:08 -07:00
Po Lu
301b97eb24 ; Fix typo in xfont.c
* src/xfont.c (xfont_list): Subtract 9 from name, not 10 + 1.
2024-07-20 21:48:08 +08:00
Stefan Kangas
2f875ead59 Avoid magic values in xfont_list
* src/xfont.c (xfont_list): Avoid magic values.
2024-07-20 15:12:50 +02:00
Eli Zaretskii
b21e749a7c Merge from origin/emacs-30
816c53c2d9 Fix bibtex validation for non-file buffers
ab7c40ea52 Fix Imenu in 'emacs-news-view-mode'
ea30ffc52b ; * doc/misc/gnus.texi (Agent Caveats): Fix doc
07b1a36f78 ; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to ...
96f1db89ee Avoid errors in 'icomplete-vertical-mode'
55110d1fda Document GNU ELPA copyright in tips.texi
079e5a0315 Improve register-use-preview docstring
e4760109ac Miscellaneous checkdoc fixes
2024-07-20 06:32:17 -04:00
Liu Hui
816c53c2d9 Fix bibtex validation for non-file buffers
* lisp/textmodes/bibtex.el (bibtex-validate): Use buffer name
to show errors in non-file buffers.  (Bug#71946)
2024-07-20 12:48:04 +03:00
Eli Zaretskii
ab7c40ea52 Fix Imenu in 'emacs-news-view-mode'
* lisp/textmodes/emacs-news-mode.el (emacs-news-view-mode): Make
it derived from emacs-news-mode.  Add useful key bindings.
(Bug#72080)
2024-07-20 12:33:23 +03:00
James Thomas
ea30ffc52b ; * doc/misc/gnus.texi (Agent Caveats): Fix doc
* doc/misc/gnus.texi (Agent Caveats): Change doc due to commit
2020-10-16 "Add a new variable to control Gnus Agent caching"
(41d220dc60, bug#43356).  (Bug#72134)
2024-07-20 11:58:20 +03:00
Eli Zaretskii
07b1a36f78 ; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to allowed extensions. 2024-07-20 10:27:52 +03:00
Paul Eggert
79b9f05d3a Avoid accessing uninitialized bool_vector words
Although loading uninitialized works from memory and then ignoring
the result works fine on conventional architectures, it
technically has undefined behavior in C, so redo bool_vector
allocation so that the code never does that.  This can improve
performance when allocating large vectors of nil, since calloc can
clear the memory lazily.
* src/alloc.c (make_clear_bool_vector): New function,
a generalization of make_uninit_bool_vector.
(make_uninit_bool_vector): Use it.
(Fmake_bool_vector): If !INIT, rely on make_clear_bool_vector.
* src/alloc.c (Fbool_vector):
* src/fns.c (Freverse): Don’t access uninitialized bool_vector words.
2024-07-20 00:19:33 -07:00
Eli Zaretskii
cb78b43f39 Fix setup of fonts for 'han' script.
* lisp/international/fontset.el (script-representative-chars): Add
more CJK representative characters to 'han' script.  (Bug#72188)
2024-07-20 09:46:58 +03:00
Eli Zaretskii
96f1db89ee Avoid errors in 'icomplete-vertical-mode'
* lisp/minibuffer.el (completion--hilit-from-re): Avoid signaling
an error if STRING does not match REGEXP.  Fix doc string and
indentation.  (Bug#72176)
2024-07-20 08:58:39 +03:00
Stefan Kangas
55110d1fda Document GNU ELPA copyright in tips.texi
* doc/lispref/tips.texi (Library Headers): Document that GNU ELPA
packages should have their copyright assigned to the FSF.
2024-07-20 07:46:37 +02:00
Po Lu
358dbbb723 Fix compilation on builds with native rectangle structures
* src/androidgui.h (CONVERT_TO_NATIVE_RECT)
(CONVERT_FROM_EMACS_RECT): Delete redundant macro definitions.

* src/xdisp.c (Fremember_mouse_glyph) [CONVERT_TO_EMACS_RECT]:
Expand CONVERT_TO_EMACS_RECT to convert native rectangles into
a readable format if required.  Reported by Stefan Kangas
<stefankangas@gmail.com>.
2024-07-20 12:39:33 +08:00
Po Lu
892abde34e Respect mouse-fine-graned-tracking in touch screen simple translation
* lisp/touch-screen.el (touch-screen-current-tool): Expand doc
string.
(touch-screen-handle-point-update): Record extents of glyph
beneath the mouse as computed by `remember_mouse_glyph' if
necessary, and defer generation of mouse-movement events till
the mouse exit it.

* src/xdisp.c (Fremember_mouse_glyph): New function.
(syms_of_xdisp): Define new subr.
2024-07-20 11:28:47 +08:00
Stefan Kangas
079e5a0315 Improve register-use-preview docstring
* lisp/register.el (register-use-preview): Improve docstring.
2024-07-20 02:42:08 +02:00
Stefan Kangas
e4760109ac Miscellaneous checkdoc fixes
* lisp/ansi-color.el (ansi-color--ensure-context):
* lisp/doc-view.el (doc-view-svg-face):
* lisp/external-completion.el (external-completion-table):
* lisp/ffap.el (ffap-ro-mode-hook, ffap-gnus-hook):
* lisp/find-file.el:
* lisp/flow-ctrl.el (flow-control-c-s-replacement)
(flow-control-c-q-replacement):
* lisp/forms.el (forms-multi-line):
* lisp/help.el (search-forward-help-for-help):
* lisp/hi-lock.el (hi-lock-use-overlays):
* lisp/image.el (find-image):
* lisp/isearch.el (isearch-forward, isearch-forward-regexp)
(isearch-lazy-count-format):
* lisp/jsonrpc.el (jsonrpc--continue, initialize-instance):
* lisp/mouse-copy.el (mouse-kill-preserving-secondary):
* lisp/pixel-scroll.el (pixel-bob-at-top-p)
(pixel-scroll-down-and-set-window-vscroll):
* lisp/printing.el (pr-gv-command, pr-gs-command)
(pr-gs-switches):
* lisp/register.el (register-use-preview):
* lisp/repeat.el (repeat-check-key):
* lisp/saveplace.el (save-place-abbreviate-file-names):
* lisp/select.el (gui--clipboard-selection-unchanged-p):
* lisp/ses.el (ses-header-row):
* lisp/simple.el (transpose-sexps-default-function)
(normal-erase-is-backspace, normal-erase-is-backspace-mode):
* lisp/sqlite-mode.el (sqlite-mode):
* lisp/tempo.el (tempo-insert-region):
* lisp/term.el (term-mode-map, term-mode, term-char-mode):
Checkdoc fixes.
2024-07-20 02:42:08 +02:00
Paul Eggert
9f4fc66082 Work around GCC bug 58416 on 32-bit x86
* configure.ac (C_SWITCH_MATCHINE): On 32-bit x86 with GCC 4+,
append -mfpmath=sse (if SSE2 is known to work) or -fno-tree-sra
(otherwise) to work around GCC bug 58416.
* etc/NEWS: Mention this.
2024-07-19 14:23:11 -07:00
Paul Eggert
524e9d50a7 In ‘INSTALL’ put configure vars in one section
* INSTALL: Move description of CFLAGS etc. into the section headed
“Here is a complete list of the variables you may want to set”
since they are also variables one might want to set.
2024-07-19 14:23:11 -07:00
Stefan Monnier
153732e638 Merge from origin/emacs-30
a478423d19 * lisp/progmodes/peg.el (peg-syntax-classes): Typo (bug#7...
951fb93956 * lisp/transient.el (static-if): Remove duplicated defini...
0218fb2143 Adapt file-remote-p doc
34c1094e60 ; Fix typo in etc/ORG-NEWS (Bug#72186)
5916b172bd * etc/TODO: Delete item about merging Magit.
a6cab228d4 ; Fix typos
41dc28244f * doc/man/emacs.1.in: Add "No warranty" notice.
b2ac343586 ; * doc/man/emacs.1.in: Improve wording.
110b3d08d7 Improve emacs man page description of --user flag
4911f08912 Checkdoc fixes in allout-widgets.el
109b592d77 Checkdoc fixes in subr.el
4643672078 Checkdoc fixes in touch-screen.el
9889774c62 Checkdoc fixes in treesit.el

# Conflicts:
#	etc/NEWS
2024-07-19 14:31:53 -04:00
Stefan Monnier
6c96d06281 ; Merge from origin/emacs-30
The following commit was skipped:

c9d28a05d9 Avoid overflow in pgtk_is_numeric_char
2024-07-19 14:31:50 -04:00
Jim Porter
b7893e7387 Don't set exit info in Eshell if the command is being piped elsewhere
Previously, the exit info in Eshell was that of the last command that
finished, rather than the last command in a pipeline.

* lisp/eshell/esh-cmd.el (eshell-exec-lisp)
(eshell-lisp-command): Check whether the command is being piped.

* lisp/eshell/esh-proc.el (eshell-gather-process-output): Record whether
the command is being piped...
(eshell-sentinel): ... and do the right thing with that info.

* test/lisp/eshell/esh-proc-tests.el
(esh-proc-test/sigpipe-exits-process): Check the exit status to ensure
we don't report the first process's SIGPIPE exit.
2024-07-19 11:22:34 -07:00
Jim Porter
39c704e03d Split out exit code parts of 'eshell-close-handles' into a new function
* lisp/eshell/esh-cmd.el (eshell-last-command-status)
(eshell-last-command-result): Move here from esh-io.el.
(eshell-set-exit-info): New function, extracted from
'eshell-close-handles'.

* lisp/eshell/esh-io.el (eshell-close-handles): Make old calling
convention obsolete.  Update callers to use 'eshell-set-exit-info' as
needed.
2024-07-19 11:22:34 -07:00
Stefan Monnier
a478423d19 * lisp/progmodes/peg.el (peg-syntax-classes): Typo (bug#72131) 2024-07-19 14:18:29 -04:00
Philip Kaludercic
34b832fce1
* lisp/which-key.el: Bump version to 3.6.1
This is necessary to trigger a new ELPA release.
2024-07-19 19:42:44 +02:00
Mattias Engdegård
f591f47779 ; * test/lisp/net/dbus-tests.el: silence compilation warnings 2024-07-19 19:36:38 +02:00
Peder O. Klingenberg
c330b97fe2 Visualize ranking of last game when adding scores
* lisp/play/gamegrid.el (gamegrid-add-score-insecure): Move point to
the score just added, or end of buffer if the new score did not make
the list.  This makes it easier to see where the last game
ranked.  (Bug#72185)
2024-07-19 19:12:33 +02:00
Jonas Bernoulli
951fb93956
* lisp/transient.el (static-if): Remove duplicated definition.
(Bug#72182)

This should have been removed when the standalone version was merged
into Emacs.
2024-07-19 19:10:30 +02:00
Michael Albinus
0218fb2143 Adapt file-remote-p doc
* doc/lispref/files.texi (Magic File Names): Adapt file-remote-p.

* lisp/files.el (file-remote-p): Adapt docstring.
2024-07-19 18:29:49 +02:00
Stefan Kangas
34c1094e60 ; Fix typo in etc/ORG-NEWS (Bug#72186) 2024-07-19 11:17:58 +02:00
Jim Porter
99b360bb5a Allow specifying stdout/stderr separately in some Eshell commands
* lisp/eshell/eshell.el (eshell-command): Add ERROR-TARGET.
* lisp/eshell/em-script.el (eshell-execute-file): Make interactive, and
add ERROR-TARGET.

* doc/misc/eshell.texi (One-Off Commands, Scripts): Update
documentation.

* etc/NEWS: Announce this change.
2024-07-18 15:00:41 -07:00
Jim Porter
965be7bc46 ; * doc/misc/eshell.texi (Bugs and ideas): Remove now-implemented idea. 2024-07-18 12:48:31 -07:00
Jim Porter
259f4613bd Improve implementation of built-in Eshell "kill" command
* lisp/eshell/esh-proc.el (eshell/kill): Fix handling of commands like
"kill 123".  Use REMOTE when signalling PIDs in remote directories.
Signal using process objects when possible.  Report errors when failing
to signal.

* test/lisp/eshell/esh-proc-tests.el (esh-proc-test/kill/process-id)
(esh-proc-test/kill/process-object): New tests (bug#72013).
2024-07-18 12:28:33 -07:00
Jim Porter
c7a498260c Handle broken pipes in a better way in Eshell
* lisp/eshell/esh-proc.el (eshell-insertion-filter): Send SIGPIPE
delaying for Tramp and falling back to SIGTERM for MS-Windows
(bug#72117).
2024-07-18 11:10:04 -07:00
Jim Porter
1550213613 Improve handling of deferrable Eshell commands
Now, we use the 'eshell-deferrable' wrapper to wrap a form that returns
a process (or list thereof).  This improves upon the old method, which
failed to handle 'eshell-replace-command' correctly.  In that case,
Eshell would fail to unmark commands as deferrable when necessary
(e.g. for commands in pipelines).

* lisp/eshell/esh-cmd.el (eshell-deferrable-commands): Make into a
defvar.
(eshell-deferrable): New function...
(eshell-structure-basic-command): ... use it.
(eshell-trap-errors): Rename to...
(eshell-do-command): ... this, and use 'eshell-deferrable'.  Update
callers.
(eshell--unmark-deferrable): Remove.  Update callers.
(eshell-execute-pipeline): Remove 'eshell-process-identity'.
(eshell-process-identity, eshell-named-command*, eshell-lisp-command*):
Make obsolete.

* test/lisp/eshell/esh-cmd-tests.el (eshell-test-replace-command): New
function.
(esh-cmd-test/pipeline/replace-command): New test.
2024-07-18 11:10:04 -07:00
Stefan Kangas
76874df05f Fix minor code style issue in pgtkfns.c
* src/pgtkfns.c (pgtk_get_defaults_value)
(pgtk_set_defaults_value): Fix code style.
2024-07-18 14:59:41 +02:00
Stefan Kangas
87facc9e3d Avoid overflow in pgtk_is_numeric_char
* src/pgtkfns.c (PATH_MAX_LEN): New macro.
(parse_resource_key): Avoid overflow if a key is RESOURCE_KEY_MAX_LEN
long by making the array larger.
2024-07-18 14:48:56 +02:00
Stefan Kangas
d00a10333f Use strnlen to avoid unnecessary work in pgtkfns.c
* src/pgtkfns.c (pgtk_get_defaults_value, pgtk_set_defaults_value):
Factor out new function...
(pgtk_check_resource_key_length): ...to here.  Avoid unnecessary work by
using strnlen.
2024-07-18 14:48:27 +02:00
Eli Zaretskii
a90a1ed527 Minor cleanup of code in insdel.c
* src/insdel.c (del_range_2): Update *_BYTE variables _after_
updating the corresponding character values.  This follows what we
do everywhere else, and allows to put a watchpoint on, say, Z_BYTE
to check consistency between the character and byte counts.  See
bug#72165 for one situation where it is useful.
2024-07-18 12:59:28 +03:00
Stefan Kangas
5916b172bd * etc/TODO: Delete item about merging Magit.
Change requested by Jonas Bernoulli <jonas@bernoul.li>.
2024-07-18 11:47:37 +02:00
Stefan Kangas
a6cab228d4 ; Fix typos 2024-07-18 11:46:50 +02:00
Stefan Kangas
41dc28244f * doc/man/emacs.1.in: Add "No warranty" notice. 2024-07-18 10:42:59 +02:00