all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#65598: Lock-file link target uses obsolete system-name variable
@ 2023-08-29 17:55 JD Smith
  2023-08-29 18:16 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: JD Smith @ 2023-08-29 17:55 UTC (permalink / raw)
  To: 65598

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.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#65598: Lock-file link target uses obsolete system-name variable
  2023-08-29 17:55 bug#65598: Lock-file link target uses obsolete system-name variable JD Smith
@ 2023-08-29 18:16 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-08-29 18:16 UTC (permalink / raw)
  To: JD Smith; +Cc: 65598

> From: JD Smith <jdtsmith@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.





^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-08-29 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-29 17:55 bug#65598: Lock-file link target uses obsolete system-name variable JD Smith
2023-08-29 18:16 ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.