A minor mode is not enabled/disabled by setting a variable. The minor mode variable should be used to check the "mode enabled" status, not to set the mode state. If its value is t, the minor mode is on, else the mode is off.
See the below snippets to see how to control any minor mode. Replace MINOR-MODE-NAME with the actual minor mode name you are dealing ...
Customize option auto-revert-verbose to nil. C-h v tells you this:
auto-revert-verbose is a variable defined in autorevert.el.
Its value is t
When nil, Auto-Revert Mode does not generate any messages.
When non-nil, a message is generated whenever a file is reverted.
You can customize this variable.
It's kind of a shame that the doc of auto-...
auto-revert-tail-mode is great, but it has its limits. Therefore I prefer to use an asynchronous shell command. Open the remote directory in dired, position the cursor to the file you want to watch, and apply ! tail -f * &.
If you want to suppress Tramp messages, decrease the verbosity. (setq tramp-verbose 1) shall be sufficient.
As someone who just had this problem, I found another solution: auto-image-file-mode. What it does is automatically make sure the file is in image mode instead of binary, so enable both that and auto-revert-mode and everything works as expected. Emacs 24.4.1
You can do this for a specific buffer with M-x auto-revert-mode (manual). For file buffers, this will check every auto-revert-interval seconds (defaults to 5) for changes and update the buffer from disk automatically.
Your title says "a particular file" while your question's body mentions a file type (org files). Depending on your circumstances, here are a ...
Funny: it looks like you choose a tag that directly answers your question ("directory-local-variables")
The best way to accomplish this is by placing a .dir-locals.el file in your org directory and using it to enable auto-revert-mode. Specifically, the file should look contain this:
((nil . ((eval . (auto-revert-mode 1)))))
If you want only org ...
This isn't specific to focus in/out but rather to just updating buffers when the underlying file changes. Emacs calls this "reverting" the buffer and has the functions revert-buffer to do it manually and auto-revert-mode to revert automatically when the file changes on disk. auto-revert-mode can be added to the hook for whatever mode your using or you turn ...
Since Emacs 24.4, auto-revert-mode does not poll anymore. Instead, it uses file notifications from your underlying OS. There shouldn't be any performance problem; people have reported 600+ buffers in parallel in auto-revert-mode, IIRC.
You don't provide much information about what you are doing or what you are seeing. Try to give a step-by-step recipe, preferably starting from emacs -Q, and say what you expect versus what you see.
Does manually reverting the buffer work (M-x revert-buffer, after setting the current buffer to the image buffer)? If so, then investigate what is different ...
Maybe use add-file-hook to turn off auto-revert-mode for a file buffer that is larger than some limit. This seems to work OK (tested minimally):
(defvar my-max-auto-revert-size 1000000000
"Do not auto-revert file buffers larger than this.")
(when (> (buffer-size) my-max-auto-revert-size)
As Dan pointed out, by default you need to manually revert dired buffers (e.g., by typing g) in order to update the directory listing view.
If you want this to happen automatically, then you can turn on auto-revert mode. For example,
(add-hook 'dired-mode-hook #'(turn-on-auto-revert-mode))
But see the Emacs manual, node Auto Reverting Dired for some ...
I don't know elfeed-log, but my crystal ball suggests, in order:
just put the cursor at the very end of the buffer, and the window keep scrolling to keep the end of the buffer visible.
if that doesn't work, set window-point-insertion-type to t in the elfeed-log buffer and try step 1 again.
if neither works, send your problem to the maintainer of the elfeed-...
Assuming you're not using auto-revert-tail-mode, you might be able to just tell Emacs that if the file is too large, then the buffer is not "stale". E.g. something like:
(defun my-not-too-big (&rest _)
(or (not buffer-file-name)
(let ((size (nth 7 (file-attributes buffer-file-name))))
(< size 10000000000))))
Yes. Put this at the end of your file.
* COMMENT Config
eval: (auto-revert-mode 1)
This assumes Org-mode, for other modes use comments in the language used as explained in the link given below.
Note: see Local Variables in Files in the manual for the background, safety information and a caveat that this might not always be a good ...
I tried opening a png in emacs, enabling auto-revert-mode and then from a shell, copying another image over it and then replacing that file with a copy of the original png.
What I found is that the file is sometimes updated to the new files binary contents, but not the rendered content. If it opens the binary content, try using C-c C-c to convert it to an ...
To enable a minor-mode you have to use the eval keyword as explained in Specifying File Variables
To enable or disable a minor mode in a local variables list, use the eval keyword with a Lisp expression that runs the mode command.
While that isn't explicitly mentioned in Per-Directory Local Variables it does apply here to - after all directory variables ...
The following lisp snippet installs a slight variation of what you want.
It reverts all buffers that have windows in the current frame.
So everything what you actually see is reverted.
If you insist that only the current buffer should be reverted you can change the filter to something like (lambda (buf) (eq (car (window-list)) (get-buffer-window buf))).