vedang / pdf-tools

Emacs support library for PDF files.
https://pdftools.wiki
GNU General Public License v3.0
618 stars 89 forks source link

With dired+ installed, navigating from pdf-tools buffer hangs emacs #240

Closed jhncondix closed 11 months ago

jhncondix commented 11 months ago

Emacs version: GNU Emacs 28.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.33, cairo version 1.16.0) of 2022-05-31.

Pop!_OS 22.04 LTS, Gnome 42.9, X11

dired+ Version: 2023.07.18

Pdf-tools Version: 20230611.239

Bug:

Jumping from a pdf-tools buffer to a dired location when using helm or other completion frameworks like ido and vertico hangs emacs if dired+ is loaded.

Expected behavior:

After installing dired+ I can still jump from a pdf-tools buffer to a dired buffer using helm or other completion frameworks and can use C-x C-j to jump to the folder of the open pdf file.

Steps:

I should add that pdf-tools and dired+ WITHOUT the completion frameworks work fine together. I ran emacs -Q and just installed the two packages. Then, using the basic emacs completion with letters and tabs, or using C-x C-j, works fine. I had large pdfs open in pdf-tools with dired+ running, and C-x C-j jumps instantly to the underlying dired folder.

jhncondix commented 11 months ago

I did some further testing and discovered that the factor causing emacs to hang was not the pdf size, but the length of the absolute path to the file. I had failed to control for path length. When the path was in the 40-50 character range I could jump to dired with no issue, regardless of file size. Emacs froze using pdf-tools and dired+ when the path was in the over 100 character or so range, again, regardless of file size. Maybe this is an issue of how dired+ handles the path variable. I will take this issue up with the maintainer of dired+.