aboutsummaryrefslogtreecommitdiffstats
path: root/src (follow)
Commit message (Collapse)AuthorAgeFilesLines
* * src/term.c (append_glyph): Fix wide character handling in margins columns.feature/margin-columnsJuri Linkov2025-12-311-4/+4
| | | | | Use 'it->pixel_width' for 'it->margin_column' and 'nglyphs'. Also fix 'glyph->padding_p' (bug#80025).
* Make variables 'left-margin-columns' and 'right-margin-columns' buffer-localJuri Linkov2025-12-301-6/+7
| | | | | | * src/xdisp.c (handle_single_display_spec): Use FIXNATP for margin column. Also use 'Vleft_margin_columns' instead of 'Fsymbol_value' (bug#80025). (left-margin-columns, right-margin-columns): Use Fmake_variable_buffer_local.
* Fix term.c:append_glyph for wide character margin column indicatorsJuri Linkov2025-12-301-47/+30
| | | | | | * src/term.c (append_glyph): Add 'handled_column' variable and use it on existing code instead of immediately returning after adding margin column glyph (bug#80025).
* Support multi-character margin indicators (bug#80025)Juri Linkov2025-12-292-6/+9
| | | | | | * src/term.c (append_glyph): * src/xdisp.c (append_glyph, produce_image_glyph): Increment it->margin_column to handle multi-char margin indicators.
* Add new variables 'left-margin-columns' and 'right-margin-columns' (bug#80025)Juri Linkov2025-12-291-5/+45
| | | | | | | | | | | | | | | | | | | | | | | * src/xdisp.c (left-margin-columns, right-margin-columns): New variables. (handle_single_display_spec): Find the column number that corresponds to the position of the column symbol in these variables. * lisp/outline.el (outline--create-button-icons): Add the symbol 'outline' to margin column spec. (outline-minor-mode): Add/remove the symbol 'outline' to/from 'left-margin-columns' and 'right-margin-columns'. * lisp/progmodes/flymake.el (flymake--bs-display): Add the symbol 'flymake' to margin column spec. (flymake--restore-margins): Remove the symbol 'outline' from 'left-margin-columns' and 'right-margin-columns'. (flymake--resize-margins): Add the symbol 'outline' to 'left-margin-columns' and 'right-margin-columns'. * lisp/progmodes/hideshow.el (hs--make-indicators-overlays): Add the symbol 'hideshow' to margin column spec. (hs-minor-mode): Add/remove the symbol 'outline' to/from 'left-margin-columns'.
* Add the same margin-column handling for term and image glyphs (bug#80025)Juri Linkov2025-12-222-9/+149
| | | | | | | | * src/term.c (append_glyph): * src/xdisp.c (produce_image_glyph): Copy the margin-column random-access indexing with space-padding from 'append_glyph' in xdisp.c. Also copy code from the end of these functions before return after handling the margin column.
* Initial implementation of column-based margin indicators (bug#80025)Juri Linkov2025-12-212-7/+79
| | | | | | | | | | * src/dispextern.h (it): Add 'margin_column' field. * src/xdisp.c (handle_single_display_spec): Parse margin column specification '(margin left-margin COLUMN)' and set the column to 'it->margin_column'. (append_glyph): Support random-access indexing of margin column, padding with spaces when the required column is beyond the used area.
* ; Avoid compilation warnings in xwidget.c on macOSEli Zaretskii2025-12-211-10/+9
| | | | | * src/xwidget.c (Fxwidget_perform_lispy_event): Avoid compiler warnings about set but not used variables. (Bug#80044)
* Improve handling of non-ASCII characters in 'transpose-regions'Jens Schmidt2025-12-201-62/+91
| | | | | | | | | | | * src/editfns.c (Ftranspose_regions): Separate code related to character semantics from that related to byte semantics and in that way leverage optimizations for regions of equal length with respect to both semantics. Move and update comments dating back to the initial implementation. * test/src/editfns-tests.el (editfns-tests--transpose-regions-tests) (editfns-tests--transpose-regions-markups) (editfns-tests--transpose-regions): New test and accompanying variables.
* Fix byte-vs-char length issue in 'transpose-regions'Jens Schmidt2025-12-201-7/+9
| | | | | | * src/editfns.c (Ftranspose_regions): Calculate length of range between regions both in units of bytes and characters and use these values as appropriate.
* Don't change visibility of tty root frames (Bug#80032)Martin Rudalics2025-12-201-18/+12
| | | | | | * src/frame.c (Fmake_frame_visible, Fmake_frame_invisible): * doc/lispref/frames.texi (Visibility of Frames): Don't change visibility of tty root frames. (Bug#80032)
* Revert to simpler (and we hope faster) TAGGEDPPaul Eggert2025-12-191-8/+2
| | | | | | | | | | | | | | | | | Suggested by Mattias Engdegård (bug#80021#17). * src/lisp.h (lisp_h_FIXNUMP, lisp_h_TAGGEDP): Go back to the simpler (X&7) == TAG approach for checking object tags. This reverses my commit ccdb08ef4ed8f96e79aa06cf5e806c9c487d58ad “Improve performance of CONSP, FIXNUMP, etc.” dated 2018-08-25 13:39:18 -0700, though it keeps the TAGGEDP function the older commit introduced. Although the older commit improved performance on its circa 2010 platform, when I ran today’s ‘make -C lisp compile-always’ benchmark on Ubuntu 25.10 which uses gcc (Ubuntu 15.2.0-4ubuntu4) on an circa-2021 Intel Xeon W-1350, this patch makes the ‘make -C lisp compile-always’ benchmark 3.1% faster. Although the patch unfortunately also makes the Emacs text segment 0.6% larger, in this case speed and simplicity beat text size in importance.
* Don't make tty child frames visible when selected (bug#80020)Gerd Möllmann2025-12-191-10/+3
| | | | | | * src/frame.c (do_switch_frame): Don't change visibility of tty child frames. (Fraise_frame): Doc string fix.
* Remove no-longer needed MALLOC_0_IS_NONNULL macro.Paul Eggert2025-12-091-2/+0
| | | | | * src/conf_post.h (MALLOC_0_IS_NONNULL): Remove. Gnulib no longer needs this.
* Port back to GTK2Paul Eggert2025-12-092-2/+2
| | | | | | | Problem reported by Sven Joachim in: https://lists.gnu.org/r/emacs-devel/2025-12/msg00225.html * src/xterm.c (xi_frame_selected_for): Also define if !(defined USE_GTK && defined HAVE_GTK3).
* ; Fix confusing comment in xmenu.c.Paul Eggert2025-12-091-1/+1
|
* ; Fix a typo in xterm.[ch].Eli Zaretskii2025-12-092-2/+2
|
* Pacify -Wunused-function re get_conversion_fieldPaul Eggert2025-12-082-8/+3
| | | | | * src/textconv.c (get_conversion_field): Define only if HAVE_ANDROID, since it is unused on non-Android.
* ; * src/keyboard.c (make_lispy_event): Remove unused variable.Po Lu2025-12-091-1/+1
|
* Fix builds without toolkit menu barsPo Lu2025-12-092-4/+3
| | | | | | | | * src/keyboard.c (make_lispy_event): Call x_y_to_column_row when building internal menu bar events. * src/xdisp.c (x_y_to_column_row): Provide DX and DY parameters to x_y_to_column_row.
* Fix xmenu.c USE_X_TOOLKIT duplicationPaul Eggert2025-12-081-2/+2
| | | | | | * src/xmenu.c (Fx_menu_bar_open_internal): Don’t say ‘#ifdef USE_X_TOOLKIT’ inside an #if where it is already known that USE_X_TOOLKIT is defined.
* Fix some C symbol extern visibilityPaul Eggert2025-12-0825-162/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make some C symbols static if they don’t need to be extern. Also, remove a couple of functions that were discovered to be unused as a result of this process, and mark two extern functions intended to be usable from GDB. * src/buffer.c (previous_overlay_change): * src/composite.c (composition_lisp_table): * src/fileio.c (file_name_directory): * src/frame.c (check_tty): * src/insdel.c (adjust_markers_for_insert): * src/keyboard.c (unread_switch_frame, read_char) (requeued_events_pending_p): * src/sysdep.c (renameat_noreplace) [!HAVE_ANDROID]: * src/textconv.c (get_conversion_field) [!HAVE_ANDROID]: * src/treesit.c (TREESIT_BOB_LINECOL, TREESIT_TS_POINT_1_0) (treesit_buf_tracks_linecol_p, make_treesit_parser) (make_treesit_node): * src/xdisp.c (x_y_to_hpos_vpos): * src/xfaces.c (load_color) [!MSDOS]: * src/xfns.c (x_real_pos_and_offsets): * src/xterm.c (x_dnd_do_unsupported_drop): Now static. Move up if necessary. * src/coding.c (utf8_string_p): * src/keyboard.c (detect_input_pending_ignore_squeezables): Remove; unused. * src/frame.c (gui_set_alpha): * src/textconv.c (start_batch_edit, end_batch_edit, commit_text) (finish_composing_text, set_composing_text) (set_composing_region, textconv_set_point_and_mark) (delete_surrounding_text, request_point_update) (textconv_barrier, replace_text, get_extracted_text) (get_surrounding_text): * src/xdisp.c (gui_union_rectangles): * src/xterm.c (xi_frame_selected_for): Define only if needed. * src/treesit.c (treesit_debug_print_parser_list) (treesit_debug_print_linecol): Declare EXTERNALLY_VISIBLE. * src/xdisp.c (x_y_to_column_row): New function, defined only if needed. All external callers to x_y_to_hpos_vpos changed.
* New 'R' code letter for 'interactive' formsSean Whitton2025-12-081-7/+23
| | | | | | | | | | | | | | | | | | | * src/callint.c (callint_argfuns): Add use-region-beginning and use-region-end. (syms_of_callint): Protect use-region-beginning and use-region-end. Add DEFSYM for Quse_region_p. (Fcall_interactively): New 'R' code letter. * lisp/textmodes/paragraphs.el (repunctuate-sentences): * lisp/vc/diff-mode.el (diff-delete-other-hunks, diff-apply-hunk) (diff-revert-and-kill-hunk, diff-apply-buffer): * lisp/vc/log-view.el (log-view-mark-entry) (log-view-unmark-entry): Use it. * doc/lispref/commands.texi (Interactive Codes): * doc/lispref/markers.texi (The Region): * etc/NEWS: * lisp/simple.el (use-region-beginning, use-region-end) (use-region-p): * src/callint.c (Finteractive): Document it.
* NS: Fix compilation on pre macOS 11 macsDavid Caldwell2025-12-081-2/+3
| | | | | | | * src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Add a compile check around setToolbarStyle since it is not available until macOS 11.0 and a run-time check in case it was compiled on macOS >= 11.0 but run on an earlier version. (Bug#79951)
* ; Fix commentary in xfaces.cEli Zaretskii2025-12-081-6/+4
| | | | | * src/xfaces.c (face_at_buffer_position) (face_at_string_position): Fix commentary.
* ; * src/.gdbinit: Improve comments of .gdbinit helper functions (bug#79932)Jeremy Bryant2025-12-081-0/+15
| | | | | | | | | | xgetptr: Improve comment describing helper function. xgetint: Add comment describing helper function. xgettype: Add comment describing helper function. xgetsym: Add comment describing helper function. xprintstr: Add comment describing helper function. Co-authored-by: Eli Zaretskii <eliz@gnu.org>
* Simplify conv_sockaddr_to_lisp via strnlenPaul Eggert2025-12-071-7/+1
| | | | | * src/process.c (conv_sockaddr_to_lisp): Use strnlen rather than a circumlocution.
* Fix the DJGPP portPo Lu2025-12-081-9/+10
| | | | | | | | | | | | * msdos/sed2v2.inp (ALIGNOF_EMACS_INT): Define to 4. * msdos/sedlibmk.inp (OMIT_GNULIB_MODULE_fchmodat) (OMIT_GNULIB_MODULE_issymlinkat, OMIT_GNULIB_MODULE_issymlink) (OMIT_GNULIB_MODULE_lchmod): Define to true. * src/gmalloc.c (__morecore, __after_morecore_hook) (__malloc_initialize_hook): Don't declare till stddef.h has been included for `ptrdiff_t'.
* Align config.h better to src/lisp.hPaul Eggert2025-12-071-20/+11
| | | | | | | | | | | | | | | | | This is mostly a cleanup patch to fix growing discrepancies between src/lisp.h and configure.ac in terms of how they deduce how EMACS_INT aligns. The patch includes a static check that the two methods now agree. It also speeds up ‘configure’ a bit. * configure.ac (ALIGNOF_INT, ALIGNOF_LONG, ALIGNOF_LONG_LONG): Remove; no longer used. (ALIGNOF_EMACS_INT): New macro. (system_malloc): Set to 'no' more consistently with what’s in src/lisp.h. * src/lisp.h (ALIGNOF_EMACS_INT): Do not define here, as config.h defines it now. Check that config.h’s definition equals the actual alignof (EMACS_INT). (USE_USB_TAG): Set more consistently with what’s in configure.ac. (alignas): Don’t second-guess Gnulib.
* Work around GCC bug 123042Paul Eggert2025-12-071-3/+3
| | | | * src/ccl.c: The bug occurs in GCC versions after GCC 13.
* Include malloc.h early in alloc.cPaul Eggert2025-12-072-21/+21
| | | | | | | | | | | * src/alloc.c, src/gmalloc.c: Include <malloc.h> before <stdlib.h>. This mimics include patterns elsewhere, and avoids a problem if malloc.h declares realloc (i.e., rpl_realloc) early as extern, whereas Gnulib stdlib.h declares it later as inline which means it is extern inline, which clashes with gmalloc’s definition of rpl_realloc when gmalloc.o is used. Problem discovered when building Emacs on Ubuntu 25.10 with "./configure CC='gcc -m32' emacs_cv_struct_alignment=no gl_cv_header_working_stdalign_h=no".
* Pacify -Werror=null-dereference in ralloc.cPaul Eggert2025-12-071-6/+2
| | | | | * src/ralloc.c (find_heap, update_heap_bloc_correspondence): Omit unnecessary comparisons to NULL that cause GCC to warn.
* Allow volume control of system audio device on MS-WindowsEli Zaretskii2025-12-071-0/+67
| | | | | | * src/sound.c (Fw32_sound_volume): New function. * etc/NEWS: Announce it.
* * src/comp.c (emit_EQ): Make a declaration an assignment (bug#79722)Gerd Möllmann2025-12-071-1/+1
|
* Merge from origin/emacs-30Eli Zaretskii2025-12-061-3/+6
|\ | | | | | | | | | | | | | | 998d45d5d10 ; * lisp/calc/calc-units.el: Better reference for CODATA ... fae83f1eb8b ; Improve documentation of 'char-script-table' 3e489ed8049 ; * src/font.c (Flist_fonts): Doc fix. 4c292b6f703 ; vc-dir-clean-files: Improve docstring and message (bug#... 8a6b84dbcbc Fix doc string of 'display-buffer'
| * ; * src/font.c (Flist_fonts): Doc fix.Eli Zaretskii2025-12-041-3/+6
| |
* | ; * src/eval.c (Ffunc_arity): Doc fix (bug#79880).Eli Zaretskii2025-12-061-1/+6
| |
* | ; * src/.gdbinit: Document xfmt, a user-defined function.Jeremy Bryant2025-12-061-0/+4
| | | | | | | | | | | | Proposed in (bug#79932). Co-authored-by: Eli Zaretskii <eliz@gnu.org>
* | Fix root frame check in store_frame_param (Bug#79947)Martin Rudalics2025-12-061-10/+20
| | | | | | | | | | | | | | * src/frame.c (store_frame_param): Make sure 'minibuffer', 'parent-frame' and 'delete-before' parameters reference frame on same terminal. Spare GUI frames when checking root frames of tty frames and their surrogate minibuffer frames (Bug#79947).
* | Don't emit print-circle refs for empty string and vectorMattias Engdegård2025-12-041-14/+25
| | | | | | | | | | | | | | | | | | The empty vector and string(s) are immutable, contain no references and always read as the same objects. * src/print.c (PRINT_CIRCLE_CANDIDATE_P): Turn macro into... (print_circle_candidate_p): ...a function, and exclude [] and "". * test/src/print-tests.el (print-circle): Add test case.
* | * Have comp do not use builtin_expect with libgccjit < 14 (bug#79722)Andrea Corallo2025-12-041-16/+21
| | | | | | | | | | * src/comp.c (emit_EQ): Do not use '__builtin_expect' with libgccjit < 14.
* | NS: Fix toolbar style and positionRudolf Adamkovič2025-12-041-0/+7
| | | | | | | | | | | | | | | | * src/nsterm.m ([EmacsWindow initWithEmacsFrame:fullscreen:screen:]): Always show the toolbar below the window title. This is needed on Mac OS 11+ where the toolbar style is decided by the system (which is unpredictable) and the newfangled "compact" toolbar may be chosen (which is undesirable). (Bug#79900)
* | ; Avoid assertion violations in 'font-match-p'Eli Zaretskii2025-12-041-0/+4
| | | | | | | | | | * src/font.c (font_match_p): Avoid assertion violations in 'font_encode_char' if FONT is not a font-object.
* | Waste 4 fewer bytes in GNU/Linux 32-bit HPPAPaul Eggert2025-12-031-6/+19
| | | | | | | | | | | | | | Also, add more commentary about the situation. * src/systhread.h (SYSTHREAD_ALIGN_ROOM): Use alignof (double), not alignof (int), to align the room. This means we have only 8 (not 12) bytes of slop on 32-bit HPPA GNU/Linux.
* | Port to GNU/Linux HPPA mallocPaul Eggert2025-12-022-10/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On this platform, you cannot reliably malloc objects containing values of type pthread_mutex_t or pthread_cond_t, since malloc guarantees only 8-byte alignment but these two types require 16-byte alignment. See GCC bug 115750 <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115750> reported by Sam James and Emacs bug 79936 <https://bugs.gnu.org/79936> reported by John Paul Adrian Glaubitz. * configure.ac (ALIGNOF_MAX_ALIGN_T, ALIGNOF_PTHREAD_COND_T) (ALIGNOF_PTHREAD_MUTEX_T) [HAVE_PTHREAD]: New C macros. * src/systhread.c (sys_mutex_init, sys_mutex_lock) (sys_mutex_unlock, sys_cond_init, sys_cond_wait) (sys_cond_signal, sys_cond_broadcast, sys_cond_destroy): Use SYTHREAD_ALIGN_PTR to convert sys_mutex_t and sys_cond_t to pthread_mutex_t and pthread_cond_t, since runtime conversion is needed on GNU/Linux HPPA. * src/systhread.h (SYSTHREAD_ALIGN_ROOM, SYSTHREAD_ALIGN_PTR): New macros, which affect the generated code only on unusual platforms like GNU/Linux HPPA. (sys_mutex_t, sys_cond_t) [HAVE_PTHREAD]: Use them.
* | Pacify gcc -Wdangling-else in dbusbind.cPaul Eggert2025-12-021-10/+10
| | | | | | | | | | | | | | * src/dbusbind.c (XD_DBUS_VALIDATE_BUS_NAME) (XD_DBUS_VALIDATE_PATH, XD_DBUS_VALIDATE_INTERFACE) (XD_DBUS_VALIDATE_MEMBER): Make these expand to single statements when they are followed by ‘;’. All uses changed.
* | Cache VC incoming revisionsSean Whitton2025-11-301-2/+2
| | | | | | | | | | | | | | | | | | * lisp/vc/vc-hooks.el (vc-file-setprop): Use cl-pushnew. (vc--repo-setprop, vc--repo-getprop, vc--repo-clearprops): New functions. * lisp/vc/vc.el (vc--incoming-revision): Cache incoming revisions. * src/fns.c (Fput): State that VALUE is returned.
* | Use treesit-extra-load-path for more values of treesit-auto-install-grammarJuri Linkov2025-11-301-1/+2
| | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-auto-install-grammar): Use the first writable directory from 'treesit-extra-load-path' for values 'always', 'ask', 'ask-dir' (bug#79862). * src/treesit.c (syms_of_treesit): Extend docstring.
* | * lisp/cus-start.el: Make 'treesit-extra-load-path' customizable.Juri Linkov2025-11-281-1/+3
| | | | | | | | | | | | | | | | | | | | | | * lisp/treesit.el (treesit-auto-install-grammar): Add the value 'ask-dir'. (treesit-ensure-installed): When 'treesit-auto-install-grammar' is 'ask' or 'ask-dir', ask for the directory to install the grammar library using the first writable directory of 'treesit-extra-load-path' as default. Also add the provided directory to 'treesit-extra-load-path' afterwards. * src/treesit.c (treesit-extra-load-path): In the docstring mention the fact that the first directory is special (bug#79862).
* | Fix recently-introduced ash bugPaul Eggert2025-11-271-4/+5
| | | | | | | | | | | | | | | | | | | | Problem reported by John Paul Adrian Glaubitz (bug#79876). * src/data.c (Fash): Don’t assume stdc_leading_zeros, which returns an unsigned integer of unspecified width, returns a value narrower than EMACS_INT. Also, don’t munge the code to worry about stdc_leading_zeros (0); unlike GCC’s __builtin_clz, stdc_leading_zeros works fine on 0. And use a temporary to avoid a cast.