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

* Re: Please help me test this on MS-Windows
  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 18:30   ` Óscar Fuentes
  0 siblings, 2 replies; 5+ messages in thread
From: Óscar Fuentes @ 2021-03-07 16:37 UTC (permalink / raw)
  To: emacs-devel; +Cc: Matt Armstrong

Matt Armstrong <matt@rfc20.org> writes:

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

emacs -Q

GNU Emacs 27.1 (build 1, i686-w64-mingw32) of 2020-11-19

Debugger entered--Lisp error: (file-error "Unlocking file" #("Permission denied" 0 17 (charset windows-1252)) "c:/Users/Oscar/AppData/Local/Temp/unlock-testxeeb8...")
  unlock-buffer()
  (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer))
  (progn (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer)))
  (unwind-protect (progn (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))
  (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))
  (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
  (progn (make-directory lockname-as-directory) (let ((temp-file spoiler-name) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert "Hello, World!")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-modified-p t) (let ((buffer-file-name name) (buffer-file-truename name)) (unlock-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer))))))
  (unwind-protect (progn (make-directory lockname-as-directory) (let ((temp-file spoiler-name) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert "Hello, World!")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-modified-p t) (let (... ...) (unlock-buffer))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))))) (delete-directory dir t nil))
  (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 (make-directory lockname-as-directory) (let ((temp-file spoiler-name) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer (set-buffer temp-buffer) (insert "Hello, World!")) (save-current-buffer (set-buffer temp-buffer) (write-region nil nil temp-file nil 0))) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn (set-buffer-modified-p t) (let ... ...)) (and (buffer-name temp-buffe
 r) (kill-buffer temp-buffer)))))) (delete-directory dir t nil)))
  (progn (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 (make-directory lockname-as-directory) (let ((temp-file spoiler-name) (temp-buffer (generate-new-buffer " *temp file*"))) (unwind-protect (prog1 (save-current-buffer ... ...) (save-current-buffer ... ...)) (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn ... ...) (and ... ...))))) (delete-directory dir t nil))))
  eval((progn (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 (make-directory lockname-as-directory) (let ((temp-file spoiler-name) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...))) (let ((temp-buffer ...)) (save-current-buffer (set-buffer temp-buffer) (unwind-protect ... ...)))) (delete-directory dir t nil)))) t)
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  call-interactively(eval-last-sexp nil nil)
  command-execute(eval-last-sexp)




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

* Re: Please help me test this on MS-Windows
  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
  1 sibling, 1 reply; 5+ messages in thread
From: Eli Zaretskii @ 2021-03-07 16:56 UTC (permalink / raw)
  To: Óscar Fuentes; +Cc: matt, emacs-devel

> From: Óscar Fuentes <ofv@wanadoo.es>
> Date: Sun, 07 Mar 2021 17:37:57 +0100
> Cc: Matt Armstrong <matt@rfc20.org>
> 
> emacs -Q
> 
> GNU Emacs 27.1 (build 1, i686-w64-mingw32) of 2020-11-19
> 
> Debugger entered--Lisp error: (file-error "Unlocking file" #("Permission denied" 0 17 (charset windows-1252)) "c:/Users/Oscar/AppData/Local/Temp/unlock-testxeeb8...")
>   unlock-buffer()

Emacs 28 here: I also see Permission denied (i.e. EACCESS).



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

* Re: Please help me test this on MS-Windows
  2021-03-07 16:37 ` Óscar Fuentes
  2021-03-07 16:56   ` Eli Zaretskii
@ 2021-03-07 18:30   ` Óscar Fuentes
  1 sibling, 0 replies; 5+ messages in thread
From: Óscar Fuentes @ 2021-03-07 18:30 UTC (permalink / raw)
  To: emacs-devel

Óscar Fuentes <ofv@wanadoo.es> writes:

> emacs -Q
>
> GNU Emacs 27.1 (build 1, i686-w64-mingw32) of 2020-11-19
>
> Debugger entered--Lisp error: (file-error "Unlocking file" #("Permission denied" 0 17 (charset windows-1252)) "c:/Users/Oscar/AppData/Local/Temp/unlock-testxeeb8...")
>   unlock-buffer()

After the error, without exiting the backtrace: C-x C-c

Emacs asks `Save file "c:/Users/"...' I answer `n'. Then asks `Modifier
buffers exists; exit anyway?', I answer `yes'. Emacs hangs, 0% cpu use.
Had to kill it with the Windows Task Manager.

That doesn't happen if I exit the Bactrace buffer with `q'.




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

* Re: Please help me test this on MS-Windows
  2021-03-07 16:56   ` Eli Zaretskii
@ 2021-03-07 19:53     ` Matt Armstrong
  0 siblings, 0 replies; 5+ messages in thread
From: Matt Armstrong @ 2021-03-07 19:53 UTC (permalink / raw)
  To: Eli Zaretskii, Óscar Fuentes; +Cc: emacs-devel

Eli Zaretskii <eliz@gnu.org> writes:

>> From: �scar Fuentes <ofv@wanadoo.es>
>> Date: Sun, 07 Mar 2021 17:37:57 +0100
>> Cc: Matt Armstrong <matt@rfc20.org>
>> 
>> emacs -Q
>> 
>> GNU Emacs 27.1 (build 1, i686-w64-mingw32) of 2020-11-19
>> 
>> Debugger entered--Lisp error: (file-error "Unlocking file" #("Permission denied" 0 17 (charset windows-1252)) "c:/Users/Oscar/AppData/Local/Temp/unlock-testxeeb8...")
>>   unlock-buffer()
>
> Emacs 28 here: I also see Permission denied (i.e. EACCESS).

Great, thanks Óscar and Eli.



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