unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Matt Armstrong <matt@rfc20.org>
To: emacs-devel@gnu.org
Subject: Please help me test this on MS-Windows
Date: Sun, 07 Mar 2021 08:08:55 -0800	[thread overview]
Message-ID: <871rcrndyg.fsf@mdeb> (raw)

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)))



             reply	other threads:[~2021-03-07 16:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-07 16:08 Matt Armstrong [this message]
2021-03-07 16:37 ` Please help me test this on MS-Windows Óscar Fuentes
2021-03-07 16:56   ` Eli Zaretskii
2021-03-07 19:53     ` Matt Armstrong
2021-03-07 18:30   ` Óscar Fuentes

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871rcrndyg.fsf@mdeb \
    --to=matt@rfc20.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).