From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id QG9tOFqzAWFOUQAAgWs5BA (envelope-from ) for ; Wed, 28 Jul 2021 21:43:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id SOUCNFqzAWH1QAAAB5/wlQ (envelope-from ) for ; Wed, 28 Jul 2021 19:43:22 +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 EF7BAD668 for ; Wed, 28 Jul 2021 21:43:21 +0200 (CEST) Received: from localhost ([::1]:37634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m8pSa-0001Vm-Kr for larch@yhetil.org; Wed, 28 Jul 2021 15:43:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36284) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8pS0-0001Vc-Ke for emacs-orgmode@gnu.org; Wed, 28 Jul 2021 15:42:44 -0400 Received: from ciao.gmane.io ([116.202.254.214]:34522) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m8pRy-0003XU-OV for emacs-orgmode@gnu.org; Wed, 28 Jul 2021 15:42:44 -0400 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1m8pRw-000AYX-Ij for emacs-orgmode@gnu.org; Wed, 28 Jul 2021 21:42:40 +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: Wed, 28 Jul 2021 21:42:34 +0200 Organization: www.karl-voit.at Message-ID: <2021-07-28T21-39-15@devnull.Karl-Voit.at> References: <2021-07-23T10-42-47@devnull.Karl-Voit.at> <87v94yojwx.fsf@localhost> <2021-07-27T14-01-26@devnull.Karl-Voit.at> <87wnpc0w86.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: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=1627501402; 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=JKzm2V/FQIZVeuOeQAPO9nbd7zDjrpsw1vIdaFYeFcI=; b=TFq4xXq13OvKk4w5kRDkukUjnrko5eU8SmYzEpwa319azwyPWdSyZbTVwf8v/CoKGEaGtk 5jq3d0cLtfcCvfJnwo5YxkmII2tsHxlJO4FnZYfF23hjH4q8hpH+ZBNtaw8R5NecGXZ5yL 8OfCECg6SK0AFekkBh59Kx7hdMrkxrU1xNqTDf2pDWBq/MQRnMghit45bpaFGQvAFmT8eb gJ/urp0Z/3Nk7NS2/X/Jp/2qgNWtMRHI1sqLO56j1/HPvVzIUBP/muQiec6KfHfkN35vge 7LK1xaySe35C6LlNeh6bP8I022hR22GaccNm+GI4ZsDD9VwpJFI8dQR5EUHB7w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627501402; a=rsa-sha256; cv=none; b=Tl0W9FWJMMzyFp1mTdMGMicSDkLJ2TKGsjpYqX8c6Lvlrk3s6rwW4RXmiF8dmvuoi/vuqX BiIhY6GFnm/nMv/rBZSv65qshs3DV43xQ4LJ13GeSX3z3CNW45gS5Fd97V889BF9MoHUHv S9gCBRFml3WmC5Knqn4LTK8xBqN9PrS+9Jde3cDnrBSFK98pAs4YMgN64gmIPMcPpfgZ/M r19++jCkIb4itxszw/eMLzoOkTKodwiSBSVVaak7CDCf1dSeQWlWGCiX0OMg/TdiX9+Rj7 Gv7/rYruodcsnag6pTw/x+3sYKf5y6Cik66t4dxIUiU1hkh8SDRQSzcXOR9Pkw== 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: EF7BAD668 X-Spam-Score: -2.42 X-Migadu-Scanner: scn0.migadu.com X-TUID: /8VI86PzmCF5 * Ihor Radchenko wrote: > Karl Voit writes: >> 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. > > That's not overwriting. org-columns-modify-value-for-display-function is > not a function, but a custom variable defaulting to nil. You have all > rights to set it to whatever you wish. Oh, this is reassuring. Thank you! >> 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. > > Hmm. You are right. This should be a bug. It happens because > org-colview.el is only loaded after you actually run column view or > corresponding dblock. Before that, Emacs is not aware about this > variable (unless you require org-colview manually in your config). > >> 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. > > That's probably because the function I provided tries to compute the > description part of the link by querying the headline for each result. > You may get much better performance using the following version: > > (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]]" value)) > (_ nil))) I can confirm that this version does not have any negative impact compared to the version without your code. If anybody is interested why this is taking roughly 20min to update one table: | - command-execute 553233 93% | - call-interactively 553233 93% | - funcall-interactively 553233 93% | - org-ctrl-c-ctrl-c 553233 93% | - org-update-dblock 553228 93% | - org-dblock-write:columnview 553228 93% | - org-columns--capture-view 553212 93% | - org-columns 540042 91% | - org-columns--display-here 536947 90% | - face-remap-add-relative 527000 88% | - face-remap-order 526004 88% | - sort 521312 88% | face-attrs-more-relative-p 458136 77% | + org-columns--new-overlay 2008 0% | face-attribute 205 0% | + org-columns--overlay-text 44 0% | org-get-level-face 4 0% | + org-map-entries 1506 0% | + org-columns-compute-all 1441 0% | + org-columns--set-widths 8 0% | + org-map-entries 12126 2% | + org-columns-quit 16 0% | + org-table-align 12 0% | + org-columns--clean-item 4 0% | + org-element-context 5 0% | + ... 38956 6% | + timer-event-handler 166 0% | + redisplay_internal (C function) 28 0% > Best, > Ihor Thank Ihor, you have improved yet another part of my Emacs life! -- 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/