Jelajahi Sumber

ob-python.el: Use a defcustom for two variables.

* ob-python.el (org-babel-python-command): Use a defcustom.
(org-babel-python-mode): Use a defcustom and default to
'python-mode when featured.

Thanks to Andreas Röhler for providing a prelimiary patch.
Bastien Guerry 12 tahun lalu
induk
melakukan
ef1bb160c6
1 mengubah file dengan 11 tambahan dan 4 penghapusan
  1. 11 4
      lisp/ob-python.el

+ 11 - 4
lisp/ob-python.el

@@ -40,12 +40,19 @@
 
 (defvar org-babel-default-header-args:python '())
 
-(defvar org-babel-python-command "python"
-  "Name of the command for executing Python code.")
+(defcustom org-babel-python-command "python"
+  "Name of the command for executing Python code."
+  :group 'org-babel
+  :version "24.3"
+  :type 'string)
 
-(defvar org-babel-python-mode (if (featurep 'xemacs) 'python-mode 'python)
+(defcustom org-babel-python-mode
+  (if (or (featurep 'xemacs) (featurep 'python-mode)) 'python-mode 'python)
   "Preferred python mode for use in running python interactively.
-This will typically be either 'python or 'python-mode.")
+This will typically be either 'python or 'python-mode."
+  :group 'org-babel
+  :version "24.3"
+  :type 'function)
 
 (defvar org-src-preserve-indentation)