From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: bjdouma@xs2.xs4all.nl (Bauke Jan Douma) Newsgroups: gmane.emacs.help Subject: signal-USR1-hook woes Date: 08 Sep 2003 01:20:28 GMT Organization: a training zoo Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3f5bd95c$0$49102$e4fe514c@news.xs4all.nl> Reply-To: bjdouma@xs4all.nl NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1062984744 14329 80.91.224.253 (8 Sep 2003 01:32:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 8 Sep 2003 01:32:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 08 03:32:21 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19wAtB-0006Be-00 for ; Mon, 08 Sep 2003 03:32:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 19wArl-0004hP-VW for geh-help-gnu-emacs@m.gmane.org; Sun, 07 Sep 2003 21:30:53 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!syros.belnet.be!news.belnet.be!transit.news.xs4all.nl!not-for-mail Original-Newsgroups: gnu.emacs.help X-Newsreader: trn 4.0-test76 (Apr 2, 2001) Originator: bjdouma@xs2.xs4all.nl (Bauke Jan Douma) Original-Lines: 43 Original-NNTP-Posting-Date: 08 Sep 2003 03:20:28 CEST Original-NNTP-Posting-Host: 194.109.3.12 Original-X-Trace: 1062984028 news.xs4all.nl 49102 194.109.3.12:1562 Original-X-Complaints-To: abuse@xs4all.nl Original-Xref: shelby.stanford.edu gnu.emacs.help:116421 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:12340 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:12340 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 , 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