Giter Club home page Giter Club logo

Comments (2)

tjtrabue avatar tjtrabue commented on August 23, 2024 1

Ok, this really baked my noodle, but I finally figured out what the real problem was. My second comment was incorrect. The problem has nothing to do with straight.el's native-compilation feature. In fact, the issue has nothing to do with helpful at all! It was one of helpful's dependencies: elisp-refs. For some reason, straight.el cannot generate the autoloads file for elisp-refs. I'm not sure why, but it's definitely the autoloads step of straight's build process that fails with the Wrong type error: listp, 1 exception.

The solution was to add a specific build recipe for elisp-refs to my ~/.emacs file that skips the autoloads phase:

;; We have to specify how to install and load elisp-refs.el
(use-package elisp-refs
  :demand t
  :straight
  (elisp-refs :type git :host github :repo "Wilfred/elisp-refs"
                   ;; Skip the autoloads phase because straight.el can't seem to get it right.
                   :build (:not autoloads)))

(use-package helpful
    ;; THIS IS NEW: We must wait until elisp-refs has loaded, otherwise helpful will try its own
    ;; recipe for installing elisp-refs, which will break.
    :after elisp-refs
    :ensure t
    :defer t
    ;; No need for a :straight directive at all anymore.
    :general
    (general-def
      ;; Replace standard help functions with helpful functions.
      "C-h f" 'helpful-callable
      "C-h v" 'helpful-variable
      "C-h k" 'helpful-key
      ;; Other useful keybindings.
      "C-h C" 'helpful-command
      "C-h F" 'helpful-function)
    (my/user-leader-def
      "C-d" 'helpful-at-point)
    (general-def 'normal emacs-lisp-mode-map
      "K" 'helpful-at-point))

from helpful.

tjtrabue avatar tjtrabue commented on August 23, 2024

So, I'm afraid I must tuck my tail. I discovered that the problem was indeed with straight.el, after all, and I apologize for not digging into their documentation before I opened this issue. Apparently in the last 6 months or so, straight.el enabled an experimental native-compilation feature if one is using Emacs built with native-compilation support, which I am. Thus, straight.el will automatically attempt to compile all packages it installs by default, and for some reason helpful.el throws that wrong type argument error when compiled. Anyways, the fix was to add the following configuration to my use-package directive:

  (use-package helpful
    :ensure t
    :defer t
    ;; THIS IS THE NEW PART
    :straight
    (helpful :type git :host github :repo "Wilfred/helpful"
             ;; Disable native-compilation when installing helpful to avoid compile-time error.
             :build (:not native-compile))
    :general
    (general-def
      ;; Replace standard help functions with helpful functions.
      "C-h f" 'helpful-callable
      "C-h v" 'helpful-variable
      "C-h k" 'helpful-key
      ;; Other useful keybindings.
      "C-h C" 'helpful-command
      "C-h F" 'helpful-function)
    (my/user-leader-def
      "C-d" 'helpful-at-point)
    (general-def 'normal emacs-lisp-mode-map
      "K" 'helpful-at-point))

EDIT: This did not solve my problem. Please see the next comment for a true fix.

from helpful.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.