From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Current mode command discovery Date: Sun, 14 Feb 2021 23:56:35 +0200 Message-ID: References: <87v9aubm96.fsf@gnus.org> <878s7qifn2.fsf@telefonica.net> <874kieidcl.fsf@telefonica.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8565"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 To: =?UTF-8?Q?=c3=93scar_Fuentes?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Feb 14 22:57:35 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBPOZ-00027V-1V for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 22:57:35 +0100 Original-Received: from localhost ([::1]:33894 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBPOY-0005QG-2F for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Feb 2021 16:57:34 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48462) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBPNi-00050N-5p for emacs-devel@gnu.org; Sun, 14 Feb 2021 16:56:42 -0500 Original-Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:43650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBPNg-0008WD-88 for emacs-devel@gnu.org; Sun, 14 Feb 2021 16:56:41 -0500 Original-Received: by mail-wr1-x430.google.com with SMTP id n8so6697068wrm.10 for ; Sun, 14 Feb 2021 13:56:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=j5v4xWh5QyQ2nKxGC7GL+ojGWU8ixOGTRLGnJlhbT/s=; b=q2GfMnklLjsLp0ELzaMGg+BgJugwi0EInfeGz30W7NsWY99+UuwF8o/wyTG278uXEM Dh0OEqbPVEEwCqcmWJwYusgXjhjwH/SscZ+mjq2N4CzL4lSUjmoCKB3Lv/zj9ez74qia k0UNqpK9lxXZp5z/f77xSLIHk6kAlKKj/ZfUqZoa0L5ADwz43YF2E72dGO7qKKHC6UGI iaoexxYCzEU6rWTkpe2mFQfqkO6OiCi5+w3QT3Bza0kflFhzKHvHGQredyK2Q4cMCKrn J8NLrbQKRpak6aYrM2ua0m5/cX/tGN3lQE0jhRFIjnLRSzK/HKliFMHZSQ4pbKWcOIMZ fO/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=j5v4xWh5QyQ2nKxGC7GL+ojGWU8ixOGTRLGnJlhbT/s=; b=eueh7prDUD5Yv9UicXxLk7mdhc3iMeWPUqWKAnS+rge5oQa96KAZwwIhbnNTgGcX5q BSxsI1AesW8ptsANiMluJwfiqV5utNkTxYQEgac9qkZKKLpr0oLJGDIu2MaqC1EuFkJw kp6l8u1d5EFfeWZOKW8FhbCi9fXzMBUBl+3gdEf8lMG1xRaV2fhKPlO8vLMqpGO3RA7X KTH1UOAL1QjBMsNcBdyW7esu67ApUuT/dcXD3jfrnO5n70YD++3U9bdVGyJGW9BuWFhN sPs6fIOaniIwdrm5pKdRlSeNfefiRFV4A8dw0HCvYEPCirsdxSNwcHQsbOPLa5ysgYms fenw== X-Gm-Message-State: AOAM531dbjyBc0OvvKTLGfHYzCViZlYyVadu4/05q3QzxuXoO9sBHPQL cZ0PCKGgeb6P8lKCvNzhlrBOyh8HscI= X-Google-Smtp-Source: ABdhPJw0rx1Eq0LWXz+ypJYuR2eVaFKIgDg1Hx+RXYK8U7Gf1POuckxGSvBrbjvsSbsXnsGNeg84+A== X-Received: by 2002:a5d:52c5:: with SMTP id r5mr15419449wrv.208.1613339798604; Sun, 14 Feb 2021 13:56:38 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id t6sm11877545wrn.96.2021.02.14.13.56.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 14 Feb 2021 13:56:37 -0800 (PST) In-Reply-To: <874kieidcl.fsf@telefonica.net> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=raaahh@gmail.com; helo=mail-wr1-x430.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:264786 Archived-At: On 14.02.2021 22:49, Óscar Fuentes wrote: > AFAIU it fails for commands that are defined outside of the source file > that `provide's the feature. This happens with large packages, which > incidentally are the ones that define more commands. So the heuristics > fails precisely where the filtering is most needed. IME only a minority of packages are like that. Which possibly means that the majority of the commands are defined in packages which will satisfy the current logic of that implementation. But those that don't, should be easy enough to augment by adding (mode -> (extra-package-1, extra-package-2, ...)) mapping somewhere. This will still result in an order of magnitude fewer annotations than doing them for each command. >> Any false negatives can be augmented >> with special (declare ...) instructions. But if we take that approach >> as a basis, fewer commands might such annotations. > > Yes, it would save many annotations, but not enough to use it as a basis > (see above). Also, commands within a feature that are intended as > generally applicable require an annotation too (to leave them out of the > filtering.) Yes, sure. This might actually require some special support inside 'declare', so that the command later could avoid scanning the whole obarray (if we care about that). > The approach has its merits, but it looks a bit too fragile to me. I like it because the implementation without annotations should already work well enough for one to be able to get the feel of the feature (meaning, it will likely work better than the current new feature for quite some time, if one takes third-party packages without annotations into account). And fixing the misbehaving cases can be done gradually, sort of like progressive improvement.