all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* signal-USR1-hook woes
@ 2003-09-08  1:20 Bauke Jan Douma
  2003-09-08  6:27 ` Eli Zaretskii
       [not found] ` <mailman.344.1062998727.18171.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 3+ messages in thread
From: Bauke Jan Douma @ 2003-09-08  1:20 UTC (permalink / raw)


Hi,

I am trying to get a list of currently open files in emacs, by
sending it SIGUSR1 (signo=10).  I have the following defines:

(defvar emacs-open-files "/root/emacs/.emacs-open-files" "List of files currently open in Emacs")

(defun list-emacs-open-files ()
	(interactive)
	
	(message "list-emacs-open-files: done")
	(let	(
		 (buf_list (buffer-list))
		)

		(with-temp-file emacs-open-files
			(while buf_list                                             	
				(cond	(
					 (buffer-file-name (car buf_list))
					 (insert (buffer-file-name (car buf_list)))
					 (insert "\n")
					)
				)
				(setq buf_list (cdr buf_list))
			)
		)
	)
)

(add-hook `signal-USR1-hook `list-emacs-open-files nil nil)

Alas, it doesn't work.  It does work from within emacs by
calling M-x list-emacs-open-files or by eval'ing
(signal-process (emacs-pid) 10).
When doing kill -USR1 <emacs-pid>, all that happens is I get a
visual bell, the file is not written.
An strace reveals that the signal is sent allright.

I am doing something wrong, but what?
Thanks!

bjd

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

end of thread, other threads:[~2004-02-29  5:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-08  1:20 signal-USR1-hook woes Bauke Jan Douma
2003-09-08  6:27 ` Eli Zaretskii
     [not found] ` <mailman.344.1062998727.18171.help-gnu-emacs@gnu.org>
2004-02-29  5:50   ` Ed L Cashin

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.