aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Prefer static_assert to verifyscratch/static_assertStefan Kangas2024-07-2432-120/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although static_assert is C11-specific, and Emacs remains on C99, it has been backported to older compilers by Gnulib. Gnulib has already changed to prefer static_assert, and we can do the same. * lib-src/asset-directory-tool.c (main_2): * src/alloc.c (BLOCK_ALIGN, aligned_alloc, lisp_align_malloc) (vectorlike_nbytes, allocate_pseudovector): * src/android.c (android_globalize_reference, android_set_dashes): * src/android.h: * src/androidfont.c (androidfont_draw, androidfont_text_extents): * src/androidvfs.c: * src/bidi.c (BIDI_CACHE_MAX_ELTS_PER_SLOT) (bidi_find_bracket_pairs): * src/buffer.c (init_buffer_once): * src/casefiddle.c (do_casify_multibyte_string): * src/dispnew.c (scrolling_window, scrolling): * src/editfns.c (styled_format): * src/emacs-module.c (module_extract_big_integer): * src/fileio.c (Fdo_auto_save): * src/fns.c (next_almost_prime, hash_string): * src/fringe.c (init_fringe): * src/keyboard.h (kbd_buffer_store_event_hold): * src/keymap.c: * src/lisp.h (u, memclear, reduce_emacs_uint_to_hash_hash) (modiff_incr): * src/lread.c (skip_lazy_string): * src/pdumper.c (dump_bignum, Fdump_emacs_portable) (dump_do_dump_relocation, pdumper_load): * src/process.c (make_process, Fmake_process) (connect_network_socket): * src/regex-emacs.c: * src/sort.c (tim_sort): * src/sysdep.c (init_random, SSIZE_MAX): * src/thread.c: * src/timefns.c (trillion_factor): * src/unexelf.c: * src/xterm.c (x_send_scroll_bar_event): Prefer static_assert to Gnulib verify. Remove import of verify.h, except when used for other reasons.
* * lisp/isearch.el: Exit Isearch after deleting the frame (bug#41338).Juri Linkov2024-07-231-0/+2
| | | | | (isearch-mode): Add 'isearch-done' to 'delete-frame-functions'. (isearch-done): Remove 'isearch-done' from 'delete-frame-functions'.
* * lisp/isearch.el: Preserve original value of overriding-terminal-local-map.Juri Linkov2024-07-231-5/+7
| | | | | | | | | | | (isearch--saved-local-map): New variable (bug#72229). (isearch-mode): Set isearch--saved-local-map to overriding-terminal-local-map. (isearch-done): Set overriding-terminal-local-map back to isearch--saved-local-map. (isearch-mouse-2): Let-bind overriding-terminal-local-map to isearch--saved-local-map. (isearch-done): Move comment intended to be docstring to docstring.
* Better reproduce mouse event coalescence during touch event translationPo Lu2024-07-231-2/+20
| | | | | | * lisp/touch-screen.el (touch-screen-handle-touch): Save the confines of the current mouse glyph before initiating simple translation.
* Don't highlight matches in dired query-replace commandsVisuwesh2024-07-231-7/+10
| | | | | | | | * lisp/dired-aux.el (dired-do-query-replace-regexp) (dired-do-replace-regexp-as-diff) (dired-do-find-regexp-and-replace): Turn off lazy highlighting when reading the regexp from the user to avoid highlighting regexp matches in the dired buffer. (bug#72147)
* * src/comp.c (obj_to_reloc): Use eassume.Stefan Kangas2024-07-231-1/+1
|
* Use SBYTES instead of strlen in treesit.cStefan Kangas2024-07-221-8/+4
| | | | | | * src/treesit.c (treesit_ensure_query_compiled) (Ftreesit_node_child_by_field_name, treesit_initialize_query): Use SBYTES instead of strlen.
* Prohibit unbinding of built-in variablesPo Lu2024-07-222-24/+32
| | | | | | | | * src/data.c (set_internal): Signal error if a BLV with a redirect or a forwarded symbol is being unbound. * test/src/data-tests.el (binding-test-makunbound-built-in): New test.
* Fix segfault when deleting tree-sitter query (bug#72238)Yuan Fu2024-07-211-2/+4
| | | | | * src/treesit.c (treesit_delete_query): Only delete query and cursor when they are non-NULL.
* Add link to commit compatibility function handlesTheodor Thornhill2024-07-211-1/+1
| | | | | * lisp/progmodes/typescript-ts-mode.el (tsx-ts-mode--indent-compatibility-b893426): Add link to GitHub.
* Improve one test (bug#71998)Theodor Thornhill2024-07-211-0/+18
| | | | | * test/lisp/progmodes/typescript-ts-mode-resources/indent.erts (Name): Add pre-indent state.
* ; Minor whitespace fixTheodor Thornhill2024-07-211-1/+1
| | | | | | * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--font-lock-settings): Tabs to spaces.
* Signal error on wrong typescript dialectTheodor Thornhill2024-07-211-0/+13
| | | | | | | | | | | | | | | | | * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode-wrong-dialect-error): New error. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--check-dialect): Helper function. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--indent-rules, tsx-ts-mode--font-lock-compatibility-bb1f97b, tsx-ts-mode--font-lock-compatibility-function-expression, tsx-ts-mode--font-lock-compatibility-function-expression, typescript-ts-mode--font-lock-settings): Use the new helper.
* ; Fix typoTheodor Thornhill2024-07-211-1/+1
| | | | * lisp/treesit.el (treesit-ready-p): Minor typo fix.
* * lisp/progmodes/go-ts-mode.el (go-ts-mode-build-tags): Fix :version.Michael Albinus2024-07-211-1/+1
|
* Add commands to run unit tests in 'go-ts-mode'Ankit R Gadiya2024-07-212-1/+106
| | | | | | | | | | | | | | | * 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)
* ; Fix recent changes in pdumper.cEli Zaretskii2024-07-211-4/+2
| | | | | * src/pdumper.c (dump_treesit_compiled_query, dump_vectorlike): Minor copyedits.
* Fix bool vector length overflowPaul Eggert2024-07-203-10/+28
| | | | | | | | | | | | | | | | | * 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.
* Change list-length intptr_t to ptrdiff_tPaul Eggert2024-07-201-3/+3
| | | | | | | | | * 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.
* ; * lisp/eshell/esh-io.el (eshell-close-handles): Fix version annotation.Jim Porter2024-07-201-1/+1
|
* Support dumping tree-sitter query (bug#69952)Yuan Fu2024-07-202-8/+20
| | | | | | | | | | | | | 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.
* Support compiled queries in pdump by dumping source (bug#69952)Sergey Vinokurov2024-07-201-1/+22
| | | | | * src/pdumper.c (dump_vectorlike): Dump compiled queries. * src/pdumper.c (dump_treesit_compiled_query): New function.
* SAFE_ALLOCA fixesPaul Eggert2024-07-209-51/+48
| | | | | | | | | | | | | | | | | | | | | * 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.
* ; Fix typo in xfont.cPo Lu2024-07-201-2/+2
| | | | * src/xfont.c (xfont_list): Subtract 9 from name, not 10 + 1.
* Avoid magic values in xfont_listStefan Kangas2024-07-201-2/+2
| | | | * src/xfont.c (xfont_list): Avoid magic values.
* Merge from origin/emacs-30Eli Zaretskii2024-07-2030-106/+120
|\ | | | | | | | | | | | | | | | | | | | | 816c53c2d9d Fix bibtex validation for non-file buffers ab7c40ea52a Fix Imenu in 'emacs-news-view-mode' ea30ffc52b3 ; * doc/misc/gnus.texi (Agent Caveats): Fix doc 07b1a36f78c ; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to ... 96f1db89ee7 Avoid errors in 'icomplete-vertical-mode' 55110d1fda2 Document GNU ELPA copyright in tips.texi 079e5a03156 Improve register-use-preview docstring e4760109ac8 Miscellaneous checkdoc fixes
| * Fix bibtex validation for non-file buffersLiu Hui2024-07-201-3/+6
| | | | | | | | | | * lisp/textmodes/bibtex.el (bibtex-validate): Use buffer name to show errors in non-file buffers. (Bug#71946)
| * Fix Imenu in 'emacs-news-view-mode'Eli Zaretskii2024-07-201-2/+11
| | | | | | | | | | | | * lisp/textmodes/emacs-news-mode.el (emacs-news-view-mode): Make it derived from emacs-news-mode. Add useful key bindings. (Bug#72080)
| * ; * doc/misc/gnus.texi (Agent Caveats): Fix docJames Thomas2024-07-201-1/+2
| | | | | | | | | | | | * doc/misc/gnus.texi (Agent Caveats): Change doc due to commit 2020-10-16 "Add a new variable to control Gnus Agent caching" (41d220dc6085, bug#43356). (Bug#72134)
| * ; * src/sqlite.c (Fsqlite_load_extension): Add "vec0" to allowed extensions.Eli Zaretskii2024-07-201-0/+1
| |
| * Avoid errors in 'icomplete-vertical-mode'Eli Zaretskii2024-07-201-18/+20
| | | | | | | | | | | | * lisp/minibuffer.el (completion--hilit-from-re): Avoid signaling an error if STRING does not match REGEXP. Fix doc string and indentation. (Bug#72176)
| * Document GNU ELPA copyright in tips.texiStefan Kangas2024-07-201-5/+5
| | | | | | | | | | * doc/lispref/tips.texi (Library Headers): Document that GNU ELPA packages should have their copyright assigned to the FSF.
| * Improve register-use-preview docstringStefan Kangas2024-07-201-10/+13
| | | | | | | | * lisp/register.el (register-use-preview): Improve docstring.
| * Miscellaneous checkdoc fixesStefan Kangas2024-07-2024-69/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Avoid accessing uninitialized bool_vector wordsPaul Eggert2024-07-203-22/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix setup of fonts for 'han' script.Eli Zaretskii2024-07-201-1/+3
| | | | | | | | | | * lisp/international/fontset.el (script-representative-chars): Add more CJK representative characters to 'han' script. (Bug#72188)
* | Fix compilation on builds with native rectangle structuresPo Lu2024-07-202-5/+11
| | | | | | | | | | | | | | | | | | | | * 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>.
* | Respect mouse-fine-graned-tracking in touch screen simple translationPo Lu2024-07-202-11/+88
| | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | Work around GCC bug 58416 on 32-bit x86Paul Eggert2024-07-192-0/+51
| | | | | | | | | | | | | | * 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.
* | In ‘INSTALL’ put configure vars in one sectionPaul Eggert2024-07-191-8/+18
| | | | | | | | | | | | * 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.
* | Merge from origin/emacs-30Stefan Monnier2024-07-1983-301/+297
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a478423d19f * lisp/progmodes/peg.el (peg-syntax-classes): Typo (bug#7... 951fb93956d * lisp/transient.el (static-if): Remove duplicated defini... 0218fb21437 Adapt file-remote-p doc 34c1094e607 ; Fix typo in etc/ORG-NEWS (Bug#72186) 5916b172bdc * etc/TODO: Delete item about merging Magit. a6cab228d4d ; Fix typos 41dc28244f2 * doc/man/emacs.1.in: Add "No warranty" notice. b2ac3435867 ; * doc/man/emacs.1.in: Improve wording. 110b3d08d73 Improve emacs man page description of --user flag 4911f08912a Checkdoc fixes in allout-widgets.el 109b592d77b Checkdoc fixes in subr.el 46436720787 Checkdoc fixes in touch-screen.el 9889774c62e Checkdoc fixes in treesit.el # Conflicts: # etc/NEWS
| * * lisp/progmodes/peg.el (peg-syntax-classes): Typo (bug#72131)Stefan Monnier2024-07-191-1/+1
| |
| * * lisp/transient.el (static-if): Remove duplicated definition.Jonas Bernoulli2024-07-191-11/+0
| | | | | | | | | | | | | | (Bug#72182) This should have been removed when the standalone version was merged into Emacs.
| * Adapt file-remote-p docMichael Albinus2024-07-192-7/+20
| | | | | | | | | | | | * doc/lispref/files.texi (Magic File Names): Adapt file-remote-p. * lisp/files.el (file-remote-p): Adapt docstring.
| * ; Fix typo in etc/ORG-NEWS (Bug#72186)Stefan Kangas2024-07-191-1/+1
| |
| * * etc/TODO: Delete item about merging Magit.Stefan Kangas2024-07-181-5/+0
| | | | | | | | Change requested by Jonas Bernoulli <jonas@bernoul.li>.
| * ; Fix typosStefan Kangas2024-07-1874-256/+250
| |
| * * doc/man/emacs.1.in: Add "No warranty" notice.Stefan Kangas2024-07-181-0/+2
| |
| * ; * doc/man/emacs.1.in: Improve wording.Stefan Kangas2024-07-181-1/+1
| |
| * Improve emacs man page description of --user flagStefan Kangas2024-07-181-3/+3
| | | | | | | | | | * doc/man/emacs.1.in: Improve --user flag description. (Bug#72169)