Skip to content
This repository has been archived by the owner on Aug 7, 2022. It is now read-only.

Commit

Permalink
Enable pdf-view-mode only if needed
Browse files Browse the repository at this point in the history
* lisp/pdf-tools.el (pdf-tools-install): Check if buffer is already in
  pdf-view-mode. This avoids resetting of local variables/state.
  • Loading branch information
Andreas Politz committed May 26, 2015
1 parent 1c0e87c commit 5b153d7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lisp/pdf-tools.el
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,8 @@ See `pdf-view-mode' and `pdf-tools-enabled-modes'."
(add-hook 'pdf-view-mode-hook 'pdf-tools-enable-minor-modes)
(dolist (buf (buffer-list))
(with-current-buffer buf
(when (and (pdf-tools-pdf-buffer-p)
(when (and (not (derived-mode-p 'pdf-view-mode))
(pdf-tools-pdf-buffer-p)
(buffer-file-name))
(pdf-view-mode)))))))

Expand Down

0 comments on commit 5b153d7

Please sign in to comment.