From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id IOlUBkV9/WAHfAEAgWs5BA (envelope-from ) for ; Sun, 25 Jul 2021 17:03:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eP0FAkV9/WBgZwAAB5/wlQ (envelope-from ) for ; Sun, 25 Jul 2021 15:03:33 +0000 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 34AEE7966 for ; Sun, 25 Jul 2021 17:03:32 +0200 (CEST) Received: from localhost ([::1]:41804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m7ff8-0003qp-UP for larch@yhetil.org; Sun, 25 Jul 2021 11:03:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42788) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7fdV-0002h7-RL for emacs-orgmode@gnu.org; Sun, 25 Jul 2021 11:01:49 -0400 Received: from mail.neuhalfen.name ([144.76.61.246]:49438) by eggs.gnu.org with esmtps (TLS1.2:DHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m7fdT-0000Bo-Nf for emacs-orgmode@gnu.org; Sun, 25 Jul 2021 11:01:49 -0400 From: Jens Neuhalfen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=neuhalfen.name; s=2019; t=1627225296; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H5+Hm7UNEcSQEysrYPxL6klZ8RJbx1N76Lrw+0yLQpU=; b=HprdvV3GX/8XURaJ8IDI/b8Ymmb94hTRGrF8IzgSuw2Qss8ESFol/Xyk1xfdA7dSAOzHC+ FgGM4Szi/PU7ZZvg/s7TDCf47YaL31vB03s4v8rctjMxm+cUl8wXhU8GKWbz6LIFZhsL3n hIN85S+Rk6o7FkD5CUl05DPIJEKX1yEXUgaeWgZg4Qy2COZTJ3J0Ft/Q+2ncNseyUIWnMK p+B+fVhnYFaR7lnY4n/1o36OWTWsL8slYavJdugQZnjdxgbh7R+JAtdNuT96wS9Gv/jGBg XkGWwNEJrzNf6kQXESpCERl/sCcx2BJeZMaJ/g17Nehj/YutG8bjgC6shq/jgQ== To: Karl Voit , emacs-orgmode@gnu.org Subject: Re: Dynamic block tables: adding prefix of "id:" to %ID In-Reply-To: <2021-07-25T08-23-28@devnull.Karl-Voit.at> References: <2021-07-23T10-42-47@devnull.Karl-Voit.at> <2021-07-23T14-54-25@devnull.Karl-Voit.at> <2021-07-25T08-23-28@devnull.Karl-Voit.at> Date: Sun, 25 Jul 2021 17:01:35 +0200 Message-ID: <8735s2bfow.fsf@neuhalfen.name> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=144.76.61.246; envelope-from=jens@neuhalfen.name; helo=mail.neuhalfen.name 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, 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.23 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1627225412; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=H5+Hm7UNEcSQEysrYPxL6klZ8RJbx1N76Lrw+0yLQpU=; b=LZvpf3s4Ie/5MQCLrkfSlXvvVYeqLBm4aV0JFjqyjfFTuOoC6ruwjLu8hA39yBMfLa668x qEME8jWhe0Uugvty95c+I9T4DpEdGvjbV1CCQMoYkTOjb7Go0/RmQn5wBUAlZkCNHsYVdv G4R9ydY7AOzaxyZc7w7iWhSdoe0H1/he8CCvyshFgw/B7OQmhRplDSuzdd730M2fmymfLl XazOJgnDnESzMh/9F06/NDZSLXP1lIY9w5dXL/x2t8AEEDXU1NzxPpXH7Goi1ATb6IBHJX 8keMY28AxdoHXAnklH9sd5qhxzGFREKTjxQcW5h97fYMQWzddtUKNh9d8rBuIw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627225412; a=rsa-sha256; cv=none; b=LREAZt5B6YRPpUpkHjjOg2DjLMkfOjOHrKMY3tqHxQPJTReiDEQOcD/vIaNZ2THFpxkxeM 3q8KflczsJnxFpsA+BXqicXXOH5RP6OscO121Amrx2QiKRXXIlXJrzurN94KVyjz8cAJ19 +N8RBKfsr0Xy85pHpeKl+OaK8kVzc+8uFgwxxQc5If6FBeZLqKyvv8Y1YiZzOowCWYlPYA I2P3pvFhTboFMicn4amqADMtqNMcG+6S6D/6Fil+T7aUGuOZJH8NWLSQ5B19FUzBqEX4nC E7k+VAnj6HdO+lGsSlip+Q+Ezr9J0s+ObJPgq6DFs9+L2ks8Rp293cOZlY6O5A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=neuhalfen.name header.s=2019 header.b=HprdvV3G; dmarc=pass (policy=none) header.from=neuhalfen.name; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=neuhalfen.name header.s=2019 header.b=HprdvV3G; dmarc=pass (policy=none) header.from=neuhalfen.name; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 34AEE7966 X-Spam-Score: -3.12 X-Migadu-Scanner: scn1.migadu.com X-TUID: NdFE+jRO7g1q Hi Karl, I use a wrapper around org-map-entries to create custom tables. Calling the wrapper takes a configuration for each table column. This is q= uite nice for other use cases as well, to e.g. convert properties (":TASK_P= ROGRESS: 75") into graphical representations like harvey balls. Each column takes the following configuration values: - colname :: The name of the column - entry :: the property value of the column - map :: a lambda function called with the value (optional) - default :: default value if nothing yields a non nil value (optional) (defun neuhalje/org-generate-table-from-sections-mapped (query default sco= pe mapping add-headline) "See my library of Babel." (let* ( (org-use-tag-inheritance nil) (title-row (mapcar '(lambda (cfg) (cdr (assoc "colname" cfg))) ma= pping)) (rows (org-map-entries #'(lambda () (mapcar '(lambda (column) (let* ((defa= ult-value (or (cdr (assoc "default" column)) default)) (entry (cd= r (assoc "entry" column))) (mapping (= cdr (assoc "map" column))) (raw (org-= entry-get nil entry)) (mapped (i= f mapping (funcall mapping raw) raw))) (or mapped def= ault-value))) mapping)) query scope))) (if add-headline (append `(,title-row hline) rows) rows))) #+NAME: generate-table-from-sections-mapped #+BEGIN_SRC emacs-lisp :exports results :results table :var query=3D'() :v= ar default=3D"N/A" scope=3D'file :var mapping=3D'() :var add-headline=3D't = :cache no (neuhalje/org-generate-table-from-sections-mapped query default scope mapp= ing add-headline) #+end_src I call it from my org files like this: #+name: demoprops2 #+begin_src emacs-lisp '( (("colname" . "ROW") ("entry" . "ITEM")) (("colname" . "default") ("entry" . "x-prop-xxx")) (("colname" . "custom default") ("entry" . "x-prop-b") ("default" . "not= there")) (("colname" . "link") ("entry" . "CUSTOM_ID") ("map" . (lambda (value) (= if value (format "[[#%s][%s]]" value value) "")))) (("colname" . "linked item") ("entry" . "CUSTOM_ID") ("map" . (lambda (v= alue) (if value (format "[[#%s][%s]]" value (org-entry-get nil "ITEM")) (or= g-entry-get nil "ITEM"))))) ) #+end_src #+CALL: generate-table-from-sections-mapped(scope=3D'file, mapping=3Ddemop= rops2, query=3D"+mytag-exclude") Regards Jens > Hi, > > * Kristian Gr=C3=B6nberg wrote: >> >> I didn't read your question properly. >> Would it work for you to use the "<>"? >> >> *** <> barheading >>:PROPERTIES: >>:ID: [[bar][barheading]] >>:END: >> >> /Kris > > I'm afraid not because the dynamic block would duplicate the > target definition and not generating a link. > > -- > get mail|git|SVN|photos|postings|SMS|phonecalls|RSS|CSV|XML into Org-mode: > > get Memacs from https://github.com/novoid/Memacs < > Personal Information Management > http://Karl-Voit.at/tags/pim/ > Emacs-related > http://Karl-Voit.at/tags/emacs/