Humor: Cargo Cult Programming

pll at lanminds.com pll at lanminds.com
Thu Nov 14 16:22:36 EST 2002


In a message dated: Thu, 14 Nov 2002 16:02:30 EST
mike ledoux said:

>On Thu, Nov 14, 2002 at 03:57:29PM -0500, pll at lanminds.com wrote:
>> 
>> 
>> Well yes, but when you're editing several different files at the same 
>> time, it's very convenient to have different emacs buffers with 
>> several different files opened in order to be able to quickly and 
>> easily cut'n'paste between the files without using the mouse.
>
>vi can do that.  I use multiple buffers in vi all the time.  With Vim,
>you can even make multiple buffers visible at the same time.

Right, I knew that, but what I'm referring to is that some of those 
multiple buffers are actually files located on remote machines.
IOW, rather than:
	- scp'ing a bunch of files from several different 
	  machines to say /tmp,
	- opening them all up into different buffers, 
	- editing them,
	- saving them,
	- then scp'ing them all back to the right systems.

I can simply open "a bunch of files" regardless of whether they're 
local or not from within Emacs, edit them to my hearts content, then 
save them.  I basically eliminate steps 1 and 5 above.  Additionally, 
if those files are under revision control on the remote machines, I 
can check them out from within emacs as well.

(granted, I don't do this often, and more times than not, I ssh to 
the remote machine, co the file from RCS, vi it, etc.)

>> You mean the rectangle thingy?  I've not seen it anywhere else but in 
>> emacsen.
>
>Not being an emacs guy, I'm not certain that this is the same thing,
>but Vim has a 'Visual' mode that allows you to to block selections with
>a highlighting rectangle.  

I don't know about the Visual mode.  The rectangle thing with emacs 
lets me do things like this; say I have a hosts table:

	1.2.3.1	hosta
	1.2.3.2	hostb
	1.2.3.3	hostc

I can 'cut out' any given rectangle as defined by 2 corners.  So, for 
instance, say I want to make this into a DNS file where I only need 
the last octet of the IP, I can define the 'upper-left' corner to be 
'1' and the 'lower-right' corner to be the '.' between the 3.3 and 
remove that rectangle leaving me with:

	1 hosta
	2 hostb
	3 hostc

I can then define another rectangle to by the upper-left corner
being the 'h' of hosta and the lower-right corner being the 'c' of 
hostc.  Then I can cut that rectangle, move my cursor to be on the 
'1', and yank that rectangle and I end up with:

	hosta 1
	hostb 2
	hostc 3

It's really hard to explain this feature via e-mail, you really need 
to see it in action.
	
-- 

Seeya,
Paul
--
	It may look like I'm just sitting here doing nothing,
   but I'm really actively waiting for all my problems to go away.

	 If you're not having fun, you're not doing it right!





More information about the gnhlug-discuss mailing list