all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tsdh@gnu.org>
To: Hongyi Zhao <hongyi.zhao@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: The definition of orig-fn.
Date: Tue, 05 Oct 2021 09:32:51 +0200	[thread overview]
Message-ID: <874k9vud3t.fsf@gnu.org> (raw)
In-Reply-To: <CAGP6POJ7ZZb5xaaLeUWZsqCNDF9U=1okF7q6nO0G-XaH5wx2sQ@mail.gmail.com>


>> 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



  parent reply	other threads:[~2021-10-05  7:32 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 11:33 The definition of orig-fn Hongyi Zhao
2021-10-04 11:59 ` Tassilo Horn
2021-10-04 12:12   ` Hongyi Zhao
2021-10-04 12:23     ` Tassilo Horn
2021-10-04 13:57       ` Hongyi Zhao
2021-10-04 18:14         ` Tassilo Horn
2021-10-05  2:12           ` Hongyi Zhao
2021-10-05  4:56             ` Tassilo Horn
2021-10-05  6:06               ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05  6:25               ` Hongyi Zhao
2021-10-05  6:40                 ` Hongyi Zhao
2021-10-05  7:32                 ` Tassilo Horn [this message]
2021-10-05  8:15                   ` Hongyi Zhao
2021-10-05  8:50                     ` Tassilo Horn
2021-10-05  9:41                       ` Hongyi Zhao
2021-10-05  9:43                         ` Tassilo Horn
2021-10-05 10:19                           ` Tassilo Horn
2021-10-05 10:25                         ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 11:55                           ` Hongyi Zhao
2021-10-05 14:21                             ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 10:17                     ` Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-05 11:52                       ` Hongyi Zhao
2021-10-04 12:01 ` Emanuel Berg via Users list for the GNU Emacs text editor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874k9vud3t.fsf@gnu.org \
    --to=tsdh@gnu.org \
    --cc=help-gnu-emacs@gnu.org \
    --cc=hongyi.zhao@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.