GNU bug report logs - #51196
29.0.50; python.el eldoc problems

Previous Next

Package: emacs;

Reported by: Carlos Pita <carlosjosepita2 <at> gmail.com>

Date: Wed, 13 Oct 2021 23:44:01 UTC

Severity: normal

Found in version 29.0.50

To reply to this bug, email your comments to 51196 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Wed, 13 Oct 2021 23:44:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Carlos Pita <carlosjosepita2 <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 13 Oct 2021 23:44:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.0.50; python.el eldoc problems
Date: Wed, 13 Oct 2021 20:42:53 -0300
Hi all,

there are a number of issues with eldoc support in python.el, as in many
areas in which this module tries IMHO to be too smart. At the core of
these problems is the fact that eldoc will block if the underlying
python process is not idle at the moment of the call. Seemingly some
mechanisms are in place to prevent this but they are inconsistent,
dangerous, inconvenient and complex:

- Inconsistent: the "auto doc" in the echo area feature
  (i.e. python-eldoc-function) times out after
  python-eldoc-function-timout, but the manually triggered (C-c C-f,
  python-eldoc-at-point) will block emacs...

- Dangerous: ...until either the underlying process becomes idle again
  or the user aborts python-eldoc-at-point, for example by pressing C-g,
  which also aborts the action going on in the underlying process. So
  the user is faced with the choice between being able to use emacs or
  complete the real job that supposedly emacs is facilitating.

- Inconvenient: even in the case that does timeout (by default after 1
  second) once it has timed out it won't try to show documentation
  again, except when the user had previously set
  python-eldoc-function-timeout-permanent to nil, in which case it will
  immediately reattempt one time after another, all this resulting in an
  extremely laggy experience. Alternatively, the user can laboriously
  set python-eldoc-get-doc to t in order to resume the "auto doc"
  feature.

- Complex: see my previous three points.

I've expressed this opinion before regarding the autocompletion
mechanism, which shows similar shortcomings, I believe that the best
options are:

- Have a sane, solid and simple python.el with good syntax highlighting,
  movements commands, folding, etc. and leave the cleverness to elpy,
  lsp-mode, eglot, emacs-jupyter or whatever.

- If we still want some basic autocompletion and documentation features
  in this module, then let's do it right and open a thread in the
  underlying process and talk to it, avoiding the flaky and dangerous
  mechanism of pretending that emacs is the user typing.

That said, I'm not against keeping a very simple "send region to REPL"
thing, because in this case a blocking behavior is to be expected and
there is little magic going on.

Best regards,
Carlos

---

In GNU Emacs 29.0.50 (build 1, x86_64-apple-darwin20.6.0, NS appkit-2022.60 Version 11.6 (Build 20G165))
 of 2021-10-07 built on Carloss-MacBook-Pro.local
Repository revision: d2611920685ca415a1d85ffb9567b968518028d6
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2022
System Description:  macOS 11.6

Configured using:
 'configure --without-native-compilation'

Configured features:
ACL DBUS GLIB GMP GNUTLS JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY KQUEUE
NS PDUMPER PNG RSVG THREADS TIFF TOOLKIT_SCROLL_BARS XIM ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Python

Minor modes in effect:
  treemacs-icons-dired-mode: t
  treemacs-filewatch-mode: t
  treemacs-follow-mode: t
  treemacs-fringe-indicator-mode: t
  global-hl-todo-mode: t
  hl-todo-mode: t
  recentf-mode: t
  shell-dirtrack-mode: t
  company-box-mode: t
  outline-minor-mode: t
  display-line-numbers-mode: t
  ivy-mode: t
  global-company-mode: t
  company-mode: t
  which-key-mode: t
  override-global-mode: t
  electric-pair-mode: t
  minions-mode: t
  doom-modeline-mode: t
  ns-auto-titlebar-mode: t
  straight-use-package-mode: t
  straight-package-neutering-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tab-bar-history-mode: t
  tab-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
/Users/carlos/.emacs.d/straight/build/transient/transient hides /Applications/Emacs.app/Contents/Resources/lisp/transient
/Users/carlos/.emacs.d/straight/build/org/ob-exp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-exp
/Users/carlos/.emacs.d/straight/build/org/ob-emacs-lisp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-emacs-lisp
/Users/carlos/.emacs.d/straight/build/org/oc hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc
/Users/carlos/.emacs.d/straight/build/org/ob-css hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-css
/Users/carlos/.emacs.d/straight/build/org/ob-lob hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lob
/Users/carlos/.emacs.d/straight/build/org/ol-irc hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-irc
/Users/carlos/.emacs.d/straight/build/org/ob-forth hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-forth
/Users/carlos/.emacs.d/straight/build/org/org-macs hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-macs
/Users/carlos/.emacs.d/straight/build/org/ob hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob
/Users/carlos/.emacs.d/straight/build/org/org-version hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-version
/Users/carlos/.emacs.d/straight/build/org/ob-scheme hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-scheme
/Users/carlos/.emacs.d/straight/build/org/ox hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox
/Users/carlos/.emacs.d/straight/build/org/ob-C hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-C
/Users/carlos/.emacs.d/straight/build/org/org-capture hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-capture
/Users/carlos/.emacs.d/straight/build/org/ob-ref hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ref
/Users/carlos/.emacs.d/straight/build/org/ob-clojure hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-clojure
/Users/carlos/.emacs.d/straight/build/org/org-mouse hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-mouse
/Users/carlos/.emacs.d/straight/build/org/org-ctags hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-ctags
/Users/carlos/.emacs.d/straight/build/org/org-entities hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-entities
/Users/carlos/.emacs.d/straight/build/org/org-archive hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-archive
/Users/carlos/.emacs.d/straight/build/org/ob-screen hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-screen
/Users/carlos/.emacs.d/straight/build/org/ol-bibtex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-bibtex
/Users/carlos/.emacs.d/straight/build/org/ob-haskell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-haskell
/Users/carlos/.emacs.d/straight/build/org/org-table hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-table
/Users/carlos/.emacs.d/straight/build/org/ol-eww hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-eww
/Users/carlos/.emacs.d/straight/build/org/ox-org hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-org
/Users/carlos/.emacs.d/straight/build/org/org-num hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-num
/Users/carlos/.emacs.d/straight/build/org/org-plot hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-plot
/Users/carlos/.emacs.d/straight/build/org/ol-rmail hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-rmail
/Users/carlos/.emacs.d/straight/build/org/ob-awk hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-awk
/Users/carlos/.emacs.d/straight/build/org/ob-groovy hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-groovy
/Users/carlos/.emacs.d/straight/build/org/ob-octave hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-octave
/Users/carlos/.emacs.d/straight/build/org/org-faces hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-faces
/Users/carlos/.emacs.d/straight/build/org/oc-biblatex hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-biblatex
/Users/carlos/.emacs.d/straight/build/org/org-colview hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-colview
/Users/carlos/.emacs.d/straight/build/org/ob-R hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-R
/Users/carlos/.emacs.d/straight/build/org/org-refile hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-refile
/Users/carlos/.emacs.d/straight/build/org/org-timer hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-timer
/Users/carlos/.emacs.d/straight/build/org/org-mobile hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-mobile
/Users/carlos/.emacs.d/straight/build/org/ob-fortran hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-fortran
/Users/carlos/.emacs.d/straight/build/org/ob-shell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-shell
/Users/carlos/.emacs.d/straight/build/org/ob-perl hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-perl
/Users/carlos/.emacs.d/straight/build/org/ob-sqlite hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sqlite
/Users/carlos/.emacs.d/straight/build/org/oc-basic hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-basic
/Users/carlos/.emacs.d/straight/build/org/ob-sed hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sed
/Users/carlos/.emacs.d/straight/build/org/org-list hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-list
/Users/carlos/.emacs.d/straight/build/org/ob-ruby hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ruby
/Users/carlos/.emacs.d/straight/build/org/ob-eval hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-eval
/Users/carlos/.emacs.d/straight/build/org/org-habit hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-habit
/Users/carlos/.emacs.d/straight/build/org/org-clock hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-clock
/Users/carlos/.emacs.d/straight/build/org/org-goto hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-goto
/Users/carlos/.emacs.d/straight/build/org/ox-html hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-html
/Users/carlos/.emacs.d/straight/build/org/org-src hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-src
/Users/carlos/.emacs.d/straight/build/org/ob-lisp hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lisp
/Users/carlos/.emacs.d/straight/build/org/ol-eshell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-eshell
/Users/carlos/.emacs.d/straight/build/org/ob-ditaa hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ditaa
/Users/carlos/.emacs.d/straight/build/org/org-pcomplete hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-pcomplete
/Users/carlos/.emacs.d/straight/build/org/org-lint hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-lint
/Users/carlos/.emacs.d/straight/build/org/ox-latex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-latex
/Users/carlos/.emacs.d/straight/build/org/ob-sass hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sass
/Users/carlos/.emacs.d/straight/build/org/ob-tangle hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-tangle
/Users/carlos/.emacs.d/straight/build/org/ob-calc hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-calc
/Users/carlos/.emacs.d/straight/build/org/ob-java hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-java
/Users/carlos/.emacs.d/straight/build/org/ox-icalendar hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-icalendar
/Users/carlos/.emacs.d/straight/build/org/ol-mhe hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-mhe
/Users/carlos/.emacs.d/straight/build/org/org-attach-git hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-attach-git
/Users/carlos/.emacs.d/straight/build/org/ox-md hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-md
/Users/carlos/.emacs.d/straight/build/org/ox-beamer hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-beamer
/Users/carlos/.emacs.d/straight/build/org/org-element hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-element
/Users/carlos/.emacs.d/straight/build/org/oc-natbib hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-natbib
/Users/carlos/.emacs.d/straight/build/org/org-protocol hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-protocol
/Users/carlos/.emacs.d/straight/build/org/ob-gnuplot hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-gnuplot
/Users/carlos/.emacs.d/straight/build/org/org-tempo hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-tempo
/Users/carlos/.emacs.d/straight/build/org/ob-latex hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-latex
/Users/carlos/.emacs.d/straight/build/org/ol-w3m hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-w3m
/Users/carlos/.emacs.d/straight/build/org/org-id hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-id
/Users/carlos/.emacs.d/straight/build/org/ox-man hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-man
/Users/carlos/.emacs.d/straight/build/org/ol-doi hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-doi
/Users/carlos/.emacs.d/straight/build/org/org-feed hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-feed
/Users/carlos/.emacs.d/straight/build/org/ob-julia hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-julia
/Users/carlos/.emacs.d/straight/build/org/ob-lua hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lua
/Users/carlos/.emacs.d/straight/build/org/ob-table hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-table
/Users/carlos/.emacs.d/straight/build/org/ob-ocaml hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-ocaml
/Users/carlos/.emacs.d/straight/build/org/oc-csl hides /Applications/Emacs.app/Contents/Resources/lisp/org/oc-csl
/Users/carlos/.emacs.d/straight/build/org/ol-gnus hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-gnus
/Users/carlos/.emacs.d/straight/build/org/org-indent hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-indent
/Users/carlos/.emacs.d/straight/build/org/ob-lilypond hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-lilypond
/Users/carlos/.emacs.d/straight/build/org/ob-matlab hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-matlab
/Users/carlos/.emacs.d/straight/build/org/org-datetree hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-datetree
/Users/carlos/.emacs.d/straight/build/org/ol-docview hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-docview
/Users/carlos/.emacs.d/straight/build/org/ob-python hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-python
/Users/carlos/.emacs.d/straight/build/org/ob-makefile hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-makefile
/Users/carlos/.emacs.d/straight/build/org/org-duration hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-duration
/Users/carlos/.emacs.d/straight/build/org/org-agenda hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-agenda
/Users/carlos/.emacs.d/straight/build/org/ob-dot hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-dot
/Users/carlos/.emacs.d/straight/build/org/ob-js hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-js
/Users/carlos/.emacs.d/straight/build/org/ox-publish hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-publish
/Users/carlos/.emacs.d/straight/build/org/org-inlinetask hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-inlinetask
/Users/carlos/.emacs.d/straight/build/org/ob-org hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-org
/Users/carlos/.emacs.d/straight/build/org/org-keys hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-keys
/Users/carlos/.emacs.d/straight/build/org/ob-core hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-core
/Users/carlos/.emacs.d/straight/build/org/org-compat hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-compat
/Users/carlos/.emacs.d/straight/build/org/ol hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol
/Users/carlos/.emacs.d/straight/build/org/ox-odt hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-odt
/Users/carlos/.emacs.d/straight/build/org/ol-info hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-info
/Users/carlos/.emacs.d/straight/build/org/ob-plantuml hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-plantuml
/Users/carlos/.emacs.d/straight/build/org/ob-eshell hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-eshell
/Users/carlos/.emacs.d/straight/build/org/ox-ascii hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-ascii
/Users/carlos/.emacs.d/straight/build/org/org-loaddefs hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-loaddefs
/Users/carlos/.emacs.d/straight/build/org/ox-koma-letter hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-koma-letter
/Users/carlos/.emacs.d/straight/build/org/ob-maxima hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-maxima
/Users/carlos/.emacs.d/straight/build/org/org hides /Applications/Emacs.app/Contents/Resources/lisp/org/org
/Users/carlos/.emacs.d/straight/build/org/ol-bbdb hides /Applications/Emacs.app/Contents/Resources/lisp/org/ol-bbdb
/Users/carlos/.emacs.d/straight/build/org/org-macro hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-macro
/Users/carlos/.emacs.d/straight/build/org/ob-sql hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-sql
/Users/carlos/.emacs.d/straight/build/org/org-attach hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-attach
/Users/carlos/.emacs.d/straight/build/org/ob-processing hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-processing
/Users/carlos/.emacs.d/straight/build/org/ox-texinfo hides /Applications/Emacs.app/Contents/Resources/lisp/org/ox-texinfo
/Users/carlos/.emacs.d/straight/build/org/org-crypt hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-crypt
/Users/carlos/.emacs.d/straight/build/org/org-footnote hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-footnote
/Users/carlos/.emacs.d/straight/build/org/org-install hides /Applications/Emacs.app/Contents/Resources/lisp/org/org-install
/Users/carlos/.emacs.d/straight/build/org/ob-comint hides /Applications/Emacs.app/Contents/Resources/lisp/org/ob-comint
/Users/carlos/.emacs.d/straight/build/let-alist/let-alist hides /Applications/Emacs.app/Contents/Resources/lisp/emacs-lisp/let-alist

Features:
(shadow emacsbug sendmail python tramp-sh cl-print eieio-opt speedbar
ezimage dframe shortdoc help-fns radix-tree mm-archive misearch
multi-isearch sort smiley gnus-cite mail-extr gnus-bcklg qp gnus-async
gnus-ml nndraft nnmh nnfolder utf-7 epa-file gnutls network-stream nsm
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum shr
kinsoku svg dom browse-url url url-proxy url-privacy url-expand
url-methods url-history url-cookie url-domsuf url-util mailcap
gnus-group gnus-undo gnus-start gnus-dbus dbus xml gnus-cloud nnimap
nnmail mail-source utf7 netrc nnoo gnus-spec gnus-int gnus-range message
rmc puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
gnus-win gnus nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045
ietf-drums mail-utils mm-util mail-prsvr dired-aux treemacs-icons-dired
ffap url-parse url-vars tramp tramp-loaddefs trampver tramp-integration
files-x tramp-compat parse-time iso8601 ls-lisp format-spec auth-source
password-cache treemacs treemacs-header-line treemacs-compatibility
treemacs-mode treemacs-bookmarks treemacs-interface treemacs-extensions
treemacs-mouse-interface treemacs-tags imenu treemacs-persistence
treemacs-filewatch-mode filenotify treemacs-follow-mode
treemacs-rendering treemacs-async treemacs-workspaces treemacs-dom
treemacs-visuals treemacs-fringe-indicator treemacs-scope eieio
eieio-core eieio-loaddefs pulse treemacs-faces treemacs-icons
treemacs-themes treemacs-core-utils pfuture inline hl-line ht
treemacs-logging treemacs-customization treemacs-macros hl-todo
doom-solarized-dark-high-contrast-theme doom-solarized-dark-theme
doom-ayu-mirage-theme flycheck json map find-func recentf tree-widget
wid-edit bookmark pp time-date doom-acario-dark-theme vc-mtn vc-hg
vc-git diff-mode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc
vc-dispatcher term disp-table shell pcomplete ehelp thingatpt
company-box company-box-doc frame-local company-box-icons noutline
outline display-line-numbers server pdf-tools-autoloads
tablist-autoloads org-roam-autoloads emacsql-sqlite-autoloads
emacsql-autoloads jupyter-autoloads websocket-autoloads
simple-httpd-autoloads zmq-autoloads lsp-pyright-autoloads
pyvenv-autoloads code-cells-autoloads dired-x exec-path-from-shell
exec-path-from-shell-autoloads hl-todo-autoloads flycheck-autoloads
let-alist-autoloads pkg-info-autoloads epl-autoloads dap-mode-autoloads
bui-autoloads lsp-treemacs-autoloads lsp-ivy-autoloads lsp-ui-autoloads
lsp-mode-autoloads markdown-mode-autoloads spinner-autoloads
git-timemachine-autoloads magit-autoloads magit-section-autoloads
git-commit-autoloads with-editor-autoloads transient-autoloads
treemacs-icons-dired-autoloads treemacs-projectile-autoloads
treemacs-autoloads cfrs-autoloads posframe-autoloads ht-autoloads
hydra-autoloads lv-autoloads pfuture-autoloads ace-window-autoloads
projectile-autoloads counsel xdg dired dired-loaddefs compile
text-property-search comint ansi-color swiper ivy delsel ivy-faces
ivy-overlay colir color counsel-autoloads swiper-autoloads ivy-autoloads
company-box-autoloads frame-local-autoloads company-oddmuse
company-keywords company-etags etags fileloop generator xref project
ring company-gtags company-dabbrev-code company-dabbrev company-files
company-clang company-capf company-cmake company-semantic
company-template company-bbdb company pcase company-autoloads which-key
advice which-key-autoloads visual-fill-column-autoloads wgrep-autoloads
avy-autoloads edmacro kmacro undo-tree-autoloads use-package-bind-key
bind-key easy-mmode elec-pair minions minions-autoloads doom-modeline
doom-modeline-segments doom-modeline-env doom-modeline-core shrink-path
rx f s all-the-icons all-the-icons-faces data-material data-weathericons
data-octicons data-fileicons data-faicons data-alltheicons dash
doom-modeline-autoloads shrink-path-autoloads f-autoloads dash-autoloads
s-autoloads all-the-icons-autoloads doom-themes-ext-org
doom-themes-ext-treemacs doom-themes-ext-visual-bell face-remap
doom-solarized-light-theme doom-themes doom-themes-base
doom-themes-autoloads finder-inf ns-auto-titlebar
ns-auto-titlebar-autoloads use-package-core use-package-autoloads
bind-key-autoloads straight-autoloads info cl-seq cl-extra help-mode seq
byte-opt straight subr-x cl-macs gv cl-loaddefs cl-lib bytecomp
byte-compile cconv iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/ns-win ns-win
ucs-normalize mule-util term/common-win tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind kqueue cocoa ns
lcms2 multi-tty make-network-process emacs)

Memory information:
((conses 16 588199 44521)
 (symbols 48 32196 2)
 (strings 32 114559 9038)
 (string-bytes 1 4006593)
 (vectors 16 63785)
 (vector-slots 8 1517429 65843)
 (floats 8 1670 685)
 (intervals 56 6140 2011)
 (buffers 992 26))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Fri, 15 Oct 2021 02:06:02 GMT) Full text and rfc822 format available.

Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita2 <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: 29.0.50; python.el eldoc problems
Date: Thu, 14 Oct 2021 23:05:20 -0300
I've been delving into the different timeout mechanisms in python.el:

python-shell-completion-native-output-timeout 5.0
python-shell-completion-native-try-output-timeout 1.0
python-eldoc-function-timeout 1
python-eldoc-function-timeout-permanent t
This is in bad shape, in addition to points I've already made above:

- Even though in a clunky way, eldoc at least stops trying after a
timeout in order to avoid causing unbearable UI lags, but that's not
the case with c-a-p. I imagine the rationale here is that c-a-p is not
auto-triggered as eldoc is, but that's not true of company and other
completion backends that will trigger completions under the hood, so
you could end up with constant 5s lag in input.

- Apparently there is no timeout for non-native completions, as in the
case of C-c C-f described above this can freeze emacs, but in this
case it doesn't even have to be manually triggered.

- More complexity but the attempts still fall short. Probably ad hoc
patches have been piling up over the years.

Perhaps we can improve the timeout strategy, simplify it and make it
more coherent, and thus avoid throwing the baby out with the
bathwater. It won't be perfect since documentation sometimes will be
missing, completions sometimes will be missing, the prompt count will
still change mysteriously, but at least it will be safe and
comprehensible.

Best regards,
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Fri, 15 Oct 2021 20:23:02 GMT) Full text and rfc822 format available.

Message #11 received at 51196 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Carlos Pita <carlosjosepita2 <at> gmail.com>
Cc: 51196 <at> debbugs.gnu.org
Subject: Re: bug#51196: 29.0.50; python.el eldoc problems
Date: Fri, 15 Oct 2021 22:22:29 +0200
On Wed, 13 Oct 2021 at 20:42, Carlos Pita <carlosjosepita2 <at> gmail.com> wrote:

> I've expressed this opinion before regarding the autocompletion
> mechanism, which shows similar shortcomings, I believe that the best
> options are:
>
> - Have a sane, solid and simple python.el with good syntax highlighting,
>   movements commands, folding, etc. and leave the cleverness to elpy,
>   lsp-mode, eglot, emacs-jupyter or whatever.

But the problematic Eldoc functionality is disabled by default, right?
So leaving it there doesn't hurt anyone --- except for the unwitting
user who doesn't know that this feature is kind of broken.

>
> - If we still want some basic autocompletion and documentation features
>   in this module, then let's do it right and open a thread in the
>   underlying process and talk to it, avoiding the flaky and dangerous
>   mechanism of pretending that emacs is the user typing.

Personally I have zero motivation to implement this, because it would
still require evaluating code before one can get completion or
docstrings.  Nowadays there are decent static analyzers for Python out
there.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Fri, 15 Oct 2021 20:31:02 GMT) Full text and rfc822 format available.

Message #14 received at 51196 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Carlos Pita <carlosjosepita2 <at> gmail.com>
Cc: 51196 <at> debbugs.gnu.org
Subject: Re: bug#51196: 29.0.50; python.el eldoc problems
Date: Fri, 15 Oct 2021 22:30:41 +0200
On Thu, 14 Oct 2021 at 23:05, Carlos Pita <carlosjosepita2 <at> gmail.com> wrote:

> - Apparently there is no timeout for non-native completions, as in the
> case of C-c C-f described above this can freeze emacs, but in this
> case it doesn't even have to be manually triggered.

Is it even possible, technically, to add a timeout for non-native
completion?  I think this would require sending a break signal to cancel
the completions computation, which seems scary.

I thought you had a good argument for disabling native completion by
default, but this might speak against it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Fri, 15 Oct 2021 20:35:02 GMT) Full text and rfc822 format available.

Message #17 received at 51196 <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita2 <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 51196 <at> debbugs.gnu.org
Subject: Re: bug#51196: 29.0.50; python.el eldoc problems
Date: Fri, 15 Oct 2021 17:33:57 -0300
Hi Augusto,

> > - Have a sane, solid and simple python.el with good syntax highlighting,
> >   movements commands, folding, etc. and leave the cleverness to elpy,
> >   lsp-mode, eglot, emacs-jupyter or whatever.
>
> But the problematic Eldoc functionality is disabled by default, right?
> So leaving it there doesn't hurt anyone --- except for the unwitting
> user who doesn't know that this feature is kind of broken.

No, it's not, all the magic is enabled by default, only piecemeal
measures have been taken over the years in order to prevent blocking
behavior, so for example now eldoc disables itself forever after 1s
timeout. But that's not true of non-native completion AFAICS and
it certainly isn't of C-c C-f (help on symbol). And improving on this
by adding even more special cases doesn't sound like a good idea.

Best regards,
Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Sat, 16 Oct 2021 09:16:02 GMT) Full text and rfc822 format available.

Message #20 received at 51196 <at> debbugs.gnu.org (full text, mbox):

From: Augusto Stoffel <arstoffel <at> gmail.com>
To: Carlos Pita <carlosjosepita2 <at> gmail.com>
Cc: 51196 <at> debbugs.gnu.org
Subject: Re: bug#51196: 29.0.50; python.el eldoc problems
Date: Sat, 16 Oct 2021 11:15:36 +0200
On Fri, 15 Oct 2021 at 17:33, Carlos Pita <carlosjosepita2 <at> gmail.com> wrote:

> Hi Augusto,
>
>> > - Have a sane, solid and simple python.el with good syntax highlighting,
>> >   movements commands, folding, etc. and leave the cleverness to elpy,
>> >   lsp-mode, eglot, emacs-jupyter or whatever.
>>
>> But the problematic Eldoc functionality is disabled by default, right?
>> So leaving it there doesn't hurt anyone --- except for the unwitting
>> user who doesn't know that this feature is kind of broken.
>
> No, it's not, all the magic is enabled by default, only piecemeal
> measures have been taken over the years in order to prevent blocking
> behavior, so for example now eldoc disables itself forever after 1s
> timeout.

I see.  I never noticed this because Eglot masks the completion/eldoc
functions from python.el.

As you already mentioned, the biggest problem here is to use the same
Python process/thread for both REPL interaction _and_
completion/documentation stuff.  Individually, each of these things
works alright, but mixing the two is just never going to work
flawlessly.

> But that's not true of non-native completion AFAICS and
> it certainly isn't of C-c C-f (help on symbol).

If the user explicitly types C-c C-f, then I see no problem in the
blocking behavior.

> And improving on this by adding even more special cases doesn't sound
> like a good idea.
>
> Best regards,
> Carlos




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#51196; Package emacs. (Sat, 16 Oct 2021 18:50:01 GMT) Full text and rfc822 format available.

Message #23 received at 51196 <at> debbugs.gnu.org (full text, mbox):

From: Carlos Pita <carlosjosepita2 <at> gmail.com>
To: Augusto Stoffel <arstoffel <at> gmail.com>
Cc: 51196 <at> debbugs.gnu.org
Subject: Re: bug#51196: 29.0.50; python.el eldoc problems
Date: Sat, 16 Oct 2021 15:49:38 -0300
Hi Augusto,

> I see.  I never noticed this because Eglot masks the completion/eldoc
> functions from python.el.

I guess this is often the case. There are some scenarios in which you
mainly interact with your interpreter from a python buffer (as in your
code-cells) for which naive (not naTive :) ) runtime completion with
no static inference bells and whistles may still be desirable. IIRC
elpy has some kind of fallback from jedi completion to runtime
completion fed by the inferior interpreter. elpy also implements a
small rpc mechanism for all this stuff, so it doesn't share the
shortcomings of python.el while still not requiring a full-fledged
static analyzer. Sadly elpy is in low-maintenance mode now.
emacs-jupyter also gets this right when completing from its inferior
kernels, it even provides a minor mode that is able to pull off its
magic inside org babel blocks! Anyway, static analyzers are getting
better every day and the point of runtime completion is in turn
getting mooter every day, except perhaps in that it still is the more
lightweight alternative.

> As you already mentioned, the biggest problem here is to use the same
> Python process/thread for both REPL interaction _and_
> completion/documentation stuff.

Yes, there are race conditions between emacs and its user, to put it somehow.

> > But that's not true of non-native completion AFAICS and
> > it certainly isn't of C-c C-f (help on symbol).
>
> If the user explicitly types C-c C-f, then I see no problem in the
> blocking behavior.

I don't think we can ask the user to remember checking its inferior
process before requesting quick help on a symbol and, anyway, we don't
need to agree on this because after fixing the implicit cases
this one will follow suit for free.

I'm about to retire in a few months and I will have the time to
undertake a slightly more ambitious change regarding these rough edges
of python.el, but I won't start without some level of consensus around
the issues and the solution. After that, I wouldn't mind doing some
maintenance of the module.

Best regards,
Carlos




This bug report was last modified 2 years and 184 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.