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

Space bar is broken in eaf layer browser #15306

Closed
James-Hanson opened this issue Feb 2, 2022 · 3 comments · Fixed by #15436
Closed

Space bar is broken in eaf layer browser #15306

James-Hanson opened this issue Feb 2, 2022 · 3 comments · Fixed by #15436

Comments

@James-Hanson
Copy link

Description :octocat:

Pressing the space bar in eaf layer browser does nothing and throws an error. I've tested this on a totally fresh Ubuntu 20.04 installation. I installed Emacs with snap.

Reproduction guide 🪲

  • Start Emacs
  • Add eaf to layers in .spacemacs file
  • Restart Emacs to install
  • Run M-x eaf-install
  • Add all applications
  • Open browser with SPC a a b o
  • Open any website
  • Press space bar

Observed behaviour: 👀 💔
Pressing space bar does nothing and throws an error:

apply: Wrong type argument: stringp, (epc-error "EPC-ERROR: No such method : call_function")

Expected behaviour: ❤️ 😄
Pressing space bar opens the menu and does not throw an error.

System Info 💻

  • OS: gnu/linux
  • Emacs: 27.2
  • Spacemacs: 0.999.0
  • Spacemacs branch: develop (rev. 0ba8aa1)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: helm
  • Layers:
(emacs-lisp helm multiple-cursors treemacs eaf)
  • System configuration features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP
@lebensterben
Copy link
Contributor

Confirmed.
But I'm not able to do any debugging.
This package has never worked properly on my computer with 2 different OS.

@Vivien-lelouette
Copy link

Hello,

I am a Doom user, but I had the same issue.
Looking at the eaf source code, they are not calling the "call_function" but the "execute_function" instead.

The code given to doom users for the space bar to work is the following:

(define-key key-translation-map (kbd "SPC")
    (lambda (prompt)
      (if (derived-mode-p 'eaf-mode)
          (pcase eaf--buffer-app-name
            ("browser" (if  (string= (eaf-call-sync "call_function" eaf--buffer-id "is_focus") "True")
                           (kbd "SPC")
                         (kbd eaf-evil-leader-key)))
            ("pdf-viewer" (kbd eaf-evil-leader-key))
            ("image-viewer" (kbd eaf-evil-leader-key))
            (_  (kbd "SPC")))
        (kbd "SPC"))))

My fixed code is the following:

(define-key key-translation-map (kbd "SPC")
    (lambda (prompt)
      (if (derived-mode-p 'eaf-mode)
          (pcase eaf--buffer-app-name
            ("browser" (if (eaf-call-sync "execute_function" eaf--buffer-id "is_focus")
                           (kbd "SPC")
                         (kbd eaf-evil-leader-key)))
            ("pdf-viewer" (kbd eaf-evil-leader-key))
            ("image-viewer" (kbd eaf-evil-leader-key))
            (_  (kbd "SPC")))
        (kbd "SPC"))))

Note that the "stringp=" seems to be unecessary now.

Hope this can help you solve this issue for spacemacs !

Best Regards.

@TerryTsao
Copy link

Upstream wiki is outdated, while eaf APIs tend to be aggressively updated & live at HEAD. The workaround works perfectly. I'm willing to create PR (and fix upstream Wiki page) soon.

TerryTsao pushed a commit to TerryTsao/spacemacs that referenced this issue Mar 29, 2022
- Tested with my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
TerryTsao pushed a commit to TerryTsao/spacemacs that referenced this issue Mar 29, 2022
- Tested with my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
TerryTsao pushed a commit to TerryTsao/spacemacs that referenced this issue Mar 29, 2022
…anges.

- Replace outdated eaf API call with most recent ones
- Tested with eaf-browser on my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
smile13241324 pushed a commit that referenced this issue Apr 3, 2022
- Replace outdated eaf API call with most recent ones
- Tested with eaf-browser on my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
zv added a commit to zv/spacemacs that referenced this issue Apr 17, 2022
* checkversion/develop: (143 commits)
  fix typo (syl20bnr#15470)
  Remove disabled code and FIXME: resolved. (syl20bnr#15464)
  disable evil-surround in magit-status buffers (syl20bnr#15462)
  core-jump: fix incorrect lookup of :async (syl20bnr#15449)
  Replace alist helm sources with proper helm sources (syl20bnr#15364)
  Fix syl20bnr#15306. Reflect eaf layer keybinding logic to upstream changes.
  [lsp] Change default source of bindings back to spacemacs
  [core] Make startup not fail when home buffer is customised
  [spacemacs-editing] initialize `undo-tree-history-directory-alist`
  [neotree] Add zz, zt, zb bindings
  notmuch: Fix company based address completion (syl20bnr#15392)
  [bot] "documentation_updates" Mon Mar 28 11:29:34 UTC 2022 (syl20bnr#15433)
  [github] clarify Git configuration and authorisation documentation
  [org] Make org buffers work with helm-imenu-in-all-buffers
  [nixos] Fix variable name in README (syl20bnr#15413)
  [helm] fix typo in helm-ls-git (syl20bnr#15411)
  [completion] Fix readme markup. (syl20bnr#15410)
  [bot] "documentation_updates" Fri Mar 11 06:55:25 UTC 2022 (syl20bnr#15402)
  [git] document configuration of Magit Forge and Git identity (syl20bnr#15388)
  README: Added a Discord Channel
  ...
eraad pushed a commit to datil/spacemacs that referenced this issue Jun 10, 2022
…anges.

- Replace outdated eaf API call with most recent ones
- Tested with eaf-browser on my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
2ynn pushed a commit to 2ynn/spacemacs that referenced this issue Jun 22, 2022
…anges.

- Replace outdated eaf API call with most recent ones
- Tested with eaf-browser on my machine
- Both (kbd "SPC") and (kbd ",") works fine in eaf-browser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants