Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emacs users, beware of auto-saved files overwriting your template edits #54

Open
jingxuanlim opened this issue Oct 16, 2016 · 0 comments

Comments

@jingxuanlim
Copy link
Member

jingxuanlim commented Oct 16, 2016

I am an Emacs user and if you're one too, you might be wondering why all the edits you made to the css files weren't reflected.

Markdown Resume Generator takes all the css files in the template folders and concatenate them in the html file according to alphabetical order: normalize.css -> pdf.css -> resume.css -> screen.css (and other css files that you may have created in the folder).

By default, Emacs autosaves your files in the same working directory of the files you edit. These files are named exactly the same as your original file, but with a '~' at the end. These files will also go into the Markdown resume generator machinery! So if you edited resume.css, Emacs autosaves the original version of that file and this is what you have in your html: normalize.css -> pdf.css -> resume.css -> resume.css~ -> screen.css. Therefore, any changes you made in resume.css will be reversed!

You can remove the autosaved files before you generate your new html resume, but a more convenient way to deal with it is to instruct Emacs to either (1) not autosave files or (2) autosaved files in separate location. I chose the latter solution.

You can find information on how to do that and other information about auto-saving in Emacs here: Emacs Wiki: Auto Save

This is what I did in my Emacs init (.emacs) file (copied from the Emacs Wiki, but here for easy yanking):

;; Save all tempfiles in $TMPDIR/emacs$UID/                                                        
(defconst emacs-tmp-dir (format "%s%s%s/" temporary-file-directory "emacs" (user-uid)))
(setq backup-directory-alist
    `((".*" . ,emacs-tmp-dir)))
(setq auto-save-file-name-transforms
    `((".*" ,emacs-tmp-dir t)))
(setq auto-save-list-file-prefix
      emacs-tmp-dir)

Auto-saved files are therefore saved in /tmp/emacs$UID/

Thank you @adilapapaya for helping me get started and explaining how Markdown Resume Generator works!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant