From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: master c9a8a47ba4: Add new user option 'yank-transform-functions' Date: Tue, 24 May 2022 19:13:12 +0200 Message-ID: <871qwihn13.fsf@gnus.org> References: <165299854484.648.782279094390042574@vcs2.savannah.gnu.org> <20220519221545.35270C009A8@vcs2.savannah.gnu.org> <87ee0izzgp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29978"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Stefan Monnier , emacs-devel@gnu.org To: Robert Pluim Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 19:14:33 2022 Return-path: Envelope-to: ged-emacs-devel@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 1ntY76-0007ad-Ro for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 19:14:32 +0200 Original-Received: from localhost ([::1]:54736 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntY75-0004ru-RA for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 13:14:31 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntY60-0003rE-Df for emacs-devel@gnu.org; Tue, 24 May 2022 13:13:24 -0400 Original-Received: from quimby.gnus.org ([2a01:4f9:2b:f0f::2]:55712) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntY5y-0004Os-Pp for emacs-devel@gnu.org; Tue, 24 May 2022 13:13:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=A9gRxrrMr7jkQQ9mnJAzHS290Kt+F6O1WdGskpAhSvM=; b=C01w7Jv5NMDjSCvdldeX1AXq68 T9p0u8keR+e+IIKRL+VoMTJnhjb9D9SYWto7L/OJ8lOb6PVyXpliO71J/dI3MI3UDsZou1FE7H2kg 3D8+t7TEa/3ojLma80AdWJpBJuSZTBK2lmzNV2TLC3QaOHSuyeDPe69DgwGUIRZ6/k84=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ntY5p-0000Wo-U4; Tue, 24 May 2022 19:13:17 +0200 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAABVQTFRF 8+YB88wB8K8I7Y4P6W8U5lYX////i2Yb9AAAAAFiS0dEBmFmuH0AAAAJcEhZcwAACxIAAAsSAdLd fvwAAAAHdElNRQfmBREREBRhcOLeAAAAXUlEQVQ4y+2PsRHAIAwDSTbICrCB7Q2kEWD/VcK5RU2K JA3f/r18LmXzK1fyqjhqIoQnStADXMU5OtwhRKebmpqFvpEi8LSoUtDR5BQR0EXMH5UYYKjPCWsm is2X3IH3FT1sihYuAAAAWmVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsA BQAAAAEAAABSASgAAwAAAAEAAgAAAhMAAwAAAAEAAQAAAAAAAAAAAEgAAAABAAAASAAAAAEfUvc0 AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA1LTE3VDE3OjE2OjIwKzAwOjAwCNBeKgAAACV0RVh0 ZGF0ZTptb2RpZnkAMjAyMi0wNS0xN1QxNzoxNjoyMCswMDowMHmN5pYAAAAXdEVYdGV4aWY6WUNi Q3JQb3NpdGlvbmluZwAxrA+AYwAAADh0RVh0aWNjOmNvcHlyaWdodABDb3B5cmlnaHQgKGMpIDE5 OTggSGV3bGV0dC1QYWNrYXJkIENvbXBhbnn5V3k3AAAAIXRFWHRpY2M6ZGVzY3JpcHRpb24Ac1JH QiBJRUM2MTk2Ni0yLjFXrdpHAAAAJnRFWHRpY2M6bWFudWZhY3R1cmVyAElFQyBodHRwOi8vd3d3 LmllYy5jaBx/AEwAAAA3dEVYdGljYzptb2RlbABJRUMgNjE5NjYtMi4xIERlZmF1bHQgUkdCIGNv bG91ciBzcGFjZSAtIHNSR0JEU0ipAAAAAElFTkSuQmCC X-Now-Playing: Feathered Sun's _Two Journeys EP_: "Welcome Woodi" In-Reply-To: <87ee0izzgp.fsf@gmail.com> (Robert Pluim's message of "Tue, 24 May 2022 18:07:18 +0200") Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org 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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:290205 Archived-At: Robert Pluim writes: > Stefan> Are users expected to be able to make use of this with Custom? How? > > I was expecting a set of pre-defined functions along the lines of > > - 'yank-remove-whitespace > - 'yank-remove-non-ascii > - 'yank-replace-nbsp-and-similar Yes, I was thinking that we'd grow functions like that after a while. However, it's pretty situational whether you'd want these, so perhaps this is unneeded flexibility/complexity. That is, I can see people wanting to (say) make `C-u 2 C-y' yank without whitespace, so they write a `yank-remove-whitespace-when-c-u-2' and put it into here... But on the other hand, just advising `yank' is probably easier, really. So perhaps this should really be a defvar with a single function, so that modes can set it buffer-locally, for instance. Stefan Monnier writes: >> I envisioned that people might be wanting to add other things to it to >> (say) record yanked text, for instance. > > "Record yanked text" doesn't seem like a very compelling example. > I've never heard of anyone requesting such a feature or anything nearby. Oh, there's been some talk about clipboard managers and the like, and this would be a simple way to have an equivalent thing (if you're yanking from other programs; otherwise you'd use the "kill" hook). > And I'd expect such a feature to come in the form of a minor mode > instead (whose code then programmatically sets this var). Yes, that's probably true. > The problem with making it a defcustom is that packages can't > programmatically modify this var without risks of interfering > with Custom (e.g. the famous "CHANGED OUTSIDE CUSTOMIZE"). Hm, yes. I think I agree that it should be a defvar. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no