unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Please help me test this on MS-Windows
@ 2021-03-07 16:08 Matt Armstrong
  2021-03-07 16:37 ` Óscar Fuentes
  0 siblings, 1 reply; 5+ messages in thread
From: Matt Armstrong @ 2021-03-07 16:08 UTC (permalink / raw)
  To: emacs-devel

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



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

end of thread, other threads:[~2021-03-07 19:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-03-07 16:08 Please help me test this on MS-Windows Matt Armstrong
2021-03-07 16:37 ` Óscar Fuentes
2021-03-07 16:56   ` Eli Zaretskii
2021-03-07 19:53     ` Matt Armstrong
2021-03-07 18:30   ` Óscar Fuentes

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