As far as I can see the exit hooks for Emacs are not run when a user logs out from Windows 2000 or reboots the pc. I do not know however if this problem is specific to w32. It is in my opinion a serious problem that ought to be fixed before the release.

To show the problem eval the code below and then

  1) Just exit Emacs. In this case the log file will be written.

2) Instead log out from w2k. In this case the log file will not be written.


The test code:

 ;; Change the file name to something suiteable:
(defvar test-exit-file "c:/test/test-exit.tmp")

 (defun test-exit-write-stamp(from)
   (let ((old-buf (get-file-buffer test-exit-file)))
     (find-file test-exit-file)
     (goto-char (point-max))
     (unless old-buf
       (insert "\n")))
   (insert "From ") (insert from) (insert ": ")
   (insert (current-time-string))
   (insert "\n")
   (save-buffer))

 (add-hook
  'kill-emacs-query-functions
  (lambda()
    (test-exit-write-stamp "kill-emacs-query-functions")
    (message "From kill-emacs-query-functions")
    (sit-for 5)))

 (add-hook
  'kill-emacs-hook
  (lambda()
    (test-exit-write-stamp "kill-emacs-hook")
    (message "From kill-emacs-hook")
    (sit-for 5)))

---------
In GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195)
of 2006-06-25



_______________________________________________
emacs-pretest-bug mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug

Reply via email to