(defcustom python-indent-guess-indent-offset t
"Non-nil tells Python mode to guess `python-indent-offset' value."
:type 'boolean
- :group 'python)
+ :group 'python
+ :safe 'booleanp)
(defvar python-indent-current-level 0
"Current indentation level `python-indent-line-function' is using.")
\f
;;; Shell integration
-(defvar python-shell-buffer-name "Python"
- "Default buffer name for Python interpreter.")
+(defcustom python-shell-buffer-name "Python"
+ "Default buffer name for Python interpreter."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defcustom python-shell-interpreter "python"
"Default Python interpreter for shell."
:group 'python
:safe 'stringp)
-(defvar python-shell-internal-buffer-name "Python Internal"
- "Default buffer name for the Internal Python interpreter.")
+(defcustom python-shell-internal-buffer-name "Python Internal"
+ "Default buffer name for the Internal Python interpreter."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defcustom python-shell-interpreter-args "-i"
"Default arguments for the Python interpreter."
:group 'python
:safe 'stringp)
-(defcustom python-shell-prompt-output-regexp nil
+(defcustom python-shell-prompt-output-regexp ""
"Regular Expression matching output prompt of python shell.
It should not contain a caret (^) at the beginning."
:type 'string
"Seconds to wait for process output before code setup.
If output is received before the especified time then control is
returned in that moment and not after waiting."
- :type 'number
+ :type 'integer
:group 'python
- :safe 'numberp)
+ :safe 'integerp)
(defcustom python-shell-process-environment nil
"List of enviroment variables for Python shell.
\f
;;; Shell completion
-(defvar python-shell-completion-setup-code
+(defcustom python-shell-completion-setup-code
"try:
import readline
except ImportError:
except NameError:
pass
return completions"
- "Code used to setup completion in inferior Python processes.")
+ "Code used to setup completion in inferior Python processes."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
-(defvar python-shell-completion-string-code
+(defcustom python-shell-completion-string-code
"';'.join(__COMPLETER_all_completions('''%s'''))\n"
- "Python code used to get a string of completions separated by semicolons.")
+ "Python code used to get a string of completions separated by semicolons."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defun python-shell-completion--get-completions (input process)
"Retrieve available completions for INPUT using PROCESS."
\f
;;; PDB Track integration
-(defvar python-pdbtrack-stacktrace-info-regexp
+(defcustom python-pdbtrack-stacktrace-info-regexp
"> %s(\\([0-9]+\\))\\([?a-zA-Z0-9_<>]+\\)()"
"Regular Expression matching stacktrace information.
-Used to extract the current line and module beign inspected. The
+Used to extract the current line and module being inspected. The
regexp should not start with a caret (^) and can contain a string
placeholder (\%s) which is replaced with the filename beign
inspected (so other files in the debugging process are not
-opened)")
+opened)"
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defvar python-pdbtrack-tracking-buffers '()
"Alist containing elements of form (#<buffer> . #<buffer>).
This happens when pressing \"if<SPACE>\", for example, to prompt for
the if condition."
:type 'boolean
- :group 'python)
+ :group 'python
+ :safe 'booleanp)
(defvar python-skeleton-available '()
"Internal list of available skeletons.")
-(make-variable-buffer-local 'inferior-python-mode-current-file)
(define-abbrev-table 'python-mode-abbrev-table ()
"Abbrev table for Python mode."
\f
;;; FFAP
-(defvar python-ffap-setup-code
+(defcustom python-ffap-setup-code
"def __FFAP_get_module_path(module):
try:
import os
return path
except:
return ''"
- "Python code to get a module path.")
+ "Python code to get a module path."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
-(defvar python-ffap-string-code
+(defcustom python-ffap-string-code
"__FFAP_get_module_path('''%s''')\n"
- "Python code used to get a string with the path of a module.")
+ "Python code used to get a string with the path of a module."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defun python-ffap-module-path (module)
"Function for `ffap-alist' to return path for MODULE."
\f
;;; Code check
-(defvar python-check-command
+(defcustom python-check-command
"pychecker --stdlib"
- "Command used to check a Python file.")
+ "Command used to check a Python file."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defvar python-check-custom-command nil
"Internal use.")
\f
;;; Eldoc
-(defvar python-eldoc-setup-code
+(defcustom python-eldoc-setup-code
"def __PYDOC_get_help(obj):
try:
import inspect
exec('print doc')
except SyntaxError:
print(doc)"
- "Python code to setup documentation retrieval.")
+ "Python code to setup documentation retrieval."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
-(defvar python-eldoc-string-code
+(defcustom python-eldoc-string-code
"__PYDOC_get_help('''%s''')\n"
- "Python code used to get a string with the documentation of an object.")
+ "Python code used to get a string with the documentation of an object."
+ :type 'string
+ :group 'python
+ :safe 'stringp)
(defun python-eldoc--get-doc-at-point (&optional force-input force-process)
"Internal implementation to get documentation at point.