emacsorphanage / helm-ag

The silver searcher with helm interface
492 stars 76 forks source link

Make sure the temp buffer for the persistent action is not read-only #379

Closed mrBliss closed 3 years ago

mrBliss commented 3 years ago

While previewing the file corresponding to a search result in a temporary buffer (helm-ag-use-temp-buffer is set to t), it can happen that the file's mode makes the temporary buffer read-only. For example, when so-long-mode kicks in.

When then trying to preview a search result from another file, helm-ag--open-file-with-temp-buffer will fail to erase the temporary buffer because it is in read-only mode, resulting in:

let: Buffer is read-only: #<buffer  *helm-ag persistent*>

Fix this by explicitly setting the buffer-read-only variable of the temporary buffer to nil before erasing it.

jcs090218 commented 3 years ago

Sorry for the late response! Thanks for the fix!