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

no helm-org-ql #129

Closed
novoid opened this issue Jul 11, 2020 · 15 comments
Closed

no helm-org-ql #129

novoid opened this issue Jul 11, 2020 · 15 comments

Comments

@novoid
Copy link

novoid commented Jul 11, 2020

Hi,

I've got an issue where I don't get helm-org-ql despite of having installed all dependencies.

I could find a workaround by manually deinstalling org-ql and reinstalling org-ql via package-list as described in this comment. As long as I don't close Emacs, I can use helm-org-ql normally.

As far as I understand, this is maybe caused by a certain order when loading the packages. My current configuration is using use-package to set up the packages.

The current order is:

  1. helm-org
  2. helm-org-rifle
  3. org-ql

Do you have an idea what is causing this issue of not having helm-org-ql available after booting Emacs (without re-installing org-ql)?

@gvoysey
Copy link

gvoysey commented Jul 11, 2020

happening to me too. Here's my installation invocation:

(use-package org-ql
 :straight (org-ql :type git
               :host github
               :repo "alphapapa/org-ql")
     )

@novoid
Copy link
Author

novoid commented Jul 12, 2020

happening to me too

Oh. And is it still happening or could you find a fix or workaround?

Here is, what I've experienced switching to quelpa for org-ql only:

  1. exchanged use-package/MELPA to the use-package version using quelpa
  2. manually removed org-ql (installed via melpa)
  3. restart Emacs
  4. check if helm-org-ql is available

Result: no, it's still not available.

Here is my current config related to org-ql:

(use-package helm-org
  :ensure t
  :config
  (add-to-list 'helm-completing-read-handlers-alist '(org-capture . helm-org-completing-read-tags))
  (add-to-list 'helm-completing-read-handlers-alist '(org-set-tags . helm-org-completing-read-tags))
)

(use-package helm-org-rifle
  :ensure t
  :defer 110
  :after org
)

(use-package org-ql
 :straight (org-ql :type git
               :host github
               :repo "alphapapa/org-ql")
  :config
  (require 'org-ql-search) ;; workaround for https://github.com/alphapapa/org-ql/issues/53
 )

@alphapapa
Copy link
Owner

Hi Karl and Graham,

Sorry for the trouble. I will probably move helm-org-ql to a separate package in the future, which should help avoid this problem.

However, I don't understand exactly what's going on here. I guess the problem is specific to your configurations. If you use a clean config, e.g. with https://github.com/alphapapa/emacs-sandbox.sh, you should be able to follow these steps, and it should work:

  1. Install helm-org.
  2. Install org-ql.
  3. M-x helm-org-ql RET.

I just tested that, and it worked for me.

@novoid
Copy link
Author

novoid commented Jul 13, 2020

Hi @gvoysey,

Do you have an idea what might cause this issue? Maybe you have a similar setup compared to mine which might lead to this issue?

Otherwise, we have to close this issue while being unresolved for us.

FYI: I just updated to org-ql version 20200713.309 while helm-org still being at 20200311.633. After restarting Emacs, no change related to this issue.

@gvoysey
Copy link

gvoysey commented Jul 14, 2020

here's my MWE init, which doesn't expose helm-org-ql. If you want to see what i do in daily life: https://emacs.grym.io has the whole kit and caboodle.

(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el"))
      (bootstrap-version 3))
  (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 straight-use-package-by-default t)
(straight-use-package 'use-package)
(use-package git)

(setq custom-file (make-temp-file ""))

(defun fix-org-git-version ()
  "The Git version of org-mode.
  Inserted by installing org-mode or when a release is made."
  (require 'git)
  (let ((git-repo (expand-file-name
  		 "straight/repos/org/" user-emacs-directory)))
    (string-trim
     (git-run "describe"
  	    "--match=release\*"
  	    "--abbrev=6"
  	    "HEAD"))))

(defun fix-org-release ()
  "The release version of org-mode.
  Inserted by installing org-mode or when a release is made."
  (require 'git)
  (let ((git-repo (expand-file-name
  		 "straight/repos/org/" user-emacs-directory)))
    (string-trim
     (string-remove-prefix
      "release_"
      (git-run "describe"
  	     "--match=release\*"
  	     "--abbrev=0"
  	     "HEAD")))))

(use-package org
  :mode ("\\.org\\'" . org-mode)
  :bind (:map org-mode-map
  	    ("M-n" . outline-next-visible-heading)
  	    ("M-p" . outline-previous-visible-heading)
  	    ("M-RET" . org-insert-heading)
  	    ("C-c l" . org-store-link)
  	    ("C-c a" . org-agenda)
  	    )
  :config
  ;; This forces straight to load the package immediately in an attempt to avoid the
  ;; Org that ships with Emacs.
  (require 'org)
  (defalias #'org-git-version #'fix-org-git-version)
  (defalias #'org-release #'fix-org-release)

  ;; Enable org capture
  (require 'org-capture)

  ;; Enable template expansion
  (require 'org-tempo)
  ;; ignore flycheck files when looking in agenda
  (setq org-agenda-file-regexp "\\`[^\\(.\\|flycheck_\\)].*\\.org\\'")
  ;; log  TODO state changes into the default LOGBOOK drawer.
  (setq org-log-into-drawer t)
  (setq org-agenda-tags-column -79)
  )

(use-package helm
 :straight (helm :type git
  	     :host github
  	     :repo "emacs-helm/helm")
     )

(use-package helm-org
 :straight (helm-org :type git
  	     :host github
  	     :repo "emacs-helm/helm-org")
     )

(use-package org-ql
 :straight (org-ql :type git
  	     :host github
  	     :repo "alphapapa/org-ql")
 :config
     )

@alphapapa
Copy link
Owner

@novoid I suspect the fix to #75 may fix your problem that you report here. In that issue, you said:

I currently can not reproduce the issue since my org-ql isn't working at all (see #129).

I can't use my previous workaround with re-installing org-ql because there is no "uninstall" button for org-ql in my list-packages any more because(?) it is installed as a dependency for something.

I can't speak for your configuration. You can delete the directories the packages are installed in and restart Emacs, and they will no longer be installed.

@novoid
Copy link
Author

novoid commented Jul 20, 2020

Purging my packages and re-installing them from scratch, pulling the updates solved the issue on my side.

Thanks for your help!

@novoid novoid closed this as completed Jul 20, 2020
@alphapapa
Copy link
Owner

Thanks, glad to know this issue is finally fixed, hopefully for everyone who encountered it.

@novoid
Copy link
Author

novoid commented Jul 25, 2020

I'm sorry, I was not thorough enough while testing the fix. The issue still persists when org-ql was not deleted prior to Emacs start.

When I remove ~/.emacs.d/elpa/org-ql-20200713.309 before starting Emacs, helm-org-ql is available. When exiting Emacs and starting Emacs again, helm-org-ql is not available with the usual implications for depending packages such as org-super-links.

This behavior is shown when using use-package with elpa:

(use-package org-ql
  :ensure t
  :config
  (require 'org-ql-search) ;; workaround for https://github.com/alphapapa/org-ql/issues/53
)

I also tested quelpa with:

(use-package org-ql
 :straight (org-ql :type git
               :host github
               :repo "alphapapa/org-ql")
  :ensure t
  :config
  (require 'org-ql-search) ;; workaround for https://github.com/alphapapa/org-ql/issues/53
 )

Somehow, this quelpa snippet does not result in an org-ql-* directory within my quelpa/build/ as I guess it should. helm-org-ql is also not available.

I'm rather new to quelpa and I do not understand most of how it works internally. Therefore, this could be my fault, not being able to set up org-ql with quelpa properly.

Note to myself: issue is only properly tested and resolved when helm-org-ql is available in consecutive Emacs starts.

Workaround notes

As a short-term workaround, I added the following lines to my setup. They look for an existing directory of org-ql and deletes it. The plan is that the use-package that follows afterwards re-installs org-ql, resulting in a working org-ql setup during my Emacs sessions.

(let ((my-org-ql-matches (file-expand-wildcards (concat my-user-emacs-directory "elpa/org-ql-*") t)))
    (when my-org-ql-matches
        (let ((my-org-ql-dir (car my-org-ql-matches)))
            (message (concat "deleting " my-org-ql-dir " ..."))
            (delete-directory my-org-ql-dir t)
            (message (concat "deleted " my-org-ql-dir " and re-installing it later-on"))
)))

The interesting thing is that this does only works when the org-ql directory is not existing prior to the Emacs start:

  1. start Emacs with existing ~/.emacs.d/elpa/org-ql-20200713.309 directory
    • directory gets deleted
    • org-ql gets not installed
  2. start Emacs with non-existing ~/.emacs.d/elpa/org-ql-20200713.309 directory
    • no directory gets deleted since the when clause does not "fire"
    • org-ql gets installed properly, helm-org-ql is available

This behavior does not change when I move the delete-helm-org functionality prior the initialization of use-package.

In my head, this does not make any sense at all.

The rm -r ~/.emacs.d/elpa/org-ql-* ; emacs-snapshot & command works as expected and results in helm-org-ql being available after each Emacs start.

@novoid novoid reopened this Jul 25, 2020
@alphapapa
Copy link
Owner

@novoid You are using straight.el in one of those configuration snippets. Straight is not Quelpa.

@novoid
Copy link
Author

novoid commented Jul 26, 2020

@novoid You are using straight.el in one of those configuration snippets. Straight is not Quelpa.

Absolutely correct - thanks for the hint.

I corrected the snippet to ...

(use-package org-ql
  :quelpa ((org-ql :fetcher github :repo "alphapapa/org-ql") :upgrade t)
  :config
  (require 'org-ql-search) ;; workaround for https://github.com/alphapapa/org-ql/issues/53
 )

... which installs org-ql in the corresponding build directory.

However, it has the same effect: helm-org-ql only is present right after installation. When restarting Emacs without a forced removal process in-between, helm-org-ql is not available just as with use-package without quelpa.

Therefore, the setup method (plain use-package/packages.el vs. use-package/quelpa) does not have an influence on my issue.

@akirak
Copy link
Contributor

akirak commented Jul 26, 2020

@novoid

If you are using straight.el, this might work:

(use-package helm-org-ql
   :straight org-ql
   ;; Your config
   ...
   )

I'm also a straight user (for now) and using helm-org-ql. My config first loads helm, org-ql, and helm-org-ql in this order. If it doesn't work, sorry I can't help you.

Even though alphapapa is generally kind and helpful, he is responsible for a number of packages and doesn't have time to help every user with his configuration, so please don't expect too much on supporting.

@novoid
Copy link
Author

novoid commented Jul 26, 2020

@akirak

If you are using straight.el

No, I'm not. This was by accident because of a lousy internet search result process how to use quelpa with use-package. Back then, I had no clue what I was doing. Meanwhile, the varieties of possibilities of installing extensions to Emacs is confusing to me.

I started with quelpa as a test-balloon to use it as an alternative to the process of git cloning and manually setting up the load path for single packages that are not available in melpa. From the things I read today related to :ensure t I got the impression that quelpa is not meant to be an additional method besides use-package/package.el. Instead, it seems to be the case that the author(s) wrote it as a replacement. Which is a bummer in my use-case. Maybe I'll switch back to manually downloading and setting up GitHub packages. At least that's a workflow I fully understand and that works, when you ignore dependencies and frequent updates.

Even though alphapapa is generally kind and helpful, he is responsible for a number of packages and doesn't have time to help every user with his configuration, so please don't expect too much on supporting.

Thanks for mentioning. I already learned that. I'm very grateful for any help from him and usually, this turned out to be solved quickly. However, this issue seems to be related to my specific setup. As long as he can't reproduce it, he probably won't be in a position to analyze it for a fix.

I still do think that this issue here has value for rare cases where others might face the same issue. This fulfills the purpose of a crystallization point of reports of those people and maybe some of them has better Elisp-skills than I do and find some fix.

Until then, I stick to the rm -r ~/.emacs.d/elpa/org-ql-* ; emacs-snapshot & workaround.

@alphapapa
Copy link
Owner

@novoid I'm sorry this still isn't fixed for you. When I move helm-org-ql to a separate package, it should be fixed.

In the meantime, this works for me:

  1. Install helm-org.
  2. Install helm-org-ql.
  3. In the init file:
(require 'org-ql)
(require 'helm-org-ql)
  1. Restart Emacs.
  2. M-x helm-org-ql RET works.

@novoid
Copy link
Author

novoid commented Aug 2, 2020

Hi @alphapapa,

Yes, I can confirm that these two require lines do fix the issue on two different Emacs versions so that helm-org-ql is availabe after each Emacs boot process and not just every second or similar.

@novoid novoid closed this as completed Aug 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants