Subject: bug#74661: closed (Re: bug#74661: [PATCH] Make time-stamp after-save-hooks buffer-local.)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 03 Dec 2024 22:58:02 +0000

Your bug report

#74661: [PATCH] Make time-stamp after-save-hooks buffer-local.

which was filed against the automake package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
74661: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=74661
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#74661: [PATCH] Make time-stamp after-save-hooks buffer-local.
From: Karl Berry <[email-masked]>
To: [email-masked]
Cc: [email-masked]
Date: Tue, 3 Dec 2024 15:57:17 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi Collin - looks fine to me. Applied. Thank you for updating the
timestamps and providing the ChangeLog entry. --happy hacking, karl.

Subject: [PATCH] Make time-stamp after-save-hooks buffer-local.
From: Collin Funk <[email-masked]>
To: [email-masked]
Date: Mon, 02 Dec 2024 19:27:43 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

I applied a similar patch like this to Gnulib a while ago.

Basically, the use of this in files:

    # eval: (add-hook 'before-save-hook 'time-stamp)

modifies the global before-save-hook for Emacs, i.e. even after closing
the file. This caused some annoyance because it wouldn't work with this
in your Emacs init file:

    (setq enable-local-variables :safe)

The solution to this is to use:

    # eval: (add-hook 'before-save-hook 'time-stamp nil t)

so it only enables it on the current buffer.

Collin

>From f09fb67eff602dc0b78ddeca3d14c54d0e355771 Mon Sep 17 00:00:00 2001
From: Collin Funk <[email-masked]>
Date: Mon, 2 Dec 2024 19:11:40 -0800
Subject: [PATCH] Make time-stamp after-save-hooks buffer-local.

* 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 <[email-masked]>.
@@ -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 <[email-masked]>, 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 <[email-masked]>
 # 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 <[email-masked]> or send patches to
 # <[email-masked]>.
 
-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.47.1