From 71c661e4e6ab3857804113bc41fc2310343c9169 Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sat, 12 Jan 2013 20:24:27 +0100 Subject: [PATCH] * autorevert.el (auto-revert-notify-handler): Use `file-equal-p'. --- lisp/ChangeLog | 1 + lisp/autorevert.el | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7a8c5f2f490..7723528c886 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -2,6 +2,7 @@ * autorevert.el (auto-revert-notify-watch-descriptor): Give it `permanent-local' property. + (auto-revert-notify-handler): Use `file-equal-p'. 2013-01-12 Eli Zaretskii diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 51146950a5c..c9180482cd9 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el @@ -531,17 +531,14 @@ will use an up-to-date value of `auto-revert-interval'" (when (featurep 'inotify) (cl-assert (memq 'modify action))) (when (featurep 'w32notify) (cl-assert (eq 'modified action))) (cl-assert (bufferp buffer)) - (when (stringp file) - (cl-assert (string-equal - ;; w32notify returns the basename of the file - ;; without its leading directories; inotify - ;; returns its full absolute file name. - (file-name-nondirectory (directory-file-name file)) - (file-name-nondirectory (directory-file-name - (buffer-file-name buffer)))))) - - ;; Mark buffer modified. (with-current-buffer buffer + (when (and (stringp file) (stringp buffer-file-name)) + ;; w32notify returns the basename of the file without its + ;; leading directories; inotify returns its full absolute + ;; file name. + (cl-assert (file-equal-p file buffer-file-name))) + + ;; Mark buffer modified. (setq auto-revert-notify-modified-p t)))))) (defun auto-revert-active-p () -- 2.39.5