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: Mon, 04 Oct 2021 13:59:20 +0200 Message-ID: <87czolhud6.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27792"; 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 Mon Oct 04 14:03: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 1mXMhF-000702-SD for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 14:03:53 +0200 Original-Received: from localhost ([::1]:49932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXMhE-0000sU-P6 for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 04 Oct 2021 08:03:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:43780) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXMei-0000lh-Hh for help-gnu-emacs@gnu.org; Mon, 04 Oct 2021 08:01:17 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:49792) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXMeh-0004uN-W8; Mon, 04 Oct 2021 08:01:16 -0400 Original-Received: from auth2-smtp.messagingengine.com ([66.111.4.228]:56837) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXMef-00059D-OM; Mon, 04 Oct 2021 08:01:15 -0400 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailauth.nyi.internal (Postfix) with ESMTP id 1B0B927C0054; Mon, 4 Oct 2021 08:01:12 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 04 Oct 2021 08:01:12 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudelvddggeehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvufffjgfkgggtsehttdertddtredtnecuhfhrohhmpefvrghsshhi lhhoucfjohhrnhcuoehtshguhhesghhnuhdrohhrgheqnecuggftrfgrthhtvghrnhepve evieekteekveeigfefffeivdetgeduvdffueeuudevgedttdehvdfhueevfffhnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhrnhdomh gvshhmthhprghuthhhphgvrhhsohhnrghlihhthidqkeeijeefkeejkeegqdeifeehvdel kedqthhsughhpeepghhnuhdrohhrghesfhgrshhtmhgrihhlrdhfmh X-ME-Proxy: Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 4 Oct 2021 08:01:11 -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:133537 Archived-At: Hongyi Zhao 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