emacs-pretest-bug
[Top][All Lists]
Advanced

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

Exit hooks not run at logout on w32


From: Lennart Borgman
Subject: Exit hooks not run at logout on w32
Date: Mon, 26 Jun 2006 18:05:11 +0200
User-agent: Thunderbird 1.5.0.4 (Windows/20060516)


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





reply via email to

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