Subject: Re: bug#78221: 31.0.50; Improving *-change-functions notifications

From: Gerd Möllmann <[email-masked]>
Date: Sun, 04 May 2025 20:12:35 +0200

Stefan Monnier <[email-masked]> writes:

>> The right tool to find these is cflow, combined with grep and awk (or
>> python or perl or whatever) to search and filter cflow's output.  I've
>> used these before.
>
> Do you happen to remember the magic incantation to let `cflow` process
> our sources correctly?  I tried the rule below and the errors file
> suggests that the preprocessing is done correctly (it's full of
> complaints but only about redefinitions), yet the result doesn't include
> any info about the functions called by `insert_1_both` or
> `Fput_text_property` (to take two randomly sampled cases of interest).

I use Clangd + Eglot + eglot-supplements if I have questions about who
call whom.

With clangd 20 one can display incoming and outgoing call trees. Only
inconvenience is that one has to expand nodes in the tree manually
because nodes are created on demand via LSP. And this of course only
sees what's compiled in.

Anyway, random example for add_text_properties_1, incoming call trees:

- add_text_properties_1 textprop.c:1170
  - add_text_properties_1 add_text_properties_1:1182
    • ⬁add_text_properties_1 add_text_properties_1:1182
    - Fadd_text_properties Fadd_text_properties:1308
      + Fpropertize Fpropertize:3297
      + echo_add_key echo_add_key:548
      + echo_add_key echo_add_key:549
      + describe_key_maybe_fontify describe_key_maybe_fontify:3092
      + Sadd_text_properties Sadd_text_properties:1296
      + Fput_text_property Fput_text_property:1326
      + copy_text_properties copy_text_properties:2026
      + add_text_properties_from_list add_text_properties_from_list:2111
      • tty_handle_tab_bar_click tty_handle_tab_bar_click:15384
      + store_mode_line_string store_mode_line_string:28515
      + store_mode_line_string store_mode_line_string:28542
      + store_mode_line_string store_mode_line_string:28558
    + Fadd_face_text_property Fadd_face_text_property:1368
  - Fadd_text_properties Fadd_text_properties:1308
    + Fpropertize Fpropertize:3297
    + echo_add_key echo_add_key:548
    + echo_add_key echo_add_key:549
    + describe_key_maybe_fontify describe_key_maybe_fontify:3092
    + Sadd_text_properties Sadd_text_properties:1296
    - Fput_text_property Fput_text_property:1326
      + Fcall_interactively Fcall_interactively:484
      + Fcall_interactively Fcall_interactively:536
      + Fcall_interactively Fcall_interactively:567
      + produce_charset produce_charset:7277
      + update_compositions update_compositions:530
      - update_compositions update_compositions:571
        + casify_region casify_region:565
        + decode_coding_object decode_coding_object:8191
        + encode_coding_object encode_coding_object:8483
        + unwind_decompress unwind_decompress:190
        + Fzlib_decompress_region Fzlib_decompress_region:333
        - Freplace_region_contents Freplace_region_contents:2190
          + Sreplace_region_contents Sreplace_region_contents:1923
        + Fsubst_char_in_region Fsubst_char_in_region:2412
        + Ftranslate_region_internal Ftranslate_region_internal:2599
        + Ftranspose_regions Ftranspose_regions:4666
        + Ftranspose_regions Ftranspose_regions:4667
        + Finsert_file_contents Finsert_file_contents:5008
        - insert_from_buffer insert_from_buffer:1086
          + encode_coding_object encode_coding_object:8360
          + Finsert_buffer_substring Finsert_buffer_substring:1743
          + Finsert_file_contents Finsert_file_contents:4744
        + replace_range replace_range:1543
        + del_range_1 del_range_1:1743
        + del_range_byte del_range_byte:1785
        + del_range_both del_range_both:1829
        + Fcombine_after_change_execute Fcombine_after_change_execute:2392
        + insert insert:575
        + insert_and_inherit insert_and_inherit:590
        + insert_before_markers insert_before_markers:635
        + insert_before_markers_and_inherit insert_before_markers_and_inherit:651
        + insert_from_string insert_from_string:870
        + insert_from_string_before_markers insert_from_string_before_markers:890
        + Fjson_insert Fjson_insert:685
        + Freplace_match Freplace_match:2784
      + compose_text compose_text:638
      + read_minibuf read_minibuf:849
      + read_minibuf read_minibuf:851
      + read_minibuf read_minibuf:853
      + read_minibuf read_minibuf:875
      + Sput_text_property Sput_text_property:1314
    + copy_text_properties copy_text_properties:2026
    + add_text_properties_from_list add_text_properties_from_list:2111
    • tty_handle_tab_bar_click tty_handle_tab_bar_click:15384
    + store_mode_line_string store_mode_line_string:28515
    + store_mode_line_string store_mode_line_string:28542
    + store_mode_line_string store_mode_line_string:28558
  + Fadd_face_text_property Fadd_face_text_property:1368