I use, and I love it. However, one annoyance is that it scatters autosave files ( #foo#) and backup files ( foo~) all over the filesystem. So, I finally got fed up with this, and figured out how to keep them all in one place. Here’s the (GNU Emacs only) that I put in:;; Put autosave files (ie #foo#) and backup files (ie foo~) in ~/.emacs.d/. (custom-set-variables '(auto-save-file-name-transforms '(('.*' '~/.emacs.d/autosaves/ 1' t))) '(backup-directory-alist '(('.*'. '~/.emacs.d/backups/'))));; create the autosave dir if necessary, since emacs won't. (make-directory '~/.emacs.d/autosaves/' t) and, courtesy of, here’s the elisp for XEmacs.;;; Auto-save;;; Load the auto-save.el package, which lets you put all of your autosave;;; files in one place, instead of scattering them around the file system.;;; M-x recover-all-files or M-x recover-file to get them back (defvar temp-directory (concat '/tmp/' (user-login-name))) (make-directory temp-directory t); One of the main issues for me is that my home directory is; NFS mounted. By setting all the autosave directories in /tmp,; things run much quicker (setq auto-save-directory (concat temp-directory '/autosave') auto-save-hash-directory (concat temp-directory '/autosave-hash') auto-save-directory-fallback '/tmp/' auto-save-list-file-prefix (concat temp-directory '/autosave-') auto-save-hash-p nil auto-save-timeout 100 auto-save-interval 300) (make-directory auto-save-directory t) (require 'auto-save);;; Put backups in another directory. With the directory-info;;; variable, you can control which files get backed up where. (require 'backup-dir) (setq bkup-backup-directory-info `( (t,(concat temp-directory '/backups') ok-create full-path) )) (setq make-backup-files t) (setq backup-by-copying t) (setq backup-by-copying-when-mismatch t) (setq backup-by-copying-when-linked t) (setq version-control t) (setq-default delete-old-versions t). It’s amazing how such a simple piece of code eliminates such a pain in the butt problem. Thanks again. I have been thinking though. (No good deed and what not) I use individual.emacs files per user. Each user adds your snippet. Therefore, without any alterations, each user gets a (user-login-name) added to both the /tmp/emacs_backups and /tmp/emacs_autosaves. For me, these files are made with the default mask in bash, I guess. So they get permissions of 755. No matter what the original file was. Since /tmp is a public directory, now anyone can read the backups. This might be a security risk. I’m no bash expert. How to recover unsaved Excel file or restore its. Now when Excel is configured to auto save and auto recover your. Love that not only does Excel. So I’m no help. Thanks again. I had a problem where emacs would try and auto-save files to /tmp/emacs_autosaves/arthur//home/arthur/ scratch or similar directories. Emacs could not open the file because the directories did not exist. I fixed it by changing make-auto-save-file-name to not add paths to non-file buffers. I’m not where why that was there in the first place. (defun make-auto-save-file-name () (concat autosave-dir (if buffer-file-name (concat “#” (file-name-nondirectory buffer-file-name) “#”) (concat “#%” (buffer-name) “#”)))) Thanks for the script. I used this code for a while, it works but causes error message in mail buffers. After some investigation I think that this code does the Wrong Thing. How to recover unsaved Excel file or restore its. Now when Excel is configured to auto save and auto recover your. Love that not only does Excel. I love and hate the autosave feature at the same time. I don't think that I am the only gamer who has a complicated relationship with autosave in video games. There are times when. You'll probably do so when you finally decide to stop playing, which we all know isn't anytime soon. Everything is fine until. The default implementation of make-auto-save-file-name is much more sophisticated, and it uses the variable auto-save-file-name-transforms which allows the user to change the outcome without redefining functions. (setq auto-save-file-name-transforms `((' (?:[^/] / ) (.* )',(concat autosave-dir ' 1') t))) Acheives the same goal as the defuns, without breaking autosaves for gnus or tramp. Setq auto-save-file-name-transforms only works for the auto-save (#) files. The default make-backup-file-name function, defined in files.el, invokes make-backup-file-name-1, which embeds the!path! File name synthesis so there is no way to change these long names for backup (~) files without completely replacing make-backup-file-name function. To shrink auto-save names, the last element of auto-save-file-name-transforms should be nil instead of t. Also, note that the RE is for DOS. For LINUX I use: (setq auto-save-file-name-transforms `((“ ([^/] / ) (.* )”, “~/bak/ 2” nil))) making auto-saves userhome bak #filename#. I don’t get it. So many people seem to have ‘just lived’ with it. Everyone: The /info/ is right there, it is even in the FAQ. ‘C-h i’ at your service:,—-[ (info “(efaq)Disabling backups”) ]| Beginning with Emacs 21.1, you can control where Emacs puts backup| files by customizing the variable backup-directory-alist'. This| variable's value specifies that files whose names match specific patters| should have their backups put in certain directories. A typical use is| to add the element(“.”. DIR)’ to force Emacs to put all backup| files in the directory dir'.—- •. I think you don’t want to use custom-set-variables. That’s used by customize, and it could get confused if it sees two of them. I like the solution at better: (defvar backup-dir (expand-file-name “~/.emacs.d/backup/”)) (defvar autosave-dir (expand-file-name “~/.emacs.d/autosave/”)) (setq backup-directory-alist (list (cons “. ” backup-dir))) (setq auto-save-list-file-prefix autosave-dir) (setq auto-save-file-name-transforms `((“.”,autosave-dir t))) I like the tip about creating the directories, though. Attention, Internet Explorer User Announcement: Jive has discontinued support for Internet Explorer 7 and below. In order to provide the best platform for continued innovation, Jive no longer supports Internet Explorer 7. Jive will not function with this version of Internet Explorer. Please consider upgrading to a more recent version of Internet Explorer, or trying another browser such as Firefox, Safari, or Google Chrome. (Please remember to honor your company's IT policies before installing new software!) • • • •.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |