From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Christopher Dimech Newsgroups: gmane.emacs.help Subject: Re: org-capture-templates constructed from three distinct functions Date: Sat, 12 Dec 2020 04:58:24 +0100 Message-ID: References: <87zh2j90jz.fsf@web.de> <87o8izzo2l.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7837"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Michael Heerdegen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sat Dec 12 04:59:26 2020 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1knw46-0001xV-Il for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 04:59:26 +0100 Original-Received: from localhost ([::1]:39668 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knw45-0006E3-HH for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Dec 2020 22:59:25 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knw3E-0006Dr-15 for help-gnu-emacs@gnu.org; Fri, 11 Dec 2020 22:58:32 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:52455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knw39-0007jH-3p for help-gnu-emacs@gnu.org; Fri, 11 Dec 2020 22:58:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607745505; bh=a0oU26G1IUPcbykdA49vacjKFF9ymY9oDqs0vXEgA5U=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=e7VYfCkT+YgRSa7TLN9al8SHwcUZAhozUYQ+kYBvKNM9mnW44fmSH1OdIYWsRYoAC wozYXKdm/pk0w/XQR0wlfGMAIc5RxwPlXy4BWb/7KkpmsFqgC82Tyo8mUNhmPUp4gv WgAVMh909LiJYVrZHAn3XKjXQLq+FKRYwxnMTHks= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from [213.165.168.94] ([213.165.168.94]) by web-mail.gmx.net (3c-app-mailcom-bs06.server.lan [172.19.170.174]) (via HTTP); Sat, 12 Dec 2020 04:58:24 +0100 Importance: normal Sensitivity: Normal In-Reply-To: <87o8izzo2l.fsf@web.de> X-UI-Message-Type: mail X-Priority: 3 X-Provags-ID: V03:K1:LzBBulAqYqSNCL9j58q+mdHoTS7ef8Tgge2SxXLjIm3GKKMUrol+QngakkG1okoFVMWY3 6nZY9Wsd/DhFKVPPpKx4A2+RRO4WgPrDzZZ7AbDLn1rg0QgsL60kv4nv8+Rkc5RLd2yT0l8X7ozk LtINIwz0H1h/ki6dt4H/qpIihLSz8E0T2tTFz3sPaKxxfnuR3J0VsKP20bnbD34SOoVcRiKnZD7U dubEWmHAJw09iqashhENFXleyC3XYXhMMxXBJlCovzFWk2cK2EEBtVAnvDut5V3t8VWdmV3p1N+u to= X-UI-Out-Filterresults: notjunk:1;V03:K0:rS5q2KVlgZE=:7E9KKAsJMhVeagDax2Umot 2epaNkl76Jk4x2O8dBJhyjxTemhQ61NzOwLOF3ZuKL8apcNAEOiVzXuGrzbG0wSlg/zpoBH6Y e11eylgDytogXvYvxwnbx61iKlQy5+ElgNpoUJ+2upNT17ej+j4ZYDm302pK2b5hsy4gwo7YS ZL8hn9+hzrmbfd/ARl+/cqpbuZu6O+Kddez/JaqC57f5euEhrU4JZvoV5CtG+2mQFVLQ2BHH1 sejkkWACFISN3Kv0zFR3159v6B/CT+kZ3jreM61LCsOx3kJRikdZral3VBb3gezMQHS70l8Z+ VvgJBOLocCTuQbxrG70WVz6VCq4TdXT36THNIpxNahK4L1T72xCtcB97xBejLkpjqsAHkixY0 Ysc1pzdRl0/2iAoaIbolhHELBC21WxitbqxOfu/hcbm8zH9mL/5XAhij8sZPX9n5FA1OW61V6 iho4IHN936Z7LpMRO2ctGc64TWW8LmbMl/tUkbHek3lF0wqD/ttwxPab8j9Sk11lP63xCNFXf teGbbU1QmnMivVQ8FKq0fHdD7j0Dj75rGSOTIna/H++LcphXXs4p33MD8/jTdIfMwUYEMTau2 KKZ2UOqPmURsQ= Received-SPF: pass client-ip=212.227.17.20; envelope-from=dimech@gmx.com; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:126280 Archived-At: > Sent: Saturday, December 12, 2020 at 4:43 AM > From: "Michael Heerdegen" > To: help-gnu-emacs@gnu.org > Subject: Re: org-capture-templates constructed from three distinct funct= ions > > Christopher Dimech writes: > > > (defun captr-tdr () > > (interactive) > > (setq org-capture-templates 'captr-templ-tdr)) > ^ > You want the binding of the variable, that quote is wrong. > > Appending template lists has the problem that you get copies added if > you accidentally reevalute your code. > > You might want to consider to use `add-to-list' or `cl-pushnew' to avoid > this problem, or, alternatively, interpret and handle > `org-capture-templates' as an association list (with the key binding as > key and the definition as value). How would an association list look like for this one book template, if I m= ay ask? > Then you could use `setf' with > `alist-get' to add or even modify or delete entries. This is a very > clean and convenient but more learning involving way to achieve this. > > BTW, it should be possible to use buffer local `org-capture-templates' > binding. > > > (global-set-key (kbd "H-c") #'captr-tdr) > > Why do you want to use a key for this (instead of just evaluating the > code directly in your init file)? > > > Regards, > > Michael. > > >