mickeynp / combobulate

Structured Editing and Navigation in Emacs with Tree-Sitter
GNU General Public License v3.0
921 stars 53 forks source link

Can't get combobulate to work with load-path #119

Open rdeusser opened 1 week ago

rdeusser commented 1 week ago

I've got this in my Emacs config:

(use-package combobulate
  :custom
  ;; You can customize Combobulate's key prefix here.
  ;; Note that you may have to restart Emacs for this to take effect!
  (combobulate-key-prefix "C-c o")
  :hook ((prog-mode . combobulate-mode))
  ;; Amend this to the directory where you keep Combobulate's source
  ;; code.
  :load-path (lambda () (expand-file-name "combobulate.el" (straight--repos-dir "combobulate"))))

After restarting Emacs when I press C-c o it says it's undefined. If I run combobulate-mode through M-x nothing happens. Even with toggle-debug-on-error turned on nothing happens. There's nothing in *Messages* either. The only way I can get it to work is by doing this:

(use-package combobulate
  :straight (combobulate :type git :host github :repo "mickeynp/combobulate")
  :custom
  ;; You can customize Combobulate's key prefix here.
  ;; Note that you may have to restart Emacs for this to take effect!
  (combobulate-key-prefix "C-c o")
  :hook ((prog-mode . combobulate-mode))
  :config
  (load (expand-file-name "combobulate.el" (straight--repos-dir "combobulate"))))

but then I get a recursive load error in *Message*.

Anybody know why this is?

matasar commented 1 week ago

I also have this problem. My experience here is that combobulate stopped working as of the more recent versions, and I can't work out how to make it work again.

mickeynp commented 1 week ago

Clearly this third-party package manager does something different to the builtin use-package method of loading combobulate. Please use the provided example instead until I have time to look at a fix.

gvoysey commented 1 day ago

This is not amazingly helpful, but the last working version i have pinned with straight is ee82c568ad639605518f62f82fae4bcc0dfdbb81, which is a lot to bisect. (edit: it's now 573b74e7359a254984036355678e54d236e11c4b, see below)

I can concur that i'm seeing this behavior too; C-c o o just doesn't exist as far as my emacs is concerned with:

gvoysey commented 1 day ago

i bisected it, though!

c66d23d6d3608f662b168b28b0539c9a74c34659 is the first bad commit; 573b74e7359a254984036355678e54d236e11c4b works.


status: waiting for both good and bad commits
~/.emacs.d/straight/repos/combobulate master|bisect ❯                                                                                                                                                                14:06:42
~/.emacs.d/straight/repos/combobulate master|bisect ❯ git checkout ee82c568ad639605518f62f82fae4bcc0dfdbb81                                                                                                          14:06:47
Note: switching to 'ee82c568ad639605518f62f82fae4bcc0dfdbb81'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at ee82c56 Merge pull request #85 from DamienCassou/readme-fixes
~/.emacs.d/straight/repos/combobulate @ee82c568|bisect ❯ git bisect good                                                                                                                                             14:07:09
status: waiting for bad commit, 1 good commit known
~/.emacs.d/straight/repos/combobulate @ee82c568|bisect ❯ git checkout master                                                                                                                                         14:07:12
Previous HEAD position was ee82c56 Merge pull request #85 from DamienCassou/readme-fixes
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
~/.emacs.d/straight/repos/combobulate master|bisect ❯ git bisect bad                                                                                                                                                 14:07:18
Bisecting: 43 revisions left to test after this (roughly 6 steps)
[1f3025e24b783334874e45406a7503b99e1d8c36] Try to ensure the right node order is used for enveloping
~/.emacs.d/straight/repos/combobulate @1f3025e2|bisect ❯ git bisect bad                         14:07:21
Bisecting: 21 revisions left to test after this (roughly 5 steps)
[1dde92d82e1de7657a172fefedfbbe506fee6b4a] Fix test deltas
~/.emacs.d/straight/repos/combobulate @1dde92d8|bisect ❯ git bisect bad                         14:08:48
Bisecting: 10 revisions left to test after this (roughly 3 steps)
[67e4634ba24d735859757057e25ca3e09edff18b] Actually use `rx' in combobulate-procedure-expand-rules
~/.emacs.d/straight/repos/combobulate @67e4634b|bisect ❯ git bisect good                        14:10:29
Bisecting: 5 revisions left to test after this (roughly 3 steps)
[889a464d05ae9dffbaa3a5b2654a426c76459ea6] Basic definition and procedure application now works
~/.emacs.d/straight/repos/combobulate @889a464d|bisect ❯ git bisect bad                         14:10:59
Bisecting: 2 revisions left to test after this (roughly 1 step)
[c66d23d6d3608f662b168b28b0539c9a74c34659] WIP define language
~/.emacs.d/straight/repos/combobulate @c66d23d6|bisect ❯ git bisect bad                         14:11:43
Bisecting: 0 revisions left to test after this (roughly 0 steps)
[573b74e7359a254984036355678e54d236e11c4b] More improvements to Go sibling navigation
~/.emacs.d/straight/repos/combobulate @573b74e7|bisect ❯ git bisect good                        14:12:18
c66d23d6d3608f662b168b28b0539c9a74c34659 is the first bad commit
commit c66d23d6d3608f662b168b28b0539c9a74c34659
Author: Mickey Petersen <mickey@fyeah.org>
Date:   Fri Jan 26 05:40:40 2024 +0000

    WIP define language

 combobulate-settings.el | 23 -----------------------
 combobulate.el          | 45 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 44 insertions(+), 24 deletions(-)```
matasar commented 5 hours ago

Thanks for bisecting! I've pinned to that version and I can use it again. I also asked about this in the doom discord, maybe someone will have some ideas.

gvoysey commented 5 hours ago

doom's a whole other ball of wax -- luckily, you can eliminate it from contributing here @mickeynp because I don't use it (but do see the same failure to recognize C-c o o behavior)

Possibly a useful bit of information: i can make the transient display on the latest commit -- by first manually launching M-x combobulate-query-builder and then inside the query builder C-c o o is recognized and launches the main transient.