aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Disable -Wclobbered around exec_byte_code (bug#79610)scratch/exec-byte-codeMattias Engdegård2025-10-171-15/+13
| | | | | | | * src/bytecode.c (exec_byte_code): The old hack for working around spurious -Wclobbered warnings from GCC no longer suffices; disable the warning locally. This also makes the code slightly smaller and faster.
* ; exec_byte_code: refactor branch caseMattias Engdegård2025-10-161-14/+14
|
* exec_byte_code: use fixed registers for top and pc (bug#79610)Mattias Engdegård2025-10-161-2/+16
| | | | | | | | | | | | | GCC seems to have difficulty allocating important global interpreter variables in registers; telling it which ones to use for 'top' and 'pc' makes a big difference and seems to ease pressure enough for it to deal with other variables as well. We do it for AMD64 and ARM64. Clang doesn't seem to need these directives. It does result in -Wclobbered warnings that seem difficult to silence. * src/bytecode.c (BC_REG_TOP, BC_REG_PC): New. (exec_byte_code): Use them.
* ; exec_byte_code: don't re-use op in FETCH2Mattias Engdegård2025-10-161-1/+1
|
* exec_byte_code: reduce use of semi-global 'op' (bug#79610)Mattias Engdegård2025-10-161-56/+65
| | | | | | | | | | | * src/bytecode.c (exec_byte_code): Re-type op from int to ptrdiff_t, which avoids some useless conversions. Reduce its use by using local variables for intra-block use, and another variable (arg) where it doesn't need to be alive across instruction dispatch. We also eliminate it where performance doesn't matter by re-fetching it from the instruction stream. All this should help the register allocator.
* Return case common to all completions in try-completionSpencer Baugh2025-10-161-6/+0
| | | | | | | | | | | | | | | When completion-ignore-case is non-nil, if all completions share a common prefix ignoring case, try-completion has always returned that. Now, if all completions also share a common prefix including case, try-completion includes that common prefix in its return value (bug#79377). * lisp/minibuffer.el (completion-pcm--merge-completions): Always use return value from try-completion, which may change case. * src/minibuf.c (Ftry_completion): Return the common prefix which changes case. * test/lisp/minibuffer-tests.el (completion-pcm-bug4219) (completion-substring-test-5): New tests.
* Fix MS-Windows tray notifications from different Emacs framesEli Zaretskii2025-10-111-10/+22
| | | | | | | | | | | | | | | | | * src/w32fns.c (EMACS_TRAY_NOTIFICATION_ID_INIT): Rename from EMACS_TRAY_NOTIFICATION_ID; all users adjusted. (last_tray_notification_id): New static variable. (add_tray_notification): Advance 'last_tray_notification_id' for each new notification; wrap around to the fixed initial value when reached the maximum. This allows Lisp programs track notifications and remove them from the same frame from which they were created. (Fw32_notification_notify, Fw32_notification_close): Doc fixes. * doc/lispref/os.texi (Desktop Notifications): Update the documentation of 'w32-notification-notify' and 'w32-notification-close'. Bug#79400
* Merge from origin/emacs-30Eli Zaretskii2025-10-111-2/+2
|\ | | | | | | | | | | | | | | 1895ba3ba3b ; Document %i format 85db0ac0d6e ; * doc/lispref/nonascii.texi (Explicit Encoding): Fix a ... c119a3600ed ; * doc/lispref/tips.texi (Documentation Tips): Document ... Also fix trailing whitespace in test files.
| * ; Document %i formatEli Zaretskii2025-10-111-2/+2
| | | | | | | | | | | | * src/editfns.c (Fformat): Doc fix. * doc/lispref/strings.texi (Formatting Strings): Document %i.
* | Fix last changeEli Zaretskii2025-10-111-0/+4
| | | | | | | | | | | | | | | | | | | | At least on MS-Windows, the last change caused the process-tests/fd-setsize-no-crash/make-process test to hang. * src/process.c (wait_reading_process_output) [WINDOWSNT]: Do not stop monitoring the process descriptor when zero bytes are read. The EOF indication from subprocesses on MS-Windows is detected via an error condition (see w32.c), while zero-size reads are not to be taken as such. (Bug#79436)
* | Stop monitoring fds after receiving EOFSpencer Baugh2025-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | When a subprocess closes its stdout/stderr pipe, that causes pselect to always indicate that fd is readable, and read to always return with EOF on that fd. Therefore when we receive an EOF we need to stop monitoring the fd. Otherwise Emacs will spin at 100% CPU, repeatedly reading that same EOF off the fd. * src/process.c (wait_reading_process_output): When 'read_process_output' returns EOF indication, stop monitoring the descriptor. (Bug#79436)
* | Allow creating a pipe process without a bufferSpencer Baugh2025-10-111-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously, even passing :buffer nil to make-pipe-process would create a buffer. Now, if you explicitly call (make-pipe-process :buffer nil), it will create a pipe process without a buffer, just like all the other process creation functions. * src/process.c (Fmake_pipe_process): Check for explicit :buffer nil and don't make a buffer. (bug#79596) * doc/lispref/processes.texi (Asynchronous Processes): Update. * test/src/process-tests.el (process-test-make-pipe-process-no-buffer): Add test.
* | * src/pdumper.c (dump_queue_dequeue): Avoid -Wgnu-folding-constant.Sahil Kang2025-10-111-1/+2
| | | | | | | | | | Fixes bug#79581 Copyright-paperwork-exempt: yes
* | * src/w32console.c: Fix last change (bug#79298).Eli Zaretskii2025-10-091-25/+10
| |
* | Fix text-terminal output with UTF-8 encoding on MS-WindowsEli Zaretskii2025-10-091-8/+30
| | | | | | | | | | | | | | * src/w32console.c (w32con_write_glyphs) (w32con_write_glyphs_with_face): Support UTF-8 encoded text better, by counting characters and using display columns, not bytes, to move the cursor after writing the text. (Bug#79298)
* | Run buffer-local window change functions in their buffers nowMartin Rudalics2025-10-061-50/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The buffer-local-versions of 'window-buffer-change-functions', 'window-size-change-functions', 'window-selection-change-functions' and 'window-state-change-functions' are now run with the respective buffer temporarily current. Also, the local version of 'window-buffer-change-functions' is run for the buffer removed from the window too. * src/window.c (run_window_change_functions_locally) (run_window_change_functions_globally): New functions replacing 'run_window_change_functions_1'. (run_window_change_functions): Run the buffer local versions of these hooks in their respective buffers. Run 'window-buffer-change-functions' for the buffer removed from the window too. (Vwindow_buffer_change_functions, Vwindow_size_change_functions) (Vwindow_selection_change_functions) (Vwindow_state_change_functions): Mention that the buffer-local versions are run with their buffer temporarily current. * doc/lispref/windows.texi (Window Hooks): Mention that buffer-local-versions of window change functions are run with their buffer temporarily current. Also say that 'window-buffer-change-functions' will be run for removed buffer too. * etc/NEWS: Advertise changes for the buffer-local versions of window change functions.
* | Fix 'restart-emacs' on MS-WindowsEli Zaretskii2025-10-021-0/+3
| | | | | | | | | | | | * src/w32.c (w32_reexec_emacs): Reset undocumented bits in STARTUPINFO flags. Suggested by yhr0x43 <yhr0x43@gmail.com>. (Bug#79554)
* | Use up-to-date time in wait_reading_process_outputPaul Eggert2025-09-271-15/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Prefer coarse timestamps when using X syncPaul Eggert2025-09-273-9/+23
| | | | | | | | | | | | | | | | 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.
* | Make native lisp code reflect EQ C implementationAndrea Corallo2025-09-221-51/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/comp.c (ABI_VERSION): Bump new version (comp_t): add 'eq'. (helper_link_table): add 'slow_eq'. (emit_slow_eq): New function. (emit_EQ): Rework to reflect EQ implementation. (declare_runtime_imported_funcs): Import 'slow_eq'. (Fcomp__init_ctxt): Register emitter 'emit_eq' for op code Qeq. This and the previous 2 commits increase elisp-benchmarks performance by 3.6% on my test machine. Also a (small) reduction in eln size comes with it.
* | * Make sure the compiler optimizes for symbols_with_pos_enabled 0 in EQAndrea Corallo2025-09-221-1/+1
| | | | | | | | * src/lisp.h (EQ): Make use '__builtin_expect'.
* | Change EQ to move slow code path into a separate functionPip Cet2025-09-222-4/+17
| | | | | | | | | | * src/data.c (slow_eq): New function. * src/lisp.h (EQ): Call it.
* | Improve documentation of 'accept-process-output'Eli Zaretskii2025-09-201-2/+8
| | | | | | | | | | | | | | | | | | * doc/lispref/processes.texi (Accepting Output): * src/process.c (Faccept_process_output): Document better the meaning of the timeout of 'accept-process-output' a,d the fact that it doesn't always return as soon as some output is available. See https://lists.gnu.org/archive/html/emacs-devel/2025-08/msg00750.html for more details.
* | Fix reference leak in displaying successive dashes of distinct styles on AndroidPo Lu2025-09-201-2/+3
| | | | | | | | | | | | * src/android.c (android_set_dashes): Always release local reference to dash array even when it was returned by GetObjectField.
* | ; * src/bytecode.c (exec_byte_code): Revert gratuituous style changeMattias Engdegård2025-09-191-1/+1
| |
* | ; * src/bytecode.c (exec_byte_code): Fix coding style.Po Lu2025-09-191-1/+1
| |
* | * src/bytecode.c (exec_byte_code): Better quitcounter reset value.Mattias Engdegård2025-09-181-1/+3
| | | | | | | | | | | | This value forces a quit check at the next backward branch, to avoid rare situations being hard to interrupt. Suggested by Pip Cet.
* | Don't save quitcounter across longjmp in exec_byte_codeMattias Engdegård2025-09-181-3/+1
| | | | | | | | | | | | * src/bytecode.c (exec_byte_code): Reset quitcounter to 1 after longjmp; the exact value isn't important. This may reduce register pressure a tiny bit or at least remove a useless stack slot.
* | Turn some checking macros into functions in the GC marker codeMattias Engdegård2025-09-171-81/+80
| | | | | | | | | | | | | | | | | | | | | | This rids us of a bunch of unhygienic macros with free variables and makes the marking code actually readable again. Even better, it is all processed by the compiler even when the checks are disabled. * src/alloc.c (CHECK_ALLOCATED, CHECK_LIVE, CHECK_ALLOCATED_AND_LIVE) (CHECK_ALLOCATED_AND_LIVE_SYMBOL): Transform macros into... (check_live, check_allocated_and_live, check_allocated_and_live_symbol) (check_allocated_and_live_vectorlike): ...functions. Callers adapted.
* | ; * src/lisp.h (enum handlertype): Comment accuracy.Mattias Engdegård2025-09-171-1/+1
| |
* | Merge from origin/emacs-30Eli Zaretskii2025-09-131-3/+3
|\ \ | |/ | | | | | | | | 47454566772 ; * lisp/dired-x.el (dired-find-subdir): Doc fix (bug#794... 0832e5fec56 ; * lisp/vc/vc.el (vc-print-root-log): Improve docstring ... 2fafcdbf6ac ; Minor copyedits in src/editfns.c
| * ; Minor copyedits in src/editfns.cEli Zaretskii2025-09-091-3/+3
| | | | | | | | | | | | * src/editfns.c (Fbuffer_string, Freplace_buffer_contents) (styled_format): Avoid using non-ASCII characters in doc strings and comments.
* | Allow disabling of reloading files on doc read failureSpencer Baugh2025-09-131-2/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | Reloading a byte-compiled file when we fail to fetch some docstring in it is not guaranteed to work and can cause subtle bugs which are worse than simply not having a docstring. Add 'documentation-dynamic-reload' variable to allow disabling this behavior. See the discussion in https://lists.gnu.org/archive/html/emacs-devel/2025-08/msg00304.html for more details. * src/doc.c (syms_of_doc): Add 'documentation-dynamic-reload'. (Fdocumentation, Fdocumentation_property): Check value of 'documentation-dynamic-reload'.
* | Ignore keymaps at point for positions outside the bufferSpencer Baugh2025-09-091-22/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct a few edge cases where we used the keymaps at point when looking up keymaps for an event position which is outside the current buffer. Namely: - Clicking on a part of the mode line which is after the end of mode-line-format produces an event with non-nil posn-area but nil posn-string. - Even if posn-string doesn't have a local keymap, we should still ignore the keymaps at point if posn-string is non-nil. * src/keymap.c (Fcurrent_active_maps): Ignore keymaps at point for more positions outside the buffer. (bug#76620)
* | Allow use of \N{...} earlier to help fix bug#79353Stefan Monnier2025-09-091-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | * lisp/emacs-lisp/shorthands.el (hack-read-symbol-shorthands): Avoid inf-loops during bootstrap. E.g. this can occur while loading `uni-special-lowercase.el` where `hack-local-variables--find-variables` uses `downcase` which triggers loading `uni-special-lowercase.el`, ... * lisp/international/mule-cmds.el (ucs-names): Explicitly require `charprop`. * src/Makefile.in ($(lispsource)/loaddefs.el): Depend on `charprop`.
* | Harmonise doc strings for {re-,posix-,}search-{forward,backward}Mattias Engdegård2025-09-071-61/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The doc strings for re-search-forward and re-search-backward have been improved (bug#25193, bug#31584) but the corresponding posix- and non-regexp search functions still have the original text, despite describing the exact same mechanism. There is no reason for them to differ, so we make them all use the updated version which also is more readable. Any future doc string improvements should be made to all of them in the same way for consistency. * src/search.c (Fsearch_backward, Fsearch_forward) (Fposix_search_backward, Fposix_search_forward): Use text from Fre_search_forward and Fre_search_backward.
* | ; * src/process.c (deactivate_process): Fix last change.Eli Zaretskii2025-09-061-2/+5
| |
* | Avoid assertion violations when starting client network processEli Zaretskii2025-09-061-1/+5
| | | | | | | | | | * src/process.c (deactivate_process): Clear the callback info of descriptors we are closing. (Bug#79367)
* | (redisplay_internal): Fix `follow-mode` (bug#79306)Stefan Monnier2025-09-051-2/+2
| | | | | | | | | | * src/xdisp.c (redisplay_internal): Don't increment `redisplay_counter` if we ail out before starting an actual redisplay.
* | Fix locking to threads of the client network processEli Zaretskii2025-09-051-0/+15
| | | | | | | | | | | | * src/process.c (server_accept_connection): Make the client process be locked to the same thread as the parent server process, or unlocked if the server process was unlocked. (Bug#79367)
* | Fix crash when the same XI device appears in multiple hierarchy eventsPo Lu2025-09-041-4/+4
| | | | | | | | | | * src/xterm.c (xi_disable_devices): Move `out' label into the outermost loop. (bug#79343)
* | ; * src/data.c (Fash): GCC argument signedness quibbleMattias Engdegård2025-09-011-1/+1
| |
* | * src/data.c (Fash): Speed up when argument and result are fixnums.Mattias Engdegård2025-09-011-9/+17
| |
* | bug#79241: Fix incorrect handling of overlays in `vertical-motion'Sergio Pastor Pérez2025-08-301-0/+3
| | | | | | | | | | | | | | | | | | * src/indent.c (vertical-motion): If iterator is inside an overlay, reset it to the beginning of line before trying to reach goal column. This prevents point from being stuck at the beginning of overlay strings during upward motions. Copyright-paperwork-exempt: yes
* | ; Fix formattingRobert Pluim2025-08-271-3/+3
| | | | | | | | | | * src/process.c (clear_fd_callback_data, delete_write_fd, delete_keyboard_wait_descriptor): Space before paren.
* | Fix last change in 'next_element_from_display_vector'Eli Zaretskii2025-08-261-2/+8
| | | | | | | | | | | | | | * src/xdisp.c (next_element_from_display_vector): Only switch the iterator from unibyte to multibyte, never in the other direction, and not if the original character came from a unibyte buffer. (Bug#79317)
* | Fix use of display-table for mode-line displayEli Zaretskii2025-08-251-0/+4
| | | | | | | | | | | | * src/xdisp.c (next_element_from_display_vector): Fix handling non-ASCII characters in display-table cells corresponding to ASCII characters. (Bug#79311)
* | Fix assertion violations caused by recent redisplay changesEli Zaretskii2025-08-251-2/+0
| | | | | | | | | | * src/xdisp.c (push_it): Don't rest the string_from_prefix_prop_p flag. (Bug#79304)
* | Attempt to fix assertion violations in bug#79304Eli Zaretskii2025-08-251-21/+8
| | | | | | | | | | | | | | | | | | | | The following changes make the changes for bug#79275 less radical, closer to their previous shape, while still fixing that bug. * src/xdisp.c (push_prefix_prop, get_it_property): Restore original code that determined the object and position on it. (get_line_prefix_it_property): Take FROM_BUFFER from the actual object of the prefix property.
* | Disallow string data resizing (bug#79784)Mattias Engdegård2025-08-244-87/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only allow string mutation that is certain not to require string data to be resized and reallocated: writing bytes into a unibyte string, and changing ASCII to ASCII in a multibyte string. This ensures that mutation will never transform a unibyte string to multibyte, that the size of a string in bytes never changes, and that the byte offsets of characters remain the same. Most importantly, it removes a long-standing obstacle to reform of string representation and allow for future performance improvements. * src/data.c (Faset): Disallow resizing string mutation. * src/fns.c (clear_string_char_byte_cache): * src/alloc.c (resize_string_data): Remove. * test/src/data-tests.el (data-aset-string): New test. * test/lisp/subr-tests.el (subr--subst-char-in-string): Skip error cases. * test/src/alloc-tests.el (aset-nbytes-change): Remove test that is no longer relevant. * doc/lispref/strings.texi (Modifying Strings): * doc/lispref/sequences.texi (Array Functions): * doc/lispref/text.texi (Substitution): Update manual. * etc/NEWS: Announce.