joddie / pcre2el

convert between PCRE, Emacs and rx regexp syntax
GNU General Public License v3.0
242 stars 25 forks source link

Symbol’s function definition is void: reb-target-binding on emacs 29 #51

Closed dinkonin closed 1 year ago

dinkonin commented 1 year ago

When I try to use re-builder with pcre on GNU Emacs 29.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-11-23 I get Symbol’s function definition is void: reb-target-binding

This is the commit to master that removed the binding Emacs Git.

marczz commented 1 year ago

As commented dinkopnin in emacs 29 the macro reb-target-binding was replaced by a function reb-target-value, and this is blocking the use of re-builder with pcre2.el, because the pcre2el is using the old macro.

I don't understand why the straightforward pull rquest #52 from Matt Beshara is not merged after 3 months.

But as a temporary fix, waiting for the merge to happen, we can redefine the macro

(with-eval-after-load 're-builder
  (if (fboundp #'reb-target-value)
    (defmacro reb-target-binding (symbol)
     "Return binding for SYMBOL in the RE Builder target buffer."
     `(with-current-buffer reb-target-buffer ,symbol))
       (defmacro reb-target-binding (symbol)
         `(reb-target-value (quote ,symbol)
     ))))
hardaker commented 1 year ago

Cause I missed it -- the original author of the package has disappeared and I've been trying to keep up with merging but simply missed this one. Sorry!