summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-11-21 05:52:02 -0800
committerCraig Jennings <c@cjennings.net>2025-11-21 05:52:02 -0800
commit5dffefd76ad29b030ba2392ab878cb8feee01c6a (patch)
treeeadf564eb3e4a2e884fb42305efa8c3b361aa71b /modules
parentcde19ae8c3a0da8623e4154789d2482468765e48 (diff)
fix: add quick-sdcv quit binding and fix calendar-sync sentinel
- Add 'q' keybinding in quick-sdcv-mode to quit-window for easier dictionary dismissal while reading epubs - Fix "Selecting deleted buffer" error in calendar-sync by checking buffer-live-p before accessing process buffer in sentinel 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/calendar-sync.el24
-rw-r--r--modules/system-utils.el2
2 files changed, 15 insertions, 11 deletions
diff --git a/modules/calendar-sync.el b/modules/calendar-sync.el
index 8b276333..dbea95c9 100644
--- a/modules/calendar-sync.el
+++ b/modules/calendar-sync.el
@@ -663,17 +663,19 @@ invoked when the fetch completes, either successfully or with an error."
:sentinel
(lambda (process event)
(when (memq (process-status process) '(exit signal))
- (with-current-buffer (process-buffer process)
- (let ((content
- (if (and (eq (process-status process) 'exit)
- (= (process-exit-status process) 0))
- (calendar-sync--normalize-line-endings (buffer-string))
- (setq calendar-sync--last-error
- (format "curl failed: %s" (string-trim event)))
- (cj/log-silently "calendar-sync: Fetch error: %s" calendar-sync--last-error)
- nil)))
- (kill-buffer (process-buffer process))
- (funcall callback content)))))))
+ (let ((buf (process-buffer process)))
+ (when (buffer-live-p buf)
+ (let ((content
+ (with-current-buffer buf
+ (if (and (eq (process-status process) 'exit)
+ (= (process-exit-status process) 0))
+ (calendar-sync--normalize-line-endings (buffer-string))
+ (setq calendar-sync--last-error
+ (format "curl failed: %s" (string-trim event)))
+ (cj/log-silently "calendar-sync: Fetch error: %s" calendar-sync--last-error)
+ nil))))
+ (kill-buffer buf)
+ (funcall callback content))))))))
(error
(setq calendar-sync--last-error (error-message-string err))
(cj/log-silently "calendar-sync: Fetch error: %s" calendar-sync--last-error)
diff --git a/modules/system-utils.el b/modules/system-utils.el
index 2ee7200c..f5af18de 100644
--- a/modules/system-utils.el
+++ b/modules/system-utils.el
@@ -207,6 +207,8 @@ Logs output and exit code to buffer *external-open.log*."
(use-package quick-sdcv
:bind
("C-h d" . quick-sdcv-search-input)
+ :bind (:map quick-sdcv-mode-map
+ ("q" . quit-window))
:custom
(quick-sdcv-dictionary-prefix-symbol "â–º")
(quick-sdcv-ellipsis " â–¼"))