unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* RE: yank-repeat-newline
       [not found]       ` <4E2F1964.4040008@easy-emacs.de>
@ 2011-07-26 20:33         ` Drew Adams
  0 siblings, 0 replies; only message in thread
From: Drew Adams @ 2011-07-26 20:33 UTC (permalink / raw)
  To: 'Andreas Röhler', 'Teemu Likonen'
  Cc: help-gnu-emacs, emacs-devel

> 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
to do.

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.




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-07-26 20:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <4E2F11A3.3090102@easy-emacs.de>
     [not found] ` <87tya8rgrz.fsf@mithlond.arda>
     [not found]   ` <4E2F1453.5010604@easy-emacs.de>
     [not found]     ` <87pqkwrg2d.fsf@mithlond.arda>
     [not found]       ` <4E2F1964.4040008@easy-emacs.de>
2011-07-26 20:33         ` yank-repeat-newline Drew Adams

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).