From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:203:b4db::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms12 with LMTPS id ICudDbOZy2GkegAAsNZ9tg (envelope-from ); Tue, 28 Dec 2021 23:11:47 +0000 Received: from out1.migadu.com ([2001:41d0:2:863f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4FbVDLOZy2EH4wAA9RJhRA (envelope-from ); Wed, 29 Dec 2021 00:11:47 +0100 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1640733107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=dVTTVT6VHd+oDxKdhtcXAGL1oFXgvPHOlum85+iVTH4=; b=a39Oo3NYtp12QIQjG4+aZuYBkPCwsGZmBbnsuLUYUYDgG4rZ4GGZ02RMhKT/cby69E9Yi1 9jU0MGBPohHtQJ1FJVjXD7mGwlU6k26qLRT/317Miqsy38zZEIo7eMWu9uap4j9yV6iyrh m4Eayb5uDO6jx6sB4FnN7jaMHysQkdPJoV+PO7hsz1rCeCBRPdfdnqfKyZYOpzGLImq3EP La7cXTD2oORD5JAyOohl1dqcXL+HRmnbkmTpHlxuu/mg9A1OnBWzgnWBdsrs3khEAFIXLa r2XvEB+qu8JIYBYWxb8gLFkbqZN40DMRIDNkTEqiex3rRrXEC9vSbj9En7goQg== From: Kyle Meyer To: piem@inbox.kyleam.com Cc: Xinglu Chen Subject: [PATCH] lei: Delete message buffer's window along with query window Date: Tue, 28 Dec 2021 18:11:43 -0500 Message-Id: <20211228231143.244455-1-kyle@kyleam.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyleam.com X-TUID: i4NweDkEr4II Within query buffers, a message for the current line can be displayed while keeping point in the query buffer. Calling quit-window in a query buffer, however, leaves the associated buffer's window in place, which is probably not what the caller wants. Add a custom quit-window variant that handles the message buffer too. Suggested-by: Xinglu Chen Link: https://inbox.kyleam.com/piem/871r96am1q.fsf@yoctocell.xyz --- piem-lei.el | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/piem-lei.el b/piem-lei.el index 6c537339..22814c74 100644 --- a/piem-lei.el +++ b/piem-lei.el @@ -375,6 +375,16 @@ (defun piem-lei-query-show-or-scroll-down (arg) (arg (- arg)) (t '-)))) +(defun piem-lei-query-quit-window (&optional kill) + "Call `quit-window' on the selected window. +If there is a visible `piem-lei-show-mode' buffer, first call +`quit-window' on its window. The prefix argument KILL is passed +to both underlying `quit-window' calls." + (interactive "P") + (when-let ((msg-win (piem-lei-query--get-visible-message-window))) + (quit-window kill msg-win)) + (quit-window kill)) + (defvar piem-lei-query-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") #'piem-lei-query-show) @@ -384,6 +394,7 @@ (defvar piem-lei-query-mode-map (define-key map "p" #'piem-lei-query-previous-line) (define-key map "s" #'piem-lei-q) (define-key map "t" #'piem-lei-mid-thread) + (define-key map "q" #'piem-lei-query-quit-window) map) "Keymap for `piem-lei-query-mode'.") base-commit: d7d15a74c933e9a108c47f0515fc7a1b6d3199d6 -- 2.34.0