2

Gents,

I used several IDEs for Python. I like Spyder, but I have have been a pretty obsessive Emacs user for a LONG time. I install ELPY. It works very well for my needs. However, I cannot get code folding to work. Whenever I click on anything and then choose EPLY->Code folding->Hide/show at point (through the menu system), I get the following error:

Debugger entered--Lisp error: (void-variable hs-minor-mode) elpy-folding-toggle-at-point() funcall-interactively(elpy-folding-toggle-at-point) call-interactively(elpy-folding-toggle-at-point nil nil) command-execute(elpy-folding-toggle-at-point)

Does anybody know how to get this working? It does not matter much where I click on a function or pretty much anything.

  • Hide/Show minor mode works very well inside ELPY. However, I still find it very strange the ELPY's menus for code folding/unfolding with the error changing to: Debugger entered--Lisp error: (invalid-function hs-life-goes-on) hs-life-goes-on(nil) elpy-folding-toggle-at-point() funcall-interactively(elpy-folding-toggle-at-point) call-interactively(elpy-folding-toggle-at-point nil nil) command-execute(elpy-folding-toggle-at-point) Any ideas? – Pablo A Perez-Fernandez Dec 7 '19 at 9:41
  • 1
    (void-variable hs-minor-mode) means the the variable hs-minor-mode is nil, and becomes true if you enable the mode with M-x hs-minor-mode. After this is enabled, you may type the command ELPY -> Code-folding ->.... Try if this works for you, you may add a hook to elpy config to enable this mode automatically. Also see the same question here: stackoverflow.com/questions/5244485/…. – Ian Dec 7 '19 at 14:20
  • @Ian, unfortunately, your suggestion is the first thing I tried. I did M-x hs-minor-mode and did confirm that the var hs-minor-mode evaluates to t using M-: hs-minor-mode. I added hs-minor-mode as a hook for elpy-mode. As I mentioned, I can fold/unfold code using hs-minor-mode, but the ELPY menus throw an error. – Pablo A Perez-Fernandez Dec 8 '19 at 16:38
  • Allow me to expand on the issues. Once you have enabled hs-minor-mode, the ELPY menus do fold/unfold code. However, they fold and unfold code as well as throwing the error I mentioned. What does not make sense is that the symbol hs-life-goes-on is defined (contrary to the error at the top of the stack trace) as if defined as a macro. – Pablo A Perez-Fernandez Dec 8 '19 at 16:47
  • Folding appears to be in development and not yet released: github.com/jorgenschaefer/elpy/commit/…. – aparkerlue Jan 11 at 21:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.