From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GEbbEYyU5mMuzwAAbAwnHQ (envelope-from ) for ; Fri, 10 Feb 2023 20:01:32 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id OK3CEYyU5mPYggEA9RJhRA (envelope-from ) for ; Fri, 10 Feb 2023 20:01:32 +0100 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 DDCA3336BA for ; Fri, 10 Feb 2023 20:01:31 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pQYdT-0006Xz-2y; Fri, 10 Feb 2023 14:00:39 -0500 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 1pQYdQ-0006Xi-S1 for emacs-orgmode@gnu.org; Fri, 10 Feb 2023 14:00:37 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pQYdO-0002SB-T4 for emacs-orgmode@gnu.org; Fri, 10 Feb 2023 14:00:36 -0500 Received: by mail-wm1-x32d.google.com with SMTP id n13so4498398wmr.4 for ; Fri, 10 Feb 2023 11:00:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:date:references:in-reply-to:subject:to:from:message-id :from:to:cc:subject:date:message-id:reply-to; bh=seCZRnrddKLhjXkSuAj6htJ52E3lBzHzBSsWXAmChGs=; b=FM3s6b71FOZymVUZOYVjTdnaQcEo4dS9em9wyl9wTzfTYt6c78Ydy1XXPmCTPkLi/L wjkjllNRwWLCvefSSiSESBDUkQbD4vrLWHz1hJgUC2gqfm+idoOKk1z/BtlGT/EM+7f+ 3DoNxVsINS6cBWD0nH2F32kMdtLTdEDgFrBM515GLdUTjaxtgzKMmKooq5lMu26iP5xr g3sQzuwDPKrF5XylMakAf09az9hJAfcdl7h0v8ahPwEe2pj51tmN4V4V0Q3SFwFfIrxw G+boBNAsOBLpJrtlKa4NsOwQ2ij3uJqS9XNS6tAGNsFkGCqH36m6gvMQjacNTMC8atJI gXuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:date:references:in-reply-to:subject:to:from:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=seCZRnrddKLhjXkSuAj6htJ52E3lBzHzBSsWXAmChGs=; b=FaqzjOCIthJwbxptbe3ekRR/q5o3q4K2c6THdyswiL2KTK0q1AR7f8Q3SCyQG5A3lD aDUbZrrmuJ5NKoTUJAQMfw9nQMxu4HwGJfXNWHTwDauBJJCAAlVy43Cwu6Fgm1lTvJLe 1qzlJjjq8mNEXBBCpnd1J62dJnkNIs/HyfvCznNcTYNL4SNQ7OXFqzxLo7qTcf0J+Wsw 9eerL3OpgOpO7ScGeNPShkLoVMEQSGp534hIpRWuzh48fiIAerLN9muhw0c79e9K3vdP JKzencFMVzLLzfDDZqe6wzxiRFEoauWMI5RWGYWErlDvODmGYK8K6sWdf0LbYTM4Wo4L +kXw== X-Gm-Message-State: AO0yUKUqQtnyWQIo/2RT7e4Q3QFzpceH/fsdzKqjzdH6PxZ+Xy5Pvg5B 6IS4Z6gSU28jjurJql+kwK8= X-Google-Smtp-Source: AK7set9mgH471aGW1jAZU8qGDb974QgWLjpPXgP0nv/r3q2p5wmL0cnhEHmelxrmgOOlqeas3MeAig== X-Received: by 2002:a05:600c:4586:b0:3df:9858:c03a with SMTP id r6-20020a05600c458600b003df9858c03amr10743175wmo.15.1676055632938; Fri, 10 Feb 2023 11:00:32 -0800 (PST) Received: from keynux ([2a01:e0a:505:3460:169:7511:f49a:58eb]) by smtp.gmail.com with ESMTPSA id l22-20020a05600c089600b003dc59081603sm5333095wmp.48.2023.02.10.11.00.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 11:00:32 -0800 (PST) Message-ID: <63e69450.050a0220.9052f.652e@mx.google.com> Received: by keynux (sSMTP sendmail emulation); Fri, 10 Feb 2023 20:00:30 +0100 From: Bruno Barbier To: Arthur Miller , emacs-orgmode@gnu.org Subject: Re: Problem with let/cl-letf binding stuff with org-capture In-Reply-To: References: Date: Fri, 10 Feb 2023 20:00:30 +0100 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=brubar.cs@gmail.com; helo=mail-wm1-x32d.google.com 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, FREEMAIL_FROM=0.001, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1676055691; a=rsa-sha256; cv=none; b=TpwunYE4+P45/0NCjwxjksBnI0uaUUHp4hyq5onONFbe/2RlE5GneWlL76+nHWjGc0t2rQ UOGvyARlWfBfS832Z2m671xrZq/F5jE3uhg7IcWe0qksPKcsgm0mqOtcVnqjDq4ylPty3L XF88Nyw37bX4S1lA1+uOSoBX+VyFzfgxZTJ43NSQ5BcPNf9UN43MB3UVWmXsZX/RW3jlvx QOvQM7rktzTs+r/aPlbw8yDErXskq97WE8TmbWNq4HX1uEU7T9WZeaNnO1PfGgG4ykG30R NSLSrD3ug8RNLgQcvL17s0pt0TmqD0vrvDNxzgVzUeGMvv/xoA8CvnaRLKac6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FM3s6b71; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1676055691; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=seCZRnrddKLhjXkSuAj6htJ52E3lBzHzBSsWXAmChGs=; b=PXPGUqUmiguDfYJZcBdAyMxQeb/LISDeCCulDHsYGr2Jmidhzfe4L83UB81f/0s4uCd6YY alsBFx3OD2NuQ1m3mvbZa6rddl/zrm867CuBH432N/i3RmY5nFhXGIFns5/8WbsAAtle3g lLgkV1BHySz0KHU7zaf4R6m55vySxuOYRKVGguXndIKc5YI6iM5U+B1tzdEmGHsYvl4Exc HOWz/ibEQE07zSqoMTK5JxeJvunf/4/Qs2pKJ+4klmAP46X7PJ8PHm54wBISVN7aWLwuFC t/wkMM52peLVEnnBUXlTfo+HRrzQyHluSRTXh4xM4+Zqli8de+jMhQRzjGc7NQ== Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=FM3s6b71; dmarc=pass (policy=none) header.from=gmail.com; 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" X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.81 X-Spam-Score: -4.81 X-Migadu-Queue-Id: DDCA3336BA X-TUID: c7uzvCcYE1ag Arthur Miller writes: > However I see that the binding for the org-capture-finalizer, in capture buffer, > is still the default 'org-capture--default-finalize' and not my lambda. > > I am really not an expert on emacs lisp; and I do understand that this is > somewhat "creative" use of org-capture (to put it nicely :-)), but I would like > to understand what is going on here. > > I don't understand why let-binding here does not work? Your bindings probably work. But, as the function `org-capture' just *starts* the capture process, they are removed when exiting the 'let', before you even begin editing your capture. I'm not sure I understand your use case: if you have a piece of org text, you can put it anywhere (possibly using refiling). If you really want to just get the piece of text, you might be able to use the hook `org-capture-mode-hook' to replace the key binding to 'C-c C-c' in the capture buffer, so that it calls your own function that will take the string and call `org-capture-kill'. Note that they are safer way to modify Emacs behavior than overwriting the functions. You can usually use hooks (like `org-capture-mode-hook'): (info "(elisp) Hooks") or, if it's not possible, you can advise the functions: (info "(elisp) Advising Functions") Bruno