wutingcindy / gyp

Automatically exported from code.google.com/p/gyp
0 stars 0 forks source link

gyp.el modifies global python-mode settings #309

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
gyp.el sets the global variables python-indent, python-continuation-offset, and 
python-guess-indent, which affect all python files, not just .gyp files, 
because these variables are not buffer-local.  The gyp-set-indentation hook 
should make these variables buffer-local before setting them so this mode 
doesn't have side effects on non-gyp files.

diff --git a/emacs.d/gyp.el b/emacs.d/gyp.el
index c20fc8d..878f508 100644
--- a/emacs.d/gyp.el
+++ b/emacs.d/gyp.el
@@ -35,6 +35,9 @@

 (defun gyp-set-indentation ()
   "Hook function to configure python indentation to suit gyp mode."
+  (make-local-variable 'python-continuation-offset)
+  (make-local-variable 'python-indent)
+  (make-local-variable 'python-guess-indent)
   (setq python-continuation-offset 2
         python-indent 2
         python-guess-indent nil))

Original issue reported on code.google.com by ben.darn...@gmail.com on 8 Dec 2012 at 11:02