80
80
(defcustom py-install-directory nil
81
81
"Directory where python-mode.el and it's subdirectories should be installed. Needed for completion and other environment stuff only. "
85
85
(defcustom py-guess-py-install-directory-p t
86
86
"If in cases, `py-install-directory' isn't set, `py-set-load-path'should guess it from `buffer-file-name'. "
91
91
(defcustom py-load-pymacs-p nil
92
92
"If Pymacs as delivered with python-mode.el shall be loaded.
104
104
Default is nil. "
109
109
(defcustom py-hide-show-minor-mode-p nil
110
110
"If hide-show minor-mode should be on, default is nil. "
115
115
(defcustom py-outline-minor-mode-p t
116
116
"If outline minor-mode should be on, default is `t'. "
121
121
(defcustom py-start-run-py-shell t
122
122
"If `python-mode' should start a python-shell, `py-shell'. Default is `t'.
134
134
when `py-number-face' was customized differently than inherited
139
139
;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
140
140
(defcustom py-close-provides-newline t
141
141
"If a newline is inserted, when line after block isn't empty. Default is non-nil. "
144
144
(make-variable-buffer-local 'py-close-provides-newline)
146
146
(defcustom py-dedent-keep-relative-column t
147
147
"If point should follow dedent or kind of electric move to end of line. Default is t - keep relative position. "
151
151
(defcustom py-indent-honors-multiline-listing nil
152
152
"If `t', indents to 1+ column of opening delimiter. If `nil', indent adds one level to the beginning of statement. Default is `nil'. "
156
156
(defcustom py-indent-honors-inline-comment nil
157
157
"If non-nil, indents to column of inlined comment start.
158
158
Default is nil. "
162
162
(defcustom py-closing-list-dedents-bos nil
163
163
"If non-nil, closing parentesis dedents onto column of statement, otherwise keeps additional `py-indent-offset', default is nil "
167
167
(defcustom py-electric-colon-active-p nil
168
168
"`py-electric-colon' feature. Default is `nil'. See lp:837065 for discussions. "
172
172
(defcustom py-electric-comment-p t
173
173
"If \"#\" should call `py-electric-comment'. Default is `t'. "
177
177
(defcustom py-electric-comment-add-space-p nil
178
178
"If py-electric-comment should add a space. Default is `nil'. "
182
182
(defcustom py-mark-decorators nil
183
183
"If py-mark-def-or-class functions should mark decorators too. Default is `nil'. "
187
187
(defcustom py-tab-indent t
188
188
"*Non-nil means TAB in Python mode calls `py-indent-line'."
192
192
(defcustom py-complete-function 'py-shell-complete
193
193
"Function used for completion in buffers. "
195
195
(const :tag "Pymacs based py-complete" py-complete)
196
196
(const :tag "py-shell-complete" py-shell-complete)
197
197
(const :tag "IPython's ipython-complete" ipython-complete))
200
200
(defcustom py-shell-complete-function 'py-completion-at-point
201
201
"Function used for completion in buffers. "
202
202
:type '(choice (const :tag "py-completion-at-point" py-completion-at-point)
203
203
(const :tag "Pymacs based py-complete" py-complete)
204
204
(const :tag "IPython's ipython-complete" ipython-complete))
207
207
(defcustom py-encoding-string " # -*- coding: utf-8 -*-"
208
208
"Default string specifying encoding of a Python file. "
212
212
(defvar py-encoding-string-re "^[ \t]*#[ \t]*-\\*-[ \t]*coding:.+-\\*-"
213
213
"Matches encoding string of a Python file. ")
247
247
(defcustom py-lhs-inbound-indent 1
248
248
"When line starts a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis. "
251
251
(make-variable-buffer-local 'py-lhs-inbound-indent)
253
253
(defcustom py-rhs-inbound-indent 1
254
254
"When inside a multiline-assignment: How many colums indent should be more than opening bracket, brace or parenthesis. "
257
257
(make-variable-buffer-local 'py-rhs-inbound-indent)
259
259
(defcustom py-continuation-offset 2
302
302
should be of the form `#x...' where `x' is not a blank or a tab, and
303
303
`...' is arbitrary). However, this string should not end in whitespace."
307
307
(defcustom py-indent-comments t
308
308
"When t, comment lines are indented. "
312
312
(defcustom py-temp-directory
313
313
(let ((ok '(lambda (x)
328
328
can write into: the value (if any) of the environment variable TMPDIR,
329
329
/usr/tmp, /tmp, /var/tmp, or the current directory."
333
333
(defcustom py-beep-if-tab-change t
334
334
"*Ring the bell if `tab-width' is changed.
350
350
Python code synchronously in a subprocess, jump immediately to the
351
351
source code of the innermost traceback frame."
355
355
(defcustom py-ask-about-save t
356
356
"If not nil, ask about which buffers to save before executing some code.
357
357
Otherwise, all modified buffers are saved without asking."
361
361
(defcustom py-backspace-function 'backward-delete-char-untabify
362
362
"*Function called by `py-electric-backspace' when deleting backwards."
366
366
(defcustom py-delete-function 'delete-char
367
367
"*Function called by `py-electric-delete' when deleting forwards."
371
371
(defcustom py-pdbtrack-do-tracking-p t
372
372
"*Controls whether the pdbtrack feature is enabled or not.
376
376
source file and line that the program is stopped at, much the same way
377
377
as gud-mode does for debugging C programs with gdb."
380
380
(make-variable-buffer-local 'py-pdbtrack-do-tracking-p)
382
382
(defcustom py-pdbtrack-minor-mode-string " PDB"
383
383
"*String to use in the minor mode list when pdbtrack is enabled."
387
387
(defcustom py-import-check-point-max
413
413
(defcustom py-current-defun-delay 2
414
414
"When called interactively, `py-current-defun' should wait PY-WHICH-FUNC-DELAY seconds at the definition name found, before returning to previous position. "
419
419
(defcustom py-send-receive-delay 5
420
420
"Seconds to wait for output, used by `python-send-receive'. "
425
425
(defvar py-exec-command nil
426
426
"Mode commands will set this. ")
474
474
(defcustom py-shell-input-prompt-1-regexp "^>>> "
475
475
"*A regular expression to match the input prompt of the shell."
479
479
(defcustom py-shell-input-prompt-2-regexp "^[.][.][.] "
480
480
"*A regular expression to match the input prompt of the shell after the
481
481
first line of input."
485
485
(defcustom py-shell-switch-buffers-on-execute t
486
486
"When non-nil switch to the Python output buffer. "
490
490
(defcustom py-split-windows-on-execute t
491
491
"When non-nil split windows, make Python output buffer other. "
495
495
(defcustom py-hide-show-keywords
501
501
"Keywords composing visible heads.
502
502
Also used by (minor-)outline-mode "
503
503
:type '(repeat string)
506
506
(defcustom py-hide-show-hide-docstrings t
507
507
"*Controls if doc strings can be hidden by hide-show"
511
511
(defcustom python-mode-hook nil
512
512
"Hook run when entering Python mode."
516
516
(defcustom imenu-create-index-p t
517
517
"Non-nil means Python mode creates and displays an index menu of functions and global variables. "
521
521
(defcustom py-shell-name "python"
522
522
"A PATH/TO/EXECUTABLE or default value `py-shell' may look for, if no shell is specified by command. "
525
525
(make-variable-buffer-local 'py-shell-name)
527
527
(defcustom py-source-modes '(python-mode jython-mode)
596
594
should be of the form `#x...' where `x' is not a blank or a tab, and
597
595
`...' is arbitrary). However, this string should not end in whitespace."
601
599
(defcustom py-kill-empty-line t
602
600
"*If t, py-indent-forward-line kills empty lines. "
606
604
(defcustom py-remove-cwd-from-path t
607
605
"Whether to allow loading of Python modules from the current directory.
610
608
reasons, as it is easy for the Python process to be started
611
609
without the user's realization (e.g. to perform completion)."
615
613
(defcustom py-imenu-show-method-args-p nil
616
614
"*Controls echoing of arguments of functions & methods in the Imenu buffer.
617
615
When non-nil, arguments are printed."
621
619
(defcustom python-default-interpreter 'cpython
622
620
"*Which Python interpreter is used by default.
635
633
\\[py-toggle-shells] to change the interpreter shell."
636
634
:type '(choice (const :tag "Python (a.k.a. CPython)" cpython)
637
635
(const :tag "JPython" jpython))
640
638
(defcustom python-python-command-args '("-i")
641
639
"*List of string arguments to be used when starting a Python shell."
642
640
:type '(repeat string)
645
643
(defcustom python-jython-command-args '("-i")
646
644
"*List of string arguments to be used when starting a Jython shell."
660
658
gud-mode does for debugging C programs with gdb, but without
661
659
having to restart the program."
664
662
(make-variable-buffer-local 'python-pdbtrack-do-tracking-p)
666
664
(defcustom python-pdbtrack-minor-mode-string " PDB"
667
665
"*Minor-mode sign to be displayed when pdbtrack is active."
671
669
(defcustom python-shell-prompt-alist
672
670
'(("ipython" . "^In \\[[0-9]+\\]: *")
727
725
If a file is loaded into a buffer that is in one of these major modes, it is considered Python source by `py-load-file', which uses the
728
726
value to determine defaults."
729
727
:type '(repeat function)
732
730
(defcustom python-jython-packages '("java" "javax" "org" "com")
733
731
"Packages implying `jython-mode'.
734
732
If these are imported near the beginning of the buffer, `python-mode'
735
733
actually punts to `jython-mode'."
736
734
:type '(repeat string)
740
738
(defface py-number-face
741
739
'((t (:inherit default)))
742
740
;; '((t (:inherit 'font-lock-variable-name-face)))
743
741
"Highlight numbers. "
745
743
(defvar py-number-face 'py-number-face)
747
745
(defface py-XXX-tag-face
748
746
'((t (:inherit font-lock-string-face)))
749
747
"XXX\\|TODO\\|FIXME "
751
749
(defvar py-XXX-tag-face 'py-XXX-tag-face)
753
751
;; ;; Face for None, True, False, self, and Ellipsis
754
752
(defface py-pseudo-keyword-face
755
753
'((t (:inherit font-lock-keyword-face)))
756
754
"Face for pseudo keywords in Python mode, like self, True, False, Ellipsis."
758
756
(defvar py-pseudo-keyword-face 'py-pseudo-keyword-face)
760
758
(defface py-variable-name-face
761
759
'((t (:inherit default)))
762
760
;; '((t (:inherit 'font-lock-variable-name-face)))
763
761
"Face method decorators."
765
763
(defvar py-variable-name-face 'py-variable-name-face)
767
765
;; PEP 318 decorators
768
766
(defface py-decorators-face
769
767
'((t (:inherit font-lock-keyword-face)))
770
768
"Face method decorators."
772
770
(defvar py-decorators-face 'py-decorators-face)
774
772
;; Face for builtins
775
773
(defface py-builtins-face
776
774
'((t (:inherit font-lock-builtin-face)))
777
775
"Face for builtins like TypeError, object, open, and exec."
779
777
(defvar py-builtins-face 'py-builtins-face)
781
779
(defface py-class-name-face
782
780
'((t (:inherit font-lock-type-face)))
783
781
"Face for classes."
785
783
(defvar py-class-name-face 'py-class-name-face)
787
785
;; XXX, TODO, and FIXME comments and such
788
786
(defface py-exception-name-face
789
787
'((t (:inherit font-lock-builtin-face)))
792
790
(defvar py-exception-name-face 'py-exception-name-face)
794
792
;; ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^