GNU bug report logs - #65598
Lock-file link target uses obsolete system-name variable

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Tue, 29 Aug 2023 17:57:02 UTC

Severity: normal

To reply to this bug, email your comments to 65598 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#65598; Package emacs. (Tue, 29 Aug 2023 17:57:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to JD Smith <jdtsmith <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 29 Aug 2023 17:57:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Lock-file link target uses obsolete system-name variable
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.

See also #19438.



Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#65598; Package emacs. (Tue, 29 Aug 2023 18:17:02 GMT) Full text and rfc822 format available.

Message #8 received at 65598 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: JD Smith <jdtsmith <at> gmail.com>
Cc: 65598 <at> debbugs.gnu.org
Subject: Re: bug#65598: Lock-file link target uses obsolete system-name
 variable
Date: Tue, 29 Aug 2023 21:16:06 +0300
> From: JD Smith <jdtsmith <at> gmail.com>
> 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.




This bug report was last modified 248 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.