emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Please help me test this on MS-Windows


From: Matt Armstrong
Subject: Please help me test this on MS-Windows
Date: Sun, 07 Mar 2021 08:08:55 -0800

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 via email to

[Prev in Thread] Current Thread [Next in Thread]