emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 54e0b14a69: Adjust better to Autoconf quoting style change


From: Paul Eggert
Subject: master 54e0b14a69: Adjust better to Autoconf quoting style change
Date: Wed, 6 Jul 2022 00:27:26 -0400 (EDT)

branch: master
commit 54e0b14a6981a317210493f0fead1e2c5b6508ea
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    Adjust better to Autoconf quoting style change
    
    * 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 5da70a4028..a214dcbcb7 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 77d20a5a7b..39ac1fde60 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 9a73cf5a40..b0a1d34251 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 19dc14202d..ecca7afd00 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 5a23f504f7..cbe766cedb 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 c1e7942d60..4646a2809b 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' 
<configure.ac
+  sed -n 's/^AC_INIT(\[GNU Emacs],[     ]*\[\([^]]*\).*/\1/p' <configure.ac
 ` || version=
 if [ ! "${version}" ]; then
   printf '%s\n' \
diff --git a/src/xterm.c b/src/xterm.c
index 45aef51ecb..996a441fda 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -233,18 +233,19 @@ along with GNU Emacs.  If not, see 
<https://www.gnu.org/licenses/>.  */
        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 e383b4bb6c..7c609f3c2a 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 ()



reply via email to

[Prev in Thread] Current Thread [Next in Thread]