Skip to content

guide-key breaks "query-replace"; modifies match-data #49

@ysmolski

Description

@ysmolski

Switching guide-mode ON breaks every package using "query-replace" on Emacs > 24.5. When I turn it on and try to run command replace-string I get stacktraces like this:

Debugger entered--Lisp error: (args-out-of-range #<buffer prot.c> 0 1)
  buffer-substring-no-properties(0 1)
  perform-replace("tube " "Tube *" t nil nil nil nil 7179 54699 nil nil)
  query-replace("tube " "Tube *" nil 7179 54699)
  apply(query-replace ("tube " "Tube *" nil 7179 54699))
  anzu--query-replace-common(nil :prefix-arg 1)
  anzu-query-replace(1)
  funcall-interactively(anzu-query-replace 1)
  #<subr call-interactively>(anzu-query-replace nil nil)
  apply(#<subr call-interactively> anzu-query-replace (nil nil))
  call-interactively@ido-cr+-record-current-command(#<subr call-interactively> anzu-query-replace nil nil)
  apply(call-interactively@ido-cr+-record-current-command #<subr call-interactively> (anzu-query-replace nil nil))
  call-interactively(anzu-query-replace nil nil)
  command-execute(anzu-query-replace)

Probably it modifies match-data because calls string-match periodically? If so that means that it can break other packages on > Emacs 24.5.

See clues here: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=31586

It was enabled this way:

(require-package 'guide-key)
(setq guide-key/guide-key-sequence '("C-x" "C-c" "C-x 4" "C-x 5" "C-c ;" "C-c ; f" "C-c ' f" "C-x n" "C-x C-r" "C-x r"))
(guide-key-mode 1)
(diminish 'guide-key-mode)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions