aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
authorPaul Eggert2016-06-19 00:47:00 +0200
committerPaul Eggert2016-06-19 00:47:00 +0200
commit68cb71c0928eb8b10487a125192f43923e8bfe7f (patch)
tree053133358af1bd991d60ed6c29590ad84b29fed0 /lisp/progmodes/python.el
parent87c9d8fcec183c8f4933e218c1895b6a0722b1e1 (diff)
parent9ae514a9b7ed368ea97ddefa806079b6423833cb (diff)
downloademacs-68cb71c0928eb8b10487a125192f43923e8bfe7f.tar.gz
emacs-68cb71c0928eb8b10487a125192f43923e8bfe7f.zip
Merge from origin/emacs-25
9ae514a * etc/AUTHORS: Update the AUTHORS file 3ca428e add entries to authors.el 66d556b Fix eldoc-related freezes in python mode d59bcbc Handle mouse leaving initial window in `mouse-set-region' (Bu... 27fe1e4 org.el: Fix bindings of < and > for calendar scrolling a813487 Fix undo boundary in recursive edit (Bug#23632) 1f85b7c Doc fixes re alist-get. (Bug#23548) ba3f206 * lisp/progmodes/python.el (inferior-python-mode): Avoid tabs... 56fa055 * src/syntax.c (syms_of_syntax) <comment-end-can-be-escaped>:... 4c1370a * lisp/help-fns.el (describe-function-1): Fix handling of fil... a3f7ae8 * lisp/emacs-lisp/cl-macs.el (cl-loop): Doc fix re "by". 601b9b2 * doc/misc/cl.texi (Mapping over Sequences): Fix cl-notevery.
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el40
1 files changed, 38 insertions, 2 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d4089a3ea92..ad69f8779e0 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2700,6 +2700,7 @@ variable.
2700\(Type \\[describe-mode] in the process buffer for a list of commands.)" 2700\(Type \\[describe-mode] in the process buffer for a list of commands.)"
2701 (when python-shell--parent-buffer 2701 (when python-shell--parent-buffer
2702 (python-util-clone-local-variables python-shell--parent-buffer)) 2702 (python-util-clone-local-variables python-shell--parent-buffer))
2703 (set (make-local-variable 'indent-tabs-mode) nil)
2703 ;; Users can interactively override default values for 2704 ;; Users can interactively override default values for
2704 ;; `python-shell-interpreter' and `python-shell-interpreter-args' 2705 ;; `python-shell-interpreter' and `python-shell-interpreter-args'
2705 ;; when calling `run-python'. This ensures values let-bound in 2706 ;; when calling `run-python'. This ensures values let-bound in
@@ -4313,12 +4314,47 @@ returns will be used. If not FORCE-PROCESS is passed what
4313 (unless (zerop (length docstring)) 4314 (unless (zerop (length docstring))
4314 docstring))))) 4315 docstring)))))
4315 4316
4317(defvar-local python-eldoc-get-doc t
4318 "Non-nil means eldoc should fetch the documentation
4319 automatically. Set to nil by `python-eldoc-function' if
4320 `python-eldoc-function-timeout-permanent' is non-nil and
4321 `python-eldoc-function' times out.")
4322
4323(defcustom python-eldoc-function-timeout 1
4324 "Timeout for `python-eldoc-function' in seconds."
4325 :group 'python
4326 :type 'integer
4327 :version "25.1")
4328
4329(defcustom python-eldoc-function-timeout-permanent t
4330 "Non-nil means that when `python-eldoc-function' times out
4331`python-eldoc-get-doc' will be set to nil"
4332 :group 'python
4333 :type 'boolean
4334 :version "25.1")
4335
4316(defun python-eldoc-function () 4336(defun python-eldoc-function ()
4317 "`eldoc-documentation-function' for Python. 4337 "`eldoc-documentation-function' for Python.
4318For this to work as best as possible you should call 4338For this to work as best as possible you should call
4319`python-shell-send-buffer' from time to time so context in 4339`python-shell-send-buffer' from time to time so context in
4320inferior Python process is updated properly." 4340inferior Python process is updated properly.
4321 (python-eldoc--get-doc-at-point)) 4341
4342If `python-eldoc-function-timeout' seconds elapse before this
4343function returns then if
4344`python-eldoc-function-timeout-permanent' is non-nil
4345`python-eldoc-get-doc' will be set to nil and eldoc will no
4346longer return the documentation at the point automatically.
4347
4348Set `python-eldoc-get-doc' to t to reenable eldoc documentation
4349fetching"
4350 (when python-eldoc-get-doc
4351 (with-timeout (python-eldoc-function-timeout
4352 (if python-eldoc-function-timeout-permanent
4353 (progn
4354 (message "Eldoc echo-area display muted in this buffer, see `python-eldoc-function'")
4355 (setq python-eldoc-get-doc nil))
4356 (message "`python-eldoc-function' timed out, see `python-eldoc-function-timeout'")))
4357 (python-eldoc--get-doc-at-point))))
4322 4358
4323(defun python-eldoc-at-point (symbol) 4359(defun python-eldoc-at-point (symbol)
4324 "Get help on SYMBOL using `help'. 4360 "Get help on SYMBOL using `help'.