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

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

Re: Always reread some files


From: Kevin Rodgers
Subject: Re: Always reread some files
Date: Mon, 02 Dec 2002 15:26:37 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Frédéric Bothamy wrote:

* arthur.chereau <arthur.chereau@voila.fr> [2002-11-29 15:25] :

I always want to reread those files.

auto-revert-mode


Unfortunately this doesn't work because the *.log files buffers are opened 
immediately after their modification, that is:
- I compile
- a .log file is created
- I open the .log file
- I recompile
- the .log file is modified
- I open the .log file buffer (immediately, so auto-revert is too slow for that)
- Emacs asks me if it should reread the .log file
- auto-revert reverts the file, but it's too late

That's why I would like to disable the revert question for all *.log files.


Maybe use the variable revert-without-query using a regexp like this :
".+\.log$" and set a lower auto-revert-interval (5 by default).


Or perhaps:

;; Warning: Untested!
(defadvice revert-buffer (before yes activate)
  "Always revert buffers visiting *.log files (without querying)."
  (if (and buffer-file-name (string-match "\\.log\\'" buffer-file-name))
      (setq unread-command-events '(?y ?e ?s ?\r))))

--
<a href="mailto:&lt;kevin.rodgers&#64;ihs.com&gt;";>Kevin Rodgers</a>



reply via email to

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