From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.help Subject: Re: How can function know its own name? Date: Sun, 26 Jun 2022 09:43:35 +0000 Message-ID: <87k093wyig.fsf@posteo.net> 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="27951"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Help GNU Emacs To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 26 11:44:38 2022 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 1o5Oom-00072D-Cu for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 11:44:36 +0200 Original-Received: from localhost ([::1]:51478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o5Ool-0006k4-0X for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 26 Jun 2022 05:44:35 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5Oo1-0006jw-CE for help-gnu-emacs@gnu.org; Sun, 26 Jun 2022 05:43:49 -0400 Original-Received: from mout01.posteo.de ([185.67.36.65]:50211) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o5Onz-00065z-54 for help-gnu-emacs@gnu.org; Sun, 26 Jun 2022 05:43:49 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id B64D8240027 for ; Sun, 26 Jun 2022 11:43:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1656236621; bh=y1f43/ApLnDXGT6NLAZAy43CdEtfTJ/VLYj2yDCiJ8c=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=f5TzFNwefgRSOqoBFGUkCq52KkbnqAB6TnEyaXXhAE/TBWxTBGr4CJoYLJ/Yb6WAa b4ThTCgQ3BlG/rqj7PwwQ426hg9zTV6z/fIbkR2q/8v2V2QU8KoGarDl/hmJgqPHBx 0icNp6O9z9f+2sZDMaIt7CEozuumlviZZXxzEuanVWBFbH36JZsdgfq6cuU6cR7sOe aAE5BZ8JpDsgilZ22eyUxFThePvN9Ds6jhlBbTJ745/ATRbItfp3wuLK26FEGhCFNF dMWtsCt5R5PWF+tO3wGuNE1pGH6sNtyh9msPqY+2dljSRF0Z2Q7HyMaFaOF5Y418W7 kexVeI+5VI5Jg== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4LW5XD5jSJz6tmQ; Sun, 26 Jun 2022 11:43:40 +0200 (CEST) Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB In-Reply-To: (Jean Louis's message of "Sat, 25 Jun 2022 23:21:20 +0300") Received-SPF: pass client-ip=185.67.36.65; envelope-from=philipk@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 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, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 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:138101 Archived-At: Jean Louis writes: > I would like to invoke logging for specific functions automatically, > without specifying what to log, and my function should know which > function invoked it. > > For example > > (defun my-log (&optional function-name) > (log-to-database function-name)) > > (defun logged-function () > (my-log (find-function-name)) ;; I would like at this point to recognize that it was invoked from within logged-function? > (ignore)) > > Would this be possible somehow? > > > Jean > > Take action in Free Software Foundation campaigns: > https://www.fsf.org/campaigns > > In support of Richard M. Stallman > https://stallmansupport.org/ This might do the job: https://emacs.stackexchange.com/questions/2310/can-functions-access-their-name/2312#2312