Questions tagged [revert-buffer]

32 questions
169
votes
10 answers

How do I reload a file in a buffer?

I usually work on files which are updated in the file system via version control. What's a quick way to reload a file without having to C-x C-f the file again and getting asked if I want to reload it?
Fernando Briano
  • 1,915
  • 2
  • 14
  • 13
15
votes
5 answers

Revert all open buffers (and ignore errors)

When working on a project under version control with git, I often want to do some things in a shell that affect many of my open files, then revert every buffer that I have open to make sure that I don't accidentally clobber the new version with…
Patrick Collins
  • 372
  • 2
  • 9
14
votes
1 answer

On "really edit the buffer", have emacs run ediff-current-file automatically?

Context When emacs detects that a file was changed outside of an editing buffer. Observed emacs will ask: somefilename changed in disk; really edit the buffer? (y, n, r or C-h) (Incidentally, sometimes it happens even when there is no actual…
12
votes
1 answer

How to stop dired printing "Reverting buffer ..."

After setting dired-auto-revert-buffer to t, even when I'm working on a buffer of file that may produce some results, the message keep printing if there is a dired buffer behind current buffer. This is really annoying. How can I completely disable…
Saddle Point
  • 481
  • 7
  • 23
10
votes
3 answers

global-auto-revert-mode doesn't seem to work?

My init file includes (setq global-auto-revert-mode t) and I can confirm it's true with C-h v. But I still have to manually revert all my files with revert-buffer whenever I change git branches. I even get as far as trying to save and getting the…
djechlin
  • 923
  • 8
  • 21
6
votes
1 answer

Surprisingly persistent local variable

A local variable keeps coming back, and I know not whence. In a certain buffer, TeX-command-extra-options is "--synctex=1", even after I have removed this from my init.el and restarted Emacs. I tried setting it to something else by adding %%% Local…
Toothrot
  • 3,204
  • 1
  • 12
  • 30
6
votes
1 answer

Revert-buffer ---> Discard unsaved changes without y/n prompt

(setq revert-without-query '(".*")) With this extra line in .emacs file, i have configured emacs to revert buffers without any prompt. It doesn't prompt for clean buffers but when the buffer has unsaved changes, it prompts for confirmation. So, how…
Madhavan
  • 1,957
  • 12
  • 28
5
votes
3 answers

What is the best way to reload git stashed changes you've popped while file is open in buffer?

When I'm viewing a file and then pop a stash which modifies that file in the working tree using git stash pop in either bash or eshell, what is the best way to immediately see those changes in the buffer visiting that file? Usually I end up using…
Gina
  • 153
  • 6
4
votes
1 answer

Dired+. Autorefresh after copy files

Windows 10, Emacs 25.1, Dired+. I copy file from one folder to another. Here screens: After copy I get the next result: As you can see the bottom buffer is not refresh. So I need to go to bottom buffer and press g for refresh. The question is:…
Alex
  • 781
  • 2
  • 7
  • 18
3
votes
2 answers

Is it possible to DISABLE auto-reverting remote file?

Emacs 26.3 Linux Mint 19.3 I work with my Google drive. I want to disable auto reverting mode for remote files. Is it possible?
a_subscriber
  • 3,854
  • 1
  • 17
  • 47
2
votes
2 answers

How to avoid the prompt in `revert-buffer`

I'm trying to get rid of the annoying prompt at the end of revert-buffer. This prompt would make sense in a lesser text editor where reverting the buffer is an irreversible action (pardon the pun). However, most of the time when I want to revert…
2
votes
0 answers

global-auto-revert-mode with confirmation first?

I know I can use (global-auto-revert-mode 1) to automatically revert a buffer if the buffer has been changed in another editor. However, when Emacs detects (automatically) that the buffer has changed, I would prefer it then to ask me whether I want…
user90726
  • 173
  • 7
2
votes
1 answer

Why needs syntax highlighting often a `revert-buffer`?

Quite frequently, syntax highlighting in a given buffer is broken (i.e., a big fraction of the code is not highlighted). This is definitely not due to syntax errors, and the point at which highlighting stops quite often is in the middle of an…
Torsten Bronger
  • 329
  • 2
  • 6
2
votes
1 answer

How to quickly revert the buffer?

revert-buffer is often slower than closing an opening the same file. I've noticed - for example, I can undo to the state of the file before reverting. While this might be useful in some cases, I would like to clear undo history and load the file as…
ideasman42
  • 8,375
  • 1
  • 28
  • 105
2
votes
0 answers

How to make emacs not crash when converting binary file to UTF-8

When I run revert-buffer-with-coding-system [RET] UTF-8 Emacs crashes. This is the file I'm trying to revert. \0 …
9716278
  • 173
  • 6
1
2 3