emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master c9a8a47ba4: Add new user option 'yank-transform-functions'


From: Lars Ingebrigtsen
Subject: Re: master c9a8a47ba4: Add new user option 'yank-transform-functions'
Date: Tue, 24 May 2022 19:13:12 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Robert Pluim <rpluim@gmail.com> 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 <monnier@iro.umontreal.ca> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]