Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ysmolski opened this issue Jul 27, 2019 · 0 comments
Open

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

ysmolski opened this issue Jul 27, 2019 · 0 comments

Comments

@ysmolski
Copy link

ysmolski commented Jul 27, 2019

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)
@ysmolski ysmolski changed the title guide-key is not match-string friendly guide-key break "query-replace"; modifies match-data Jul 27, 2019
@ysmolski ysmolski changed the title guide-key break "query-replace"; modifies match-data guide-key breaks "query-replace"; modifies match-data Jul 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant