unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jason Rumney <jasonr@gnu.org>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] autorevert.el -- revert fix for Windows platform
Date: Sat, 24 Mar 2007 11:46:00 +0000	[thread overview]
Message-ID: <46050F78.80408@gnu.org> (raw)
In-Reply-To: <yoijhcsarihx.fsf@gamma02.me.chalmers.se>

Johan Bockgård wrote:
> Jason Rumney <jasonr@gnu.org> 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	other threads:[~2007-03-24 11:46 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 11:27 [PATCH] autorevert.el -- revert fix for Windows platform Jari Aalto
2007-03-22 15:00 ` Chong Yidong
2007-03-22 15:56   ` Lennart Borgman (gmail)
2007-03-22 17:49     ` Jason Rumney
2007-03-23 13:26       ` Eli Zaretskii
2007-03-23 17:31         ` Jari Aalto
2007-03-23 20:36           ` Jason Rumney
2007-03-23 23:07             ` Jason Rumney
2007-03-24 10:52               ` martin rudalics
2007-03-24 11:11                 ` Jason Rumney
2007-03-24 11:25                   ` Johan Bockgård
2007-03-24 11:46                     ` Jason Rumney [this message]
2007-03-24 11:32                   ` martin rudalics
2007-03-24 18:21             ` Eli Zaretskii
2007-03-24 22:56               ` Kim F. Storm
2007-03-25  4:13                 ` Eli Zaretskii
2007-03-24 14:46           ` Eli Zaretskii
2007-03-23  7:03   ` Jari Aalto
2007-03-23 14:10     ` Eli Zaretskii
2007-03-23 15:47       ` Kim F. Storm
2007-03-23 16:51         ` Jason Rumney
2007-03-23 18:48           ` Luc Teirlinck
2007-03-24 14:59             ` Eli Zaretskii
2007-03-23 22:41           ` Stefan Monnier
2007-03-24 23:50             ` Kim F. Storm
2007-03-25  0:24               ` Luc Teirlinck
2007-03-25  1:09                 ` Kim F. Storm
2007-03-25 19:09                   ` Stefan Monnier
2007-03-23 16:57         ` Stefan Monnier
2007-03-24 14:49         ` Eli Zaretskii
2007-03-23 13:25   ` Eli Zaretskii
2007-03-22 22:50 ` Richard Stallman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46050F78.80408@gnu.org \
    --to=jasonr@gnu.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).