Question: I am writing some code to write out an email to a file, let you edit it in your own editor, and when you're done you can tell my code to carry on. I'd like to have it catch the common error where you still have the file open, and therefore might not have saved it. 

My first attempt was to try to obtain an exclusive lock on the file (using [File.flock](http://www.ruby-doc.org/core/classes/File.html#M000032)) but that never caught it. A bit more googling suggests that [this is a hard problem](http://www.ruby-forum.com/topic/205774).

The best suggestion appears to be to look for common lock files, eg `vi foo` will make `.foo.swp` while `joe foo` will make `.#foo`.

So the question is, is there a better way to tell if a file is being edited? And if not, is there a list of all common lock file naming conventions?

Answer: 
After some Firebug stepping, I found this works quite well.

```
var store = this.getStore();
store.remoteFilter = false;
store.clearFilter();
store.remoteFilter = true;
store.filter(...);

```

`remoteFilter` does not seem to be a documented property, but it will suspend xhr calls while it's set to `false`.

When you set `remoteFilter` to false, when `clearFilter()` is called, the `load()` function is stepped over.
I've experienced the same issue but not with a Grid but with a DataView, however, this might apply equally to your case. I initially tried:

```
var store = this.getStore();
store.suspendEvents();
store.clearFilter();
store.resumeEvents();
store.filter(...);

```

this didn't work—still 2 HTTP requests were made, once for `clearFilter()`, once for `filter(...)`.

However, the following works:

```
var store = this.getStore();
store.getProxy().extraParams['q'] = keywords;
store.load();

```