From cee9ca0a4c25130592829e218fee6d5f68552b8b Mon Sep 17 00:00:00 2001 From: Collin Funk Date: Tue, 3 Dec 2024 14:56:53 -0800 Subject: [PATCH] lib scripts: Make time-stamp after-save-hooks buffer-local. From https://bugs.gnu.org/74661. * contrib/tap-driver.pl: Add time-stamp-line-limit so Emacs updates the timestamp. Pass optional arguments to 'add-hook'. * lib/tap-driver.sh: Likewise. * lib/compile: Pass optional arguments to 'add-hook'. * lib/depcomp: Likewise. * lib/install-sh: Likewise. * lib/mdate-sh: Likewise. * lib/missing: Likewise. * lib/mkinstalldirs: Likewise. * lib/py-compile: Likewise. * lib/test-driver: Likewise. * lib/ylwrap: Likewise. --- contrib/tap-driver.pl | 5 +++-- lib/compile | 4 ++-- lib/depcomp | 4 ++-- lib/install-sh | 4 ++-- lib/mdate-sh | 4 ++-- lib/missing | 4 ++-- lib/mkinstalldirs | 4 ++-- lib/py-compile | 4 ++-- lib/tap-driver.sh | 5 +++-- lib/test-driver | 4 ++-- lib/ylwrap | 4 ++-- 11 files changed, 24 insertions(+), 22 deletions(-) diff --git a/contrib/tap-driver.pl b/contrib/tap-driver.pl index 6a57bb080..5fdf38b0a 100755 --- a/contrib/tap-driver.pl +++ b/contrib/tap-driver.pl @@ -32,7 +32,7 @@ use strict; use Getopt::Long (); use TAP::Parser; -my $VERSION = '2013-12-24.15'; # UTC +my $VERSION = '2024-12-03.03'; # UTC my $ME = "tap-driver.pl"; @@ -555,7 +555,8 @@ main @ARGV; # cperl-extra-newline-before-brace: t # cperl-merge-trailing-else: nil # cperl-continued-statement-offset: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-line-limit: 50 # time-stamp-start: "my $VERSION = " # time-stamp-format: "'%:y-%02m-%02d.%02H'" # time-stamp-time-zone: "UTC0" diff --git a/lib/compile b/lib/compile index 49b3d05fd..c3e8760e9 100755 --- a/lib/compile +++ b/lib/compile @@ -1,7 +1,7 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. # Written by Tom Tromey . @@ -343,7 +343,7 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/depcomp b/lib/depcomp index 1f0aa972c..87974bf3e 100755 --- a/lib/depcomp +++ b/lib/depcomp @@ -1,7 +1,7 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 1999-2024 Free Software Foundation, Inc. @@ -784,7 +784,7 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/install-sh b/lib/install-sh index b1d7a6f67..8a76989bb 100755 --- a/lib/install-sh +++ b/lib/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -533,7 +533,7 @@ do done # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/mdate-sh b/lib/mdate-sh index 764e142ee..da9c9f7d4 100755 --- a/lib/mdate-sh +++ b/lib/mdate-sh @@ -1,7 +1,7 @@ #!/bin/sh # Get modification time of a file or directory and pretty-print it. -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 1995-2024 Free Software Foundation, Inc. # written by Ulrich Drepper , June 1995 @@ -222,7 +222,7 @@ echo $day $month $year # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/missing b/lib/missing index 7e7d78ec5..03c4378e1 100755 --- a/lib/missing +++ b/lib/missing @@ -1,7 +1,7 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU and other programs. -scriptversion=2024-06-07.14; # UTC +scriptversion=2024-12-03.03; # UTC # shellcheck disable=SC2006,SC2268 # we must support pre-POSIX shells @@ -228,7 +228,7 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/mkinstalldirs b/lib/mkinstalldirs index e536369cc..02e046b9b 100755 --- a/lib/mkinstalldirs +++ b/lib/mkinstalldirs @@ -1,7 +1,7 @@ #! /bin/sh # mkinstalldirs --- make directory hierarchy -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Original author: Noah Friedman # Created: 1993-05-16 @@ -156,7 +156,7 @@ exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/py-compile b/lib/py-compile index c9d4fde94..d57bf1c7d 100755 --- a/lib/py-compile +++ b/lib/py-compile @@ -1,7 +1,7 @@ #!/bin/sh # py-compile - Compile a Python program -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 2000-2024 Free Software Foundation, Inc. @@ -236,7 +236,7 @@ esac # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/tap-driver.sh b/lib/tap-driver.sh index bd9597588..78eb13711 100755 --- a/lib/tap-driver.sh +++ b/lib/tap-driver.sh @@ -23,7 +23,7 @@ # bugs to or send patches to # . -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. @@ -647,7 +647,8 @@ test $? -eq 0 || fatal "I/O or internal error" # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) +# time-stamp-line-limit: 50 # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/test-driver b/lib/test-driver index dc38f623f..6bd0d0517 100755 --- a/lib/test-driver +++ b/lib/test-driver @@ -1,7 +1,7 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 2011-2024 Free Software Foundation, Inc. # @@ -152,7 +152,7 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" diff --git a/lib/ylwrap b/lib/ylwrap index 9e63acd92..2ac4fce89 100755 --- a/lib/ylwrap +++ b/lib/ylwrap @@ -1,7 +1,7 @@ #! /bin/sh # ylwrap - wrapper for lex/yacc invocations. -scriptversion=2024-06-19.01; # UTC +scriptversion=2024-12-03.03; # UTC # Copyright (C) 1996-2024 Free Software Foundation, Inc. # @@ -237,7 +237,7 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'before-save-hook 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp nil t) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" -- 2.11.4.GIT