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

Add file-field to possible-files #260

Merged
merged 5 commits into from
Aug 26, 2021
Merged

Add file-field to possible-files #260

merged 5 commits into from
Aug 26, 2021

Conversation

bdarcus
Copy link
Contributor

@bdarcus bdarcus commented Aug 26, 2021

Fix for #259

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Is it possible for you to test this @teddygroves?

I don't have the data to do it quickly, but it should work.

@bdarcus bdarcus force-pushed the file-field branch 2 times, most recently from 35d8c9d to a133892 Compare August 26, 2021 12:28
@bdarcus bdarcus force-pushed the file-field branch 2 times, most recently from e07b9d0 to f6862f6 Compare August 26, 2021 14:08
@teddygroves
Copy link

Is it possible for you to test this @teddygroves?

I don't have the data to do it quickly, but it should work.

I tried running this again

(bibtex-actions-open-library-files '("albertyThermodynamicsBiochemicalReactions2003"))

and got this error:

seq-mapcat: Lisp nesting exceeds ‘max-lisp-eval-depth’

Here is my new use-package declaration

(use-package bibtex-actions
  :ensure t
  :demand t
  :straight (:type git :host github :repo "bdarcus/bibtex-actions"
                   :branch "file-field"
                   )
  :bind (("C-c b" . bibtex-actions-insert-citation)
         :map minibuffer-local-map
         ("M-b" . bibtex-actions-insert-preset))
  :after (embark parsebib bibtex-completion)
  :config
  (add-to-list 'embark-target-finders 'bibtex-actions-citation-key-at-point)
  (add-to-list 'embark-keymap-alist '(bib-reference . bibtex-actions-map))
  (add-to-list 'embark-keymap-alist '(citation-key . bibtex-actions-buffer-map))
  (advice-add #'completing-read-multiple
              :override #'consult-completing-read-multiple)
  (setq bibtex-actions-file-variable "file"
        bibtex-actions-bibliography '("/Users/tedgro/Reading/bibliography.bib")))

Here is the debugger output (sorry for the spam but I can't make enough sense of it to know what to leave out!): https://gist.github.com/teddygroves/df7e2eeb62951bbb841018cba8746063

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Hmm ... I wonder if it's because you have spaces and such in the file path, and I need to account for that?

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Can you try the latest commit and see if that works?

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Actually, that won't work.

@teddygroves
Copy link

Actually, that won't work.

Yeah I still get the same error: https://gist.github.com/teddygroves/c2f2564c70c255409192e5319cc0eced.

Looking at the debug output I think it's getting in an infinite loop running bibtex-actions--get-candidates. I tried running just (bibtex-actions--get-candidates) in the scratch buffer and got the same error. I'm not sure why that would happen here but not on the main branch.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

OK, I just updated the latest commit.

File path is now quoted, and expanded, which is what at xdg-open expects for file names like that.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Looking at the debug output I think it's getting in an infinite loop running bibtex-actions--get-candidates. I tried running just (bibtex-actions--get-candidates) in the scratch buffer and got the same error. I'm not sure why that would happen here but not on the main branch.

Yeah, doesn't make sense.

I can't test it ATM as something is wrong with my straight installation, and I have some other stuff to work on.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Actually, I can confirm it happens on my system too, so maybe just some stupid bug here.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Unfortunately, that bug is on the main branch, and probably introduced yesterday. I've not figured it out yet though, other that it centers on bibtex-actions--format-candidates.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

I solved the bug on main, but my power is out, so will be a bit to get back to this.

If you want to experiment, moving bibtex-actions-get-entry down towards end of the file will probably fix it.

Or you can see what I did on the latest main commit.

@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

Edit: I think this should work now.

@bdarcus bdarcus merged commit 346f762 into main Aug 26, 2021
@bdarcus bdarcus deleted the file-field branch August 26, 2021 21:29
@bdarcus
Copy link
Contributor Author

bdarcus commented Aug 26, 2021

I merged this. Let me know how it goes, good or bad ;-)

@teddygroves
Copy link

It works! Thanks so much for taking the time to look into this!

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

Successfully merging this pull request may close these issues.

2 participants