org-roam / org-roam-ui

A graphical frontend for exploring your org-roam Zettelkasten
GNU General Public License v3.0
1.99k stars 109 forks source link

[BUG] Emacs 28.1 native compilation - Using straight.el for installing org-mode-ui breaks org mode functionalities #268

Open mukundzare opened 2 years ago

mukundzare commented 2 years ago

Describe the bug On Emacs 28.1 with native compilation, while installing org-roam-ui via straight-use-package, the org as well as the org-roam packages get cloned from their git repos even though I explicitly try to install them via melpa. This causes some issue with random functions from org mode becoming unavailable and therefore void. Only when I use (use-package org-roam-ui :ensure t) does it work normally.

To Reproduce

  1. Try this with a native compiled Emacs 28.1 installation with the following minimal config:
    
    (require 'package)
    (setq package-archives '(("melpa" . "https://melpa.org/packages/")
                         ("elpa" . "https://elpa.gnu.org/packages/")
                         ("melpa-stable" . "https://stable.melpa.org/packages/")))
    (package-refresh-contents)
    (unless (package-installed-p 'use-package)
    (package-install 'use-package))

(require 'use-package)

(setq use-package-always-ensure t) ;;Straight.el (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (setq package-enable-at-startup nil)

(use-package org :ensure t)

(use-package org-roam-ui :straight (:host github :repo "org-roam/org-roam-ui" :branch "main" :files ("*.el" "out")) :after org-roam ;; normally we'd recommend hooking orui after org-roam, but since org-roam does not have ;; a hookable mode anymore, you're advised to pick something yourself ;; if you don't care about startup time, use ;; :hook (after-init . org-roam-ui-mode) :config (setq org-roam-ui-sync-theme t org-roam-ui-follow t org-roam-ui-update-on-save t org-roam-ui-open-on-start t))


2. Now try to open org some org file, you might encounter some error. For example, I encountered:
_File mode specification error: (void-function org-element-at-point)_

OR You could try launching `org-agenda` and selecting an agenda keybinding like displaying TODO items. That might throw errors. 
OR You could run `org-cycle` command and see if cycling through headers throws some void function errors.