helm-bibtex icon indicating copy to clipboard operation
helm-bibtex copied to clipboard

How to resue the current buffer to open a new PDF file?

Open fu123456 opened this issue 5 years ago • 7 comments

Hi, I often read many PDF files. Generally speaking, we fist find the corresponding PDF file via Helm-bibtex, and the open it by pdf-tools. But I find that this operation often open the pdf file in a new windows. In fact, I want to reuse current buffer, namely not open a new buffer. How to config to achieve this? Please help me.

fu123456 avatar Apr 29 '19 09:04 fu123456

I'm not sure this is under our control. Helm-bibtex just uses Emacs' find-file to open the PDF. Perhaps that's something you can configure in pdftools? Not sure.

tmalsburg avatar Apr 30 '19 18:04 tmalsburg

Similar problem here, but simpler. I'm just opening the pdf with the default pdf reader. In other words, I do

M-x helm-bibtex
Move cursor to the paper I want
Hit TAB
Hit 2

and, since I have this customization:

(bibtex-completion-pdf-open-function (quote helm-open-file-with-default-tool))

My default pdf reader (PDF-Xchange Editor) opens.

After close the pdf, and go back to the helm-bibtex window in Emacs, this window is "dead," and acts sort of like an ordinary text file; if I scroll down to another paper in the helm-bibtex window and hit TAB, I don't go to a menu, and instead, the line in the helm-bibtex window is indented.

Is this expected behavior?

notuntoward avatar Jun 07 '20 23:06 notuntoward

Either M-x helm-resume (or C-u M-x helm-resume), or call helm-bibtex again (then press C-r to see/select the minibuffer history).

jagrg avatar Jun 08 '20 00:06 jagrg

Thanks, this works! Is there any way to avoid this extra step? helm-bibtex is the only emacs package I've seen where you can't just switch between buffers and immediately get to work.

notuntoward avatar Jun 08 '20 04:06 notuntoward

After close the pdf, and go back to the helm-bibtex window in Emacs, this window is "dead," and acts sort of like an ordinary text file; if I scroll down to another paper in the helm-bibtex window and hit TAB, I don't go to a menu, and instead, the line in the helm-bibtex window is indented.

This is not expected and it doesn't happen on my system. If you give me a recipe for reproducing this issue, I can investigate. I suspect that the problem lies with helm not helm-bibtex.

tmalsburg avatar Jun 08 '20 08:06 tmalsburg

@tmalsburg

  1. M-x helm-bibtex
  2. C-g
  3. M-x switch-to-buffer
  4. Select helm bibtex and press RET

Another example using ./emacs-helm.sh:

  1. C-x C-f
  2. C-g
  3. C-x b
  4. Select helm find files

@notuntoward I don't think helm buffers are meant to be reused without first invoking helm-resume. In fact, with helm-resume you can switch back to a previous session quicker without having to search from a (possibly long) list of buffers.

jagrg avatar Jun 09 '20 00:06 jagrg

  1. M-x helm-bibtex
  2. C-g
  3. M-x switch-to-buffer
  4. Select helm bibtex and press RET

Yes, I know that you can deliberately select these buffers, but that's not what @notuntoward did if I understand correctly. @notuntoward just opened a PDF and then ended up seeing this buffer which you should never see under normal circumstances. When I finish a helm session by opening a PDF I'm always back to where I started.

tmalsburg avatar Jun 09 '20 09:06 tmalsburg