From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: master c9a8a47ba4: Add new user option 'yank-transform-functions' Date: Tue, 24 May 2022 11:24:26 -0400 Message-ID: References: <165299854484.648.782279094390042574@vcs2.savannah.gnu.org> <20220519221545.35270C009A8@vcs2.savannah.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="19266"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue May 24 17:25:49 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 1ntWPt-0004ii-2k for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 17:25:49 +0200 Original-Received: from localhost ([::1]:49484 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntWPs-0005MX-6L for ged-emacs-devel@m.gmane-mx.org; Tue, 24 May 2022 11:25:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37948) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWOg-0004W1-Ts for emacs-devel@gnu.org; Tue, 24 May 2022 11:24:34 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:40308) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntWOd-0002AR-TG for emacs-devel@gnu.org; Tue, 24 May 2022 11:24:33 -0400 Original-Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 117618076B; Tue, 24 May 2022 11:24:29 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id ADB6A80723; Tue, 24 May 2022 11:24:27 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1653405867; bh=JAT9f3JuOarfNFeSTEiJE9R5/CDk/Wo3XO1EawLjze4=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=h+FJ5S8dotRbGzSv2QS0c1YCehZ6t0dL6kpSlKMNnqeH7iUO4bsC6oXyTdeDIN8p0 Wi3vcEsjCgMa+Bs2M/Gm+d6oQy7YwFFawby7M5I7ErxzSwytzCVQp4ryIKUpMvaHRO MRf7CYyTcItVvl42I58CStthD6ui+j6LPVUegs+w6fKcrKC4IwRv42EKBK6AEGblCU qs/ICc1PeAXHD16Lrxb6JcTEXMulP0s1b/0QRzRnEagkXMk0lf1Ksx1j3IiMkUde1k PCxWe/U1XZm4TrOVbb+97Glge2xYyiVdSe0KC4apLL9bT3o0cirLtJSU9+CZ0JKQvE cd8yyoBGTdrlg== Original-Received: from pastel (unknown [45.72.221.51]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 86D97120223; Tue, 24 May 2022 11:24:27 -0400 (EDT) In-Reply-To: <20220519221545.35270C009A8@vcs2.savannah.gnu.org> (Lars Ingebrigtsen's message of "Thu, 19 May 2022 18:15:45 -0400 (EDT)") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-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:290192 Archived-At: Lars Ingebrigtsen [2022-05-19 18:15:45] wrote: > * lisp/simple.el (yank-transform-functions): New user option. > (yank): Mention it. Hmm... why is this a user option? [ Also, tho less importantly: Why is it a list of functions instead of being symmetric with Emacs-28's `kill-transform-function`? ] Are users expected to be able to make use of this with Custom? How? > +@defopt yank-transform-functions > +This variable is a list of functions. Each function is called (in > +order) with the string to be yanked as the parameter, and should > +return a (possibly transformed) string. This variable can be set > +globally, but can also be used to create new commands that are > +variations on @code{yank}. For instance, to create a command that > +works like @code{yank}, but cleans up whitespace before inserting, you > +could say something like: > + > +@lisp > +(defun yank-with-clean-whitespace () > + (interactive) > + (let ((yank-transform-functions > + '(string-clean-whitespace))) > + (call-interactively #'yank))) > +@end lisp > +@end defopt This example doesn't call for a `defcustom` but for a `defvar`, no? Stefan