public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/proj/emacs:master commit in: eclass/
Date: Wed, 23 Apr 2025 17:37:53 +0000 (UTC)	[thread overview]
Message-ID: <1745426394.246af811f23557fcccbda6dcdd908db1c91b88d1.ulm@gentoo> (raw)

commit:     246af811f23557fcccbda6dcdd908db1c91b88d1
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 21 11:41:47 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Apr 23 16:39:54 2025 +0000
URL:        https://gitweb.gentoo.org/repo/proj/emacs.git/commit/?id=246af811

elisp-common.eclass: Add lexbind cookie to site-init files

This is needed for individual site-init files to be loaded, since Emacs
from Git now complains about missing lexical-binding cookies.

Drop any initial blank lines when installing site-init files in
elisp-site-file-install. Instead, insert blank lines when concatenating
the files in elisp-site-regen.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 eclass/elisp-common.eclass | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/eclass/elisp-common.eclass b/eclass/elisp-common.eclass
index 117544e..654b302 100644
--- a/eclass/elisp-common.eclass
+++ b/eclass/elisp-common.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2024 Gentoo Authors
+# Copyright 1999-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: elisp-common.eclass
@@ -626,12 +626,12 @@ elisp-modules-install() {
 
 elisp-site-file-install() {
 	local sf="${1##*/}" my_pn="${2:-${PN}}" modules ret
-	local add_header="1 {
-		# Find first non-empty line
-		:x; /^\$/ { n; bx; }
-		# Insert a header, unless we already look at one
-		/^;.*${PN}/I! s/^/;;; ${PN} site-lisp configuration\n\n/
-		1 s/^/\n/
+	local add_header="0,/\S/ {
+		# Delete any leading blank lines
+		/\S/! d
+		# Insert a header, unless we are already looking at one
+		/^;.*${PN}/I! \
+			i ;;; ${PN} site-lisp configuration  -*-lexical-binding:t-*-\n
 	}"
 
 	[[ ${sf} == [0-9][0-9]*-gentoo*.el ]] \
@@ -711,11 +711,15 @@ elisp-site-regen() {
 	;; DO NOT EDIT THIS FILE
 
 	;;; Code:
+
 	EOF
-	# Use sed instead of cat here, since files may miss a trailing newline.
-	sed '$q' "${sflist[@]}" </dev/null >>"${T}"/site-gentoo.el || ret=$?
+	# Concatenate all site initialisation files.
+	# 1{/^;/s/\s*-\*-.*-\*-//} deletes file-local-var cookies from line 1.
+	# /\S/,$!d deletes any leading blank lines.
+	# $G inserts a blank line after each file.
+	sed -s '1{/^;/s/\s*-\*-.*-\*-//};/\S/,$!d;$G' "${sflist[@]}" \
+		</dev/null >>"${T}"/site-gentoo.el || ret=$?
 	cat <<-EOF >>"${T}"/site-gentoo.el || ret=$?
-
 	${page}
 	(provide 'site-gentoo)
 


             reply	other threads:[~2025-04-23 17:37 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 17:37 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-12-29  9:23 [gentoo-commits] repo/proj/emacs:master commit in: eclass/ Ulrich Müller
2024-12-16 18:46 Ulrich Müller
2024-09-02 15:31 Ulrich Müller
2024-09-02 15:18 Ulrich Müller
2024-09-02 15:18 Ulrich Müller
2023-10-22 10:01 Ulrich Müller
2023-10-20 12:18 Ulrich Müller
2022-10-20  8:05 Ulrich Müller
2022-10-20  8:05 Ulrich Müller
2022-04-03 18:29 Ulrich Müller
2022-04-03 18:02 Ulrich Müller
2022-03-24  6:44 Ulrich Müller
2021-07-28  7:53 Ulrich Müller
2021-04-20 18:13 Ulrich Müller
2021-04-13  7:43 Ulrich Müller
2021-04-13  7:27 Ulrich Müller
2021-04-13  7:15 Ulrich Müller
2021-04-13  7:15 Ulrich Müller
2021-04-13  7:12 Ulrich Müller
2021-04-13  7:12 Ulrich Müller
2021-04-12 19:09 Ulrich Müller
2021-04-12 19:09 Ulrich Müller
2021-03-22  9:00 Ulrich Müller
2020-09-25 17:58 Ulrich Müller
2020-08-04 14:37 Ulrich Müller
2020-02-22 11:42 Ulrich Müller
2019-12-22 12:34 Ulrich Müller
2019-12-21 18:54 Ulrich Müller
2019-12-21 18:30 Ulrich Müller
2019-09-09  8:25 Ulrich Müller
2019-08-17 22:08 Ulrich Müller
2018-06-01 18:07 Ulrich Müller
2018-06-01 18:07 Ulrich Müller
2018-02-22 13:25 Ulrich Müller

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=1745426394.246af811f23557fcccbda6dcdd908db1c91b88d1.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox