Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [saving]

The tag has no usage guidance.

1
vote
1answer
28 views

Emacs freezes when saving org file in org-mode

For some reason I cannot save files while in org-mode. This happened after I updated to a most recent version of org-mode. If I change to text mode I can save without a problem. I have tried C-x C-w ...
1
vote
0answers
39 views

Problem saving (C-x C-s) files on a NFS drive with emacs 24/25

Starting with Emacs 24 (using various different versions of Ubuntu and Linux Mint), if I open a file on an NFS drive, modify it and attempt to save it C-x C-s, I get the message of: Saving <...
2
votes
1answer
95 views

Delete auto-save file when killing Emacs without saving buffer

When I have unsaved buffers and I kill Emacs with save-buffers-kill-terminal (C-x C-c) I'm asked whether to save each buffer. Is it possible to delete a buffer's auto-save data when I answer n? I had ...
0
votes
1answer
22 views

Rewriting all file when save some changes

I work on Rails project in my Emacs25. When I change one specific file and save changes I got all file changed (from git diff). But when I try to old and new versions of this file in Meld - I get ...
2
votes
1answer
51 views

How to avoid accidentally writing temporary source-block-edit-buffers to file

When doing literate programming in org-mode, I frequently use C-c '[aka M-x org-edit-special] to enter the source-block-edit-buffer, so that I have appropriate yasnippets etc. I then accidentally ...
2
votes
0answers
140 views

Emacs sometimes fails to save files

I'm experiencing a weird problem with Emacs on Windows where sometimes, after a while, the current buffer I'm in throws an error when attempting to save the file. I can't seem to reliably reproduce ...
1
vote
2answers
176 views

Tramp: Cannot Save File

I am new to tramp and I am trying to edit a file stored in a remote server. I connect to the file through C-x C-f /ssh:username@host:path_to_file/myfile.m. And on my init.el I have the options: (setq ...
0
votes
1answer
36 views

Prevent emacs from saving previous versions of text files

I am editing a lot of text files in emacs and the automatic saving of previous versions is creating a massive amount of extraneous files. For example, if I edit a file called numbers.txt and ...
0
votes
1answer
160 views

Ask for saving contents if scratch buffer is modified before exit

I had made some random notes in my scratch buffer. By mistake, I pressed C-x C-c and killed the Emacs session. All my content in the scratch buffer was gone. Question: When I try to close Emacs ...
1
vote
1answer
62 views

What are the '.#' links for?

When an Emacs buffer is modified, a broken link is created. The link's name is a concatenation of '.#' followed by the file's name. For example: $ ls .#spacemacs_ref.org -l lrwxrwxrwx. 1 wolfv wolfv ...
-1
votes
1answer
60 views

why is save-buffer asking for a chmod?

All of sudden, XEmacs 21.4.22 starts asking whether it should chmod a+x $f everytime I try to save a buffer that is in Shell-script mode. Switching it to fundamental-mode stops that behaviour. ...
1
vote
1answer
124 views

Save REPL buffer as file?

I've seen a discussion on someone trying to save the actual state of a Lisp Slime REPL. I just want to save a text version of a Geiser Racket REPL session, e.g., *ch1*, while using org-mode. (Then I ...
2
votes
1answer
52 views

Saving very big files

I just noticed that Emacs will trim a very big file before saving it. I opened a 4.6 GB file (not the best thing to do, but anyway) and after saving, the file was trimmed to around 375 MB. It didn't ...
4
votes
2answers
81 views

Increment file name and create a new version of the file

Assume that I am working with a file whose name contains a unique version number for example myfile_03.tex or 03jhcjh.tex and so on. Currently I create a new version of the file by C-x C-w and ...
0
votes
2answers
101 views

Automatically save moved file to new location

If I open a file in emacs, and the file subsequently gets moved or renamed by a different program, emacs will still save the file to the old location and name. Example process: Open ex.txt in emacs. ...
0
votes
0answers
28 views

ssh to a remove host and use emacs in the ssh session, cursor always move to the beginning of the screen when save file

I have a VPS server and I always ssh to it and us emacs in the ssh session. I found that when I save a buffer the cursor always move to the beginning of the screen. How to disable this behavior? I don'...
1
vote
1answer
176 views

Automatically show diff before saving file

I have a file that contains important information and I often have to make small changes in this file. Every once in a while I accidentally change something in this file and then save it without ...
5
votes
1answer
179 views

Make Emacs diff files before asking to save

When I run save-buffers-kill-emacs or projectile-kill-buffers I get asked to save changed buffers. But for me a lot of these buffers do not differ from the file on disk. Can I make Emacs diff the ...
1
vote
1answer
54 views

How can I get Emacs to save the changes automatically each X seconds?

How can I setup Emacs >= 24.4 so that it saves at least the current file I'm working on automatically, say, each 5 seconds, so that I don't have to press C-x C-s each time to save my changes?
4
votes
1answer
689 views

Fix 'changed on disk'/'Reread from disk' when file has not changed

Is there any way to get emacs to actually check the contents of files on disk when determining this? E.g. if I have some unsaved changes to a file, and temporarily switch source control branches (to ...
3
votes
1answer
103 views

Save a buffer to multiple files

I have 2 files /home/user/myproject/myfile.el /ssh:user@myserver.org:/home/user/myproject/myfile.el Content of both of them are same. I want to make same change in both of them. I can do it like: ...
-1
votes
1answer
13 views

Hide some entries in the customize interface? Or prevent the user from setting them?

I'm writing a package where I need to store some data and restore it in the next session. I don't want to create a file for it so my idea is to save it with customize-save-variable. This works great ...
6
votes
2answers
3k views

How to run an `after-save-hook` only when the buffer has been saved manually

This question is inspired by https://emacs.stackexchange.com/a/5947/. Assume that I have a function like (defun do-some-actions () () (..put a copy of the current file in a specific folder...) ) ...
9
votes
0answers
127 views

Saving Calc trail for later use

Is there a possibility to save the Emacs Calculator Trail (as a file) and to restore it later? If not, should it be feature? For example, when I have an incomplete calculation but have to shutdown ...
6
votes
1answer
195 views

Automatically saving the current file after typing a certain number of characters

Is there a way to force Emacs to automatically save the current file (if it is not already saved) after typing n characters (n is a number determined by the user). Edit: After the comment of @Dan and ...
4
votes
2answers
412 views

Backup saved buffers to Dropbox (or other specific directory)

Is it possible to customize Emacs so that whenever I save a file, Emacs also copies it to a specific folder? This directory could be, for instance, D:\my_backups or C:\Users\username\Dropbox\...
9
votes
2answers
2k views

How to save a copy of a buffer to a file?

I would like to be able to save a copy (or a snapshot) of a buffer into a file. The behavior would be similar to write-file, except that it would not set the buffer to visit this file. For a usecase, ...
1
vote
1answer
575 views

Weird Prompt: file has changed since visited or saved. Save anyway? (yes or no)

I make some edits and press C-x C-s to save. Sometimes, out of blue emacs prompts this: file has changed since visited or saved. Save anyway? (yes or no). Even though I don't have the file open ...
6
votes
2answers
183 views

Save all open files in current folder and subfolders

Some of my projects are organised in way that the there isn't one make file at the top route of the project (git/svn/...) folder but I have several small Makefiles in subfolders of the project. ...
7
votes
2answers
311 views

Strip text properties in savehist

I save the kill-ring using the savehist package. savehist saves the kill ring with text-properties intact. Unfortunately, this is a problem. I have a rather large emacs config, and I use a lot of ...
11
votes
1answer
2k views

Execute external script upon save when in a certain mode?

When I'm in org-mode, I want Emacs to execute a bash script I wrote whenever I hit C-x s to save. The script automatically syncs the file I am saving to my Raspberry Pi. It expects the file name as ...
49
votes
1answer
2k views

How to view diff when emacs suggests to recover this file?

Sometimes it happens: emacs prompts you about recovering unsaved changes to a file, but you cannot remember if you want those changes or not. Starting at the recover-this-file buffer, is there a way ...
1
vote
1answer
77 views

Warning about modification of files which should be static

Some files in Emacs should not be modified, for example: an .el.gz library file which is expected to behave "properly" an external extension, which will be overwritten on update Anyway, there are ...
5
votes
2answers
518 views

How to save multiple buffers

After modifying multiple files, how can I save all their buffers?
21
votes
4answers
2k views

How do I automatically save org-mode buffers?

I regularly use org-mode and the agenda to keep track of my to-do list. Since I use Dropbox to sync my list, I need the same tasks to be available on all computers. Sometimes during the course of my ...
25
votes
4answers
2k views

How to auto-save buffers when Emacs loses focus?

I recently had a Sublime Text user try out Emacs for a while, and he was interested in getting the same auto-save behavior in Emacs. Basically, he wanted all buffers to be saved whenever the frame ...