bug#38416: 27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

bug#38416: 27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message

lin.sun

[PATCH] * makefile-edit.el: regexp-quote the param in

makefile-move-to-macro.

 

Fix the error message from `makefile-move-to-macro' when there is '$'

or '\\' in param for re-search-forward, with `(global-ede-mode t)' and

`(semantic-mode t)' enabled. Enable ede and semantic mode, then open a

Makefile.am in which has line 'AM_LIBTMP_LIBS:=$(shell X \--libs)'

will trigger the error message, and this patch fix that.

---

lisp/cedet/ede/makefile-edit.el | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

 

diff --git a/lisp/cedet/ede/makefile-edit.el

b/lisp/cedet/ede/makefile-edit.el

index 7d8a44b..add1675 100644

--- a/lisp/cedet/ede/makefile-edit.el

+++ b/lisp/cedet/ede/makefile-edit.el

@@ -78,7 +78,7 @@ makefile-move-to-macro

If NEXT is non-nil, move to the next occurrence of MACRO."

   (let ((oldpt (point)))

     (when (not next) (goto-char (point-min)))

-    (if (re-search-forward (concat "^\\s-*" macro "\\s-*[+:?]?=") nil t)

+    (if (re-search-forward (concat "^\\s-*" (regexp-quote macro)

"\\s-*[+:?]?=") nil t)

        t

       (goto-char oldpt)

       nil)))

--

2.2.0

 

 

 

Reply | Threaded
Open this post in threaded view
|

bug#39094: 27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message

lin.sun
Hi Eli,

The attachment is a patch to fix the complaint message from `makefile-move-to-macro' for the param for re-search-forward isn't escaped.
To reproduce the issue, just run follow commands in your shell,
$ echo 'AM_LIBTMP_LIBS:=$(shell X \--libs)' > /tmp/Makefile.am
$ emacs -Q --eval '(progn (global-ede-mode t)(semantic-mode t)(find-file "/tmp/Makefile.am"))'

Could you please review and apply the patch?
Thank you.

B.R.
Lin Sun

0001-Fix-the-error-message-from-makefile-move-to-macro.patch (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

bug#39094: regexp-quote the param in makefile-move-to-macro to avoid error message

Paul Eggert
Thanks for reporting that bug. I installed your patch into the master
branch.



Reply | Threaded
Open this post in threaded view
|

bug#39094: regexp-quote the param in makefile-move-to-macro to avoid error message

lin.sun
>Thanks for reporting that bug. I installed your patch into the master branch.
Thank you Paul.




Reply | Threaded
Open this post in threaded view
|

bug#38416: Recall: bug#38416: Acknowledgement (27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message)

lin.sun
In reply to this post by lin.sun
[hidden email] would like to recall the message, "bug#38416:
Acknowledgement (27.0.50;; [PATCH] * makefile-edit.el: regexp-quote the
param in makefile-move-to-macro to avoid error message)".

winmail.dat (2K) Download Attachment