From 54e0b14a6981a317210493f0fead1e2c5b6508ea Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 5 Jul 2022 23:25:44 -0500 Subject: [PATCH] Adjust better to Autoconf quoting style change MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * admin/gitmerge.el (gitmerge-emacs-version): * admin/nt/dist-build/build-zips.sh (ACTUAL_VERSION): * admin/quick-install-emacs (VERSION): * lisp/cedet/ede/emacs.el (ede-emacs-version): Adjust to change in configure.ac’s Autoconf quoting style. * etc/srecode/ede-autoconf.srt: * test/lisp/progmodes/autoconf-tests.el: (autoconf-tests-current-defun-function-define) (autoconf-tests-current-defun-function-subst): Use better Autoconf quoting. * make-dist (version): Simplify. --- admin/gitmerge.el | 2 +- admin/nt/dist-build/build-zips.sh | 2 +- admin/quick-install-emacs | 4 ++-- etc/srecode/ede-autoconf.srt | 4 ++-- lisp/cedet/ede/emacs.el | 2 +- make-dist | 2 +- src/xterm.c | 11 ++++++----- test/lisp/progmodes/autoconf-tests.el | 8 ++++---- 8 files changed, 18 insertions(+), 17 deletions(-) diff --git a/admin/gitmerge.el b/admin/gitmerge.el index 5da70a40285..a214dcbcb74 100644 --- a/admin/gitmerge.el +++ b/admin/gitmerge.el @@ -124,7 +124,7 @@ If nil, the function `gitmerge-default-branch' guesses.") (let ((coding-system-for-read vc-git-log-output-coding-system)) (call-process "git" nil t nil "show" (format "%s:configure.ac" branch))) (goto-char (point-min))) - (re-search-forward "^AC_INIT([^,]+, \\([0-9]+\\)\\.") + (re-search-forward "^AC_INIT([^,]+, \\[?\\([0-9]+\\)\\.") (string-to-number (match-string 1)))) (defun gitmerge-default-branch () diff --git a/admin/nt/dist-build/build-zips.sh b/admin/nt/dist-build/build-zips.sh index 77d20a5a7b9..39ac1fde604 100755 --- a/admin/nt/dist-build/build-zips.sh +++ b/admin/nt/dist-build/build-zips.sh @@ -148,7 +148,7 @@ done if [ -z $ACTUAL_VERSION ]; then ACTUAL_VERSION=` - sed -n 's/^AC_INIT(GNU Emacs,[ ]*\([^ ,)]*\).*/\1/p' < ../../../configure.ac + sed -n 's/^AC_INIT(\[*GNU Emacs]*,[ ]*\[*\([^] ,)]*\).*/\1/p' < ../../../configure.ac ` fi diff --git a/admin/quick-install-emacs b/admin/quick-install-emacs index 9a73cf5a401..b0a1d342518 100755 --- a/admin/quick-install-emacs +++ b/admin/quick-install-emacs @@ -172,10 +172,10 @@ test x"$prefix" = x && { prefix="`get_config_var prefix`" || exit 4 ; } test x"$ARCH" = x && { ARCH="`get_config_var host`" || exit 4 ; } VERSION=` - sed -n 's/^AC_INIT([ ]*emacs[ ]*,[ ]*\([^ ),]*\).*/\1/p' <$SRC/configure.ac + sed -n 's/^AC_INIT([ ]*\[*emacs]*[ ]*,[ ]*\[*\([^] ),]*\).*/\1/p' <$SRC/configure.ac ` || exit 4 test -n "$VERSION" || VERSION=` - sed -n 's/^AC_INIT([ ]*GNU Emacs[ ]*,[ ]*\([^ ),]*\).*/\1/p' <$SRC/configure.ac + sed -n 's/^AC_INIT([ ]*\[*GNU Emacs]*[ ]*,[ ]*\[*\([^] ),]*\).*/\1/p' <$SRC/configure.ac ` || exit 4 test -n "$VERSION" || { printf '%s\n' >&2 "$me: no version in configure.ac"; exit 4; } diff --git a/etc/srecode/ede-autoconf.srt b/etc/srecode/ede-autoconf.srt index 19dc14202de..ecca7afd007 100644 --- a/etc/srecode/ede-autoconf.srt +++ b/etc/srecode/ede-autoconf.srt @@ -44,10 +44,10 @@ template ede-empty :project AC_INIT({{PROJECT_NAME}}, {{PROJECT_VERSION}}) AM_INIT_AUTOMAKE([{{PROGRAM}}], 0) -AM_CONFIG_HEADER(config.h) +AM_CONFIG_HEADER([config.h]) {{comment_prefix}} End the configure script. -AC_OUTPUT(Makefile, [date > stamp-h] ) +AC_OUTPUT([Makefile], [date > stamp-h] ) ---- diff --git a/lisp/cedet/ede/emacs.el b/lisp/cedet/ede/emacs.el index 5a23f504f78..cbe766cedb6 100644 --- a/lisp/cedet/ede/emacs.el +++ b/lisp/cedet/ede/emacs.el @@ -59,7 +59,7 @@ Return a tuple of ( EMACSNAME . VERSION )." (file-exists-p (setq configure_ac "configure.in"))) (insert-file-contents configure_ac) (goto-char (point-min)) - (re-search-forward "AC_INIT(\\(?:GNU \\)?[eE]macs,\\s-*\\([0-9.]+\\)\\s-*[,)]") + (re-search-forward "AC_INIT(\\[?\\(?:GNU \\)?[eE]macs]?,\\s-*\\[?\\([0-9.]+\\)]?\\s-*[,)]") (setq ver (match-string 1)) ) ) diff --git a/make-dist b/make-dist index c1e7942d601..4646a2809bf 100755 --- a/make-dist +++ b/make-dist @@ -174,7 +174,7 @@ fi ### Find out which version of Emacs this is. version=` - sed -n 's/^AC_INIT(\[GNU Emacs],[ ]*\[\([^ ,)]*\)].*/\1/p' . */ EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES]) if test $HAVE_XFIXES = no; then # Test old way in case pkg-config doesn't have it (older machines). - AC_CHECK_HEADER(X11/extensions/Xfixes.h, - [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)]) + AC_CHECK_HEADER([X11/extensions/Xfixes.h], + [AC_CHECK_LIB([Xfixes], [XFixesHideCursor], [HAVE_XFIXES=yes])]) if test $HAVE_XFIXES = yes; then XFIXES_LIBS=-lXfixes fi fi if test $HAVE_XFIXES = yes; then - AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.]) + AC_DEFINE([HAVE_XFIXES], [1], + [Define to 1 if you have the Xfixes extension.]) fi fi - AC_SUBST(XFIXES_CFLAGS) - AC_SUBST(XFIXES_LIBS) + AC_SUBST([XFIXES_CFLAGS]) + AC_SUBST([XFIXES_LIBS]) Then, make sure to adjust CFLAGS and LIBES in src/Makefile.in and add the new XFIXES_CFLAGS and XFIXES_LIBS variables to diff --git a/test/lisp/progmodes/autoconf-tests.el b/test/lisp/progmodes/autoconf-tests.el index e383b4bb6c4..7c609f3c2a7 100644 --- a/test/lisp/progmodes/autoconf-tests.el +++ b/test/lisp/progmodes/autoconf-tests.el @@ -31,18 +31,18 @@ (ert-deftest autoconf-tests-current-defun-function-define () (with-temp-buffer - (insert "AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.])") + (insert "AC_DEFINE([HAVE_RSVG], [1], [Define to 1 if using librsvg.])") (goto-char (point-min)) (should-not (autoconf-current-defun-function)) - (forward-char 10) + (forward-char 11) (should (equal (autoconf-current-defun-function) "HAVE_RSVG")))) (ert-deftest autoconf-tests-current-defun-function-subst () (with-temp-buffer - (insert "AC_SUBST(srcdir)") + (insert "AC_SUBST([srcdir])") (goto-char (point-min)) (should-not (autoconf-current-defun-function)) - (forward-char 9) + (forward-char 10) (should (equal (autoconf-current-defun-function) "srcdir")))) (ert-deftest autoconf-tests-autoconf-mode-comment-syntax ()