]> code.delx.au - gnu-emacs/blobdiff - lisp/autorevert.el
Auto-commit of generated files.
[gnu-emacs] / lisp / autorevert.el
index e44d4a88edaf82cdc89f214c5eae643adbafa90f..a2d70c37762b48a3d25de3a2f865f0856adf1bf3 100644 (file)
@@ -278,7 +278,7 @@ This variable becomes buffer local when set in any fashion.")
   "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 only."
+variable through Custom."
   :group 'auto-revert
   :type 'boolean
   :set (lambda (variable value)
@@ -519,12 +519,13 @@ will use an up-to-date value of `auto-revert-interval'"
     (let ((func (if (fboundp 'inotify-add-watch)
                    'inotify-add-watch 'w32notify-add-watch))
          (aspect (if (fboundp 'inotify-add-watch)
-                     '(create modify moved-to) '(size last-write-time))))
+                     '(create modify moved-to) '(size last-write-time)))
+         (file (if (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 (directory-file-name (expand-file-name default-directory))
-              aspect 'auto-revert-notify-handler)))
+             (funcall func file aspect 'auto-revert-notify-handler)))
       (if auto-revert-notify-watch-descriptor
          (progn
            (puthash