From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 gJOIIiGh/WRRWAEAauVa8A:P1 (envelope-from ) for ; Sun, 10 Sep 2023 12:57:37 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gJOIIiGh/WRRWAEAauVa8A (envelope-from ) for ; Sun, 10 Sep 2023 12:57:37 +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 B1C4D4627B for ; Sun, 10 Sep 2023 12:57:36 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="VkC/j/Ey"; 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=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1694343456; 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=gzDP2g70wjKArfZwzwrMS9FsoBTx67wSkJVu95xXYm0=; b=pZEv1iXDFQmRTY2QxVohZ7A6XnS952CGNv7UHjGYY9pfrbNUKwz+unhB1RwVB9znwX3GU3 VfMkrPqeCjs34Hk99af4nyU2btVYjuPZ2HDyBXfbPcLf+DxqnhynLfI9gtWPtWBYGr2djb XrfgRK4LEjWE9NkxeQHJQrAdKAnzv+JdtwQ1Jzc9+KSou7/nQKvazKs/KHCeLCsWWpTEcR R3rmz2SplEUaU6huVWlc4ySpRKGEijqDz1P/FGFJUE+9MzW1UW4riuCY15keC3TP4gjuuO NECJNazxb3fMmOxbWwqQdse2s/gQyWwKuLtSfFLCFcE//eGkOs43XGkC06jbtA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b="VkC/j/Ey"; 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=none) header.from=posteo.net ARC-Seal: i=1; s=key1; d=yhetil.org; t=1694343456; a=rsa-sha256; cv=none; b=mU1h1+/UFOjA7RDvWzkyO5l5IxY1WMvm30MohO5xC+i3mM1buNmi6C+cevFpf/Fxm2olTV eW3A0OejEG1fYavae9WHuXXpVD+xcqC0MaVoCvO1OEN/7p1b8a8IAZffOSX9XTZMfVlURU il3AUudH8esLE+9TVYfT1ULklPpk60qRDxFIV84eERaHNR5Wn2WrXcDIiVTGmarsacRIh+ IO1/2cjz/3W5CmxjnvD33Mqau0GAHSY3UcDDv8g8uAJKKDx3pxDCH4juWAuFD8T38owXV5 /OeRO5xSQLPN1TcsUFLcrRq8QXIoeE9LWqvJJZf29cZB89Dwn9Un2djz+jUd6A== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qfI7Y-0000s6-Nh; Sun, 10 Sep 2023 06:56:52 -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 1qfI7W-0000ry-CQ for emacs-orgmode@gnu.org; Sun, 10 Sep 2023 06:56:50 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qfI7T-0003wt-Gt for emacs-orgmode@gnu.org; Sun, 10 Sep 2023 06:56:50 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0AC37240103 for ; Sun, 10 Sep 2023 12:56:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1694343406; bh=WtmNApTuPv0vMRPGBtmnIZ+t3se9yBlsUVLQi6ejlE0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=VkC/j/EyhYE3hUwrySGgxqBnocZZnR82VRtHkuUlLCZhKodhQCQ/5PMO9rKsOcn0Y zbgruJE8iTSeH1Rval/Ga6luU0UPsSu81cFB+3rkS1cv0fayVbdaCM+993U9Zk07rP U+EVmi5wUVuMWiHSHNSiCISe1RThdAidRS8Ef+chEak15BdCYUIXHTETJfdnV7R9g+ cgvy0mb2rnTQxCeM345cnkamXve/WRuOs3T8NVgEyG0y/EMplA04q8e3IaUwuM7uPK 3pywUawn6O+MD7tqhtiK3nttf8GQ81Q+RnteLZB9elINIFQDRypmScxMmYcL7Pbp1x j2i/b+v8Hmp7Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Rk6H134Bcz6tyL; Sun, 10 Sep 2023 12:56:45 +0200 (CEST) From: Ihor Radchenko To: Eduardo Suarez Cc: emacs-orgmode@gnu.org Subject: Re: Feature request: kill-buffer for org-capture-finalize In-Reply-To: References: <87sf7o987k.fsf@localhost> <87pm2s96xc.fsf@localhost> <87r0n77li4.fsf@localhost> <87h6o2jv8y.fsf@localhost> Date: Sun, 10 Sep 2023 10:57:46 +0000 Message-ID: <878r9epa6t.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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: B1C4D4627B X-Migadu-Scanner: mx1.migadu.com X-Migadu-Spam-Score: -6.43 X-Spam-Score: -6.43 X-TUID: g1CzrcbRlksw Eduardo Suarez writes: > 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: > ... Right. Then, what you can do is (defun my-org-capture-finalize (arg) "Like `org-capture-finalize', but kill Org buffer with double prefix arg." (interactive "P") (if (equal arg '(16)) (save-excursion (org-capture-finalize) (org-capture-goto-last-stored) (kill-buffer)) (org-capture-finalize arg))) (define-key org-capture-mode-map "\C-c\C-c" #'my-org-capture-finalize) -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at