emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] autorevert.el -- revert fix for Windows platform


From: Jason Rumney
Subject: Re: [PATCH] autorevert.el -- revert fix for Windows platform
Date: Sat, 24 Mar 2007 11:46:00 +0000
User-agent: Thunderbird 1.5.0.10 (Windows/20070221)

Johan Bockgård wrote:
Jason Rumney <address@hidden> writes:

No. buffer-size is not used, both auto-revert-tail-pos and size are
measuring bytes in the file, not characters in the buffer.

There are however two occurrences of

      (set (make-local-variable 'auto-revert-tail-pos)
            (save-restriction (widen) (1- (point-max))))

in autorevert.el.

I think this patch should fix that. Though maybe we need to handle a user trying to use this mode on a buffer without an associated file.


*** autorevert.el    26 Jan 2007 22:30:51 +0000    1.56
--- autorevert.el 24 Mar 2007 11:42:53 +0000 ***************
*** 278,284 ****
 (add-hook 'find-file-hook
       (lambda ()
         (set (make-local-variable 'auto-revert-tail-pos)
!          (save-restriction (widen) (1- (point-max))))))

 ;; Functions:

--- 278,284 ----
 (add-hook 'find-file-hook
       (lambda ()
         (set (make-local-variable 'auto-revert-tail-pos)
!          (nth 7 (file-attributes buffer-file-name)))))

 ;; Functions:

***************
*** 341,347 ****
(add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
       (set (make-local-variable 'auto-revert-tail-pos)
!            (save-restriction (widen) (1- (point-max)))))
;; let auto-revert-mode set up the mechanism for us if it isn't already
       (or auto-revert-mode
       (let ((auto-revert-tail-mode t))
--- 341,347 ----
(add-hook 'before-save-hook (lambda () (auto-revert-tail-mode 0)) nil t) (or (local-variable-p 'auto-revert-tail-pos) ; don't lose prior position
       (set (make-local-variable 'auto-revert-tail-pos)
!            (nth 7 (file-attributes buffer-file-name))))
;; let auto-revert-mode set up the mechanism for us if it isn't already
       (or auto-revert-mode
       (let ((auto-revert-tail-mode t))





reply via email to

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