otavioschwanck / harpoon.el

Harpoon for emacs
GNU General Public License v3.0
93 stars 7 forks source link

Harpoon-go-to not working, but can select harpoon file from quick-menu #5

Closed wmahany closed 2 years ago

wmahany commented 2 years ago

After a fresh installation of doom emacs (28.1) certain functionality for harpoon no longer works. When I try to access a file via the "harpoon-go-to-X" functions I get an error. I get errors when I use a bind I have defined, and also when I call the function directly with M-x harpoon-go-to-X

The error I get when I try to access the first file in my harpoon file is: harpoon_error

But when I select the file I want to go to from the quick menu (harpoon-toggle-quick-menu) then it works. I think it might have something to do with how the file name is being formatted?

For whatever reason I'm not having any issues with harpoon on a separate installation of Endeavour on another machine, also Doom emacs (28.1)

Let me know if you need more info, I don't submit many issues, so I'm not 100% sure what information you might need. Thanks!

otavioschwanck commented 2 years ago

1 - Your project is a git project? 2 - What is the content of your file? M-x harpoon-find-file 3 - How is formatted the harpoon file?

Tip: I Recommend you to use harpoon-quick-menu-hydra

wmahany commented 2 years ago

1 - This project is not a git project. It's worked in the past with files that are part of a git project, as well as files that aren't 2 - The harpoon file just has the 3-4 files I'm trying to access in it, and itt's the full path (/home/name/path/to/file.txt) 3 - Each on it's own line, and there is no odd text or whitespace. I've cleared the file and re-added files to verify that the harpoon file is clean

A picture of my harpoon file:

other_harpoon_error

I can use harpoon-quick-menu but I don't have a harpoon-quick-menu-hydra option for some reason. The harpoon-quick-menu menu lets me select files just fine, it's only when I try to use the function harpoon-go-to-X (either being called directly or via bindings) that I get that strange error

otavioschwanck commented 2 years ago

1 - This project is not a git project. It's worked in the past with files that are part of a git project, as well as files that aren't 2 - The harpoon file just has the 3-4 files I'm trying to access in it, and itt's the full path (/home/name/path/to/file.txt) 3 - Each on it's own line, and there is no odd text or whitespace. I've cleared the file and re-added files to verify that the harpoon file is clean

A picture of my harpoon file:

other_harpoon_error

I can use harpoon-quick-menu but I don't have a harpoon-quick-menu-hydra option for some reason. The harpoon-quick-menu menu lets me select files just fine, it's only when I try to use the function harpoon-go-to-X (either being called directly or via bindings) that I get that strange error

can you upgrade the harpoon and test again? I think you dont have the last version.

wmahany commented 2 years ago

Ok, I've uninstalled and reinstalled harpoon via (package! harpoon) and I am still getting this same error.

I also checked and I was mistaken, I do have harpoon-quick-menu-hydra and it works just fine. It's only when I use harpoon-go-to-X that I get these errors.

Is there any other information I can provide that might help? My harpoon config within my config.el? etc?

otavioschwanck commented 2 years ago

Can you run head -n 1 < /path/of/harpoon/file | tail -n 1 ?

To get the path of harpoon file, just open with harpoon-find-file.

TIP: SPC f Y copy the file path on doom

wmahany commented 2 years ago

I run that command: head -n 1 < /home/myhome/.emacs.d/.local/harpoon/harpoon | tail -n 1

and the output is just the full paths for the first file in my harpoon file /home/myhome/orgmode/ORG/agenda.org

with no extra spaces or characters

EDIT:

I can edit the first number (head -n 2, head -n 3, etc) and it returns the second and third file in my harpoon file respectively

otavioschwanck commented 2 years ago

I run that command: head -n 1 < /home/myhome/.emacs.d/.local/harpoon/harpoon | tail -n 1

and the output is just the full paths for the first file in my harpoon file /home/myhome/orgmode/ORG/agenda.org

with no extra spaces or characters

EDIT:

I can edit the first number (head -n 2, head -n 3, etc) and it returns the second and third file in my harpoon file respectively

Holy, thats strange. Please open emacs as runs before doing anything:

(message (s-replace-regexp "\n" ""
                  (shell-command-to-string
                   (format "head -n %s < %s | tail -n 1"
                           1
                           (if (eq major-mode 'harpoon-mode) (file-truename (buffer-file-name)) (harpoon--file-name))))))

Run with M-S-; or M-x eval-expression

wmahany commented 2 years ago

Ok so it looks like it can't find harpoon--file-name: another_harpoon_erorr

Sorry it's cut off, I can't get the full error to wrap the text in that mini buffer

wmahany commented 2 years ago

Aha! I figured it out I think.

It's the byte-compiling that's screwing me: another_harpoon_erorr

I'm going to do full re-installation of emacs and NOT byte-compile stuff to see if that helps. I'll update afterwards

wmahany commented 2 years ago

Ok, still no go, I uninstalled emacs, cleared my pacman cache, re installed and re installed doom. Still getting the error but with no mention of byte-compiling now:

another_harpoon_erorr

otavioschwanck commented 2 years ago

Released a fix, can you upgrade and try again?

wmahany commented 2 years ago

Confirmed I upgraded, and issues persists:

harpoon_git_version

another_harpoon_erorr

otavioschwanck commented 2 years ago

Released another fix, can you upgrade again?

If still doesn't works, please send me the result of:

(if (eq major-mode 'harpoon-mode) (file-truename (buffer-file-name)) (harpoon--file-name))

wmahany commented 2 years ago

That fixed it!

Thanks so much, everything is working now!