Subject: bug#49261: 28.0.50; File Locking Breaks Presumptuous Toolchains

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 07 Jul 2021 21:22:32 +0200

Eli Zaretskii <[email-masked]> writes:

> Btw, we could avoid having 2 places that produces the default
> ".#"+FILENAME lock file name by exposing to Lisp a C primitive which
> does that.  So that problem can easily be solved.

Yes, that's definitely true.  We could even make it more general and
then use it, for instance, in the auto-save code path, too.

That is, with a signature of, say...

(file-name-surround file-name prefix &optional suffix)

(file-name-surround "/tmp/foo.txt" "#" "#")
=> "/tmp/#foo.txt#"

It'd be less consing than the current

(concat (file-name-directory filename) "#" (file-name-nondirectory filename) "#")

code we have.

A better name would be nice, though.  :-)

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no