From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Matt Armstrong Newsgroups: gmane.emacs.devel Subject: Please help me test this on MS-Windows Date: Sun, 07 Mar 2021 08:08:55 -0800 Message-ID: <871rcrndyg.fsf@mdeb> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29682"; mail-complaints-to="usenet@ciao.gmane.io" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Mar 07 17:09:37 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lIvyL-0007dB-Ci for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 17:09:37 +0100 Original-Received: from localhost ([::1]:49968 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lIvyK-0006ls-Db for ged-emacs-devel@m.gmane-mx.org; Sun, 07 Mar 2021 11:09:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44204) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIvxp-0006LQ-Gg for emacs-devel@gnu.org; Sun, 07 Mar 2021 11:09:05 -0500 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:59883) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lIvxn-0000e1-FN for emacs-devel@gnu.org; Sun, 07 Mar 2021 11:09:05 -0500 X-Originating-IP: 24.113.169.116 Original-Received: from mdeb (24-113-169-116.wavecable.com [24.113.169.116]) (Authenticated sender: matt@rfc20.org) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id F20B1FF807 for ; Sun, 7 Mar 2021 16:08:58 +0000 (UTC) Received-SPF: pass client-ip=217.70.183.199; envelope-from=matt@rfc20.org; helo=relay9-d.mail.gandi.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:266131 Archived-At: Can somebody with access to an MS-Windows machine help me test the code below? Evaling this in *scratch* suffices. `unlock-buffer' should signal an error. It does on POSIX-like systems. I'm 99% sure it will on MS-Windows too, but I'd like to confirm, as well as see the specific error thrown. Emacs 27 or 28 is fine. (let* ((dir (file-name-as-directory (make-temp-file "unlock-test" t))) (name (concat dir "a")) (lockname-as-directory (file-name-as-directory (concat dir ".#a"))) (spoiler-name (concat lockname-as-directory "spoiler"))) (unwind-protect (progn ;; Create a file named DIR/.#a/spoiler, then attempt to unlock a ;; buffer named DIR/a. `unlock-buffer' should signal a file-error. (make-directory lockname-as-directory) (with-temp-file spoiler-name (insert "Hello, World!")) (with-temp-buffer (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer)))) (delete-directory dir t nil)))