all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* No query at autorevert
@ 2006-05-24 12:23 Florian Kaufmann
  2006-05-24 15:39 ` Kevin Rodgers
  2006-05-24 17:44 ` andlind
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Kaufmann @ 2006-05-24 12:23 UTC (permalink / raw)


Hello

I try to enable the global auto revert mode. But I'd like XEmacs to ask
me whether it should really revert a buffer in the case it detects that
the file on disk has changed. So I wrote in my init.el file
(global-auto-revert-mode 1)
and in my custom.el file
(custom-set-variables
  '(revert-without-query (quote (""))))

Now auto revert works, the buffers are reverted if they are changed
outside XEmacs, however I never get queried if i really want to revert
the buffer. Any ideas?

Thank you

Flo

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

* Re: No query at autorevert
  2006-05-24 12:23 No query at autorevert Florian Kaufmann
@ 2006-05-24 15:39 ` Kevin Rodgers
  2006-05-24 17:44 ` andlind
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Rodgers @ 2006-05-24 15:39 UTC (permalink / raw)


Florian Kaufmann wrote:
> I try to enable the global auto revert mode. But I'd like XEmacs to ask
> me whether it should really revert a buffer in the case it detects that
> the file on disk has changed. So I wrote in my init.el file
> (global-auto-revert-mode 1)
> and in my custom.el file
> (custom-set-variables
>   '(revert-without-query (quote (""))))
> 
> Now auto revert works, the buffers are reverted if they are changed
> outside XEmacs, however I never get queried if i really want to revert
> the buffer. Any ideas?

By "really want to revert the buffer" do you mean "explicitly revert
the buffer (via `M-x' or the menu bar File menu)"?

If so:

(defadvice revert-buffer (around query activate)
   "Always query when invoked by the user."
   (let ((revert-without-query (if (interactive-p)
				  nil
				revert-without-query)))
     ad-do-it))

-- 
Kevin

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

* Re: No query at autorevert
  2006-05-24 12:23 No query at autorevert Florian Kaufmann
  2006-05-24 15:39 ` Kevin Rodgers
@ 2006-05-24 17:44 ` andlind
  1 sibling, 0 replies; 3+ messages in thread
From: andlind @ 2006-05-24 17:44 UTC (permalink / raw)


Hi Flo!

Unfortunately, auto-revert mode always reverts without asking the user.

The problem with that kind of question is that a buffer can be reverted
at any time. This means that the user could be typing something when
the question would pop up (so that the question would be accidentally
answered), or that the minibuffer would be occupied so that the
question could not be asked.

A simpler solution for you would be to bind, say, F5 (the classical
reload key) to a function that would do revert on all buffers, with the
query enabled. (It should take only a few lines of lisp -- a good
beginners excercise.)

    -- Anders, the author of auto-revert mode.

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

end of thread, other threads:[~2006-05-24 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-24 12:23 No query at autorevert Florian Kaufmann
2006-05-24 15:39 ` Kevin Rodgers
2006-05-24 17:44 ` andlind

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.