From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: filenotify.el Date: Tue, 25 Jun 2013 14:02:38 +0200 Message-ID: <87d2ra9z4x.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1372161783 20523 80.91.229.3 (25 Jun 2013 12:03:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Jun 2013 12:03:03 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 25 14:03:02 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UrRxc-000356-31 for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 14:03:00 +0200 Original-Received: from localhost ([::1]:41883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrRxY-0006ff-5m for ged-emacs-devel@m.gmane.org; Tue, 25 Jun 2013 08:02:56 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46835) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrRxS-0006e9-3S for emacs-devel@gnu.org; Tue, 25 Jun 2013 08:02:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UrRxO-0002L6-Mq for emacs-devel@gnu.org; Tue, 25 Jun 2013 08:02:50 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:55235) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UrRxO-0002Kt-9w for emacs-devel@gnu.org; Tue, 25 Jun 2013 08:02:46 -0400 Original-Received: from mailout-de.gmx.net ([10.1.76.27]) by mrigmx.server.lan (mrigmx001) with ESMTP (Nemesis) id 0MhPBM-1UestD019W-00MZpx for ; Tue, 25 Jun 2013 14:02:45 +0200 Original-Received: (qmail invoked by alias); 25 Jun 2013 12:02:41 -0000 Original-Received: from p5B2989B6.dip0.t-ipconnect.de (EHLO detlef.gmx.de) [91.41.137.182] by mail.gmx.net (mp027) with SMTP; 25 Jun 2013 14:02:41 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX19qJdxO9MBq1QUC6JO+8Viu4iOZ/kk7QbpmLIzPhr hycQdFNyLS25Vj User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.17.21 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:161021 Archived-At: --=-=-= Content-Type: text/plain Hi, I have written filenotify.el, which is intended as upper layer for gfilenotify.c, inotify.c and w32notify.c. This is a simplified interface, which offers just file change or file attribute change notifications. I believe this is sufficient for the use-cases in Emacs; if more fine granular notifications are needed, one could still use one of the low-level packages. The package is appended, together with needed changes in subr.el and autorevert.el. I've tested it with gfilenotify and inotify; the tests for w32notify I cannot perform as usual. There are still some changes needed, but basic functionality shall be available. Beside further tests and bug fixing, I plan to write ert tests as well as a Tramp file name handler. Documentation is also lacking. But these steps could be applied later, once there is an agreement about the interface. Comments? Best regards, Michael. --=-=-= Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename=filenotify.diff Content-Transfer-Encoding: quoted-printable =3D=3D=3D modified file 'lisp/ChangeLog' *** lisp/ChangeLog 2013-06-25 09:18:09 +0000 --- lisp/ChangeLog 2013-06-25 11:44:00 +0000 *************** *** 1,11 **** 2013-06-25 R=C3=BCdiger Sonderfeld =20=20 ! * lisp/textmodes/bibtex.el (bibtex-generate-url-list): Add support for DOI URLs. =20=20 2013-06-25 R=C3=BCdiger Sonderfeld =20=20 ! * lisp/textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): Update imenu-support when dialect changes. =20=20 2013-06-25 Leo Liu --- 1,23 ---- + 2013-06-25 Michael Albinus +=20 + * filenotify.el: New package. +=20 + * autorevert.el (top): Require filenotify.el. + (auto-revert-notify-enabled): Remove. Use `file-notify-support' + instead. + (auto-revert-notify-rm-watch, auto-revert-notify-add-watch) + (auto-revert-notify-handler): Use `file-notify-*' functions. +=20 + * subr.el (file-notify-handle-event): Move function to filenotify.el. +=20 2013-06-25 R=C3=BCdiger Sonderfeld =20=20 ! * textmodes/bibtex.el (bibtex-generate-url-list): Add support for DOI URLs. =20=20 2013-06-25 R=C3=BCdiger Sonderfeld =20=20 ! * textmodes/bibtex.el (bibtex-mode, bibtex-set-dialect): Update imenu-support when dialect changes. =20=20 2013-06-25 Leo Liu =3D=3D=3D modified file 'lisp/autorevert.el' *** lisp/autorevert.el 2013-06-05 19:57:10 +0000 --- lisp/autorevert.el 2013-06-25 11:41:17 +0000 *************** *** 103,108 **** --- 103,109 ---- =20=20 (eval-when-compile (require 'cl-lib)) (require 'timer) + (require 'filenotify) =20=20 ;; Custom Group: ;; *************** *** 270,290 **** :type 'boolean :version "24.4") =20=20 ! (defconst auto-revert-notify-enabled ! (or (featurep 'gfilenotify) (featurep 'inotify) (featurep 'w32notify)) ! "Non-nil when Emacs has been compiled with file notification support.") !=20 ! (defcustom auto-revert-use-notify auto-revert-notify-enabled "If non-nil Auto Revert Mode uses file notification functions. This requires Emacs being compiled with file notification ! support (see `auto-revert-notify-enabled'). You should set this ! variable through Custom." :group 'auto-revert :type 'boolean :set (lambda (variable value) ! (set-default variable (and auto-revert-notify-enabled value)) (unless (symbol-value variable) ! (when auto-revert-notify-enabled (dolist (buf (buffer-list)) (with-current-buffer buf (when (symbol-value 'auto-revert-notify-watch-descriptor) --- 271,287 ---- :type 'boolean :version "24.4") =20=20 ! (defcustom auto-revert-use-notify file-notify-support "If non-nil Auto Revert Mode uses file notification functions. This requires Emacs being compiled with file notification ! support (see `file-notify-support'). You should set this variable ! through Custom." :group 'auto-revert :type 'boolean :set (lambda (variable value) ! (set-default variable (and file-notify-support value)) (unless (symbol-value variable) ! (when file-notify-support (dolist (buf (buffer-list)) (with-current-buffer buf (when (symbol-value 'auto-revert-notify-watch-descriptor) *************** *** 502,513 **** (puthash key value auto-revert-notify-watch-descriptor-hash-list) (remhash key auto-revert-notify-watch-descriptor-hash-list) (ignore-errors ! (funcall ! (cond ! ((fboundp 'gfile-rm-watch) 'gfile-rm-watch) ! ((fboundp 'inotify-rm-watch) 'inotify-rm-watch) ! ((fboundp 'w32notify-rm-watch) 'w32notify-rm-watch)) ! auto-revert-notify-watch-descriptor))))) auto-revert-notify-watch-descriptor-hash-list) (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) (setq auto-revert-notify-watch-descriptor nil --- 499,505 ---- (puthash key value auto-revert-notify-watch-descriptor-hash-list) (remhash key auto-revert-notify-watch-descriptor-hash-list) (ignore-errors ! (file-notify-rm-watch auto-revert-notify-watch-descriptor))))) auto-revert-notify-watch-descriptor-hash-list) (remove-hook 'kill-buffer-hook 'auto-revert-notify-rm-watch)) (setq auto-revert-notify-watch-descriptor nil *************** *** 522,621 **** =20=20 (when (and buffer-file-name auto-revert-use-notify (not auto-revert-notify-watch-descriptor)) ! (let ((func ! (cond ! ((fboundp 'gfile-add-watch) 'gfile-add-watch) ! ((fboundp 'inotify-add-watch) 'inotify-add-watch) ! ((fboundp 'w32notify-add-watch) 'w32notify-add-watch))) ! (aspect ! (cond ! ((fboundp 'gfile-add-watch) '(watch-mounts)) ! ;; `attrib' is needed for file modification time. ! ((fboundp 'inotify-add-watch) '(attrib create modify moved-to)) ! ((fboundp 'w32notify-add-watch) '(size last-write-time)))) ! (file (if (or (fboundp 'gfile-add-watch) (fboundp 'inotify-add-watch)) ! (directory-file-name (expand-file-name default-directory)) ! (buffer-file-name)))) ! (setq auto-revert-notify-watch-descriptor ! (ignore-errors ! (funcall func file aspect 'auto-revert-notify-handler))) ! (if auto-revert-notify-watch-descriptor ! (progn ! (puthash ! auto-revert-notify-watch-descriptor ! (cons (current-buffer) ! (gethash auto-revert-notify-watch-descriptor ! auto-revert-notify-watch-descriptor-hash-list)) ! auto-revert-notify-watch-descriptor-hash-list) ! (add-hook (make-local-variable 'kill-buffer-hook) ! 'auto-revert-notify-rm-watch)) ! ;; Fallback to file checks. ! (set (make-local-variable 'auto-revert-use-notify) nil))))) !=20 ! (defun auto-revert-notify-event-p (event) ! "Check that event is a file notification event." ! (and (listp event) ! (cond ((featurep 'gfilenotify) ! (and (>=3D (length event) 3) (stringp (nth 2 event)))) ! ((featurep 'inotify) ! (=3D (length event) 4)) ! ((featurep 'w32notify) ! (and (=3D (length event) 3) (stringp (nth 2 event))))))) !=20 ! (defun auto-revert-notify-event-descriptor (event) ! "Return watch descriptor of file notification event, or nil." ! (and (auto-revert-notify-event-p event) (car event))) !=20 ! (defun auto-revert-notify-event-action (event) ! "Return action of file notification event, or nil." ! (and (auto-revert-notify-event-p event) (nth 1 event))) !=20 ! (defun auto-revert-notify-event-file-name (event) ! "Return file name of file notification event, or nil." ! (and (auto-revert-notify-event-p event) ! (cond ((featurep 'gfilenotify) (nth 2 event)) ! ((featurep 'inotify) (nth 3 event)) ! ((featurep 'w32notify) (nth 2 event))))) =20=20 (defun auto-revert-notify-handler (event) "Handle an EVENT returned from file notification." ! (when (auto-revert-notify-event-p event) ! (let* ((descriptor (auto-revert-notify-event-descriptor event)) ! (action (auto-revert-notify-event-action event)) ! (file (auto-revert-notify-event-file-name event)) ! (buffers (gethash descriptor ! auto-revert-notify-watch-descriptor-hash-list))) ! (ignore-errors ! ;; Check, that event is meant for us. ! ;; TODO: Filter events which stop watching, like `move' or `removed'. ! (cl-assert descriptor) ! (cond ! ((featurep 'gfilenotify) ! (cl-assert (memq action '(attribute-changed changed created deleted ! ;; FIXME: I keep getting this action,= so I ! ;; added it here, but I have no idea = what ! ;; I'm doing. --Stef ! changes-done-hint)) ! t)) ! ((featurep 'inotify) ! (cl-assert (or (memq 'attrib action) ! (memq 'create action) ! (memq 'modify action) ! (memq 'moved-to action)))) ! ((featurep 'w32notify) (cl-assert (eq 'modified action)))) ! ;; Since we watch a directory, a file name must be returned. ! (cl-assert (stringp file)) ! (dolist (buffer buffers) ! (when (buffer-live-p buffer) ! (with-current-buffer buffer ! (when (and (stringp buffer-file-name) ! (string-equal ! (file-name-nondirectory file) ! (file-name-nondirectory buffer-file-name))) ! ;; Mark buffer modified. ! (setq auto-revert-notify-modified-p t) ! ;; No need to check other buffers. ! (cl-return))))))))) =20=20 (defun auto-revert-active-p () "Check if auto-revert is active (in current buffer or globally)." --- 514,562 ---- =20=20 (when (and buffer-file-name auto-revert-use-notify (not auto-revert-notify-watch-descriptor)) ! (setq auto-revert-notify-watch-descriptor ! (ignore-errors ! (file-notify-add-watch ! (directory-file-name (expand-file-name default-directory)) ! '(change attribute-change) 'auto-revert-notify-handler))) ! (if auto-revert-notify-watch-descriptor ! (progn ! (puthash ! auto-revert-notify-watch-descriptor ! (cons (current-buffer) ! (gethash auto-revert-notify-watch-descriptor ! auto-revert-notify-watch-descriptor-hash-list)) ! auto-revert-notify-watch-descriptor-hash-list) ! (add-hook (make-local-variable 'kill-buffer-hook) ! 'auto-revert-notify-rm-watch)) ! ;; Fallback to file checks. ! (set (make-local-variable 'auto-revert-use-notify) nil)))) =20=20 (defun auto-revert-notify-handler (event) "Handle an EVENT returned from file notification." ! (let* ((descriptor (car event)) ! (action (nth 1 event)) ! (file (nth 2 event)) ! (buffers (gethash descriptor ! auto-revert-notify-watch-descriptor-hash-list))) ! (ignore-errors ! ;; Check, that event is meant for us. ! ;; TODO: Filter events which stop watching, like `move' or `removed= '. ! (cl-assert descriptor) ! (cl-assert (memq action '(attribute-changed changed created deleted= )) t) ! ;; Since we watch a directory, a file name must be returned. ! (cl-assert (stringp file)) ! (dolist (buffer buffers) ! (when (buffer-live-p buffer) ! (with-current-buffer buffer ! (when (and (stringp buffer-file-name) ! (string-equal ! (file-name-nondirectory file) ! (file-name-nondirectory buffer-file-name))) ! ;; Mark buffer modified. ! (setq auto-revert-notify-modified-p t) ! ;; No need to check other buffers. ! (cl-return)))))))) =20=20 (defun auto-revert-active-p () "Check if auto-revert is active (in current buffer or globally)." =3D=3D=3D added file 'lisp/filenotify.el' *** lisp/filenotify.el 1970-01-01 00:00:00 +0000 --- lisp/filenotify.el 2013-06-25 11:36:23 +0000 *************** *** 0 **** --- 1,244 ---- + ;;; filenotify.el --- watch files for changes on disk +=20 + ;; Copyright (C) 2013 Free Software Foundation, Inc. +=20 + ;; Author: Michael Albinus +=20 + ;; This file is part of GNU Emacs. +=20 + ;; GNU Emacs is free software: you can redistribute it and/or modify + ;; it under the terms of the GNU General Public License as published by + ;; the Free Software Foundation, either version 3 of the License, or + ;; (at your option) any later version. +=20 + ;; GNU Emacs is distributed in the hope that it will be useful, + ;; but WITHOUT ANY WARRANTY; without even the implied warranty of + ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + ;; GNU General Public License for more details. +=20 + ;; You should have received a copy of the GNU General Public License + ;; along with GNU Emacs. If not, see . +=20 + ;;; Commentary +=20 + ;; This package is an abstraction layer from the different low-level + ;; file notification packages `gfilenotify', `inotify' and + ;; `w32notify'. +=20 + ;;; Code: +=20 + ;; We check that there is exactly one low-level package. + ;;;###autoload + (defconst file-notify-support + (or (and (featurep 'gfilenotify) + (not (featurep 'inotify)) + (not (featurep 'w32notify))) + (and (not (featurep 'gfilenotify)) + (featurep 'inotify) + (not (featurep 'w32notify))) + (and (not (featurep 'gfilenotify)) + (not (featurep 'inotify)) + (featurep 'w32notify))) + "Non-nil when Emacs has been compiled with file notification support.") +=20 + ;; Shouldn't this be `file-notify-error'? + (defconst filewatch-error nil + "The file notification error symbol") + (put 'filewatch-error 'error-conditions '(filewatch-error file-error erro= r)) + (put 'filewatch-error 'error-message "Filewatch error") +=20 + (defvar file-notify-descriptors (make-hash-table :test 'equal) + "Hash table for registered file notification descriptors. + A key in this hash table is the descriptor as returned from a + `gfilenotify', `inotify' or `w32notify'. The value in the hash + table is the cons cell (FILE . CALLBACK).") +=20 + ;; This function is used by `gfilenotify', `inotify' and `w32notify' even= ts. + ;;;###autoload + (defun file-notify-handle-event (event) + "Handle file system monitoring event. + If EVENT is a filewatch event, call its callback. + Otherwise, signal a `filewatch-error'." + (interactive "e") + (if (and (eq (car event) 'file-notify) + (>=3D (length event) 3)) + (funcall (nth 2 event) (nth 1 event)) + (signal 'filewatch-error + (cons "Not a valid file-notify event" event)))) +=20 + (defun file-notify-event-file-name (event) + "Return file name of file notification event, or nil." + (cond ((featurep 'gfilenotify) (nth 2 event)) + ((featurep 'inotify) (nth 3 event)) + ((featurep 'w32notify) (nth 2 event)))) +=20 + (defun file-notify-event-file1-name (event) + "Return second file name of file notification event, or nil. + This is available in case a file has been moved." + (cond ((featurep 'gfilenotify) (nth 3 event)) + ((featurep 'inotify) (nth 4 event)) + ((featurep 'w32notify) (nth 3 event)))) +=20 + ;; The callback function used to map between specific flags of the + ;; respective file notifications, and the ones we return. + (defun file-notify-callback (event) + "Handle an EVENT returned from file notification. + EVENT is the same one as in `file-notify-handle-event' except the + car of that event, which is the symbol `file-notify'." + (let ((descriptor (car event)) + (action (nth 1 event)) + (file (file-notify-event-file-name event)) + (file1 (file-notify-event-file1-name event)) + callback tmp) + ;; Check, that event is meant for us. + (unless (setq callback (cdr (gethash descriptor file-notify-descripto= rs))) + (signal 'filewatch-error (list "Not a valid descriptor" descriptor)= )) +=20 + ;; Map action. We ignore all events which cannot be mapped. + (setq action + (cond + ((featurep 'gfilenotify) + (cond + ((memq action '(attribute-changed changed created deleted moved)) + action))) + ((featurep 'inotify) + (cond + ((memq 'attrib action) 'attribute-changed) + ((memq 'create action) 'created) + ((memq 'modify action) 'changed) + ((memq 'delete action) 'deleted) + ((memq 'delete-self action) 'deleted) + ((memq 'moved-from action) 'deleted) + ((memq 'moved-to action) 'created) + ((memq 'move-self action) 'deleted))) + ((featurep 'w32notify) + (cond + ((eq 'added action) 'created) + ((eq 'modified action) 'changed) + ((eq 'removed action) 'deleted) + ((eq 'renamed-from action) 'deleted) + ((eq 'renamed-to action) 'created))))) +=20 + ;; Apply callback. + (when (and (stringp file) (eq action 'moved)) + (funcall callback (list descriptor 'deleted file)) + (setq action 'created file file1)) + (when (and (stringp file) action) + (funcall callback (list descriptor action file))))) +=20 + ;; We do not return a `renamed' action, for simplicity. This could be + ;; added later on. + (defun file-notify-add-watch (file flags callback) + "Add a watch for filesystem events pertaining to FILE. + This arranges for filesystem events pertaining to FILE to be reported + to Emacs. Use `file-notify-rm-watch' to cancel the watch. +=20 + The returned value is a descriptor for the added watch. If the + file cannot be watched for some reason, this function signals a + `file-error' error. +=20 + FLAGS is a list of conditions to set what will be watched for. It can + include the following symbols: +=20 + `change' -- watch for file changes + `attribute-change' -- watch for file attributes changes, like + permissions or modification time +=20 + If FILE is a directory, 'change' watches for file creation or + deletion in that directory. +=20 + When any event happens, Emacs will call the CALLBACK function passing + it a single argument EVENT, which is of the form +=20 + (DESCRIPTOR ACTION FILE [FILE1]) +=20 + DESCRIPTOR is the same object as the one returned by this function. + ACTION is the description of the event. It could be any one of the + following: +=20 + `created' -- FILE was created + `deleted' -- FILE was deleted + `changed' -- FILE has changed + `attribute-changed' -- a FILE attribute was changed +=20 + FILE is the name of the file whose event is being reported." + ;; Check arguments. + (unless (stringp file) + (signal 'wrong-type-argument (list file))) + (setq file (expand-file-name file)) + (unless (and (consp flags) + (null (delq 'change (delq 'attribute-change flags)))) + (signal 'wrong-type-argument (list flags))) + (unless (functionp callback) + (signal 'wrong-type-argument (list callback))) +=20 + (let ((handler (find-file-name-handler file 'file-notify-add-watch)) + func fl desc) + (if handler + ;; A file name handler could exist even if there is no local + ;; file notification support. + (setq desc (funcall handler 'file-notify-add-watch file flags callback)) +=20 + ;; Check, whether Emacs has been compiled with file notification su= pport. + (unless file-notify-support + (signal 'filewatch-error '("No file notification package available"))) +=20 + ;; Check, whether this has been registered already. + (maphash + (lambda (key value) + (when (equal (cons file callback) value) (setq desc key))) + file-notify-descriptors) +=20 + (unless desc + ;; Determine local function to be called. + (setq func (cond + ((fboundp 'gfile-add-watch) 'gfile-add-watch) + ((fboundp 'inotify-add-watch) 'inotify-add-watch) + ((fboundp 'w32notify-add-watch) 'w32notify-add-watch))) +=20 + ;; Determine respective flags. + (if (fboundp 'gfile-add-watch) + (setq fl '(watch-mounts)) + (when (memq 'change flags) + (setq + fl + (cond + ((fboundp 'inotify-add-watch) '(create modify move delete)) + ((fboundp 'w32notify-add-watch) '(size last-write-time))))) + (when (memq 'attribute-change flags) + (add-to-list + 'fl + (cond + ((fboundp 'inotify-add-watch) '(attrib)) + ((fboundp 'w32notify-add-watch) '(attributes)))))) +=20 + ;; Call low-level function. + (setq desc (funcall func file fl 'file-notify-callback)))) +=20 + ;; Return descriptor. + (puthash desc (cons file callback) file-notify-descriptors) + desc)) +=20 + (defun file-notify-rm-watch (descriptor) + "Remove an existing watch specified by its DESCRIPTOR. + DESCRIPTOR should be an object returned by `file-notify-add-watch'." + (let ((file (car (gethash descriptor file-notify-descriptors))) + handler) +=20 + (when (stringp file) + (setq handler (find-file-name-handler file 'file-notify-rm-watch)) + (if handler + (funcall handler 'file-notify-rm-watch descriptor) + (funcall + (cond + ((fboundp 'gfile-rm-watch) 'gfile-rm-watch) + ((fboundp 'inotify-rm-watch) 'inotify-rm-watch) + ((fboundp 'w32notify-add-watch) 'w32notify-rm-watch)) + descriptor))) +=20 + (remhash descriptor file-notify-descriptors))) +=20 + ;; The end: + (provide 'filenotify) +=20 + ;;; filenotify.el ends here =3D=3D=3D modified file 'lisp/subr.el' *** lisp/subr.el 2013-06-20 14:15:42 +0000 --- lisp/subr.el 2013-06-24 07:49:32 +0000 *************** *** 4494,4513 **** nil ,@(cdr (cdr spec))))) =20=20 - ;;;; Support for watching filesystem events. -=20 - (defun file-notify-handle-event (event) - "Handle file system monitoring event. - If EVENT is a filewatch event, call its callback. - Otherwise, signal a `filewatch-error'." - (interactive "e") - (if (and (eq (car event) 'file-notify) - (>=3D (length event) 3)) - (funcall (nth 2 event) (nth 1 event)) - (signal 'filewatch-error - (cons "Not a valid file-notify event" event)))) -=20 - ;;;; Comparing version strings. =20=20 (defconst version-separator "." --- 4494,4499 ---- --=-=-=--