Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7051351
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:15:12+00:00 2026-05-28T03:15:12+00:00

Suppose I’m entering a bunch of text in a buffer that’s not visiting a

  • 0

Suppose I’m entering a bunch of text in a buffer that’s not visiting a file (it could be a new org2blog post, or just some scratch buffer). Is it possible to autosave it somewhere in case disaster strikes and Emacs dies?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T03:15:12+00:00Added an answer on May 28, 2026 at 3:15 am

    auto-save-mode actually works with non-file buffers. It just doesn’t get enabled by default — that usually happens in (after-find-file).

    So: M-x auto-save-mode RET

    By default the auto-save file will be written to the default-directory of the buffer (or /var/tmp or ~/, depending on write permissions; see C-hv buffer-auto-save-file-name RET) which may be a little awkward to figure out after a crash, so setting that to something standard is probably a good idea.

    The following would ensure that these auto-save files are written to your home directory (or M-x customize-variable RET my-non-file-buffer-auto-save-dir RET), if auto-save-mode is invoked interactively. That will hopefully avoid this conflicting with any other uses of auto-save-mode with non-file buffers (the code mentions Mail mode, for instance).

    (defcustom my-non-file-buffer-auto-save-dir (expand-file-name "~/")
      "Directory in which to store auto-save files for non-file buffers,
    when `auto-save-mode' is invoked manually.")
    
    (defadvice auto-save-mode (around use-my-non-file-buffer-auto-save-dir)
      "Use a standard location for auto-save files for non-file buffers"
      (if (and (not buffer-file-name)
               (called-interactively-p 'any))
          (let ((default-directory my-non-file-buffer-auto-save-dir))
            ad-do-it)
        ad-do-it))
    (ad-activate 'auto-save-mode)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose I have a stringbuilder in C# that does this: StringBuilder sb = new
Suppose i have an XML file, that i use as local database, like this):
Suppose I have a pure virtual method in the base interface that returns to
Suppose I have a static method of my class that returns an object of
Suppose I have a class Baz that inherits from classes Foo and Bar ,
Suppose I have a process that is updating a record and encounters a record
Suppose I have a data frame, df, that looks like: f t1 t2 t3
Suppose there is a MySQL user alice that is currently connected to the database.
Suppose that I have a registration screen, and when the user clicks the Register
Suppose I have a file test.c containing the following: // line 1 // line

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.