vedang / pdf-tools

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

Viewing pdf files with different org-mode version throws an error #283

Open freddyholms opened 3 months ago

freddyholms commented 3 months ago

Describe the bug On a fresh install of emacs, I have reduced my config file to the following simplest case:

(use-package org
  :straight `(org
          :fork (:host nil
             :repo "https://git.tecosaur.net/tec/org-mode.git"
             :branch "dev"
             :remote "tecosaur")
          :files (:defaults "etc")
          :build t))

(use-package pdf-tools
  :straight t)
(pdf-tools-install)

When I try to view a pdf, I get the following stacktrace

Debugger entered--Lisp error: (void-variable org-format-latex-header)
  #f(compiled-function () #<bytecode -0x14765911616dbdc8>)()
  funcall(#f(compiled-function () #<bytecode -0x14765911616dbdc8>))
  eval((funcall #'#f(compiled-function () #<bytecode -0x14765911616dbdc8>)))
  custom-initialize-reset(pdf-annot-latex-header (funcall #'#f(compiled-function () #<bytecode -0x14765911616dbdc8>)))
  custom-declare-variable(pdf-annot-latex-header (funcall #'#f(compiled-function () #<bytecode -0x14765911616dbdc8>)) "Header used when latex compiling annotations.\nThe ..." :type string)
  byte-code("\301\302!\210\301\303!\210\301\304!\210\301\305!\210\301\306!\210\301\307!\210\301\310!\210\301\311!\210\301\312!\210\301\313!\210\301\314!\210\315\316\317\320\321\322..." [display-buffer--action-custom-type require pdf-view pdf-info pdf-cache pdf-misc pdf-util facemenu faces org tablist cl-lib seq custom-declare-group pdf-annot nil "Annotation support for PDF documents." :group pdf-tools custom-declare-variable pdf-annot-activate-handler-functions funcall function #f(compiled-function () #<bytecode 0x19800016fe914>) "A list of functions to activate a annotation.\n\nThe..." :type hook pdf-annot-default-text-annotation-properties #f(compiled-function () #<bytecode 0x19800016fe914>) "Alist of initial properties for new text annotatio..." (alist :key-type symbol :value-type sexp) pdf-annot-default-markup-annotation-properties #f(compiled-function () #<bytecode 0x19800016fe914>) "Alist of initial properties for new markup annotat..." (alist :key-type symbol :value-type sexp) make-obsolete-variable pdf-annot-default-annotation-properties "0.90" #f(compiled-function () #<bytecode 0x180a3585469b023f>) "An alist of initial properties for new annotations..." (cons :tag "Label" (const label) string) (cons :tag "Contents" (const contents) string) (cons :tag "Color" (const color) color) cons :tag "Icon" (const icon) choice mapcar #f(compiled-function (icon) #<bytecode 0x1daff62dbbd4d0bc>) ...] 24)
  pdf-annot-minor-mode(1)
  pdf-tools-set-modes-enabled(t nil)
  pdf-tools-enable-minor-modes()
  run-hooks(change-major-mode-after-body-hook special-mode-hook pdf-view-mode-hook)
  apply(run-hooks (change-major-mode-after-body-hook special-mode-hook pdf-view-mode-hook))
  run-mode-hooks(pdf-view-mode-hook)
  pdf-view-mode()
  set-auto-mode-0(pdf-view-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
find-file-noselect-1(#<buffer test.pdf> "~/Downloads/test.pdf" nil nil "~/Downloads/test.pdf" (19394 45))
  find-file-noselect("~/Downloads/test.pdf" nil nil t)
  find-file("~/Downloads/test.pdf" t)
  funcall-interactively(find-file "~/Downloads/test.pdf" t)
  command-execute(find-file)

Steps to Reproduce the behaviour Just launch emacs with straight.el set up and with the above init.el, then open a pdf file. For some reason, the second time I try vieweing the pdf, it works fine. I can actually reproduce without a pdf, just by (require 'pdf-annot).

What is the expected behaviour? It should work fine on the first try.

Desktop Please complete the following information: