Questions tagged [revert-buffer]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
12 views

How to save/revert changes to only parts of a buffer?

I'd love a partial save-buffer and/or revert-buffer (if I have one, I think I could easily enough implement the other). Perhaps where I select a region and have only changes within that region get ...
mtraceur's user avatar
  • 206
0 votes
0 answers
30 views

Symbol’s function definition is void: revert-buffer

For some reason whenever files change on disk, when I try to edit the file I get the following prompt but choosing revert results in <some-filename> changed on disk; really edit the buffer? (y, ...
phoxd's user avatar
  • 231
2 votes
2 answers
91 views

How to avoid the prompt in `revert-buffer` [duplicate]

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). ...
Alex Petrosyan's user avatar
2 votes
0 answers
145 views

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, ...
user90726's user avatar
  • 173
0 votes
1 answer
60 views

How to cancel a mini-buffer prompt from elisp, eg: "... changed on disk; really edit this buffer?"

Sometimes I get a mini-buffer prompt to check if I want to edit the buffer. Instead of answering this, I would like to revert all buffers, however this prompt remains. How could I cancel this prompt?...
ideasman42's user avatar
  • 8,405
2 votes
1 answer
100 views

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 ...
Torsten Bronger's user avatar
3 votes
2 answers
291 views

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's user avatar
  • 3,874
0 votes
1 answer
74 views

How do I open a .gpg file from the command line?

I have a file located in the directory ~/myfiles/list.txt.gpg. In the terminal, I type emacs ~/myfiles/list.txt.gpg and I get something that looks like this, which I'm guessing is the still encrypted ...
Hitomi86's user avatar
2 votes
1 answer
522 views

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 ...
ideasman42's user avatar
  • 8,405
1 vote
4 answers
879 views

Automatic periodic reload of all orgmode agenda files

I use about 15 orgmode agenda files, and a number of them I use passively only. Examples are my wife's agenda converted from Google calendar, a work agenda from Outlook and a list of git commits (...
AstroFloyd's user avatar
2 votes
0 answers
55 views

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 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`...
9716278's user avatar
  • 173
2 votes
1 answer
394 views

Revert buffer with coding system

Chances are that every time utf-coding should be activated by invoking 'M-x revert-coding-system` , even though a long list of utf-prefer configuration: (prefer-coding-system 'utf-8) (set-...
AbstProcDo's user avatar
  • 1,231
6 votes
1 answer
190 views

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 ...
Toothrot's user avatar
  • 3,204
2 votes
1 answer
554 views

How to revert a buffer using the "g" shortcut

I can refresh my dired buffer using M-x revert-buffer and I've seen multiple places that I can do this more easily using g but don't understand how that would be run. Does it mean M-x g or running g &...
Hugh_Kelley's user avatar
1 vote
0 answers
30 views

automatically backup before revert

I would like to backup buffers before they are (auto) reverted. This is nontrivial because the file a buffer is visiting isn't current, and the backup system normally works by duplicating the file ...
PythonNut's user avatar
  • 10.3k
1 vote
1 answer
169 views

How to understand the meaning of "revert"?

Suppose I open a file in a buffer of Emacs, and then some other program different from Emacs modifies the file. When I try to modify the buffer in Emacs, Emacs will notify me about the change which ...
Tim's user avatar
  • 4,987
4 votes
1 answer
440 views

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 ...
Alex's user avatar
  • 781
2 votes
0 answers
623 views

Auto-revert for changed pdf buffers?

Specifically in the content of exporting org->latex->pdf when using pdftools to view the resulting pdf, how can I stop emacs from asking me if I want to revert the pdf buffer and instead just auto-...
emacsomancer's user avatar
  • 1,021
2 votes
0 answers
103 views

Recommended use of non-file-visiting revert-buffer-function

Summary I am working on a major mode derived from special-mode, which populates its buffers with formatted lists of items retrieved from a web API. Reverting such a buffer involves refetching and ...
Basil's user avatar
  • 12.1k
1 vote
1 answer
287 views

How to revert buffer after magit-checkout?

I use smart-mode-line package and I noticed when I change/checkout branches in command line, or in Magit, this is not reflected in the Smart Mode Line. I still see the name of the old branch, while I ...
ReneFroger's user avatar
  • 3,855
2 votes
1 answer
731 views

dired not showing recently created files when emacs is run in daemon mode

When running emacs in daemon mode, a directory listing using dired does not seem to show the latest created files. What could be the cause of this issue, and how can I fix it?
Chris Stryczynski's user avatar
12 votes
1 answer
771 views

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 ...
Saddle Point's user avatar
15 votes
5 answers
5k views

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'...
Patrick Collins's user avatar
1 vote
2 answers
78 views

Reload single file in every window

I have this function that reload a file but it don't work when I have same buffer opened in 2 different windows: (defun reload () "Reload a file it will kill buffer, open file again and jump to ...
jcubic's user avatar
  • 691
0 votes
1 answer
183 views

Emacs auto-revert remote image file

I would like to auto-revert some remote image/pdf files. I have activated the option (setq auto-revert-remote-files t) and see that the file effectively auto-revert. Yet the image does not update. I ...
DJJ's user avatar
  • 732
14 votes
1 answer
816 views

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, ...
Stéphane Gourichon's user avatar
1 vote
1 answer
202 views

Get revert-buffer to stop corrupting my files

I'm not sure how to completely reproduce this. It may be related to this other question of mine. My hope is that someone else has seen this as well and knows what causes it. Sometimes when editing ...
asmeurer's user avatar
  • 1,562
10 votes
3 answers
4k views

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 ...
djechlin's user avatar
  • 923
2 votes
1 answer
236 views

How to determine the current text scaling?

When I type C-x C-+ the height of the default face in the current buffer is increased. However, when I revert the buffer, the text scaling is reset to normal. I would like to keep the same scaling ...
Håkon Hægland's user avatar
6 votes
1 answer
1k views

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 ...
Madhavan's user avatar
  • 1,957
5 votes
3 answers
907 views

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 ...
Gina's user avatar
  • 153
169 votes
10 answers
110k views

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's user avatar