project-defuns.el 399 B

123456789101112
  1. (defmacro project-specifics (name &rest body)
  2. (declare (indent 1))
  3. `(progn
  4. (add-hook 'find-file-hook
  5. (lambda ()
  6. (when (string-match-p ,name (buffer-file-name))
  7. ,@body)))
  8. (add-hook 'dired-after-readin-hook
  9. (lambda ()
  10. (when (string-match-p ,name (dired-current-directory))
  11. ,@body)))))