From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id EDLFDCef/WS/EwEAG6o9tA:P1 (envelope-from ) for ; Sun, 10 Sep 2023 12:49:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id EDLFDCef/WS/EwEAG6o9tA (envelope-from ) for ; Sun, 10 Sep 2023 12:49:11 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id BF51C4624A for ; Sun, 10 Sep 2023 12:49:10 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=itccanarias.org header.s=default header.b=cf6qkfZy; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=itccanarias.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694342951; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SQYVz5Otc9dyuMJr7lVLQsysPkkTk6OFUe8mgK0djxU=; b=jxgvguKozxGn5xYVA5D2FWbSVfLbKyul84sVYbJoh41CFI1IodLUyInB0JJpykD8GOBpTd rD/5SlL8qNkoJavT13GvL3mhvrlbT10wEU3uth9vbg/AUE+8KmfnSG2/O5YgYfR/K93qVe CEeBgdeu5VCnwpwoWNJZcVbnlpmvhILqbiKlK8diyFNkQ4bddv1YttH3PsdURlU8tGItfS RH5NQwGc3U6FNRYPPwK12G4mMycu99Mk/lxPvzOkZL7YwTDbo+6G+6cI7556HQLjN+bDKu ZpaT8hG5oMilhwBQ61R2LyCoXINiJ7O8moVBIjXZUVh6ausAUPhXlyDJFgnlAQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=itccanarias.org header.s=default header.b=cf6qkfZy; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=quarantine) header.from=itccanarias.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694342951; a=rsa-sha256; cv=none; b=ScNJcGsI/S4zGmN9P82rEPo9d64GMUUkul4jIfMS/b0cMVUq5FOum2aYSpIoqDXsjptS7c KzX4uiJNwSYXAJQAoHrBBRcTDsXAHUqaYDaucVgSWs4BBQ5ZkCS8LhTUke/rsS0XzmdpYa gFGVn5FBLnHUAjlE2Hcvs2Mu7kczq06j0OjCWHYDhzV5qlSYVcfFZyKgSdCQpWnaWVvRye UiW8+a9B/hY1NPgfPGPJTEdlkFxUJMxlak65LWt4ctNNBatHRxGBTtY4RM1CrG3uxVBtPO wMPzHv7GDXeXJMp/dVL2pNU2Sb4KB1YLY+5NUrnLSFHU2G3E1L56Xc0ZVoh25g== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfHzl-0007jh-AL; Sun, 10 Sep 2023 06:48:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfHzi-0007jT-VJ for emacs-orgmode@gnu.org; Sun, 10 Sep 2023 06:48:46 -0400 Received: from relay.itccanarias.org ([62.174.94.155]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfHzf-0002WV-UW for emacs-orgmode@gnu.org; Sun, 10 Sep 2023 06:48:46 -0400 Received: from localhost (localhost [127.0.0.1]) by relay.itccanarias.org (Postfix) with ESMTP id EA7B343AC8; Sun, 10 Sep 2023 11:48:40 +0100 (WEST) Received: from relay.itccanarias.org ([127.0.0.1]) by localhost (gwmail-lp.corp.itccanarias.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QZ8Vs4knaGne; Sun, 10 Sep 2023 11:48:40 +0100 (WEST) Received: from Erasure.corp.itccanarias.org (erasure.corp.itccanarias.org [10.141.187.131]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay.itccanarias.org (Postfix) with ESMTPS id 8A1F9439F4; Sun, 10 Sep 2023 11:48:40 +0100 (WEST) Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline DKIM-Signature: v=1; a=rsa-sha256; d=itccanarias.org; s=default; c=relaxed/relaxed; t=1694342914; h=from:subject:to:date:message-id; bh=SQYVz5Otc9dyuMJr7lVLQsysPkkTk6OFUe8mgK0djxU=; b=cf6qkfZyT4CjEFMuQejF3QO+xnOiM+7M2zQLvIZrmk5Hnfr55OwRIVYU30m/1ZrrXlZY8ImPB2c DY+64tGNbtckjd6cGL3lCZRrbZUkT+xd1X4MmgQ7FOYdf3WnQfVLcJ/Xg4owIA/2DTdASReiZydHI T34/qvlemIjjEjbzkbERGUm94Xtqlj7FQyp9pDRcNdQxxdw7tpafQJirJaAA2QPGREbTbtBwLJAAi Y4bumY70crv6CE+b0hsrJi1Zhk3/5jFPhk9SzGc07qMVd2aG3i7i2VY0/CjSVMzscxvuRotVXhPq9 RddqTUw6HWWMa5jCbyvMbvEY37Vzlp0V7isg== Received: from itccanarias.org (10.141.153.141) by Erasure.corp.itccanarias.org (10.141.187.131) with Microsoft SMTP Server (TLS) id 14.3.498.0; Sun, 10 Sep 2023 11:48:33 +0100 Date: Sun, 10 Sep 2023 11:48:31 +0100 From: Eduardo Suarez To: Ihor Radchenko CC: Subject: Re: Feature request: kill-buffer for org-capture-finalize Message-ID: References: <87sf7o987k.fsf@localhost> <87pm2s96xc.fsf@localhost> <87r0n77li4.fsf@localhost> <87h6o2jv8y.fsf@localhost> MIME-Version: 1.0 In-Reply-To: <87h6o2jv8y.fsf@localhost> Received-SPF: pass client-ip=62.174.94.155; envelope-from=eduardo@itccanarias.org; helo=relay.itccanarias.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: BF51C4624A X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -6.55 X-Spam-Score: -6.55 X-TUID: ur5rj1VkBBZu On Sun, Sep 10, 2023 at 08:19:25AM +0000, Ihor Radchenko wrote: > (defun my-org-capture-kill-buffer () > (when (equal current-prefix-arg '(16)) > (save-excursion > (org-capture-goto-last-stored) > (kill-buffer)))) Thanks for the proposed solution. I have tried it and it didn't work for me. Or it worked somehow. If it kills the buffer, then the buffer is opened again right after it is killed, jumping to the last stored position. I think this is because of the way the 'org-capture-finalize' function is implemented: ... (cond (abort-note (cl-case abort-note (clean (message "Capture process aborted and target buffer cleaned up")) (dirty (error "Capture process aborted, but target buffer could not be \ ned up correctly")))) (stay-with-capture ;; <- this cond is executed (org-capture-goto-last-stored))) ... It seems that the 'org-capture-goto-last-stored' function is called after the hooks so the buffer is opened again. This is just my interpretation. I'm not an expert in elisp.