comparison lisp/progmodes/python.el @ 72578:a9874901ba07

(python-eldoc-function): Re-enable quit while waiting for process.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 30 Aug 2006 21:10:10 +0000
parents b562a18db094
children a15622a85c05 c358d0861b16
comparison
equal deleted inserted replaced
72577:546f5ad61050 72578:a9874901ba07
1597 "`eldoc-print-current-symbol-info' for Python. 1597 "`eldoc-print-current-symbol-info' for Python.
1598 Only works when point is in a function name, not its arg list, for 1598 Only works when point is in a function name, not its arg list, for
1599 instance. Assumes an inferior Python is running." 1599 instance. Assumes an inferior Python is running."
1600 (let ((symbol (with-syntax-table python-dotty-syntax-table 1600 (let ((symbol (with-syntax-table python-dotty-syntax-table
1601 (current-word)))) 1601 (current-word))))
1602 ;; First try the symbol we're on. 1602 ;; This is run from timers, so inhibit-quit tends to be set.
1603 (or (and symbol 1603 (with-local-quit
1604 (python-send-receive (format "emacs.eargs(%S, %s)" 1604 ;; First try the symbol we're on.
1605 symbol python-imports))) 1605 (or (and symbol
1606 ;; Try moving to symbol before enclosing parens. 1606 (python-send-receive (format "emacs.eargs(%S, %s)"
1607 (let ((s (syntax-ppss))) 1607 symbol python-imports)))
1608 (unless (zerop (car s)) 1608 ;; Try moving to symbol before enclosing parens.
1609 (when (eq ?\( (char-after (nth 1 s))) 1609 (let ((s (syntax-ppss)))
1610 (save-excursion 1610 (unless (zerop (car s))
1611 (goto-char (nth 1 s)) 1611 (when (eq ?\( (char-after (nth 1 s)))
1612 (skip-syntax-backward "-") 1612 (save-excursion
1613 (let ((point (point))) 1613 (goto-char (nth 1 s))
1614 (skip-chars-backward "a-zA-Z._") 1614 (skip-syntax-backward "-")
1615 (if (< (point) point) 1615 (let ((point (point)))
1616 (python-send-receive 1616 (skip-chars-backward "a-zA-Z._")
1617 (format "emacs.eargs(%S, %s)" 1617 (if (< (point) point)
1618 (buffer-substring-no-properties (point) point) 1618 (python-send-receive
1619 python-imports))))))))))) 1619 (format "emacs.eargs(%S, %s)"
1620 (buffer-substring-no-properties (point) point)
1621 python-imports))))))))))))
1620 1622
1621 ;;;; Info-look functionality. 1623 ;;;; Info-look functionality.
1622 1624
1623 (defun python-after-info-look () 1625 (defun python-after-info-look ()
1624 "Set up info-look for Python. 1626 "Set up info-look for Python.