From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 6CbLNCX0HmXGQQEAauVa8A:P1 (envelope-from ) for ; Thu, 05 Oct 2023 19:36:38 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4789::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 6CbLNCX0HmXGQQEAauVa8A (envelope-from ) for ; Thu, 05 Oct 2023 19:36:37 +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 90D0047095 for ; Thu, 5 Oct 2023 19:36:37 +0200 (CEST) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=D6p4zq66; 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=1696527397; 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=muYIjCWp+sI5XZdKxDF5JTeY8imy03vpRJofj31GZaU=; b=OfpILEqLeTOhsmNuRAgjnoPSdiPtrXKoVzZaOMG+u/2v7bFc7urM0VCzoGc+HtDa0dZDa8 txM08hY/oV+BIDkn6zWzqbhSvusPQJ9QN4Z1Xf4vhhhMNfnjg28A+wZP+SkXT18JjY2sge AVF66wBiinkjKMP92b96rTwmBPSL534lfP0gv2Y/DmFt+TxGRcapiDWahecRLFs2wOXN3i RUJS+GcEQyKGFqjMDafA848/yt8ivnGqH5p3EAiZMZWiZ8/kvHwHI9321kyJZw0LC4HipF T+x2PTJ+0Kz9URBVkW8qAXz274YHNdZZzn4O7zSLYJn13a3q/K9TmFqKNmZQEQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1696527397; a=rsa-sha256; cv=none; b=FuQu2BNwplmEaNjFM6X6vKYdoiYG6oa640voSZ44j7ppVcDMCXI9B9QQ758QMotbArban8 N7xAb/hO5xZPygKjVzdq+wa4+WL+Vdspx1oHNMgYXoC7AuA7shKQo17+TO2iJ446DhE9dh TqduxBqYH/pcqc+bgKISnWBvLUx0MYh+LswybhtUr8nrMU6zZyNLruhEmGacm8LKles3C6 Mh0/+ZKqGW++zX1NNDIEUk99f6PqPlKiHVv5oGNeJ/Ugs3jtiKdnqDS2yhvILrckSD/Dh5 2LZeXlFnY8hVEVyCdQr6VvsOahkVW7wfo0niD+G32rvbYPLQhI4dyXPbazsH5w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=D6p4zq66; 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 1qoSFx-00061a-Ee; Thu, 05 Oct 2023 13:35:25 -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 1qoSFv-00060H-IA for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 13:35:23 -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 1qoSFs-0002c2-90 for emacs-orgmode@gnu.org; Thu, 05 Oct 2023 13:35:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 84403240103 for ; Thu, 5 Oct 2023 19:35:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1696527317; bh=/s88FNPH9RmjBkwgmU/XI6MmwuUOMN8raTTG3cjzO8g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=D6p4zq66LH7NoVULM17Lq/vy1piI47kNfKqKIi8lED0+xMX33AxWDhYhryJCR8mR2 k5/VMQlXmy5pWQ/Fj2yzJ7UrRJXfvjrcV3dpDOc0UJiZjzth/a5jzY3BbFNKEaGraq 8JbSIpzZj6/Uc3FBPRF0AvF53orw9E5tIlLSfBBcoFuemj+HCczYbpxmDDeATprB4F cF2e2+PrNhl11eQf1fatQxzy2KepSPOsn8kI/oqCvu4ZrHugzHvs1K6nJqY9PAKLtN 0uqtAnbQ3l7q79B8OCIUwWmAYJuTIWKpDPqcTuVrU204goG+IW/Gc9WY7S71wPYhPv gB1gc68/6GH8g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4S1dxJ5kwjz9rxH; Thu, 5 Oct 2023 19:35:16 +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: <83mswx2dvl.fsf@gnu.org> References: <87sf6pi9fn.fsf@localhost> <838r8h3w3f.fsf@gnu.org> <87zg0xgimp.fsf@localhost> <83ttr52fmx.fsf@gnu.org> <87sf6pggd6.fsf@localhost> <83mswx2dvl.fsf@gnu.org> Date: Thu, 05 Oct 2023 17:36:53 +0000 Message-ID: <87il7lgedm.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain 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_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.36 X-Migadu-Spam-Score: -8.36 X-Migadu-Scanner: mx1.migadu.com X-Migadu-Queue-Id: 90D0047095 X-TUID: bjpNpq8n9+2x Eli Zaretskii writes: >> Yes, but one cannot replicate the same completion dialogue >> programmatically in future-compatible way. > > What do you mean by that? "M-x man" does this: > > (interactive > (list (let* ((default-entry (Man-default-man-entry)) > ;; ignore case because that's friendly for bizarre > ;; caps things like the X11 function names and because > ;; "man" itself is case-insensitive on the command line > ;; so you're accustomed not to bother about the case > ;; ("man -k" is case-insensitive similarly, so the > ;; table has everything available to complete) > (completion-ignore-case t) > Man-completion-cache ;Don't cache across calls. > (input (completing-read > (format-prompt "Manual entry" > (and (not (equal default-entry "")) > default-entry)) > 'Man-completion-table > nil nil nil 'Man-topic-history default-entry))) > > This uses completing-read, as I think you wanted. > ... > Why cannot you reuse Man-completion-table? > >> 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))) > > And why is that a problem? Because we also need to bind (completion-ignore-case t) and (Man-completion-cache nil). Ideally, these details should not be something we need to know. It would be better if man.el provided some kind of API function like `man-completing-read' that takes care about these details, which are apparently necessary to avoid bug#13160 and bug#3717. >> However, `Man-completion-table' is not documented (no docstring), > > If the only thing that's missing is its doc string, that is easy to > add. Docstring would certainly help. Otherwise, we have to guess what that function does. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at