I need to edit a few .pyt
files, which are python code but specific to ESRI ArcGIS software.
Is there a variable that lists the file ending that python formatting is applied to that I could add .pyt
to in order to have those files formatted?
Thanks
python-mode
(or whatever) to turn on when you edit one of those files? If so, you can adjustauto-mode-alist
.("\\.py[iw]?\\'" . python-mode)
there's probably a way to change that regex but(add-to-list 'auto-mode-alist '("\\.pyt\\'" . python-mode))
in my init.el did the trick.("\\.py[iwt]?\\'" . python-mode)
should do it then.add-to-list
, I just update the variable each time emacs each time it's opened. Any thoughts about how to edit the variable in a way that it will persist across sessions? Like how is the rest of the list built and can I edit that? Maybe it's better to keep all of this custom stuff inside init.el.init.el
: isn't that where you put theadd-to-list
? What I meant was to find the place in yourinit.el
wherepython-mode
is set for.pyi
and.pyw
files and add thet
there. But if somebody else is doing that setting, then it's not worth worrying about it: theadd-to-list
method is fine.