From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.bugs Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches Date: Sat, 25 Mar 2017 20:34:52 +0100 Message-ID: <87wpbdcfqb.fsf@luca> References: <87r31x9ulw.fsf@luca> <87pohfkmvh.fsf@detlef> <87lgs2sobr.fsf@luca> <87y3w2gywc.fsf@detlef> <878to21fty.fsf@luca> <87wpbl1u80.fsf@detlef> <87d1ddecx2.fsf@luca> <87efxtnk8m.fsf@detlef> <87tw6nd6nf.fsf@luca> <871strm323.fsf@detlef> <838tnywshh.fsf@gnu.org> <8737e54f8c.fsf@detlef> <838tnx71u0.fsf@gnu.org> <87lgrulabr.fsf@luca> <87fui1jz9u.fsf@detlef> <87wpbdfoeu.fsf@luca> <8760ixjvnr.fsf@detlef> <87k27dfhjo.fsf@luca> <87inmx8g86.fsf@detlef> <87r31le0we.fsf@luca> <877f3d8apm.fsf@detlef> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1490470579 24461 195.159.176.226 (25 Mar 2017 19:36:19 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 25 Mar 2017 19:36:19 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: 26126@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Mar 25 20:36:15 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crrTt-0005AZ-3F for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 20:36:09 +0100 Original-Received: from localhost ([::1]:38424 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crrTx-00088X-LI for geb-bug-gnu-emacs@m.gmane.org; Sat, 25 Mar 2017 15:36:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1crrTq-000878-0I for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 15:36:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1crrTm-00061z-T1 for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 15:36:06 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:46425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1crrTm-00061h-PY for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 15:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1crrTm-00051P-CR for bug-gnu-emacs@gnu.org; Sat, 25 Mar 2017 15:36:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andreas Politz Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 25 Mar 2017 19:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26126 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26126-submit@debbugs.gnu.org id=B26126.149047051319248 (code B ref 26126); Sat, 25 Mar 2017 19:36:02 +0000 Original-Received: (at 26126) by debbugs.gnu.org; 25 Mar 2017 19:35:13 +0000 Original-Received: from localhost ([127.0.0.1]:44624 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crrSz-00050O-9Y for submit@debbugs.gnu.org; Sat, 25 Mar 2017 15:35:13 -0400 Original-Received: from gateway-a.fh-trier.de ([143.93.54.181]:44719) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1crrSx-00050B-DC for 26126@debbugs.gnu.org; Sat, 25 Mar 2017 15:35:11 -0400 X-Virus-Scanned: by Amavisd-new + McAfee uvscan + ClamAV [Rechenzentrum Hochschule Trier (RZ/HT)] Original-Received: from localhost (ip5f5bdecf.dynamic.kabel-deutschland.de [95.91.222.207]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: politza) by gateway-a.fh-trier.de (Postfix) with ESMTPSA id 17E47179B429; Sat, 25 Mar 2017 20:34:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha1; c=simple/simple; d=hochschule-trier.de; s=default; t=1490470493; bh=Kybwre9XP9ZRwuHi1bjdkvbVYss=; h=From:To:Cc:Subject:References:Date:In-Reply-To:Message-ID: MIME-Version:Content-Type; b=n/dSNiSawPHIrSk+xyQqqpMcOH6WguVZjg5irYfn2B6EeAc+DX2ICIjBkK85npsTs sKazbkCuUuNAiwk8WMH/XiA++IepKohPfZNmRMTnPupWY+4TyXlLJgbE8CRtD8VDHC 9c+ULaIS2nt8vTY/t17/3UPn6XJxw42V7FEMqDMg= In-Reply-To: <877f3d8apm.fsf@detlef> (Michael Albinus's message of "Sat, 25 Mar 2017 19:36:53 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130955 Archived-At: Michael Albinus writes: > This does not mean that the handler is forced to watch a directory > only. But it is: #+BEGIN_SRC emacs-lisp (defun file-notify-add-watch (file flags callback) ;;.... (let* ((handler (find-file-name-handler file 'file-notify-add-watch)) (dir (directory-file-name (if (file-directory-p file) file (file-name-directory file)))) desc func l-flags) (unless (file-directory-p dir) (signal 'file-notify-error `("Directory does not exist" ,dir))) (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 dir flags callback)) ;;---------------------------------------------------------^ #+END_SRC -ap