From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuri Khan Newsgroups: gmane.emacs.help Subject: Re: Is there way to read function invoked and its parameters? Date: Mon, 28 Dec 2020 16:04:41 +0700 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3103"; mail-complaints-to="usenet@ciao.gmane.io" To: Yuri Khan , Help GNU Emacs Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Dec 28 10:05:19 2020 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 1ktoSt-0000gI-3l for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 10:05:19 +0100 Original-Received: from localhost ([::1]:55612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktoSs-00029M-3U for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 28 Dec 2020 04:05:18 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktoSV-00029E-KG for help-gnu-emacs@gnu.org; Mon, 28 Dec 2020 04:04:55 -0500 Original-Received: from mail-vs1-xe32.google.com ([2607:f8b0:4864:20::e32]:44980) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktoST-0002Lx-RZ for help-gnu-emacs@gnu.org; Mon, 28 Dec 2020 04:04:55 -0500 Original-Received: by mail-vs1-xe32.google.com with SMTP id u7so5211899vsg.11 for ; Mon, 28 Dec 2020 01:04:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=kT1vKpH5lNqE/A1snarKEBMGoTmzDKA63+kH7z3SVl4=; b=Gtgu1IlLCPmg++3XHxs3diy/LQZCmpN8r4+fbtWh2kdkC1ZV64hHRJbknpu3YmqTxL d75HDbF53peUCKES2FwrZ9oKrbEpTr4ai9fGPQZUyCzOpd4VtnQ3jtzyD60ujl0mejoD Gt96R73FitldAG7x1OkjWKUU8WKeBnOa5CwU8G5DFaXItSLrK7kzIKSAQy6+gC6/x17D d8qaM1fnGXXPrGw56s7JpqKfhtnRV4BtVu1TKwBoKHFQAzn55eYPHWbNKtKhvjKRzMOC h1CVb9RNrNuid6DtmG+p58Te4RR8kaU8+mPanmWIOqfGebYD+x6eKH8GdFA1wWxt8t0u YFnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=kT1vKpH5lNqE/A1snarKEBMGoTmzDKA63+kH7z3SVl4=; b=uEnKF6wKPl4as0ujSTwvvqmWN197BXj9hlsrST1KjQSBjUBM2a8tlzaiIwR9e7mptY ZwRBQ9MGBP0bOmY97gBPkgu36Ts1xBswQhX9bRaTMJnesJpkYDshYbh/Z613+woy9VkI 3kvw18Uc8hxSSLpUZw5QBItCxhj6ok9c2osMr3cUH7Zi4IxQ2rwoaiRSU5+fzpBlHleq +eo/o8+u5RO6COPS1P3Kb+w3F/husKbSFeH537KLKVGIvfk/n0PP0Uv+TYaMV2SiAFDb kyNlrYDrOfzpuI+H92jdOB+B+B8773kA+De6dRLz4o9sltY3xm2JskNE7KY7JmZstJ62 /tjg== X-Gm-Message-State: AOAM531xr65DYeUY14/cZSWH7rDun+5b3AhgMpTla2Tr6HdkmMIdxrkk zn1hqzkweYUzQ+bNf85F0CRnob38+cYD7jdIgiY= X-Google-Smtp-Source: ABdhPJzrA4+Sn8G1jCEKd/EP6EQXnSwE823/kYEcyPNgw0hYjQP5Rw/j+IQaFWczYf2mcTHmukJarBOQNVENl6fL3WA= X-Received: by 2002:a67:2e16:: with SMTP id u22mr28184731vsu.12.1609146292569; Mon, 28 Dec 2020 01:04:52 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::e32; envelope-from=yurivkhan@gmail.com; helo=mail-vs1-xe32.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:126844 Archived-At: On Mon, 28 Dec 2020 at 14:08, Jean Louis wrote: > The principle for refreshing or reverting is there, that is > right. Only that it is very inconvenient especially if there is large > number of functions. > > In the above example I would rather like to pass some dynamically > defined function to add-hook then making many revert functions for > each report. > > I am now thinking to employ something like this concept: > > (defun my-report (arg1 arg2 arg3) > (cl-flet my-report--revert () > (my-report arg1 arg2 arg3)) > (invoke-other-function 'my-report--revert)) > > Then other function can set up hooks by using that function. Does > this sound alright to you? It might be possible but it=E2=80=99s not a good idea. Even if you manage t= o keep a function definition in a buffer-local variable, debugging that is likely going to be unpleasant.