🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98494

Re: Inconsistency between transpose-chars and transpose-words

#98494
From: svensson
Date: Wed, 26 Jun 1991 12:17
34 lines
2233 bytes
In article <1991Jun19.153701.23773@mintaka.lcs.mit.edu> boaz@GOLEM.LCS.MIT.EDU (Boaz Ben-Zvi) writes:

       BEFORE:  aaa bbb ccc   AFTER:  aaa ccc bbb   (exchange with next word)
		     ^                           ^
       BEFORE:  aaa bbb ccc   AFTER:  bbb aaa ccc   (exchange with prev. word)
		    ^                        ^

The general algorithm for exchange seems to be: 

1) search forward for a border between objects, unless at border already
2) swap objects before and after border

If "object" equals "character", no searching is necessary, since we
are always at a border. If "object" equals "word", we are already at a
border in the second case above. In the first case, we first move over
"bbb", then swap. 

  * (Just for ....) In my "emacs compatible" tcsh :
      BEFORE:   abcd         AFTER:   bacd   (i.e. cursor remains and two prev.
	          ^                     ^          chars are exchanged).

Unless my memory is fading, this is what Gosling Emacs used to do.
Since Tcsh predates Gnumacs, it might have picked up this behavior
from Gosmacs (or for that matter the other way 'round). I seem to
remember some wording in the Gosmacs manual about it; the reason it
worked this way was that it made it possible to correct the common
swap-adjacent-chars typo without extra cursor movement. The Gnumacs
model also allows this, but only when you are typing at the end of a
line. I now think that the Gnumacs model is better, but of course it
took some time to adapt. 

If you want compatibility between emacs and your shell, consider bash.

	J
Technical Details
Message-ID: <9106261017.AA25040@esat.kuleuven.ac.be>
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!imec.BE!svensson

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,dd8798cf0a4ab4a5,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-06-26 23:19:07 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!fauern!ira.uka.de!sol.ctr.columbia.edu!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!imec.BE!svensson
From: svensson@imec.BE
Newsgroups: gnu.emacs.bug
Subject: Re: Inconsistency between transpose-chars and transpose-words
Message-ID: <9106261017.AA25040@esat.kuleuven.ac.be>
Date: 26 Jun 91 12:17:18 GMT
Sender: gnulists@ai.mit.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 34
Approved: bug-gnu-emacs@prep.ai.mit.edu