diff options
| -rw-r--r-- | lisp/autorevert.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/autorevert.el b/lisp/autorevert.el index 2d148d60951..1d20896c839 100644 --- a/lisp/autorevert.el +++ b/lisp/autorevert.el | |||
| @@ -326,12 +326,12 @@ the list of old buffers.") | |||
| 326 | (add-hook 'find-file-hook | 326 | (add-hook 'find-file-hook |
| 327 | #'auto-revert-find-file-function) | 327 | #'auto-revert-find-file-function) |
| 328 | 328 | ||
| 329 | (defvar auto-revert-notify-watch-descriptor-hash-list | 329 | (defvar auto-revert--buffers-by-watch-descriptor |
| 330 | (make-hash-table :test 'equal) | 330 | (make-hash-table :test 'equal) |
| 331 | "A hash table collecting all file watch descriptors. | 331 | "A hash table mapping notification descriptors to lists of buffers. |
| 332 | Hash key is a watch descriptor, hash value is a list of buffers | 332 | The buffers use that descriptor for auto-revert notifications. |
| 333 | which are related to files being watched and carrying the same | 333 | The key is equal to `auto-revert-notify-watch-descriptor' in each |
| 334 | default directory.") | 334 | buffer.") |
| 335 | 335 | ||
| 336 | (defvar-local auto-revert-notify-watch-descriptor nil | 336 | (defvar-local auto-revert-notify-watch-descriptor nil |
| 337 | "The file watch descriptor active for the current buffer.") | 337 | "The file watch descriptor active for the current buffer.") |
| @@ -500,7 +500,7 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 500 | (defun auto-revert-notify-rm-watch () | 500 | (defun auto-revert-notify-rm-watch () |
| 501 | "Disable file notification for current buffer's associated file." | 501 | "Disable file notification for current buffer's associated file." |
| 502 | (let ((desc auto-revert-notify-watch-descriptor) | 502 | (let ((desc auto-revert-notify-watch-descriptor) |
| 503 | (table auto-revert-notify-watch-descriptor-hash-list)) | 503 | (table auto-revert--buffers-by-watch-descriptor)) |
| 504 | (when desc | 504 | (when desc |
| 505 | (let ((buffers (delq (current-buffer) (gethash desc table)))) | 505 | (let ((buffers (delq (current-buffer) (gethash desc table)))) |
| 506 | (if buffers | 506 | (if buffers |
| @@ -534,7 +534,7 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 534 | (gethash key file-notify-descriptors)) | 534 | (gethash key file-notify-descriptors)) |
| 535 | 'auto-revert-notify-handler)) | 535 | 'auto-revert-notify-handler)) |
| 536 | (setq auto-revert-notify-watch-descriptor key))) | 536 | (setq auto-revert-notify-watch-descriptor key))) |
| 537 | auto-revert-notify-watch-descriptor-hash-list) | 537 | auto-revert--buffers-by-watch-descriptor) |
| 538 | ;; Create a new watch if needed. | 538 | ;; Create a new watch if needed. |
| 539 | (unless auto-revert-notify-watch-descriptor | 539 | (unless auto-revert-notify-watch-descriptor |
| 540 | (setq auto-revert-notify-watch-descriptor | 540 | (setq auto-revert-notify-watch-descriptor |
| @@ -549,8 +549,8 @@ will use an up-to-date value of `auto-revert-interval'" | |||
| 549 | auto-revert-notify-watch-descriptor | 549 | auto-revert-notify-watch-descriptor |
| 550 | (cons (current-buffer) | 550 | (cons (current-buffer) |
| 551 | (gethash auto-revert-notify-watch-descriptor | 551 | (gethash auto-revert-notify-watch-descriptor |
| 552 | auto-revert-notify-watch-descriptor-hash-list)) | 552 | auto-revert--buffers-by-watch-descriptor)) |
| 553 | auto-revert-notify-watch-descriptor-hash-list) | 553 | auto-revert--buffers-by-watch-descriptor) |
| 554 | (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t))))) | 554 | (add-hook 'kill-buffer-hook #'auto-revert-notify-rm-watch nil t))))) |
| 555 | 555 | ||
| 556 | ;; If we have file notifications, we want to update the auto-revert buffers | 556 | ;; If we have file notifications, we want to update the auto-revert buffers |
| @@ -585,7 +585,7 @@ no more reverts are possible until the next call of | |||
| 585 | (file (nth 2 event)) | 585 | (file (nth 2 event)) |
| 586 | (file1 (nth 3 event)) ;; Target of `renamed'. | 586 | (file1 (nth 3 event)) ;; Target of `renamed'. |
| 587 | (buffers (gethash descriptor | 587 | (buffers (gethash descriptor |
| 588 | auto-revert-notify-watch-descriptor-hash-list))) | 588 | auto-revert--buffers-by-watch-descriptor))) |
| 589 | ;; Check, that event is meant for us. | 589 | ;; Check, that event is meant for us. |
| 590 | (cl-assert descriptor) | 590 | (cl-assert descriptor) |
| 591 | ;; Since we watch a directory, a file name must be returned. | 591 | ;; Since we watch a directory, a file name must be returned. |