benma / visual-regexp-steroids.el

Extends visual-regexp to support other regexp engines
255 stars 14 forks source link

Symbol's value as variable is void: vr/match-separator-string #19

Open alamaison opened 8 years ago

alamaison commented 8 years ago

When I press RET to apply the replacement, I get the following error: vr--perform-query-replace: Symbol's value as variable is void: vr/match-separator-string

This only started happening since updating from MELPA today.

My init looks like this:

(use-package visual-regexp-steroids
  :config
  (define-key global-map (kbd "C-M-%") 'vr/query-replace)
  (define-key esc-map (kbd "C-M-r") 'vr/isearch-backward) ;; C-M-r
  (define-key esc-map (kbd "C-M-s") 'vr/isearch-forward) ;; C-M-s
  (setq vr/engine 'pcre2el))
benma commented 8 years ago

What Emacs version are you using? I think it might be a version below 25.0, for which I haven't tested the new change.

Can you confirm this? Then I will start working on a fix.

alamaison commented 8 years ago

Yes, it's 24.4

On Thu, 19 May 2016 15:44 benma, notifications@github.com wrote:

What Emacs version are you using? I think it might be a version below 25.0, for which I haven't tested the new change.

Can you confirm this? Then I will start working on a fix.

— You are receiving this because you authored the thread. Reply to this email directly or view it on GitHub https://github.com/benma/visual-regexp-steroids.el/issues/19#issuecomment-220346188

benma commented 8 years ago

I pushed a fix in https://github.com/benma/visual-regexp.el/commit/db0aab0346d0feba467f16ba08c1a71a0b00ecea (it's in the visual-regexp package, not the steroids package). Can you see if that works?

alamaison commented 8 years ago

That's fixed it for me. Thanks!

luxbock commented 8 years ago

I'm having the same issue, my emacs-version is:

GNU Emacs 24.5.1 (i686-pc-mingw32) of 2015-04-11 on LEG570

and I'm on visual-regexp-20160520.400.

I can fix the issue by customizing/setting vr/match-separator-string by myself.

benma commented 8 years ago

Can you debug it further? I.e. is query-replace-from-to-separator defined for you? If not, investigate why this portion did not execute correctly:

https://github.com/benma/visual-regexp.el/blob/db0aab0346d0feba467f16ba08c1a71a0b00ecea/visual-regexp.el#L102-L110

alamaison commented 8 years ago

The problem has reoccurred for me. query-replace-from-to-separator is defined:

query-replace-from-to-separator is a variable defined in `visual-regexp.el'.
Its value is #(" → " 0 3 (face minibuffer-prompt))

Documentation:
String that separates FROM and TO in the history of replacement pairs.

Using GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-01-17 on lgw01-14, modified by Debian