syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.58k stars 4.9k forks source link

Strange behaviour for the help on key bindings #15548

Closed DrWaleedAYousef closed 7 months ago

DrWaleedAYousef commented 2 years ago

Description :octocat:

The C-h k command does not work with any key binding and gives the message: mapcar: Symbol’s value as variable is void: code-cells-mode

Clue Is this relatd to the strange behavior of the key bindings mentioned in issue #15479 ?

EDIT The problem exists even when I commented everything inside (defun dotspacemacs/user-config () and my layer definition is:

   dotspacemacs-configuration-layers
   '(pandoc
     csv
     dap
     c-c++
     php
     systemd
     (latex :variables
            latex-build-command "LatexMk" ;;default
            ;; latex-build-command "LaTeX" ;;default
            latex-enable-auto-fill t ;;default
            latex-backend 'lsp
            latex-build-engine 'luatex
            latex-view-pdf-in-split-window t
            latex-enable-magic t
            latex-refresh-preview t
            latex-enable-folding t
            )
     (bibtex :variables
             bibtex-enable-ebib-support t
             ebib-preload-bib-files'("~/MyDocuments/Phd/texmf/bibtex/bib/base/publications.bib" "~/MyDocuments/Phd/texmf/bibtex/bib/base/booksIhave.bib")
             ebib-file-search-dirs '("~/MyDocuments/Phd/PDF/")
             ebib-import-directory '("~/Downloads/")
             )
     lua
     (html :variable
           css-enable-lsp t
           less-enable-lsp t
           scss-enable-lsp t
           html-enable-lsp t
           web-fmt-tool 'web-beautify
           html-enable-leex-support t
           )
     web-beautify
     prettier
     gnus
     (git :variables
          ;; git-enable-magit-delta-plugin t
          git-enable-magit-gitflow-plugin t
          git-enable-magit-svn-plugin t
          )
     (yaml :variables
           yaml-enable-lsp t
           )
     (python :variables
             python-format-on-save t
             python-formatter 'yapf ;; default is lsp
             python-fill-column 99
             python-backend 'lsp
             python-lsp-server 'pyright
             )
     (auto-completion :variables
                      auto-completion-enable-help-tooltip t
                      )
     better-defaults
     emacs-lisp
     (helm :variables
           helm-enable-auto-resize t
           helm-no-header t)
     (lsp :variables
          lsp-lens-enable t)
     (markdown :variables
               markdown-live-preview-engine 'vmd
               )
     (chrome :variables
             )
     multiple-cursors
     (org :variables
          org-enable-org-contacts-support t
          org-contacts-files '("~/.emacs.d.loadpath/Contacts-Imported.org")
          org-capture-templates '(("c" "Contacts" entry (file "~/Contacts-Imported.org")
                                   "* %(org-contacts-template-name))
:PROPERTIES:
:EMAIL: %(org-contacts-template-email)
:END:"                                   ))
          )
     (pdf :variables
          pdf-view-display-size (quote fit-page))
     (shell :variables
            shell-default-shell 'eshell
            shell-default-height 30
            shell-default-position 'bottom
            ;; shell-enable-smart-eshell t
            )
     (spell-checking :variables
                     spell-checking-enable-auto-dictionary t)
     syntax-checking
     ;; version-control
     (treemacs :variables
               treemacs-use-follow-mode t
               treemacs-use-filewatch-mode t)
     )

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: <>

Expected behaviour: :heart: :smile: <>

System Info :computer:

Backtrace :paw_prints:

<<BACKTRACE IF RELEVANT>>
BenedictHW commented 2 years ago

Dr,

I have a feeling this may be due to your config. I am unable to reproduce the bug from my Spacemacs. Usually when "Symbol's value as variable is void" that means said symbol is undefined. Sometimes wrapping the relevant code in a "with-eval-after-load" macro solves the issue if the symbol is only undefined at a certain point in time.

I would check that whatever package code-cells-mode has been successfully loaded. Do other symbols in the same package show up when you "C-h f" function names or "C-h v" variable names? Instead of the "C-h k" command try removing helm-descbinds with the following in your dotspacemacs/layers,

(helm :packages (not helm-descbinds))

And then "C-h b". will give you the loaded keymaps for a particular buffer and its respective modes. Has code-cells-mode's keymaps listed? Does "C-h m" show code-cells-mode under it's minor modes?

As an aside, I use https://github.com/nnicandro/emacs-jupyter which has been able to connect to both the wolfram kernel and sagemath.

HTH,

jgrosso commented 2 years ago

I am also having this issue, except for me it's that string-edit-mode is void.

thanhvg commented 2 years ago

Did you update the packages yet?

jgrosso commented 2 years ago

Yup, as recently as this morning (as well as pulling the latest .emacs.d). If it's helpful , the error used to be about code-cells-mode for me too, but then it changed to string-edit-mode after I updated packages/Spacemacs a few days ago.

jgrosso commented 2 years ago

(I just reset to an old develop commit, but the issue is still there, so I suspect the issue might be in the packages or my own config.)

DrWaleedAYousef commented 2 years ago

I still will reply @BenedictHW; meanwhile, I update almost daily. This problem seems to reflect on gnus behaviour as I indicated (not very sure)

thanhvg commented 2 years ago

code-cells-mode is from python layer' s code-cells package. Do you have any customization in your dotspacemacs/user-config?

DrWaleedAYousef commented 2 years ago

I updated the issue above to reflect my current configurations. I commented everything inside the user configuration function. The problem is still there.

DrWaleedAYousef commented 2 years ago

Oh; one more thing. Just now, after I updated the issue above, I tried to comment out the python layer:

     ;; (python :variables
     ;;         python-format-on-save t
     ;;         python-formatter 'yapf ;; default is lsp
     ;;         python-fill-column 99
     ;;         python-backend 'lsp
     ;;         python-lsp-server 'pyright
     ;;         )

The problem is gone! However, gnus' problems are the same!

tko commented 2 years ago

I had similar problem with code-cells. After tinkering with some things I came up with patch I forgot to send that seems to have fixed the issue.

diff --git a/layers/+lang/python/packages.el b/layers/+lang/python/packages.el
index d84314e3e..3e5eb7cd2 100644
--- a/layers/+lang/python/packages.el
+++ b/layers/+lang/python/packages.el
@@ -99,10 +99,11 @@
 (defun python/init-code-cells ()
   (use-package code-cells
     :if (not (configuration-layer/layer-used-p 'ipython-notebook))
+    :commands code-cells-mode
+    :hook (python-mode . code-cells-mode)
     :defer t
-    :init
+    :config
     (progn
-      (add-hook 'python-mode-hook 'code-cells-mode)
       (spacemacs/set-leader-keys-for-minor-mode 'code-cells-mode
         "gB" 'code-cells-backward-cell
         "gF" 'code-cells-forward-cell

IIRC the main issue was with :init vs. :config and the other bits are needed to declare the dependencies properly for :config . maybe there's similar issue with string-edit-mode

taquangtrung commented 2 years ago

I had similar problem with code-cells. After tinkering with some things I came up with patch I forgot to send that seems to have fixed the issue.

diff --git a/layers/+lang/python/packages.el b/layers/+lang/python/packages.el
index d84314e3e..3e5eb7cd2 100644
--- a/layers/+lang/python/packages.el
+++ b/layers/+lang/python/packages.el
@@ -99,10 +99,11 @@
 (defun python/init-code-cells ()
   (use-package code-cells
     :if (not (configuration-layer/layer-used-p 'ipython-notebook))
+    :commands code-cells-mode
+    :hook (python-mode . code-cells-mode)
     :defer t
-    :init
+    :config
     (progn
-      (add-hook 'python-mode-hook 'code-cells-mode)
       (spacemacs/set-leader-keys-for-minor-mode 'code-cells-mode
         "gB" 'code-cells-backward-cell
         "gF" 'code-cells-forward-cell

I encountered the same error mapcar: Symbol’s value as variable is void: code-cells-mode.

Applying the above patch can resolve it. Thanks a lot, @tko!

xuan-w commented 2 years ago

I also have this problem. Since I don't use code-cells, I removed it and everything is fine.

ir210 commented 1 year ago

I am also having this issue, except for me it's that string-edit-mode is void.

@jgrosso I believe you are using Emacs 29. In that case, if you don't need string-edit (SPC x e), you can simply put string-edit into the dotspacemacs-excluded-packages list.

The reason for that is that Emacs added a new built-in package called string-edit in 29 and this is an entirely different package than what Spacemacs uses for "SPC x e". There is a package naming collision here.

See: https://github.com/magnars/string-edit.el/issues/19

lebensterben commented 1 year ago

@ir210

Thanks for the information. I will make a workaround to turn of string-edit on Emacs 29

github-actions[bot] commented 10 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!