Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

elpy-folding--hide-leafs: Invalid function: hs-life-goes-on #1824

Closed
SergiyKolesnikov opened this issue Jul 23, 2020 · 11 comments
Closed

elpy-folding--hide-leafs: Invalid function: hs-life-goes-on #1824

SergiyKolesnikov opened this issue Jul 23, 2020 · 11 comments

Comments

@SergiyKolesnikov
Copy link

Summary

Invoking elpy-folding--hide-leafs results in an error message:

elpy-folding--hide-leafs: Invalid function: hs-life-goes-on

Steps to reproduce

Open a Python buffer and press C-c @ C-f

My configuration

OS

Debain testing (bullseye)

Result of (elpy-config)

Elpy Configuration

Emacs.............: 26.3
Elpy..............: 1.34.0
Virtualenv........: my_venv (/home/<edited>)
Interactive Python: ipython 7.16.1 (/home/<edited>)
RPC virtualenv....: rpc-venv (/home/<edited>/.emacs.d/elpy/rpc-venv)
 Python...........: python3 3.8.4 (/home/<edited>/.emacs.d/elpy/rpc-venv/bin/python3)
 Jedi.............: 0.17.2
 Rope.............: 0.17.0
 Autopep8.........: 1.5.3
 Yapf.............: 0.30.0
 Black............: 19.10b0
Syntax checker....: flake8 (/home/<edited>/.emacs.d/elpy/rpc-venv/bin/flake8)

Warnings

Options

Elpy configuration in my init.el

(elpy-enable)
(setq elpy-rpc-python-command "python3")
(setq elpy-test-runner 'elpy-test-pytest-runner)
(define-key elpy-refactor-map (kbd "f") 'elpy-black-fix-code)
(setq elpy-indent-offset 4)
(add-hook 'elpy-mode-hook
          (lambda ()
            (setq python-indent-offset elpy-indent-offset)
	    (setq highlight-indentation-offset elpy-indent-offset)))
(setq company-idle-delay 0) ;; no delay before idle complete
(global-set-key [C-tab] 'company-complete-common)
@xorb0ss
Copy link

xorb0ss commented Jul 30, 2020

Can confirm this is also happening to me. Note also that Invalid function: hs-life-goes-on also appears any time I click anywhere - I assume because it thinks I’m trying to fold something.

@galaunay
Copy link
Collaborator

galaunay commented Aug 5, 2020

Maybe a missing require somewhere.

Is it better after executing (require 'hideshow) ?

@spluque
Copy link

spluque commented Aug 11, 2020

@galaunay requiring hideshow before or after elpy is loaded makes no difference in my case, using the latest elpy from elpa (20200805.1736). As far as I can tell, this issue seems to have been introduced in this latest version.

@nscavalier
Copy link

nscavalier commented Aug 18, 2020

I have the same error message when I use my mouse click on the text.

elpy-folding--click-text: Invalid function: hs-life-goes-on

@nscavalier
Copy link

I disabled the elpy code folding module, and the error message is gone.

@galaunay
Copy link
Collaborator

hs-life-goes-on is part of Emacs since 19.0 so it should be around.
I tried with a clean Emacs -Q and just Elpy with the folding module activated, and it is not complaining so far.
Do you something related to hideshow.el in your configuration ?

@akovardakov
Copy link

Get same error for all folding functions.
Also folding of code blocks like "for" or "if" does not work don't know if this is related or not.

@Yevgnen
Copy link

Yevgnen commented Dec 3, 2021

@galaunay hs-life-goes-on is a macro instead of a function on my Emacs. Does it matter?

mhlr added a commit to mhlr/elpy that referenced this issue Dec 16, 2021
@mhlr
Copy link
Contributor

mhlr commented Dec 16, 2021

The fix is to add (require 'hideshow) to elpy.py. The issue is that hs-life-goes-on is a macro, so it's definition needs to be available when the code using it is being loaded/bytecompiled.

I have submitted a fix in #1952

@mhlr
Copy link
Contributor

mhlr commented Feb 3, 2022

What do I need to do to get #1952 reviewed & merged?

@gopar gopar closed this as completed in 9b458c8 Feb 3, 2022
@gopar
Copy link
Collaborator

gopar commented Feb 3, 2022

What do I need to do to get #1952 reviewed & merged?

Ask and ye shall receive lol

It's done. Please re-open if issue persists.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants