From 5dffefd76ad29b030ba2392ab878cb8feee01c6a Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Fri, 21 Nov 2025 05:52:02 -0800 Subject: fix: add quick-sdcv quit binding and fix calendar-sync sentinel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 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 --- modules/calendar-sync.el | 24 +++++++++++++----------- modules/system-utils.el | 2 ++ 2 files changed, 15 insertions(+), 11 deletions(-) (limited to 'modules') 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 " ▼")) -- cgit v1.2.3