Would that be a more standard way of loading this package?
renbus opened this issue · 1 comments
Hello,
I recently discovered your package and it works well for me, it resolves this issue I had with large tables while usually viewing Org documents in Olivetti-mode (thus visual-line-mode), so thanks a lot!
I was also surprised to see how this is supposed to be used. My first reflex was to use something like this:
(use-package phscroll
:hook (org-mode . org-phscroll-mode))
But since it was throwing an autoload error, I read more carefully the Readme and ended up using:
(use-package phscroll
:init (with-eval-after-load "org"
(require 'org-phscroll))
My comment is that my first attempt seems to be a more "standard" way to use emacs packages, at least from my perspective. (To be clear, I am not advocating for the use of the use-package macro, but for the use of the org-mode hook).
(Translated Message)
Hello Renbus.
I think the former method will probably work if you add (autoload 'org-phscroll-mode "org-phscroll" nil t) before use-package.
How do you install phscroll? Are you using some kind of package manager like straight or package-vc?
If you are installing via a package manager, I think that if you add ";;;###autoload" to the definition of org-phscroll-mode, "(autoload 'org-phscroll-mode "org-phscroll" ...)" will be automatically generated.
Commit 582abed did that.
I'm using phscroll by adding it as a submodule in my Emacs configuration directory managed by Git. I'm not using a package manager for phscroll.
Considering that you are not using a package manager, autoload will not be generated, so it is safer to initialize with (with-eval-after-load "org" (require 'org-phscroll)).
(Original Message)
renbusさんこんにちは。
おそらくuse-packageの前に (autoload 'org-phscroll-mode "org-phscroll" nil t) を追加すれば、前者の方法でも動作すると思います。
あなたはphscrollをどのようにインストールしているでしょうか。straightやpackage-vcのような何らかのパッケージマネージャを使用していますか?
パッケージマネージャを介してインストールしているのであれば、org-phscroll-modeの定義場所に「;;;###autoload」を追加すれば、「(autoload 'org-phscroll-mode "org-phscroll" ...)」が自動的に生成されると思います。
それを行ったのがコミット 582abed です。
私はGitで管理されている私のEmacs設定ディレクトリの中にサブモジュールとしてphscrollを追加して使っています。phscrollに対してパッケージマネージャは使用していません。
パッケージマネージャを使用していない場合まで考慮するとautoloadは生成されないので、 (with-eval-after-load "org" (require 'org-phscroll)) で初期化する方が確実です。