From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id aJMLMGsxvmbDUwEA62LTzQ:P1 (envelope-from ) for ; Thu, 15 Aug 2024 16:48:43 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id aJMLMGsxvmbDUwEA62LTzQ (envelope-from ) for ; Thu, 15 Aug 2024 18:48:43 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=CC7RVJc8; dmarc=pass (policy=none) header.from=posteo.net; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723740523; 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: 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=hkiug6gtNDDD503POjBGSg8RTsi3EFd8JlROWjaDNhY=; b=lriC6b5ilU8bKNZLqjaG8KpHVpzN68yQ1CVT25FawjqOBK5qjF9CHKQg43zzgHEeUQTLrR p51MvaJSeSpGKvrMePbYY0oOuEAZJkA1SBt+xkJoKQPrjr4EGdnLnXQUZeYew/xShZdzPV kd6fz2K5Q3zK9OasOwiLcdnKutnSW5ezDWXRXT7dVbzsObfp7JFQu3p5zqnYih16OqTm0F tr9UZvvUaeWKmM/Cssf7mLnbKFqdN6XFkUgt63MFRzbLdMn9Dpylj02+osD0LUwqqEO1u4 eIU9pwYZ/iLmRm9KLN7VBEtLjYFV5iUapra39CSHd7o3tQ6gLxzoQlNJfbEQ5w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723740523; a=rsa-sha256; cv=none; b=kuPIp9k7yVlZ8euHZM5ZvAKdVwcing1DgTxNJjkk5tY3NupTIYDykX32Ie8m8cQiPi3bjX tBeiRX+JAq/3YgmLdeNgLWc8946dWb4RklMCPBjVh/DsEucQAtSwtAhidVQ713pPk0d2bN g8WhamEWRtwXEuq1tF1LBG0pbpOaFb3UUR0MscoCEKnSaKHKERGkBKc/QxECvMA4JTJjJZ WX41VMCjUUpopQiJs5IeC57iMKbrTp9H2jWKDbcBkf11LreAAZqjvGgwnGN7Oz+GIs0Ko3 VxKmmf6xVqx1t0H68C0mUkSeYPd16p9wlR30Ai2qOy9PgM8IYaAAG+MhsSD3oA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=CC7RVJc8; dmarc=pass (policy=none) header.from=posteo.net; 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" 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 77F3D30C84 for ; Thu, 15 Aug 2024 18:48:43 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seddW-0007bu-QH; Thu, 15 Aug 2024 12:47:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seddT-0007bl-Q1 for emacs-orgmode@gnu.org; Thu, 15 Aug 2024 12:47:39 -0400 Received: from mout02.posteo.de ([185.67.36.66]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seddN-0001dm-PI for emacs-orgmode@gnu.org; Thu, 15 Aug 2024 12:47:39 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C2411240101 for ; Thu, 15 Aug 2024 18:47:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1723740448; bh=JY0ZP4KMUHmw5lowM0GqslBLx8yBOfpZosFo69o2GL4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type: Content-Transfer-Encoding:From; b=CC7RVJc8R3uuyn8u9TDNGcP647F7W7ZNDoT3WBtoap3ddE497o2hjzj6VNAId7BFG YD7jftPgdrpj+j/JCBXLbRdG8Q6mV7yn5/Q0ZQKqa9nYT9EykeS/kbf8mz8bicrlF6 pKInFJkOz/zLLIslUlQTmAgBiRabn2gSInBtEkvaRy011kgLMW7fEJ7YJZKygtFG6K biE17KZGw/RsYNnGsZ+zfgapeWQgLCROkecOMI/45/vtrLCi9tZPZbcOOoQY3FGvgK n6aPGP3Qo9IpsjzMbz/f5E3BN3Z+wWyRIc4qwMXxm6TtHFqfKcVRiNZLb2GvuAdEvY vQGfvC/fq7WIw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Wl9ym04gnz6tym; Thu, 15 Aug 2024 18:47:28 +0200 (CEST) From: Ihor Radchenko To: =?utf-8?Q?S=C5=82awomir?= Grochowski Cc: emacs-orgmode@gnu.org Subject: Re: [FR] org-colview.el, add annotation for functions summary-types In-Reply-To: <87ttfllupj.fsf@gmail.com> References: <87plqiewa6.fsf@gmail.com> <87r0aw34yx.fsf@localhost> <87ttfllupj.fsf@gmail.com> Date: Thu, 15 Aug 2024 16:48:35 +0000 Message-ID: <878qwx3f6k.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: 77F3D30C84 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -9.68 X-Spam-Score: -9.68 X-TUID: +zyxQRSohb5u S=C5=82awomir Grochowski writes: >> See `help--symbol-completion-table-affixation'. > > It's a private function and I need only a part of it.=20 > Should I extract that part and create a new function? Like this below? > > (defun first-line-docstring (fun) > (let* ((doc (condition-case nil (documentation fun) (error nil))) > (doc (and doc (substring doc 0 (string-search "\n" doc))))) > (if doc > (format " -- %s" doc) > ""))) This would make sense, yes. Probably for org-macs.el Why not applying faces? >> I'd also prefer using a proper completing-read API instead of >> `completion-extra-properties' - by using `completion-extra-properties', >> we disallow users from utilizing this variable. > > OK. Based on this example > https://emacs.stackexchange.com/questions/74547/completing-read-search-al= so-in-annotations > I came up with this snippet below: > > (completing-read > "Summary: " > (lambda (s pred flag) > (pcase flag > ('t (all-completions s > (mapcar #'car org-columns-summary-types-defau= lt) > pred)) > ('metadata (list 'metadata > (cons 'annotation-function > (lambda (c) > (first-line-docstring > (cdr (assoc c org-columns-summary-types-de= fault)))))))))) Looks reasonable. Although, I'd prefer to avoid lambda here and simply make it into a proper function. Just like `org-tags-completion-function'. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at