help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The definition of orig-fn.


From: Tassilo Horn
Subject: Re: The definition of orig-fn.
Date: Mon, 04 Oct 2021 13:59:20 +0200
User-agent: mu4e 1.7.0; emacs 29.0.50

Hongyi Zhao <hongyi.zhao@gmail.com> writes:

> I'm trying to understand the code snippet here [1] as follows:
>
> ;;;
> (defun ora--company-good-prefix-p (orig-fn prefix)
> (unless (and (stringp prefix) (string-match-p "\\`[0-9]+\\'" prefix))
> (funcall orig-fn prefix)))
> (ora-advice-add 'company--good-prefix-p :around #'ora--company-good-prefix-p)
> ;;;
>
> The symbol `orig-fn' used above puzzles me the most. It can't be found
> by `C-h o orig-fn RET', and its definition cannot be found elsewhere
> in the above repository.

It's just the first argument of the function and will always be
`company--good-prefix-p' according to the device definition.

Have a look at (info "(elisp) Advice Combinators").

Bye,
Tassilo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]