* src/text-index.c (text_index_bytepos_to_charpos): Add a const.
(bytepos_of_head): Removed.
(text_index_charpos_to_bytepos): Don't be clever about choosing
to scan forward or backward.
(bytepos_forward_to_charpos): Use char_start_bytepos.
* src/text-index.c (is_close_enough_charpos): Remove unused arg `ti`.
(narrow_bytepos_bounds_1, narrow_charpos_bounds_1)
(narrow_bytepos_bounds, narrow_charpos_bounds):
Don't short-circuit if a known point is exactly equal to what we're
looking for, thus don't return value.
(text_index_bytepos_to_charpos, text_index_charpos_to_bytepos):
Short-circuit here instead after narrowing.
Make the two functions more alike. Short-circuit also when the text
remaining to scan is all ASCII.
* src/text-index.c (z_pos, is_close_enough_charpos): New functions.
(buf_charpos_to_bytepos): Skip the binary search if the interval to
scan is already small enough after `narrow_charpos_bounds`.
Remove bytepos information from markers since the new text-index
makes this information redundant.
Also move the charpos information out of the Lisp_Marker objects
themselves into the marker-vector: instead of having each entry
of the vector contain only a pointer to the marker, it contains both
the pointer to the marker and the bytepos of the marker.
The benefit being that we can now zip through the charpos
of all markers of a buffer without chasing any pointer since
they are all in the same contiguous vector.
* src/lisp.h (struct Lisp_Marker): Delete `charpos` and `bytepos` fields.
(set_marker_both, set_marker_restricted_both, build_marker):
Remove `bytepos` arg.
* src/pdumper.c (dump_marker): Don't dump `bytepos` and `charpos`.
* src/alloc.c (Fmake_marker): Don't set `bytepos` and `charpos`.
(build_marker): Remove `bytepos` arg. Use `marker_vector_set_charpos`.
* src/marker.c (Fmarker_position, Fmarker_last_position):
(attach_marker, set_marker_internal, marker_byte_position):
Use `marker_vector_charpos` and `marker_vector_set_charpos`.
(set_marker_both, set_marker_restricted_both): Remove `bytepos` arg.
* src/marker-vector.c (marker_vector_charpos, marker_vector_set_charpos)
(marker_vector_bytepos, marker_vector_adjust_for_delete)
(marker_vector_adjust_for_insert, marker_vector_adjust_for_replace):
New functions.
* src/marker-vector.h (marker_vector_charpos, marker_vector_set_charpos)
(marker_vector_bytepos, marker_vector_adjust_for_delete)
(marker_vector_adjust_for_insert, marker_vector_adjust_for_replace):
New declarations.
* src/insdel.c (adjust_suspend_auto_hscroll):
* src/fns.c (internal_equal_1, value_cmp, sxhash_obj):
Use `marker_vector_charpos`.
(adjust_markers_for_delete): Use `marker_vector_adjust_for_delete`.
(adjust_markers_for_insert): Use `marker_vector_adjust_for_insert`.
(adjust_markers_for_replace): Use `marker_vector_adjust_for_replace`.
(count_bytes): Delete function.
(adjust_markers_bytepos): Delete most of the contents of the function.
* src/editfns.c (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
(save_restriction_save_1, save_restriction_restore_1, transpose_markers):
* src/xdisp.c (Fbuffer_text_pixel_size, message_dolog)
(with_echo_area_buffer, unwind_with_echo_area_buffer)
(resize_mini_window, format_mode_line_unwind_data, redisplay_window)
(try_window):
* src/window.c (select_window_1, window_point)
(Fdelete_other_windows_internal, set_window_buffer)
(temp_output_buffer_show, Fsplit_window_internal)
(window_scroll_for_long_lines, window_scroll_pixel_based)
(window_scroll_line_based, scroll_command, Frecenter)
(Fmove_to_window_line, Fset_window_configuration, save_window_save):
* src/buffer.c (clone_per_buffer_values, record_buffer_markers):
(Fmake_indirect_buffer, Fset_buffer_multibyte):
* src/undo.c (record_marker_adjustments):
* src/lread.c (readchar, unreadchar):
* src/coding.c (decode_coding_object, encode_coding_object):
* src/process.c (update_process_mark, read_process_output_after_insert)
(Finternal_default_process_sentinel):
* src/print.c (print_finish):
* src/indent.c (check_display_width, restore_window_buffer)
(Fvertical_motion):
* src/dispextern.h (SET_MARKER_FROM_TEXT_POS):
* src/callint.c (Fcall_interactively):
* src/composite.c (autocmp_chars): Adjust calls to `build_marker`,
`set_marker_both`, and `set_marker_restricted_both`, and use
`marker_vector_charpos` and `marker_vector_set_charpos`.
(define-treesit-generic-mode): Append new item
to 'treesit-language-source-alist' instead of prepending.
(treesit-generic-mode-setup): Remove 'source' arg.
Use 'treesit-ensure-installed'.
(liquid-generic-ts-mode): Use 'treesit-ensure-installed'.
(alpinejs-generic-ts-setup): Run setup hook.
(treesit-generic-mode-font-lock-map): Add more mappings.
* lisp/newcomment.el (block-comment-start)
(block-comment-end): Delete.
(comment-indent):
* lisp/cedet/semantic/doc.el
(semantic-doc-snarf-comment-for-tag):
Remove use of the now-deleted variables.
As presently under discussion in bug#77823, the intended new
functionality is not really about comments at all.
Remove it for now to allow us to redesign from a clean slate,
and to deal with the regression reported in bug#77823.
This reverts the following three changesets:
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 17 12:56:52 2025 -0600
New minor mode: `electric-block-comment-mode'
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Mon Mar 31 17:58:16 2025 -0600
Add block-comment-start and block-comment-end to supported modes
Author: Elías Gabriel Pérez <eg642616@gmail.com>
AuthorDate: Sun Apr 13 12:26:08 2025 -0600
Add block-comment variables to cc-mode
* lisp/subr.el (text-clone--pending-overlays): New var.
(text-clone--maintain-overlays): New function, extracted from
`text-clone--maintain`.
(text-clone--maintain): Use it.
* admin/gnulib-patches/lib/getloadavg.c.diff: New file.
* admin/merge-gnulib (GNULIB_TOOL_FLAGS): Set --local-dir to
admin/gnulib-patches.
* lib/gnulib.mk.in: Update from Gnulib.
Various problems were addressed:
- Unbreak Flymake for Emacs 26.3. Due to use of some Elisp constructs,
the change completely broke compatibility to Emacs < 29.1. That
violated Flymake's status as a :core package as highlighted in its
description, which has implications for packages depending on it (such
as Eglot);
- No new two commands are needed (they weren't documented in the manual
anyway). The new functionality was integrated in the existing
flymake-show-buffer-diagnostics;
- Some helper functions aren't needed at all (they weren't marked
internal anyway);
- The new hook called only when a particular function is called
non-interactively in a particular way is not useful. A case for the
usefulness (if any) of this hook must be made separately. Such a hook
should be documented in the manual;
- Added missing recentering after revealing diagnostic in buffer;
- The menu entry "List all problems" was never intended to direct the
user the user to any particular problem at point;
- The useful new functionality is called out in the manual and NEWS.
* lisp/progmodes/flymake.el (flymake--indicator-overlay-spec):
Use flymake-show-buffer-diagnostics-at-mouse.
(flymake-mode-map): Recover old definition.
(flymake-after-show-buffer-diagnostics-hook): Remove hook.
(flymake-show-buffer-diagnostics): Rework.
(flymake-show-diagnostic, flymake-goto-diagnostic): Rework
docstring.
(flymake-show-buffer-diagnostics-at-event-position)
(flymake-show-buffer-diagnostics-at-event-line): Delete undocumented commands.
(flymake-diagnostics-at-mouse-event)
(flymake-pulse-momentary-highlight-region): Delete non-helpful
helper.
* doc/misc/flymake.texi (listing diagnostics): Mention new
functionality.
Can't use with-supressed-warnings, introduced in Emacs 27.1. Also can't
use multi-arg setq-local, probably introduced around the same time.
This commit by itself still doesn't allow Flymake to be loaded in Emacs
< 29. That fix will come in a later commit.
* lisp/progmodes/flymake.el (flymake--mode-line-counter-map):
Use with-no-warnings.
* lisp/progmodes/flymake.el (flymake--resize-margins): Use setq,
setq-local not needed.
Since 'origin' and 'code' are new separate optional attributes of each
diagnostic, it becomes important to not waste space in these listings
when these are absent. When a specific column isn't used by any line,
omit it. Also spare just enough horizontal space to hold the largest
element in each column.
* lisp/progmodes/flymake.el
(flymake--tabulated-setup): New helper.
(flymake-diagnostics-buffer-mode)
(flymake-project-diagnostics-mode): Use flymake--setup-tabulated-listing.
(flymake--fit-diagnostics-window): New helper.
(flymake--tabulated-list-format-base): Rename from
flymake--diagnostics-base-tabulated-list-format.
(flymake--tabulated-setup-1): Rename and rework from
flymake--tabulated-entries-1.
(flymake--diagnostics-buffer-entries): Remove.
(flymake-diagnostics-buffer-mode)
(flymake-project-diagnostics-mode): Simplify.
(flymake--project-diagnostics-entries): Remove.
Flymake backends may now explicitly specify an origin and a code for a
diagnostic in addition to the textual description. This change lays
groundwork for richer diagnostic listings and user options for
summarizing diagnostics, addressing bug#77439 and bug#77480.
* doc/misc/flymake.texi (Flymake API): Rename from "Extending
Flymake". Rework.
(Inspecting diagnostics): New section.
* lisp/progmodes/flymake.el (flymake--diag): Add origin, code and
message. Remove text.
(flymake-make-diagnostic): Support new origin, code and message.
(flymake-diagnostic-text): Rework.
* lisp/vc/emerge.el (emerge-make-diff-list)
(emerge-make-diff3-list): Set proper `default-directory' in order
to support remote files. (Bug#6850, Bug#74352)
* test/lisp/vc/emerge-tests.el: New file.
* lisp/savehist.el (savehist--reload): Don't bother merging the value
of vars that were not changed.
(savehist-minibuffer-hook): Exclude uninterned history vars.
* lisp/progmodes/js.el (js--treesit-switch-body-helper): New
anchor helper function for the switch_body.
(js--treesit-member-chained-expression-helper): New anchor
helper function for chained calls in member_expression.
(js--treesit-arrow-function-helper): New anchor helper
function for arrow_function.
(js--treesit-indent-rules): Fix rule for the indentation of
"{" when of a new line of a function declaration. (Bug#76704)
Fix the indentation of the parent of arrow_function, member_expression,
switch_body, ternary_expression and sequence_expression.
* oldXMenu/Recomp.c: Omit trailing spaces in C source code line.
This was the only such line found by this command:
grep '[ ]$' $(git ls-files | grep '\.[chmy]$')