Giter Site home page Giter Site logo

Comments (10)

hwiorn avatar hwiorn commented on May 25, 2024

@Kungsgeten
Current polymode implementation of org-brain doesn't be executed on both Emacs 28.2 and Emacs 30.x with nativecomp.

I found a workaround.
org-brain needs to be changed with-eval-after-load blocks for helm, ivy and polymode like this.

(with-eval-after-load 'polymode ;; instead of "polymode"

After changes, org-brain-polymode works without any conflicts with ein and org-brain itself.
I think using with-eval-after-load itself in a package doesn't be a recommended way, though.
This issue seems to be related to #350, #352.

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

@Kungsgeten
Sorry. I noticed #385 doesn't fix this issue. My test was wrong.

I found out the root cause of Symbol’s value as variable is void: org-brain-poly-hostmode error is related with bytecompile and with-eval-after-load clause. That's why the fix of #352 needs doing without bytecompile.

Check this link: https://lists.gnu.org/archive/html/emacs-devel/2018-03/msg00559.html

In #386, I removed with-eval-after-load and splitted org-brain.el into three parts: ivy, helm and polymode. So user can use that packages according to their needs in their init.el.

  (use-package org-brain :ensure t   
    :init
    (setq org-brain-path "directory/path/where-i-want-org-brain")
    ;; For Evil users
    (with-eval-after-load 'evil
      (evil-set-initial-state 'org-brain-visualize-mode 'emacs))
    :config  
    (bind-key "C-c b" 'org-brain-prefix-map org-mode-map)
    ;; ... omitted ...
    )

  ;; This call `polymode` inside the package. so it doesn't need
  ;; to call `(use-package polymode)` explicitly.
  ;; If you want to load `polymode` explicitly, you can add
  ;; `:after polymode` inside the below clause and `(use-package polymode)`.
  (use-package org-brain-polymode
    :straight nil
    :hook (org-brain-visualize-mode . org-brain-polymode))

  ;; If there is no helm, below code doesn't be evaluated.
  (use-package org-brain-helm
    :straight nil
    :after helm)

  ;; If there is no ivy, below code doesn't be evaluated.
  (use-package org-brain-ivy
    :straight nil
    :after ivy)

from org-brain.

LazerJesus avatar LazerJesus commented on May 25, 2024

is this issue expected to be resolved?
i am running into it and tried all shades of fixes i found in the issues here.
various combinations of this:

(use-package polymode :defer t)

(use-package org-brain
  :ensure t
  :init
  (setq org-brain-path "~/valence/courses/elisp/brain")
  (with-eval-after-load 'evil
    (evil-set-initial-state 'org-brain-visualize-mode 'emacs))
  :config
  ;; (bind-key ", B" 'org-brain-prefix-map org-mode-map)
  (setq org-id-track-globally t)
  (setq org-id-locations-file "~/.emacs.d/.org-id-locations")
  (add-hook 'before-save-hook #'org-brain-ensure-ids-in-buffer)
  (add-hook 'org-brain-visualize-mode-hook #'org-brain-polymode)
  (with-eval-after-load 'polymode)
  (setq org-brain-visualize-default-choices 'all)
  (setq org-brain-title-max-length 12)
  (setq org-brain-include-file-entries nil)
  (setq org-brain-file-enties-use-title nil)
  (setq org-brain-headline-entry-name-format-string "%2$s")
  (setq my/default-org-brain-file "brain")
  (setq org-brain-default-file-parent my/default-org-brain-file))

(use-package org-brain-polymode
    :hook (org-brain-visualize-mode . org-brain-polymode))

(use-package polymode)
(use-package org-brain-polymode
    :hook (org-brain-visualize-mode . org-brain-polymode))

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

@FinnFrotscher

is this issue expected to be resolved?

Yes. Actually this issue need to be reopened. Because #385 which I made was a wrong PR. You need the PR #386

i am running into it and tried all shades of fixes i found in the issues here. various combinations of this:

What do you get error? What is your emacs kit and emacs version?

Did you apply the PR #386? You can use this snippet with #386

from org-brain.

LazerJesus avatar LazerJesus commented on May 25, 2024

My emacs version is "30.0.50" and its built from source, no doom or spacemacs.
the error I get is:

Debugger entered--Lisp error: (void-variable org-brain-poly-hostmode)
  #f(compiled-function () #<bytecode -0x18e197d61d110495>)()
  eval-after-load-helper("/Users/finn/.emacs.d/straight/build/polymode/polym...")
  run-hook-with-args(eval-after-load-helper "/Users/finn/.emacs.d/straight/build/polymode/polym...")
  do-after-load-evaluation("/Users/finn/.emacs.d/straight/build/polymode/polym...")

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

My emacs version is "30.0.50" and its built from source, no doom or spacemacs. the error I get is:

Debugger entered--Lisp error: (void-variable org-brain-poly-hostmode)
  #f(compiled-function () #<bytecode -0x18e197d61d110495>)()
  eval-after-load-helper("/Users/finn/.emacs.d/straight/build/polymode/polym...")
  run-hook-with-args(eval-after-load-helper "/Users/finn/.emacs.d/straight/build/polymode/polym...")
  do-after-load-evaluation("/Users/finn/.emacs.d/straight/build/polymode/polym...")

Did you apply the PR #386?
I don't use vanilla Emacs with straight.el.
The bytecompile error, it looks like it hasn't been patched.

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

@FinnFrotscher
I updated the snippet.

I don't prefer vanilla configuration for now.
So I tried to dig straight.el config and the issue you posted for a while.

My emacs version is also 30.0.50. I tested it with straight.el only and I confirmed it works.
I think you need to install polymode package using straight if you don't use polymode elsewhere in your config.
Check below setting.

~/.emacs

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Bootstraping
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defvar bootstrap-version)
(setq straight-repository-branch "develop")
(let ((bootstrap-file
       (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
      (bootstrap-version 6))
  (unless (file-exists-p bootstrap-file)
    (with-current-buffer
        (url-retrieve-synchronously
         "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el"
         'silent 'inhibit-cookies)
      (goto-char (point-max))
      (eval-print-last-sexp)))
  (load bootstrap-file nil 'nomessage))

(straight-use-package 'use-package)
(setq straight-use-package-by-default t)
(setq straight-vc-git-default-clone-depth 1)

(straight-use-package 'polymode)
(straight-use-package
 '(org-brain :type git
             :host github
             :repo "hwiorn/org-brain"
             :branch "split-to-each-packages"))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Org-brain
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(use-package org-brain
  :ensure t
  :init
  (setq org-brain-path "~/org/brain")
  ;; For Evil users
  (with-eval-after-load 'evil
    (evil-set-initial-state 'org-brain-visualize-mode 'emacs))
  :config  
  (bind-key "C-c b" 'org-brain-prefix-map org-mode-map)
  ;; ... omitted ...
  )

;; This call `polymode` inside the package. so it doesn't need
;; to call `(use-package polymode)` explicitly.
;; If you want to load `polymode` explicitly, you can add
;; `:after polymode` inside the below clause and `(use-package polymode)`.
(use-package org-brain-polymode
  :straight nil
  :hook (org-brain-visualize-mode . org-brain-polymode))

;; If there is no helm, below code doesn't be evaluated.
(use-package org-brain-helm
  :straight nil
  :after helm)

;; If there is no ivy, below code doesn't be evaluated.
(use-package org-brain-ivy
  :straight nil
  :after ivy)

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

@FinnFrotscher
Did the config I pasted help you?

from org-brain.

LazerJesus avatar LazerJesus commented on May 25, 2024

@hwiorn well sort of. I implemented it just now and it works. but only when i run brain-visualize for the second time. the first time i get run-hooks: Cannot open load file: No such file or directory, org-brain-polymode.

from org-brain.

hwiorn avatar hwiorn commented on May 25, 2024

Hm, I tried to reinstall from scratch few times, But I can't reproduce the case on straight.el config. It seems to be personal config issue. Or it might be issue by straight.el.

from org-brain.

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.