help-emacs-windows
[Top][All Lists]
Advanced

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

Re: [h-e-w] Defaulting auto-revert mode


From: Joe Casadonte
Subject: Re: [h-e-w] Defaulting auto-revert mode
Date: 28 Sep 2002 09:49:57 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1

On Tue, 24 Sep 2002, Pete Klammer wrote:

> I would like every new file buffer to open in auto-revert mode; I
> don't think that's the same as setting Global Auto-Revert mode, is
> it?  No; in Global Auto-Revert mode I don't have per-buffer control
> anymore.

I'm pretty sure global-auto-revert-mode is what you want.  There's
nothing that prevents you from subsequently turning it off a buffer at
a time.  Simply set `global-auto-revert-ignore-buffer' in any buffer
that you do not wish to auto-revert.

,----[ C-h v global-auto-revert-ignore-buffer RET ]
| global-auto-revert-ignore-buffer's value is nil
|
| Documentation:
| *When non-nil, Global Auto-Revert Mode will not revert this buffer.
|
| This variable becomes buffer local when set in any fashion.
|
| Defined in `autorevert'.
`----

> So I tried this in my _emacs file:
>       (setq-default auto-revert-mode 1)

,----[ C-h v auto-revert-mode RET ]
| auto-revert-mode's value is nil
|
| Documentation:
| *Non-nil when Auto-Revert Mode is active.
|
| Never set this variable directly, use the command `auto-revert-mode'
| instead.
|
| Defined in `autorevert'.
`----

> What's the right way to do this?

Using global auto revert mode is the correct way, IMHO.  To do it
without using the global mode, you would need to call the /function/
`auto-revert-mode' for every file, perhaps in the find-file hook.

,----[ C-h f auto-revert-mode RET ]
| auto-revert-mode is an interactive compiled Lisp function in `autorevert'.
| (auto-revert-mode &optional ARG)
|
| Toggle reverting buffer when file on disk changes.
|
| With arg, turn Auto Revert mode on if and only if arg is positive.
| This is a minor mode that affects only the current buffer.
| Use `global-auto-revert-mode' to automatically revert all buffers.
`----

,----[ C-h v find-file-hooks RET ]
| find-file-hooks's value is
| (...)
|
|
| Documentation:
| List of functions to be called after a buffer is loaded from a file.
| The buffer's local variables (if any) will have been processed before the
| functions are called.
|
| Defined in `files'.
`----

(defun my-find-file-hook ()
  "Turn on auto-revert-mode manually."
  (auto-revert-mode 1))

(add-hook 'find-file-hooks 'my-find-file-hook)

Hope that helps.

--
Regards,

joe
Joe Casadonte
address@hidden

------------------------------------------------------------------------------
         Llama Fresh Farms => http://www.northbound-train.com
   Gay Media Resource List => http://www.northbound-train.com/gaymedia.html
            Perl for Win32 => http://www.northbound-train.com/perlwin32.html
               Emacs Stuff => http://www.northbound-train.com/emacs.html
          Music CD Trading => http://www.northbound-train.com/cdr.html
------------------------------------------------------------------------------
                       Live Free, that's the message!
------------------------------------------------------------------------------





reply via email to

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