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:51:38 +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="19344"; 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:52:09 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 1knvx3-0004ws-4n for geh-help-gnu-emacs@m.gmane-mx.org; Sat, 12 Dec 2020 04:52:09 +0100 Original-Received: from localhost ([::1]:37236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1knvx2-0004m7-5L for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 11 Dec 2020 22:52:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knvwc-0004lw-LB for help-gnu-emacs@gnu.org; Fri, 11 Dec 2020 22:51:42 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]:51595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1knvwa-0004hA-J1 for help-gnu-emacs@gnu.org; Fri, 11 Dec 2020 22:51:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1607745098; bh=jk4UJyWvuAJugTjNJckKG9ZxeFAfSBgQ3nm4gVNdtzs=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=fnNbIbOr0GznU+c4faubQ1sbb5Kq6taUo3UYXXsLinx1stzgzFSZtyFyJiZIHtA23 iZhAkzlq3NAf/sX16kzDbAzpYZe9dxh4Ri5jC7jPvFJKU7UqYT9IegRC6UMcVciiW3 pUZAM4uIZ+jVr++hOMKOnREs97HGB2hu1mUcCIQQ= 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:51:38 +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:DrIMkNbgPsjhUKAT8xMYAGonaTniZlWKQ6sOWdsts6UQMGbAJyV2GD5wYKbAQeklDwAh/ 2XaUkj0wTttlCUnGLR1SNBIdFYexkerDfre/yyqlqwc+0NdHzQWLpTfyJkhgEbbLveZfFuEbtjzD VWv2vN2z1vtRVAKrHrF8QPvyeMQ2npVxQ0r5yTnadPmBy13jEFGRVzeZcIsQYSATzoYtlBrsBZzq JgiW9RLmkXPK9+12ErgCf5y84do/Xn3Rj71pJtQ5ny4cQNcZTD4N/u7F9l4NoLOiaNr/SmfUczBC Is= X-UI-Out-Filterresults: notjunk:1;V03:K0:F3F7NgTmko0=:N44coy1lFBsi7q77DqcgtB fiI6A32D8lb9H55LRAL2WoSAwO+jiDdAFKbxP/pFRtpoZlBQkjzZ/zsj68Geuy4fZ78bt4TUQ SyD2CqiJmxRF1BgkwiIO6N0fOTHLK9UOB3RPkpKgVO4Oid50FOgumWlBa32Pc6sSg+rOEzlQS xuuJjuXtNF6CVQASLBogm9sOOA52vP7RKgptwlB+Q00XOA5xD6t+oKgbZwgmdi+ApPARSriGz TEc06xOuUKcGFO8EMw/g23hEoKnkU8W9BzUA6n8Td1RtlgeCiicUNaNarQ/P4TJNB9/EartvX 5YFaHa/zzOQgsHahgPYjWixbLz2xXiZb1y/nCNFlzb7VShTYS2BJ/qNus/Y2PLFIm7IuH1tgi z6w6uDdxAlXvN+Qh9PmecQbBCF3st7WkYxxToW13NtnUkrBmdgKRX7peZiDqfYxnV31N9iuec Pgoa7jH60o36hGI3CMoHL6uS2PAtwXhT1Vc5KU0IZawkDUpR+ZFp1hW3lFY1gdPZ5Dp4KGp7l 06l1jYz16vrkcnWAZGRgR1+zRXhn3xGDV6kULEG1+Jya2RP0nMGNeHAVLY7exLcLTldBz8lkh KiejCBradQjQs= Received-SPF: pass client-ip=212.227.17.21; 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:126278 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. I thought to first append the three lists, then transfer them to org-capture-templates > 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). 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)? Because I could have various template setups. This is for writing. I could have others, e.g. projects, archaeology. I could use a keybinding to loop to the one I want to use, rather than sticking everything in one. > Regards, > > Michael. > > >