Frage

gulp watches files for livereload,

gulp.watch([
    '/templates/**/*.hbs'
], ['build-dev-templates']);

but when i edit on emacs, it creates autosave files like .#index.hbs and Gaze gives this error:

Error: ENOENT, no such file or directory 'app/client/templates/.#index.hbs'

How do i get rid of this?

War es hilfreich?

Lösung

One option would be to move your backup files elsewhere. I use this snippet from What the .emacs.d!? to put all backup files into ~/.emacs.d/backups:

(setq backup-directory-alist
      `(("." . ,(expand-file-name
                 (concat user-emacs-directory "backups")))))

You should be able to use a similar technique for moving auto-save files. Something like this should work:

(setq auto-save-file-name-transforms
          `((".*" ,(expand-file-name
                    (concat user-emacs-directory "auto-save")) t)))

Andere Tipps

You can also try to exclude the backup files of your watcher with this pattern :

gulp.watch([
  '/templates/**/*.hbs',
  '!/templates/**/.#*'
], ['build-dev-templates']);

For me, the only thing that worked was to disable the .# file creation with

(setq create-lockfiles nil)

This functionality has been added in Emacs 24.3.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top