diff options
| author | Craig Jennings <c@cjennings.net> | 2026-07-24 08:46:04 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-07-24 08:46:04 -0500 |
| commit | d9ab1074991ee3c4c680024b14d6de0475560380 (patch) | |
| tree | 00b9459181efaececd8da2c065c69ac92b0a8bc2 /modules/calibredb-epub-config.el | |
| parent | 7e5aa31731a6d6446055729fb7597d549ff637f4 (diff) | |
| download | dotemacs-d9ab1074991ee3c4c680024b14d6de0475560380.tar.gz dotemacs-d9ab1074991ee3c4c680024b14d6de0475560380.zip | |
fix: correct four wrong behaviors and drop three dead code paths
- yt-dlp downloads claimed completion when tsp had merely queued them.
- A fresh machine opened org links in EWW, not Chrome.
- ArchWiki search raised a raw error instead of the install hint.
- The pre-commit hook kept running when its cd failed.
- Removed a second device-grouping implementation nothing called.
- Removed a redundant epub advice that ran on every file visit.
- Removed a buffer-burying clause naming a mode Emacs doesn't define.
- Moved the Hugo bindings onto the custom prefix map.
- The ArchWiki docs path is now a variable, making it testable.
Diffstat (limited to 'modules/calibredb-epub-config.el')
| -rw-r--r-- | modules/calibredb-epub-config.el | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/modules/calibredb-epub-config.el b/modules/calibredb-epub-config.el index e0a82245..27fa6369 100644 --- a/modules/calibredb-epub-config.el +++ b/modules/calibredb-epub-config.el @@ -205,22 +205,14 @@ Adjust it live with `cj/nov-widen-text' and `cj/nov-narrow-text'.") (defvar cj/nov-margin-step 2 "Percentage points each `cj/nov-widen-text'/`cj/nov-narrow-text' press changes.") -;; Prevent magic-fallback-mode-alist from opening epub as archive-mode -;; Advise set-auto-mode to force nov-mode for .epub files before magic-fallback runs -(defun cj/force-nov-mode-for-epub (orig-fun &rest args) - "Force nov-mode for .epub files, bypassing archive-mode detection." - (if (and buffer-file-name - (string-match-p "\\.epub\\'" buffer-file-name)) - (progn - (unless (featurep 'nov) - (require 'nov nil t)) - ;; Call nov-mode if available, otherwise fallback to default behavior - (if (fboundp 'nov-mode) - (nov-mode) - (apply orig-fun args))) - (apply orig-fun args))) - -(advice-add 'set-auto-mode :around #'cj/force-nov-mode-for-epub) +;; .epub reaches nov-mode through auto-mode-alist -- nov's use-package :mode +;; below registers "\\.epub\\'" there, and `set-auto-mode' consults +;; auto-mode-alist before magic-fallback-mode-alist, so the zip container never +;; reaches the archive-mode fallback. An :around advice on `set-auto-mode' used +;; to force this and was pure overhead: set-auto-mode runs on every file visit, +;; so it added a frame and a failure surface to every file of every type. +;; Verified live before removal -- a real zip-format .epub opened in nov-mode +;; both with the advice and without it. ;; Define helper functions before use-package so they're available for hooks (defun cj/forward-paragraph-and-center () |
