From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 8PPxCxTqHmXkgQAA9RJhRA:P1 (envelope-from ) for ; Thu, 05 Oct 2023 18:53:40 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 8PPxCxTqHmXkgQAA9RJhRA (envelope-from ) for ; Thu, 05 Oct 2023 18:53:40 +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 8B5093D41F for ; Thu, 5 Oct 2023 18:53:39 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fu0gXXzW; 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"; dmarc=pass (policy=none) header.from=posteo.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1696524820; 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=g3lxVbsRNCpELA1C6XMx96mEVKD86LhLb4RGbRtuEX0=; b=tmej5h+0u9uArn5Fxx5Za4HlGHRIW+t+EennOSBsw1uocH/8TiMw9rw86RTplTAXMjfcBd fCBfgRwD1ubRjbK0ds0FzKidPU0OXdaQcIaiMvBN1rKytq+baV1QMxVs7/BPvyTzGjkyVF tn6T9LVydIaiTmUHBbh1Xz9qi6+zqPb0CsXZE6BmtKDps0Lx+Zn80Sq7hYyl3qoXic2UAd iCZ405zm9XcPdoNC+NW7mEj8PcPfFd61PBnSkKIW/TAkiZybZMV0fgNDMCg3Rhpgx1gFL5 OlAB1Q/9lPcM+OPQyY20xWPyvW7esC4WpL2PLXXivq8f8nj0K1rIUl2U53ymGQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696524820; a=rsa-sha256; cv=none; b=HdE2Ty3IJ/sqfQ/B/eul2by6+Z/0SL0Ovz9AL4GaVLaoqnZHQ91Ln9QapkVsDVez8AFxuC bEJBzHs5zWvU5HN/KhmNAoL26rfH+RcRW8yV0iVKv/s4JNW7w5OHBbAwN7L9vyB0oCFtT5 X7zO4F/BtaVYvfvqinSEVU95II18A+jIZZIFtt2suUknH7G01zyYM8O0lbzgNwgbM8SmOd lH/PKdcbenVhh0lP4EiaE7yq4rXaXSI+NZ/jW6EZM5c/ciBnvF2CwQhh/7giVajL0auV5g QNf8j/JjRWuV6aYmcQF1WpnH2Qk6wxanN3upSbyI8gXn5Hokzi0qel6C4lK+CQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=fu0gXXzW; 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"; dmarc=pass (policy=none) header.from=posteo.net Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qoRae-0005r5-Lm; Thu, 05 Oct 2023 12:52:45 -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 1qoRac-0005qh-EU for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 12:52:43 -0400 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qoRaa-0006i7-6y for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 12:52:42 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id F3F23240029 for ; Thu, 5 Oct 2023 18:52:37 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696524758; bh=xyAoX0XR/c5h3xOPrHt4Q2wIZ5siAKDqgy1d7BLSkPA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=fu0gXXzWt8p7RlpZFhvdkc8P0qb0imiXM4avSdRAq3MunEet4sW6JATah4Oll5zLB tL1/hPqHs8zJ3c3e+nIWOFxWvVUF0+2pyAoGYVcrYIte9Ztu0UFfG0lxk2odlXG3yG As7vZc1lEErUpNgLLyI40JE6GUt1GQ6jEc3AiaxKPGQobqfK5s2RDszDJiXCE0QIfZ twd9LonF1QJnzyI0Cyvderof9yLodnsfdmXN235aQz43ES7hKr7WYNPb8UDBTEOerO fHTtyqjkM9ENz0t0Rs9sA+m87WHomGmacFGj72A824CsRJ8VpVrXkOIfXo6cZJUdxE jMLtAht0Qnklg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1d051yPkz9rxD; Thu, 5 Oct 2023 18:52:36 +0200 (CEST) From: Ihor Radchenko To: Eli Zaretskii Cc: manikulin@gmail.com, emacs-orgmode@gnu.org, emacs-devel@gnu.org Subject: Re: Completion of links to man pages In-Reply-To: <83ttr52fmx.fsf@gnu.org> References: <87sf6pi9fn.fsf@localhost> <838r8h3w3f.fsf@gnu.org> <87zg0xgimp.fsf@localhost> <83ttr52fmx.fsf@gnu.org> Date: Thu, 05 Oct 2023 16:53:57 +0000 Message-ID: <87sf6pggd6.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.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_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, 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.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-Country: US X-Migadu-Flow: FLOW_IN X-Spam-Score: -8.84 X-Migadu-Spam-Score: -8.84 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 8B5093D41F X-TUID: VlDhEVSCiRzF Eli Zaretskii writes: >> > How is it different from the "M-x man" completion we already have? >> >> M-x man will display the man page, while we just need `completing-read' >> from the same source M-x man or M-x woman use. > > Sorry, I don't understand: "M-x man" does provide completion. Yes, but one cannot replicate the same completion dialogue programmatically in future-compatible way. > And what do you mean by "`completing-read' from the same source M-x > man or M-x woman use"? > > IOW, I think I have no clue of what are you trying to accomplish, > sorry. We aim to create Org links like [[man:ls]]. To create a link in Org, the interface is C-c C-l (org-insert-link), which then prompts for link type (man:) and link path (ls). When querying for the path, we want to have the same completion COLLECTION as M-x man/woman has. For now, as you can see in the quoted code from my initial message, we have to partially replicate the code from man.el and woman.el: (defun org-man--complete-man (prompt) (require 'man) (let (Man-completion-cache) ;; <- implementation detail in man.el (completing-read prompt 'Man-completion-table))) (defun org-man--init-woman-cache (&optional re-cache) ;; <- implementation detail in woman.el (unless (and (not re-cache) (or (and woman-expanded-directory-path woman-topic-all-completions) (woman-read-directory-cache))) (setq woman-expanded-directory-path (woman-expand-directory-path woman-manpath woman-path)) (setq woman-totic-all-completions (woman-topic-all-completions woman-expand-directory-path)) (woman-write-directory-cache))) (defun org-man--complete-woman (prompt) (require 'woman) (org-man--init-woman-cache) (completing-read prompt woman-topic-all-completions)) However, `Man-completion-table' is not documented (no docstring), `woman-topic-all-completions' is tricky to use - we have to copy-paste cache initialization code and later make sure that we keep things up to date to upstream. What I am asking here is to provide a stable Elisp API for the above use case. Currently, we have to rely on implementation details. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at