From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#60929: 30.0.50; [FR] `file-name-extension' and backup suffixes Date: Tue, 24 Jan 2023 11:12:56 +0000 Message-ID: <87cz745gqp.fsf@localhost> References: <87o7qw6rrz.fsf@localhost> <83y1q01031.fsf@gnu.org> <87v8l45740.fsf@localhost> <83ilh3293n.fsf@gnu.org> <878rht7eht.fsf@localhost> <83tu0hidcp.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4976"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60929@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 24 12:13:30 2023 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 1pKHF4-00014J-4c for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Jan 2023 12:13:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pKHEq-0002ol-Dc; Tue, 24 Jan 2023 06:13:17 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pKHEe-0002ia-IF for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 06:13:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pKHEc-0001ue-Of for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 06:13:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pKHEc-0007AK-2p for bug-gnu-emacs@gnu.org; Tue, 24 Jan 2023 06:13:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Jan 2023 11:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60929 X-GNU-PR-Package: emacs Original-Received: via spool by 60929-submit@debbugs.gnu.org id=B60929.167455875727505 (code B ref 60929); Tue, 24 Jan 2023 11:13:02 +0000 Original-Received: (at 60929) by debbugs.gnu.org; 24 Jan 2023 11:12:37 +0000 Original-Received: from localhost ([127.0.0.1]:55976 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKHEC-00079Z-Jo for submit@debbugs.gnu.org; Tue, 24 Jan 2023 06:12:36 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:38233) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pKHEB-00079M-Pa for 60929@debbugs.gnu.org; Tue, 24 Jan 2023 06:12:36 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id D8360240132 for <60929@debbugs.gnu.org>; Tue, 24 Jan 2023 12:12:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1674558749; bh=LA28ZARi0IBsVz94zv4oYsLJds70k6hAvI2zSH/XE40=; h=From:To:Cc:Subject:Date:From; b=fF5ksuxW3nFRV8MI0gq90BNx8P1s9dh4pNvu+6xFPdQbPu8dLxmv/x+FJz7UmnNsW MBc4Rk6x+bQbUjNeVojw3oP73pc/9pSbN5R2nPvSIZnzm1t5fXJlbCD4EcDgSPpr2C M/2DCUBXAx5jmW5qPMLNeiD5ZDcLPyXXDVwx9ZXJ7wn/a/mYtP0UiVzPIhCrwUm8Gg gTWH5zM6jmyN23qHsuWTvb9Km+1Fin2o2S13btAfAllrtXmczk/l+W/1rNeXML2bv/ Xz3JeKOxaaOE2Wu+4p0war2+F8KLar8WCUEZhb1wc32KpqkVJkVFPPpdQ7z2ThC98g N9Htc62hhw+uA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4P1PSr3Jc3z6tnQ; Tue, 24 Jan 2023 12:12:25 +0100 (CET) In-Reply-To: <83tu0hidcp.fsf@gnu.org> 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254042 Archived-At: Eli Zaretskii writes: >> 3. It would be nice to have Elisp API to determine (1) "effective" file >> name as seen to the user wrt editing functionality (foo.ext); (2) a >> list of transformations Emacs applied to the file contents when >> opening the file (decrypt, strip backup/version, tramp connection, >> etc) > > What would you do with the "effective" file name obtained via such a > hypothetical API? I'm asking because the answer might be relevant to > defining the terms in which the API will return the information; a > file name is just one possibility, not the only one. The original need is deriving exported file name. I can also imagine one trying to apply equivalent encryption or simply file name suffix to the exported file: foo.org.gpg -> (exports to) foo.html.gpg foo.org.~10~ -> (exports to) foo.html.~10~ foo.org.gpg -> (backed up to + auto-encrypted) foo.org.gpg~ foo.org.gz -> (exports to + auto-compressed) foo.html.gz Hmm... If we go further into generalization, what I am talking about is centralized API to "describe" current buffer file: 1. What is already there: - `buffer-file-name' - `buffer-file-truename' - `buffer-file-number' 2. What could be made available: - TRAMP mount point - `buffer-effective-name' - some info + callback to re-encrypt/re-archive/re-apply suffixes for a given file buffer onto another file buffer. > For example, if you want the file name so you could know the > appropriate major mode, perhaps a better interface would be to give > you a list of relevant major modes? I am not sure what you refer to here. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at