From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 13:56:18 2023 Received: (at submit) by debbugs.gnu.org; 29 Aug 2023 17:56:18 +0000 Received: from localhost ([127.0.0.1]:51495 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb2wr-0000cG-Uo for submit@debbugs.gnu.org; Tue, 29 Aug 2023 13:56:18 -0400 Received: from lists.gnu.org ([2001:470:142::17]:50068) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb2wp-0000c2-5l for submit@debbugs.gnu.org; Tue, 29 Aug 2023 13:56:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb2wc-0001Fz-DK for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2023 13:56:02 -0400 Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qb2wZ-0007K0-Cr for bug-gnu-emacs@gnu.org; Tue, 29 Aug 2023 13:56:02 -0400 Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-58fb8963617so53671067b3.3 for ; Tue, 29 Aug 2023 10:55:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693331757; x=1693936557; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=Zd4Tur/j9HL2BquaCp1zEVeYANBEYVBJSUhVwo1SfMw=; b=JbY3+TJwRJa6e/iudfPfcHRvzdt/+enD4Dfbd5anHd5wPOGv9DBRIsqcx2fmRB9dqd XvRfQBnzR74GbWJPWQgTMeMYNKl/fTOGZ3TWqg0++Aitt2N1KtGkGsPmGkzR9pK/O8R3 um0DSn1dOJWPyA2/8Z8B5lq3Vr9Ckxtf369ty+2qcvFGIjEeRlCCf/MhQN8C9PFpQYL8 S6gEhjBrNNa7vIHCWppzr4yK0nm7fsPl+QKyotVMLSorYp/llsqtV4WXu5Rm668NgwEv zhF8yrxxUE542IWweTLcA/QCxoCEAH/xD1iA7/tVOZgV6QqxtyH4iTlU4YQoZp967JJf ecEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693331757; x=1693936557; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zd4Tur/j9HL2BquaCp1zEVeYANBEYVBJSUhVwo1SfMw=; b=WfbqJy1lZjtOX7INUhy3Z3c5yY3L2+9nhj+oyD1vY/uhYLTq83C6u2DZfyN+x3e+/2 ehoB4ZJ5RgeQU4qiWBWC+VpVe5K9IYldw8SNPqZiHGySZGPsdO+/1G439EEJxQ0iOVzg PY+aR3qzs10LSPNFIAcEEKCBZCS7Mub5Mnq6aPUD5PQ6XJSXqMReJu0XY3Rp93vaCdxc eEflRFncb2DeQZIb+LvPRlyf03wxnlID/MV9eNrMmzELP6WH8dKqi6oQQKFwHTrRstO1 QnSMTn6LFo1/epnAU4aNE9AzndyYjrLrxY+JvkzxuIbGpli/tgALMy3ANWB0N18rLxer Yjdg== X-Gm-Message-State: AOJu0YxWbwOw36RBf8/cTFQz6oLBKnHTjghZx1Pm7Di9h1awsdWZGPjm iS/zUUzP5H7/TyHWohlE6CtNwdr9a/c= X-Google-Smtp-Source: AGHT+IHiFLbadkOIy9rNfpVRfsPoTjxOE+fka4/HaLb+CrvNjhOz7tPnTDkh7FtjcvqajWXk39Xp4w== X-Received: by 2002:a0d:ca0b:0:b0:58d:f1fe:5954 with SMTP id m11-20020a0dca0b000000b0058df1fe5954mr31060884ywd.32.1693331757448; Tue, 29 Aug 2023 10:55:57 -0700 (PDT) Received: from smtpclient.apple ([131.183.131.33]) by smtp.gmail.com with ESMTPSA id h84-20020a816c57000000b00583d1fa1fccsm2887970ywc.0.2023.08.29.10.55.56 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Aug 2023 10:55:56 -0700 (PDT) From: JD Smith Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Subject: Lock-file link target uses obsolete system-name variable Message-Id: <1C763881-7469-43DB-8679-11DA26E8BF32@gmail.com> Date: Tue, 29 Aug 2023 13:55:45 -0400 To: bug-gnu-emacs@gnu.org X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::1131; envelope-from=jdtsmith@gmail.com; helo=mail-yw1-x1131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) The variable system-name is obsoleted in favor of the (system-name) = function. But the lock file symlink target generated when file locks = are enabled still uses the value of the variable, not the function. This is important when you need to override the name of the system. In = my situation this is because (system-name) is dynamically updated as my = laptop is attached to different networks (host.local, host.some.fqdn, = etc.), leading to spurious "~/tmp/file locked by =E2=80=A6=E2=80=9D = prompts as I move around. I can easily fix this like: (setq system-name ; to prevent spurious locks as (system-name) changes (replace-regexp-in-string (rx ?. (* any) eos) "" (system-name))) but that utilizes the obsolete variable. Either un-obsoleting this = variable, or having the internal file-lock code call (system-name), so = it can be overridden with advice, is a suggested solution. See also #19438.= From debbugs-submit-bounces@debbugs.gnu.org Tue Aug 29 14:16:46 2023 Received: (at 65598) by debbugs.gnu.org; 29 Aug 2023 18:16:46 +0000 Received: from localhost ([127.0.0.1]:51526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb3Gg-00018L-Am for submit@debbugs.gnu.org; Tue, 29 Aug 2023 14:16:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41546) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qb3Gc-000185-Oy for 65598@debbugs.gnu.org; Tue, 29 Aug 2023 14:16:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qb3GQ-0003D9-76; Tue, 29 Aug 2023 14:16:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=FVJKHrDtnVFjyRWNAiNVX75AAvdHroN8O9MW9Q2Tjiw=; b=sMYVSiY/gNaL+6JH3VnX 9pbejPdMk4F6/Nw40yHevrN9BxPhEURa1VzPJrMx0RuKBNie0WhWBmOUShAYEtqGoJRrpEMBYGoxY qo0wsNRdDl837KQkBK8SS9vD4LtXby8oO7B1bhuKUBQ9b9xh+kXQs6HTMqQui4Do2/BJ68T9L5yfC MsPLdDCoZU6WsQjGNX5lqEmIOCQeiBrpOIeXdQfgotI6q16ZPmJ0uMp2MxO+uugisUaGPzMk3AhXo J3HfKefqCGtKSMZERU5maZ8nTFd2Aa0SClXl1q9e5PpXg+Da5Uc6+ypLftJinljuna5Z7jN+9fi2D XGS14j4x5knIGQ==; Date: Tue, 29 Aug 2023 21:16:06 +0300 Message-Id: <83ledthfyx.fsf@gnu.org> From: Eli Zaretskii To: JD Smith In-Reply-To: <1C763881-7469-43DB-8679-11DA26E8BF32@gmail.com> (message from JD Smith on Tue, 29 Aug 2023 13:55:45 -0400) Subject: Re: bug#65598: Lock-file link target uses obsolete system-name variable References: <1C763881-7469-43DB-8679-11DA26E8BF32@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 65598 Cc: 65598@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: JD Smith > Date: Tue, 29 Aug 2023 13:55:45 -0400 > > The variable system-name is obsoleted in favor of the (system-name) function. But the lock file symlink target generated when file locks are enabled still uses the value of the variable, not the function. > > This is important when you need to override the name of the system. In my situation this is because (system-name) is dynamically updated as my laptop is attached to different networks (host.local, host.some.fqdn, etc.), leading to spurious "~/tmp/file locked by …” prompts as I move around. > > I can easily fix this like: > > (setq system-name ; to prevent spurious locks as (system-name) changes > (replace-regexp-in-string (rx ?. (* any) eos) "" (system-name))) > > but that utilizes the obsolete variable. Either un-obsoleting this variable, or having the internal file-lock code call (system-name), so it can be overridden with advice, is a suggested solution. Or you can set system-name to the nil value.