From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id uBJZLMd9dmLV7AAAbAwnHQ (envelope-from ) for ; Sat, 07 May 2022 16:10:15 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id aJSRK8d9dmIBBwEAG6o9tA (envelope-from ) for ; Sat, 07 May 2022 16:10:15 +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 482EA27A12 for ; Sat, 7 May 2022 16:10:15 +0200 (CEST) Received: from localhost ([::1]:58248 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nnL8P-0001Tr-Il for larch@yhetil.org; Sat, 07 May 2022 10:10:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nnL7k-0001RI-25 for emacs-orgmode@gnu.org; Sat, 07 May 2022 10:09:33 -0400 Received: from mail-io1-xd2d.google.com ([2607:f8b0:4864:20::d2d]:33619) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nnL7i-00031w-EG for emacs-orgmode@gnu.org; Sat, 07 May 2022 10:09:31 -0400 Received: by mail-io1-xd2d.google.com with SMTP id i20so10886259ion.0 for ; Sat, 07 May 2022 07:09:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=jxHPCofJ+j2Ja4TIPrZZ29L39QPItXyg5Iou0DIFiA4=; b=YRnbxteL1p6HEdxCo8gEhjdna2hZLSUky4Y1mtrN7escp+3FnSnI9i3txPLDal7irW GDaxgnojTu6p+7qmxW65czxQfkZCVQzNFTsnnVRk3YtUfZifGozIimjC44pxA7EdGmF4 59SLvdK4k9LhSWvI9iH9q1VbdcCHSed8Yn7aqSS35RTW7wR9buOi+mYADW9kphKE1Odk VvARo+Czi4we/4V629bYAZ7E91SAiwDU22miR3dlV86q+yvE8tU4YqSegQ1tn74fT29V QiEXIZ6y+TTCkKBVIMTT4/A/bpSH3O1bp/sxTPu5edW800wgB4ga26KF5xCGiBKijZJW EwSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=jxHPCofJ+j2Ja4TIPrZZ29L39QPItXyg5Iou0DIFiA4=; b=UhHyxiItewiYECwGstmcsU5hlqlH0jLteFVxkQjrQwugQg9Jyi1xAxSdq3B6PY/gbr kA01yxkm0hY7ZI3Te041/ZJsc5M529rrzIwjNO/44X2BDN8m/iH1Jn932vFgLbYiN9qu RI3zNyjIWnGmXnQqrMeiYoHKfdcQPxaTIIlHt0Admk5B5xmugzcgFe3p5TmADdL8juJr bn87QRH6a94ACHEQp1Zwq1teRhu/qcFdFVQZz8FIcrDSwb8+lvfTsX4v21l9hOks0w3g y5EycMg1XXdJnSV1UwlnKUiNZVHOP1VHM9eW8/ru2XbS9qUpWvLzBpmQzrIGPO+ZDc2h 535g== X-Gm-Message-State: AOAM5325f4TFsKFuoEaNbQ5BqXzn4GggWG8TKolT0G6D+LtbZwHmKxeD R9qnxUgXtfHYtrJ3MMYNNqbvVq0vsLFoAQ== X-Google-Smtp-Source: ABdhPJwVoLqwgBc48oUoLIiCAinQPhep7fXxgP3jfl3n8eyyfMI6nqOHRCRgZzF1GPc39vnBzgXnfA== X-Received: by 2002:a02:5d47:0:b0:32b:4387:51c8 with SMTP id w68-20020a025d47000000b0032b438751c8mr3626751jaa.103.1651932568435; Sat, 07 May 2022 07:09:28 -0700 (PDT) Received: from tyler-fedora ([107.161.129.166]) by smtp.gmail.com with ESMTPSA id g14-20020a02770e000000b0032b3a7817e9sm2107530jac.173.2022.05.07.07.09.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 May 2022 07:09:28 -0700 (PDT) From: Tyler Grinn To: John Kitchin Cc: org-mode-email Subject: Re: Concatenate properties References: <87y1zfk3ls.fsf@gmail.com> <87zgjuis8z.fsf@gmail.com> Date: Sat, 07 May 2022 10:09:25 -0400 In-Reply-To: (John Kitchin's message of "Sat, 7 May 2022 09:20:56 -0400") Message-ID: <87r155igdm.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::d2d; envelope-from=tylergrinn@gmail.com; helo=mail-io1-xd2d.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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" 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=1651932615; 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=jxHPCofJ+j2Ja4TIPrZZ29L39QPItXyg5Iou0DIFiA4=; b=eKWakjCqPAZpVKymX4or19DXiU7Ilk/QfqRzwDP/Qyrli3YqbIYZEmMlOZwF9saQ6Q1cbI rUrMKvwGb7SkzwMgB4qRq01+YWEb4sMyIdXikLbYfAM9yejFE4cD706e2g00QOx9WA+kz3 dwLpEdz33WePRPJFgUTfuZB2eiKmBGCrMX2b8H/aauAqBrKFwb3Q61C7QkCnfmH8luJTGe dn65LCCoTHttFLwu3LFF1LMt77Yj+cbHKMr6RzGLIf63D7xWXKMXXzw6MLvHJKLZfGmsVc Bi2WMX5BiVFv1qbZR4ZTbqR9n6XgRv5+Nd7IJPd5xeJ/ltiYTGd+MY47n8cDNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651932615; a=rsa-sha256; cv=none; b=LQx0BOHYpcaD/Uf3PmsApigA6EiyqbFWQQfZ0jnUUyad4c/UKGaKC79KI2+BMqern/Aigy QfVsVTWS9RIfcrrdnttKIS5TDR0f9xXNhVQgaybcjqEFNBCULk9txdtqLemXCyhKM1G5a+ sQ3c3UkvQ5mkwTDQ7870qxx54MhWsU1sdFzJHDGdJ4CfMJAIFqs0lLRbVchumOYTb7dedR euCdDSApShs7kAPJyIVF/ThqLlFxQ4GW6GxCqA0RMsFNk0nAfxEHhmHQyVLUFZOJtqVaNL KDvqGjN0HosG9N3SdjZaOnXBQukE5ynDoT575MJfwie/xs4Bmx2ylEHXyfZPUA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YRnbxteL; 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-Spam-Score: -7.10 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=YRnbxteL; 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-Queue-Id: 482EA27A12 X-Spam-Score: -7.10 X-Migadu-Scanner: scn0.migadu.com X-TUID: ZSCfKzICXlTM John Kitchin writes: > Where did you add that? > > John > > ----------------------------------- > Professor John Kitchin (he/him/his) > Doherty Hall A207F > Department of Chemical Engineering > Carnegie Mellon University > Pittsburgh, PA 15213 > 412-268-7803 > @johnkitchin > http://kitchingroup.cheme.cmu.edu > > On Fri, May 6, 2022 at 11:40 AM Tyler Grinn > wrote: > > Thanks for the advice. I've added the caret symbol > (:EXPORT_FILE_NAME^: > assignment-1) to mean 'concatenate' as opposed to + for 'joining'. > If > this is something the community would want I will clean it up and > send > in a patch. I modified 'org--property-local-values' to return a cons list with the car being the value of the property and the cdr being either 'concat or 'join. ;; Find additional values. (let* ((property-extension (org-re-property (concat (regexp-quote property) "[+^]") t t))) (while (re-search-forward property-extension end t) (push (cons (match-string-no-properties 3) (if (string-match-p "\\^\\'" (match-string-no-properties 2)) 'concat 'join)) value))) I used a single re-search in order to maintain the ordering of properties, ie: :PROP: he :PROP^: llo :PROP+: world produces 'hello world' I then updated both 'org-entry-get' and 'org-entry-get-with-inheritance' to 'cl-reduce' the cons list into the final string value.