From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id SFjpByv3/2CmHwAAgWs5BA (envelope-from ) for ; Tue, 27 Jul 2021 14:08:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id uKSQAyv3/2BIcgAAbx9fmQ (envelope-from ) for ; Tue, 27 Jul 2021 12:08:11 +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 7CEA1B445 for ; Tue, 27 Jul 2021 14:08:10 +0200 (CEST) Received: from localhost ([::1]:60584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8LsW-0002Qf-Nr for larch@yhetil.org; Tue, 27 Jul 2021 08:08:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8Ls8-0002Pu-Kl for emacs-orgmode@gnu.org; Tue, 27 Jul 2021 08:07:44 -0400 Received: from ciao.gmane.io ([116.202.254.214]:44280) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8Ls4-0006gl-Fu for emacs-orgmode@gnu.org; Tue, 27 Jul 2021 08:07:44 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m8Ls0-0009SQ-MM for emacs-orgmode@gnu.org; Tue, 27 Jul 2021 14:07:36 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Karl Voit Subject: Re: Dynamic block tables: adding prefix of "id:" to %ID Date: Tue, 27 Jul 2021 14:07:26 +0200 Organization: www.karl-voit.at Message-ID: <2021-07-27T14-01-26@devnull.Karl-Voit.at> References: <2021-07-23T10-42-47@devnull.Karl-Voit.at> <87v94yojwx.fsf@localhost> User-Agent: slrn/1.0.3 (Linux) X-GPG-Key: http://www.Karl-Voit.at/Karl_Voit_GnuPG_public_key.gpg X-Registered-Linux-User: 224337 X-Confession: Pastafarian http://www.venganza.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.25, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Reply-To: Karl Voit 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=1627387690; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:references:references:list-id: list-help:list-unsubscribe:list-subscribe:list-post; bh=AgfbgKMtE4hRKhm9efqun5LqEtBP/JeKXmLmPxaXMUg=; b=D7l7vAjLl6V+UOkTNH1c2YeB67hAPfsfVvBXe+91LhKLoMjIwPWjzSHxPimAZgMDEujGyv 8ugn5/8lwaH4gczaj28jOUbk3fAt+OBGHmxFrom8JZK7cjtj3M4ATAgxuAyj8XqwYSzRoM oEDyyewYRGLWFNmmuYucnPn10gYBH2FqmxxWMnRJtIXPhPKbJtr9HiABf8pMKgoEI9apmO YKybzY7AeAXgRSvf81jdENUDFtdedFDUybrLy4+SivQEBxiiQcJ1cNYcyy9YuSMGtvkxAU xHE7W2+dNA7tuZy0k0yHWJE2Lltice/jaoJ4QXnQ8qoA+iLuRq2zVIgbIUk3HQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627387690; a=rsa-sha256; cv=none; b=Ir7AlTVsVbn9RrfRVajuLV+wqX8dSsp7BViC48mxoONMbcOgnEKNm/IbxUPnac3NUpW6oK 1tpHSq7mSeipBqrAQ8e8nuHRwsNXNfOFfrcbdhUB7CmBWJBHkdC3kQ8xH3jrB8F1qgo82M wB9Ji8003ck74IqdmfGJvnBqC5CVDAtEVtUShGNjTfjj9DTeq4EamVLG/Q3+Jas5aAEsko srhu7kVe2ffSllc5ntVRPNiZymctg9ixWv6jhmx+i6FBhveBMDKskRAZRD0Q+6x70OuNDJ AgroDOKtBUor4y5iaf4LNlY+y4q+5104VyGe+SEhX4u2QSUz5X4p70msPyQOCw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; 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: -2.42 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; 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: 7CEA1B445 X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: 7ywvWJHWs75H Hi Ihor, * Ihor Radchenko wrote: > Karl Voit writes: > >> I do have a dynamic block table like this: >> ... >> | NEXT | [0/0] proj bar | bar | :bar:project: | >> >> Is there a way to get the ID column with working ID links such as: >> ... >> | NEXT | [0/0] proj bar | id:bar | :bar:project: | > > You may customise org-columns-modify-value-for-display-function: > > (defun yant/org-columns-custom-formatter (column-title value) > "Format column values for columns with ID-LINK title as proper Org mode id: link." > (pcase column-title > ("ID-LINK" > (format "[[id:%s][%s]]" > value > (org-with-point-at (org-id-find value 'marker) > (org-get-heading t t t t)))) > (_ nil))) > (setq org-columns-modify-value-for-display-function #'yant/org-columns-custom-formatter) > > Then, you can use the following dblock. Note that I renamed the column > name to "ID-LINK" > > #+BEGIN: columnview :id global :match "+project-focus/!+STARTED|+NEXT|+WAITING" :format "%TODO(State) %ITEM(What) %ID(ID-LINK) %TAGS(Tags)" > #+END: Thanks, this sounds clever and I think I understand the code. Although I would have preferred not to overwrite a function. I always have a fear that this leads to nasty side-effects with future updates. Without deeper knowledge, I was astonished that C-h f org-columns-modify-value-for-display-function did not lead to a matching function and C-h v ... to a matching variable. However, I set up following test file and it worked: #+BEGIN: columnview :id global :match "+project+focus/!+STARTED|+NEXT|+WAITING" :format "%TODO(State) %ITEM(What) %ID(ID-LINK) %TAGS(Tags)" | State | What | ID-LINK | Tags | |-------+----------------+----------------+-----------------| | NEXT | [/] focus proj | [[id:2021-07-27-focus-proj][[/] focus proj]] | :focus:project: | #+END: * Test ** NEXT [/] focus proj :focus:project: :PROPERTIES: :CREATED: [2021-07-27 Tue 13:59] :COOKIE_DATA: todo recursive :ID: 2021-07-27-focus-proj :END: ** NEXT [/] non-focus proj :project: :PROPERTIES: :CREATED: [2021-07-27 Tue 13:59] :COOKIE_DATA: todo recursive :ID: 2021-07-27-non-focus-proj :END: When I applied the new change to update a table in a file of 71k lines of org, I had to cancel the process after over two hours without a result. Before the change, updating this table took roughly 20 minutes. Therefore, this somehow makes a poor performance even worse. -- 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/