[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/pdf-tools c451c0e3db 1/8: Auto enable pdf-view-dark-minor-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/pdf-tools c451c0e3db 1/8: Auto enable pdf-view-dark-minor-mode if the theme is dark |
Date: |
Sat, 10 Jun 2023 16:02:06 -0400 (EDT) |
branch: elpa/pdf-tools
commit c451c0e3db5b367d191bddf428e38fd8a21c0102
Author: Vedang Manerikar <ved.manerikar@gmail.com>
Commit: Vedang Manerikar <ved.manerikar@gmail.com>
Auto enable pdf-view-dark-minor-mode if the theme is dark
This is meant as a workaround for #166 (which see).
Best guess about what is happening and why this workaround works comes
from @d8660091 (lightly edited):
> I'm using M2 and I can reproduce the issue with just the following
> snippets I extracted from pdf-isearch-current-colors, which was
> invoked during a pdf isearch:
(add-hook 'pdf-tools-enabled-hook
(lambda ()
(pdf-util-face-colors 'pdf-isearch-match nil)
(pdf-util-face-colors 'pdf-isearch-lazy nil)))
> And run `pdf-tools-install`
> I tried adding `(sit-for 1)` before `(delete-frame f)`, the crash
> was gone.
> But I am still not sure what's really happening.
> I think `pdf-view-dark-minor-mode` works because new frame is not
> created and `delete-frame` doesn't happen.
If anyone has an idea about what is happening here and what the
correct way to fix it is, please get in touch via the linked issue!
Closes: #166
---
lisp/pdf-tools.el | 33 +++++++++++++++++++--------------
1 file changed, 19 insertions(+), 14 deletions(-)
diff --git a/lisp/pdf-tools.el b/lisp/pdf-tools.el
index aa19969bfd..382d5b6e91 100644
--- a/lisp/pdf-tools.el
+++ b/lisp/pdf-tools.el
@@ -134,20 +134,25 @@ In order to customize dark and light colors use
pdf-virtual-global-minor-mode))
(defcustom pdf-tools-enabled-modes
- '(pdf-history-minor-mode
- pdf-isearch-minor-mode
- pdf-links-minor-mode
- pdf-misc-minor-mode
- pdf-outline-minor-mode
- pdf-misc-size-indication-minor-mode
- pdf-misc-menu-bar-minor-mode
- pdf-annot-minor-mode
- pdf-sync-minor-mode
- pdf-misc-context-menu-minor-mode
- pdf-cache-prefetch-minor-mode
- pdf-occur-global-minor-mode
- ;; pdf-virtual-global-minor-mode
- )
+ (append '(pdf-history-minor-mode
+ pdf-isearch-minor-mode
+ pdf-links-minor-mode
+ pdf-misc-minor-mode
+ pdf-outline-minor-mode
+ pdf-misc-size-indication-minor-mode
+ pdf-misc-menu-bar-minor-mode
+ pdf-annot-minor-mode
+ pdf-sync-minor-mode
+ pdf-misc-context-menu-minor-mode
+ pdf-cache-prefetch-minor-mode
+ pdf-occur-global-minor-mode)
+ ;; See an interesting discussion at:
+ ;; https://github.com/vedang/pdf-tools/issues/166 about how
+ ;; this avoids a segfault crash in MacOS Ventura. IF you
+ ;; know why this happens, please get in touch via the linked
+ ;; issue.
+ (when (eq 'dark (frame-parameter nil 'background-mode))
+ '(pdf-view-dark-minor-mode)))
"A list of automatically enabled minor-modes.
PDF Tools is build as a series of minor-modes. This variable and
- [nongnu] elpa/pdf-tools updated (a9c9a12c3e -> 70865fb38d), ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 70865fb38d 8/8: Fix: Keep cursor on the same line when reopening list of annots, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools fb6616c15e 2/8: Add an FAQ on re-compiling epdfinfo, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools c451c0e3db 1/8: Auto enable pdf-view-dark-minor-mode if the theme is dark,
ELPA Syncer <=
- [nongnu] elpa/pdf-tools 154e31dc3c 4/8: Display a header line when editing annotation contents, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 0822f438de 7/8: Update NEWS with recent contributions, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 5b58c6bcc3 3/8: Add command and submenu to switch between selection styles, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 6a86b29140 5/8: Use 'C-c C-k' to abandon edits of annotation contents, ELPA Syncer, 2023/06/10
- [nongnu] elpa/pdf-tools 97cffdd1b2 6/8: Allow creation of markup annotations without a text selection, ELPA Syncer, 2023/06/10