unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Suggestion for autorevert.el
@ 2004-03-24 15:14 Eric Hanchrow
  2004-03-25  4:06 ` Luc Teirlinck
  2004-03-25  7:49 ` Richard Stallman
  0 siblings, 2 replies; 13+ messages in thread
From: Eric Hanchrow @ 2004-03-24 15:14 UTC (permalink / raw)



I often use `autorevert' to do what `tail' does -- namely, watch the
end of a constantly-growing file.  However, the current code doesn't
make that easy, because point never moves.  So here's an idea for
keeping point at the end of the buffer.  You'll note I have a
question: the new variable auto-revert-tail seems like it ought to be
buffer-local, but it's not clear to me how to make it so if I use
`defcustom'.  I was tempted to use `defvar' instead, since a few
other variables in autorevert.el are themselves defined with `defvar'
... but I'm not sure why.

    diff -bu /usr/local/src/emacs-cvs/lisp/autorevert.el.\~1.22.\~ /usr/local/src/emacs-cvs/lisp/autorevert.el
    --- /usr/local/src/emacs-cvs/lisp/autorevert.el.~1.22.~	2004-03-20 17:00:11.000000000 -0800
    +++ /usr/local/src/emacs-cvs/lisp/autorevert.el	2004-03-23 18:24:19.000000000 -0800
    @@ -176,6 +176,12 @@
       :group 'auto-revert
       :type 'boolean)

    +;; should this be buffer-local?
    +(defcustom auto-revert-tail nil
    +  "When non-nil, move point to the end of the buffer after reverting."
    +  :group 'auto-revert
    +  :type 'boolean)
    +
     (defcustom global-auto-revert-ignore-modes '()
       "List of major modes Global Auto-Revert Mode should not check."
       :group 'auto-revert
    @@ -401,7 +407,9 @@
           (if (eq revert 'vc)
              (vc-mode-line buffer-file-name))
           (if auto-revert-verbose
    -	  (message "Reverting buffer `%s'." (buffer-name))))))
    +	  (message "Reverting buffer `%s'." (buffer-name)))
    +      (if auto-revert-tail
    +          (goto-char (point-max))))))

     (defun auto-revert-buffers ()
       "Revert buffers as specified by Auto-Revert and Global Auto-Revert Mode.

    Diff finished.  Tue Mar 23 18:34:41 2004

-- 
Hamburgers!  The cornerstone of any nutritious breakfast.
        -- Jules {From "Pulp Fiction"}

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2004-04-03  1:30 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-24 15:14 Suggestion for autorevert.el Eric Hanchrow
2004-03-25  4:06 ` Luc Teirlinck
2004-03-25  7:49 ` Richard Stallman
2004-04-01  3:30   ` Luc Teirlinck
2004-04-01  8:00     ` Juanma Barranquero
2004-04-01 17:34     ` Richard Stallman
2004-04-02  4:09       ` Luc Teirlinck
2004-04-02  4:28         ` Luc Teirlinck
2004-04-02  5:02         ` Stefan Monnier
2004-04-02 16:02           ` Luc Teirlinck
2004-04-02 23:46             ` Luc Teirlinck
     [not found]   ` <87vfktj86f.fsf@offby1.atm01.sea.blarg.net>
2004-04-02  0:11     ` Luc Teirlinck
2004-04-03  1:30       ` Richard Stallman

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).