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

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

bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches


From: Andreas Politz
Subject: bug#26126: 26.0.50; file-notify-rm-watch removes arbitrary watches
Date: Sat, 25 Mar 2017 20:34:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Michael Albinus <michael.albinus@gmx.de> 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





reply via email to

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