all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: suvayu ali <fatkasuvayu+linux@gmail.com>
To: Andrea Crotti <andrea.crotti.0@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: reload modified files in buffer
Date: Wed, 15 Dec 2010 07:43:59 -0800	[thread overview]
Message-ID: <AANLkTi=KZMG0Fg78a5VyZczKbLA80CkqpMob3Ba9XshS@mail.gmail.com> (raw)
In-Reply-To: <m1k4jcz8jy.fsf@ip1-201.halifax.rwth-aachen.de>

Hi Andrea,

On Tue, Dec 14, 2010 at 7:19 AM, Andrea Crotti
<andrea.crotti.0@gmail.com> wrote:
>
> I use this
> --8<---------------cut here---------------start------------->8---
>  (defun is-git-file ()
>    "Return nil unless the file is in the git files"
>    (if
>        (member (file-name-nondirectory buffer-file-name)
>                (split-string  (shell-command-to-string "git ls-files")))
>        (auto-revert-mode t)))
>
>  (add-hook 'find-file-hook 'is-git-file)
> --8<---------------cut here---------------end--------------->8---
>
> to set files in auto-revert mode if they're part of a git repository.
> Maybe you can adapt something like this to your needs.
> Having everything in auto-revert mode might slow down too much...

Any particular reason to write your own function? I simply use this,

(lambda ()
	  (if (vc-working-revision (buffer-file-name))
		(auto-revert-mode t)))

--
Suvayu

Open source is the future. It sets us free.



  reply	other threads:[~2010-12-15 15:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14  6:55 reload modified files in buffer Rajinder Yadav
2010-12-14  7:57 ` suvayu ali
2010-12-14  9:28 ` Deniz Dogan
2010-12-14 15:19 ` Andrea Crotti
2010-12-15 15:43   ` suvayu ali [this message]
2010-12-15 16:58     ` Andrea Crotti
     [not found] <mailman.1.1292309755.5276.help-gnu-emacs@gnu.org>
2010-12-14  7:12 ` Sven Joachim
2010-12-15 15:42   ` Peter Dyballa
2010-12-15 19:14     ` Andrea Crotti
2010-12-15 19:26       ` Peter Dyballa
2010-12-16  0:39       ` suvayu ali
2010-12-16 11:42         ` Rajinder Yadav
2010-12-16 16:32           ` PJ Weisberg
2010-12-16 18:08           ` suvayu ali
2010-12-17 23:09           ` Andrea Crotti
     [not found]   ` <mailman.9.1292427789.4561.help-gnu-emacs@gnu.org>
2010-12-15 16:04     ` Sven Joachim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='AANLkTi=KZMG0Fg78a5VyZczKbLA80CkqpMob3Ba9XshS@mail.gmail.com' \
    --to=fatkasuvayu+linux@gmail.com \
    --cc=andrea.crotti.0@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.