From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iI+jEni2K2I7LwEAgWs5BA (envelope-from ) for ; Fri, 11 Mar 2022 21:52:08 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id cLBID3i2K2K1sAAAauVa8A (envelope-from ) for ; Fri, 11 Mar 2022 21:52:08 +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 D551031648 for ; Fri, 11 Mar 2022 21:52:07 +0100 (CET) Received: from localhost ([::1]:52456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nSmF5-0008AB-1U for larch@yhetil.org; Fri, 11 Mar 2022 15:52:07 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40640) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nSmEa-0008A3-Hh for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 15:51:36 -0500 Received: from [2607:f8b0:4864:20::536] (port=37671 helo=mail-pg1-x536.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nSmEY-0004KR-Su for emacs-orgmode@gnu.org; Fri, 11 Mar 2022 15:51:36 -0500 Received: by mail-pg1-x536.google.com with SMTP id bc27so8407337pgb.4 for ; Fri, 11 Mar 2022 12:51:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version; bh=9L+4q1FAS0CH0x8buMBYKRQOEu96/AyCT4HCMyO8zeo=; b=H72w6A4LtZsMj9BMIkqzSY66rhLVt0MvALfs/QO3niP18CkhzS3ea9xa3DSXsrVbih jLWtG/CQHjCTcalvSFNq3k3XLCGxbCgWl9IjYC7Gy2nCpYU0cwfVopaG+yT3LC0//fQS TVQMAmKU2KOghGr2yUcBWUrure8pX/s/bMy/IURSz/wpv1VY2MvUb+1yC8uiNiCEOcI6 igmREJ7nx/9+8EV9wWO8QGdOXEHBpxIZSCyw2gFcFfD4gdIcsKqyrEoS3e7G+9KponWM sUpYuBTD/pJ/oY9gwazDdCNdEl2coxpJI3BaTkwQBfIssB+HFkoIyFzUTXgZ/pkMqG5c 4Pyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=9L+4q1FAS0CH0x8buMBYKRQOEu96/AyCT4HCMyO8zeo=; b=vuuEHFXJE43S4ALdhEibz950TDOPYRnlPX9Gbh5notnzSVYPRZf6nym3n1CodcVN5k mOdL/zeRAuaH7zs6U+Zuu8L/BSgyzAzs1dzhyioO2WGSPm7mz5PokQWxq2J/wGbfRIRS w9fv1Wb6ftSmf7H9/NjGPsCQt1ShYK9bdZpkL6p6QbQsFTNZgT0/Ay09aVclz0ic2Ihy bI7veuFoX5TYoFWQrEjE1hEssVR4FlvRjm1HENAtpcgSI1DlgyjdayMKpgVdY5ou7iyi n23EjRI8ASFoEQMQ/a1JGkgRhuyqyQR4twNRNVyMnV6jgjV2hEZ41unZlBDJ8NuEDlaX EEmA== X-Gm-Message-State: AOAM532W2X+oLTsp8VxX7ghUZATCNSxdp5LLp4sIUcGqtHiEaI3ylRkV nJosW0L3hnnYVTVLTKPbGnO2h38p4J1vwQ== X-Google-Smtp-Source: ABdhPJygdOWU9YnM9u3do0vrdh4hXQ2lKS0YXpb/e3s+ORFtkHB8aVZ8FBPM5Uv+nK8iuUnKbZjZ/g== X-Received: by 2002:a63:f412:0:b0:381:28f:85dd with SMTP id g18-20020a63f412000000b00381028f85ddmr5738054pgi.319.1647031892703; Fri, 11 Mar 2022 12:51:32 -0800 (PST) Received: from dingbat (2001-44b8-31f2-bb00-cb63-738c-eb69-f04b.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:cb63:738c:eb69:f04b]) by smtp.gmail.com with ESMTPSA id z23-20020a17090a609700b001bf5a1830f3sm10248987pji.10.2022.03.11.12.51.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 12:51:32 -0800 (PST) References: User-agent: mu4e 1.7.9; emacs 28.0.91 From: Tim Cross To: Ignacio Casso Subject: Re: [BUG] org-capture autoload bug? [9.5.2 (9.5.2-gfbff08 @ /home/ignacio/.emacs.d/elpa/org-9.5.2/)] Date: Sat, 12 Mar 2022 06:59:50 +1100 In-reply-to: Message-ID: <87mthw8b74.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::536 (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::536; envelope-from=theophilusx@gmail.com; helo=mail-pg1-x536.google.com X-Spam_score_int: -6 X-Spam_score: -0.7 X-Spam_bar: / X-Spam_report: (-0.7 / 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, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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: , Cc: c.buhtz@posteo.jp, Max Nikulin , emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1647031928; 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=9L+4q1FAS0CH0x8buMBYKRQOEu96/AyCT4HCMyO8zeo=; b=THf+T7CtjTkhSqyHGRHhncQN7DmOQJ482Ftc4FBzhGah0aUlUDz9AsW+1WA0tWE5uqqEAC OdyEx41zqVJ2zbgxAlftHoykgW4lyPQ/wvfqChf/CIKhAFsOw53D3OK+7Xu0tWC0BAvgFE 3WKTFlSC18s4GiZj2+rBfwh/D6yAs+d6F5Aw/2BxW5ZbyC6j1NC8XZDO2uVQ0LOnQduBIX kdetIb56L/CEmbnzx8v8A69cz5vztAyRl+GpakgOfm32KKQdC5mkF6j3cBI0WKrQp5uqFZ 8KBgKt20qsgQiO59mSc7FVzKalqZo0CgW2+OLF95FUKCuy4e/IfZ+Qsxsa1YRg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1647031928; a=rsa-sha256; cv=none; b=O8AxKfi99aiOtfNJa6JeQM3eMT85cWsS1PReccHOpttYcF+wb9ra2fBW8v7+bCDJpGoxpR f1eXViGlIOeB0uTcum+zjN3vnMWlyhybFQQa42wn4YxPfdyLxgny72RFfqDHTl3v/92878 imwD1U3Ka329glbLTDanbzFkfQ/E1VzCN3azXzi0w69zO8BvYCkz9I6vAd0dVafwNDHy6h vc4swAT/9X7UmdAYxdqfPmkvH/4vJTDZPS4ATAMCvI0cCp8BSJiMvsIYO/ND3qmTLaKIlO +JMrnKa7qLFIBIQiAq6fhkLC2khxS9RTkz3jVXitXtFlDpFZfCwiBDPniTU5KQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=H72w6A4L; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Spam-Score: 6.01 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=H72w6A4L; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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-Queue-Id: D551031648 X-Spam-Score: 6.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: IwtR4GRv0rls Ignacio Casso writes: > Max Nikulin writes: > >> Ignacio, I think, you can add (require 'org-capture) inside your >> function just before `let' and it would work almost as lazy loading. > > Thanks, I was already using (require 'org-capture) in my init file to > solve this. As I said, it's not really a problem for me, I was just > reporting it in case it was a bug. I was not sure since I don't really > know the inner workings of autoloads and custom variables, but since > this snippet works when org-capture is not yet loaded > > (setq org-capture-templates > '(("d" "default" entry > (file+headline org-default-notes-file "Tasks") > "* %?"))) > (org-capture nil "d") > > and this snippet also works > > (let ((my-new-var 2)) > (defcustom my-new-var 1 "New variable that did not exist before") > (message "%s" my-new-var)) ;; This prints 2 > (message "%s" my-new-var) ;; This prints 1 > > I thought that this snippet should work too when org-capture is not yet > loaded, and that the fact that it doesn't could mean that there is a bug > somewhere > > (let ((org-capture-templates > '(("d" "default" entry > (file+headline org-default-notes-file "Tasks") > "* %?")))) > (org-capture nil "d"))) > > >> I have no particular opinion concerning adding autoload cookie to >> `org-capture-templates'. Emacs has enough number of them, but Org has >> no such custom variables. > > I put an autoload cookie myself and it doesn't fix it, so it's probably > not that. It's the first time I manage autoload cookies though, so I may > have done something wrong. I only tested that the autoload cookie worked > by checking that before loading org-capture, org-capture-templates > appears in the completion list for C-h v, and I can evaluate it. While I don't know if this is a bug, it certainly doesn't seem to be doing the right thing from an 'intuitive' point of view. I would expect when a variable is bound to a value inside a let and a function is then called which uses that variable, the initial let bound value should be used and the result be the same regardless of whether org-capture has or has not been loaded. It means there is a hidden side-effect here, which isn't good and probably needs more analysis. If you had set the value using setq rather than as a let form, it wouldn't be overridden when org-capture is loaded, so why does it when it is a let binding? Might be worth asking a general question on emacs-devel? Stephan or Eli can probably provide some clarification here (maybe this is somehow related to the changes associated with the lexical binding stuff?)