From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: The definition of orig-fn. Date: Tue, 05 Oct 2021 09:32:51 +0200 Message-ID: <874k9vud3t.fsf@gnu.org> References: <87czolhud6.fsf@gnu.org> <878rz9ht1m.fsf@gnu.org> <87sfxgfy19.fsf@gnu.org> <878rz8t68a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31041"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.7.0; emacs 29.0.50 Cc: help-gnu-emacs@gnu.org To: Hongyi Zhao Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 05 09:48:53 2021 Return-path: Envelope-to: geh-help-gnu-emacs@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 1mXfC1-0007xS-86 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 09:48:53 +0200 Original-Received: from localhost ([::1]:53954 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXfBz-00080E-KA for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 03:48:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41912) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXfB3-0007yr-LG for help-gnu-emacs@gnu.org; Tue, 05 Oct 2021 03:47:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50974) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXfB3-0001Kb-DO; Tue, 05 Oct 2021 03:47:53 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:59547) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXfB3-0001Tt-A1; Tue, 05 Oct 2021 03:47:53 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailauth.nyi.internal (Postfix) with ESMTP id DEADC27C0054; Tue, 5 Oct 2021 03:47:52 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Tue, 05 Oct 2021 03:47:52 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelfedguddulecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpehffgfhvffuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe evveeikeetkeeviefgfeffiedvteeguddvffeuueduveegtddthedvhfeuveffhfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 5 Oct 2021 03:47:52 -0400 (EDT) In-reply-to: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:133555 Archived-At: >> I don't know how that candidate selection by number actually works >> but the advice arranges that the original `company--good-prefix-p' is >> only called if >> >> (and (stringp prefix) (string-match-p "\\`[0-9]+\\'" prefix)) >> >> is nil and that happens only if the prefix doesn't start with a >> number. So I'd suggest it's essential to the use-case. > > Thanks for analyzing the complex advice combination function - if I > could call it that way. > >> > 2. Extend the digits to a more wide range with digits letters, so that >> > I can select and insert more candidates, as we've discussed here [1]. >> >> The above regexp would already match 9281 but probably pressing 9 >> already selects the 9th candidate and you cannot type more? > > I still don't quite understand what you mean above. The currently > implemented method can match 0-9, by mapping 0 to 10, therefore, we > can select 10 candidates by number. The advice suppresses calls to `company--good-prefix-p' if the prefix matches "\\`[0-9]+\\'" which would be true for 9281, too. That's why I've said, the regexp would allow multi-digit prefixes but probably the candidate selection by numeric key press doesn't because it triggers immediately when a numeric key is pressed. Bye, Tassilo