SystemCrafters / crafted-emacs

A sensible base Emacs configuration.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

python-mode > Flymake message flashes in mini-buffer if symbol has no eldoc

pablos-here opened this issue · comments

Hi,

In python-mode, I am seeing an unexpected behavior when symbols have a flymake issue between:

  1. symbols that have eldoc versus
  2. symbols that do not have eldoc

It is a minor issue.

Suppose that the flymake issue is that the symbol is not being accessed:

  • When a symbol has eldoc, the mini-buffer expands with a snippet of documentation.
  • When a symbol does not have eldoc, the flymake warning is briefly displayed in the mini-buffer, followed by a persistent message about the type of symbol.

Below is a test case with sample python code[1], a custom.el and a software dependency[3].

Thank you!

Test Case

  • Start with a fresh ~/crafted-emacs directory

  • Create custom.el - see [2].

  • Start emacs and ensure all packages have been downloaded.

  • Create a new python-mode file with the test code[1]

  • Place point on the tee of import

  • Use the keyboard to move point over to the cue in QApplication. Witness in the mini-buffer the first message briefly displayed, followed by the second, persistent message:

    1. Pywright: "QApplication" is not accessed
    2. (class) QApplication

References

1 - test code

from PyQt5.QtWidgets import QApplication
from urllib import request

2 - custom.el

See code
(provide 'custom)

(require 'crafted-defaults)    ; Sensible default settings for Emacs
(require 'crafted-updates)     ; Tools to upgrade Crafted Emacs
(require 'crafted-completion)  ; selection framework based on `vertico`
(require 'crafted-ui)          ; Better UI experience (modeline etc.)
;;(require 'crafted-windows)     ; Window management configuration
(require 'crafted-editing)     ; Whitespace trimming, auto parens etc.
(require 'crafted-lisp)
;;(require 'crafted-evil)        ; An `evil-mode` configuration
(require 'crafted-org)         ; org-appear, clickable hyperlinks etc.
(require 'crafted-project)     ; built-in alternative to projectile
(require 'crafted-speedbar)    ; built-in file-tree
;;(require 'crafted-screencast)  ; show current command and binding in modeline
(require 'crafted-compile)
;;(require 'crafted-erlang)
(require 'crafted-ide)
;;(require 'crafted-latex)
;;(require 'crafted-mastering-emacs)
;;(require 'crafted-osx)
;;(require 'crafted-pdf-reader)
(require 'crafted-python)
(require 'crafted-startup)
(require 'crafted-workspaces)

(add-hook 'python-mode-hook 'eglot-ensure)

3 - Software dependency - Qt5 Python library:

pip3 install PyQt5

I don't see the problem you describe when I follow these directions. Am I missing something? I notice you turn on eglot, but which server do you install?

Ok, after installing the pyright language server with pip3 install pyright, I now see the problem. However, this is more related to the language server than to Crafted Emacs. If you do not install the language server and/or don't turn on eglot you don't see this problem.

Ah, I see what you're saying: eglot issue. If so, I'll close the issue (and apologize for wasting your time) and open an issue with eglot.

Thanks. No worries, I don't mind looking into things.

While I appreciate your kindness, my take-away is to do better at reporting bugs. I see where I flubbed this one. :]