From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#28910: 27.0.50; Equivalent to __FILE__ Date: Mon, 10 May 2021 12:59:40 -0400 Message-ID: References: <87vaismurv.fsf@russet.org.uk> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17697"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 28910-done@debbugs.gnu.org, Philipp Stephani , Rocky Bernstein To: phillip.lord@russet.org.uk (Phillip Lord) Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon May 10 19:00:33 2021 Return-path: Envelope-to: geb-bug-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 1lg9Gj-0004Tl-Cp for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 19:00:33 +0200 Original-Received: from localhost ([::1]:48000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lg9Gi-0006qi-Ct for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 May 2021 13:00:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40570) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lg9GG-0006pP-Qc for bug-gnu-emacs@gnu.org; Mon, 10 May 2021 13:00:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lg9GF-0003B8-5P for bug-gnu-emacs@gnu.org; Mon, 10 May 2021 13:00:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lg9GF-0003qQ-3t for bug-gnu-emacs@gnu.org; Mon, 10 May 2021 13:00:03 -0400 Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 May 2021 17:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 28910 X-GNU-PR-Package: emacs Mail-Followup-To: 28910@debbugs.gnu.org, monnier@iro.umontreal.ca, monnier@iro.umontreal.ca Original-Received: via spool by 28910-done@debbugs.gnu.org id=D28910.162066599014724 (code D ref 28910); Mon, 10 May 2021 17:00:02 +0000 Original-Received: (at 28910-done) by debbugs.gnu.org; 10 May 2021 16:59:50 +0000 Original-Received: from localhost ([127.0.0.1]:34131 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lg9G2-0003pQ-Ed for submit@debbugs.gnu.org; Mon, 10 May 2021 12:59:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:51219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lg9G0-0003pA-O3 for 28910-done@debbugs.gnu.org; Mon, 10 May 2021 12:59:49 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 184CB440A21; Mon, 10 May 2021 12:59:43 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BF2D2440B0A; Mon, 10 May 2021 12:59:41 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620665981; bh=f9q+mamvS0bEu5e9ogWEWupFdPSfjtQ4ngkpykk5SkA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=dmEWSCHxEsuLYa68dAMcpMXT3JR6K2GzK4SHQXe4JWutm/6gNL45FEUKQqh5DvzjB VQBasZ663zGi70bt3U0oNUHi2o5sjohm3vIh1YfOYTDHB+6AqH2sE9uTBZijn8DbWe oA4AvTMtY7O0gly0V5VYft+akVt/9GZkNW1QmQKG2z5ziFH2nImUJxqmXxT6zDOQAq ofbN+XYMrB+0gYjH+/pgod3Svf42iqxKZM0yF6wWJicBg7H3ati62GTH6QbxZKd2oB 2lQ42ep7ChvR/VPjiQIz6jYxB+Gz62RA/DPtyrjPSZBFejlj7IAuFMWlQJemkPwjMP x4HD3FtfPgAoQ== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 833F3120294; Mon, 10 May 2021 12:59:41 -0400 (EDT) In-Reply-To: <87vaismurv.fsf@russet.org.uk> (Phillip Lord's message of "Thu, 02 Nov 2017 17:53:56 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206179 Archived-At: Phillip Lord [2017-11-02 17:53:56] wrote: > Philipp Stephani writes: >> Stefan Monnier schrieb am Fr., 20. Okt. 2017 um >> 14:42 Uhr: >>> We should provide some `current-source-file-name` function which macros >>> can use to find get the name of the source file in which they were invoked. >> `f-this-file' from the `f' package is some prior art, but I guess it also >> doesn't work correctly with macros. > emacs-load-relative uses the name "__FILE__" for the same thing. Emacs's `master` now has the `macroexp-file-name` function which provides this functionality. So I guess `emacs-load-relative` could now redefine __FILE__ as (defmacro __FILE__ () (macroexp-file-name)) tho oddly it seems that it defines `__FILE__` as a function rather than a macro, so maybe it should be (defalias '__FILE__ #'macroexp-file-name) but that doesn't match the semantics I expect from something called `__FILE__`. In any case, my original request is now satisfied, so I'm closing this. Stefan