all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: <lin.sun@zoom.us>
To: 39094@debbugs.gnu.org, eliz@gnu.org
Subject: bug#39094: 27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message
Date: Sun, 12 Jan 2020 16:06:43 +0800	[thread overview]
Message-ID: <000201d5c91f$3bac3b90$b304b2b0$@zoom.us> (raw)
In-Reply-To: <5ddfcabc.1c69fb81.626d0.c7a5@mx.google.com>

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

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

[-- Attachment #2: 0001-Fix-the-error-message-from-makefile-move-to-macro.patch --]
[-- Type: application/octet-stream, Size: 1360 bytes --]

From 9dfa710fd57095cceb025f665e71772f93e6bbe4 Mon Sep 17 00:00:00 2001
From: "lin.sun" <lin.sun@zoom.us>
Date: Fri, 1 Nov 2019 10:25:17 +0800
Subject: [PATCH] Fix the error message from `makefile-move-to-macro'

* makefile-edit.el: regexp-quote the param in makefile-move-to-macro.
With `(global-ede-mode t)' and `(semantic-mode t)' enabled, error
happened when open a Makefile.am which has '$' or '\\' in its macro
list. Simply create a Makefile.am include the line
'AM_LIBTMP_LIBS:=$(shell X \--libs)', open the file with ede and
semantic mode enabled will trigger this issue. Escape the param for
re-search-forward in `makefile-move-to-macro' can fix this.
---
 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	other threads:[~2020-01-12  8:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-28 13:25 bug#38416: 27.0.50; ; [PATCH] * makefile-edit.el: regexp-quote the param in makefile-move-to-macro to avoid error message LinSun
2020-01-12  8:06 ` lin.sun [this message]
     [not found]   ` <25c4e204-0465-5e7a-4183-8e5a23989b85@cs.ucla.edu>
2020-01-17  8:17     ` bug#39094: " Eli Zaretskii
2020-01-19  2:32 ` 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
2020-01-19  2:35 ` bug#38416: Recall: " lin.sun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000201d5c91f$3bac3b90$b304b2b0$@zoom.us' \
    --to=lin.sun@zoom.us \
    --cc=39094@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.