From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 6B1A71584AD for ; Wed, 23 Apr 2025 15:09:19 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4AA4734305D for ; Wed, 23 Apr 2025 15:09:19 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 4CC3011029A; Wed, 23 Apr 2025 15:09:18 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 4412311029A for ; Wed, 23 Apr 2025 15:09:18 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E9CF534305D for ; Wed, 23 Apr 2025 15:09:17 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 604D623D0 for ; Wed, 23 Apr 2025 15:09:16 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1745420538.3ba318e113caaa573ee6c2ce8360a8c6f5b1167d.ulm@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/elisp-common.eclass X-VCS-Directories: eclass/ X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 3ba318e113caaa573ee6c2ce8360a8c6f5b1167d X-VCS-Branch: master Date: Wed, 23 Apr 2025 15:09:16 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b6d0066b-69c1-4c84-abe5-afc3c92d2db4 X-Archives-Hash: 045cbef04ef90a50464aface4e867d0f commit: 3ba318e113caaa573ee6c2ce8360a8c6f5b1167d Author: Ulrich Müller gentoo org> AuthorDate: Mon Apr 21 11:41:47 2025 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Wed Apr 23 15:02:18 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3ba318e1 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 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 117544e94b35..654b302bb39a 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[@]}" >"${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[@]}" \ + >"${T}"/site-gentoo.el || ret=$? cat <<-EOF >>"${T}"/site-gentoo.el || ret=$? - ${page} (provide 'site-gentoo)