I participate in a python project where tabs are used, however I do not use them in every other code that I write, it is vital to use them in this particular project. Projects are located in one directory in certain directories. I.e:
\main_folder \project1 \project2 \project3 ...etc
I have a couple of functions / hooks on opening a file and keep that untabify and tabify are the whole buffer I'm working on.
;; My Functions (defun untabify-buffer () "Untabify current buffer" (interactive) (untabify (point-min) (point-max))) (defun tabify-buffer () "Tabify current buffer" (interactive) (tabify (point-min) (point-max))) ;; HOOKS ; untabify buffer on open (add-hook 'find-file-hook 'untabify-buffer) ; tabify on save (add-hook 'before-save-hook 'tabify-buffer)
If I put it in a .emacs file, it runs on every .py file that I open, which is not what I want. I would like these hooks to be used only in one specific folder with the corresponding subfolders. Tried .dir_locals, but it only works for properties that don't intercept. I cannot use hooks in certain modes (e.g. python-mode), since almost all projects are written in python. Honestly, I tried writing esisp conditional save, but failed.
source share