[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Tue, 26 Jul 2011 13:33:38 -0700
> However, after all think Emacs could make a better use of these both
> interactive codes by separating it. It's a kind of interference with
> "P" "p" which makes things more complex then needed and doesn't
> contribute - IMHO.
> Will present the matter at emacs-devel.
I suggest you think more about it, Andreas.
You cannot "separate" the two behaviors if they are represented by exactly the
same argument (value). How can any given prefix arg - that is, one single
value, represent both the number of yanks and whether to add a newline to each
yank? If it is one value then it cannot distinguish two things.
Things are even simpler - you can forget about arguments, prefix or otherwise.
You cannot separate the two command behaviors if you want them to be triggered
by the _same user input event_ and you want nothing else to affect the behavior,
besides the user. It does not matter how you communicate the user behavior to
the command (prefix arg or otherwise): the problem is the same.
Only the user behavior can distinguish the behaviors you want (unless you want
to distinguish based on tide levels, time of day, etc.). So you need two
different user behaviors - the user needs some way to let your command know what
Having the user distinguish using positive and non-positive prefix args is one
way. But you need _some_ user-level difference.
Describe to yourself exactly what you expect the different user inputs to be,
which would distinguish the command behavior cases. Figure out what you want
the _user_ to do differently in the two cases and then you'll know how to code
it to get the behavior you want.
Just think a little more about it, and I'm sure you'll have a Eureka moment.
RE: yank-repeat-newline, Drew Adams, 2011/07/26