• Noam Postavsky's avatar
    Adjust match data before calling after-change-funs · 66f95e0d
    Noam Postavsky authored
    It's important to adjust the match data in between calling
    before-change-functions and after-change-functions, so that buffer
    change hooks will always see match-data consistent with buffer content.
    (Bug #23917)
    
    * src/insdel.c (replace_range): Add new parameter ADJUST_MATCH_DATA, if
    true call update_search_regs.  Update all callers (except
    Freplace_match) to pass 0 for the new parameter.
    * src/search.c (update_search_regs): New function, extracted from
    Freplace_match.
    (Freplace_match): Remove match data adjustment code, pass 1 for
    ADJUST_MATCH_DATA to replace_range instead.
    66f95e0d
search.c 100 KB