Subject: Applying old samx patch to newer sam?

From: [email-masked] (Paul Jackson)
Date: Wed, 22 Mar 2000 22:30:41 -0500

Summary:

    The only samx patch I could find was old, and didn't entirely
    apply to the latest sam code.  But it (the samkey features)
    seem to work.  Should I worry?  Is there a more recent
    samx patch?

Background:

    I've just stumbled onto sam and samx, while casting about for
    a 'decent' editor for use on Linux, Irix and occassionally
    Windows.

    For the last few years, I had used 'ed' for global work,
    and Rick Davis' jot (aka zip) for mouse work.  But jot only
    runs on Irix, and now I am working more with Linux.  So
    off to look for another editor.

    Thanks especially to all who have contributed to this email
    list over the years -- the ~500 messages in the archives
    were very useful in getting up to speed quickly.
    
    Sam and samx are great - I am glad I found them.

Details:

    The only samx patches I could find were:
    
	Samx Version 2: Extensions to the Unix/X11 Sam Editor
	-----------------------------------------------------
	Ed Kubaitis ([email-masked])
	17 April 1993
    
    from:

	ftp://ftp.funet.fi/pub/unix/editors/sam/samx2/

    I've managed to apply these patches to the most recent sam
    that I could find, circa April 1999, under:

	ftp://ftp.demon.co.uk/pub/unix/plan9/sam-9libs.*

    and the result seems to work, after a little futzing around,
    _except_ that the following piece of the patch seems to be
    quite inapplicable.

    The old samx patch would change the file strwidth.c thusly:
    
	***************
	*** 13,18 ****
		l = 0;
		n = f->n;
		info = f->info;
		if(s)
			while(c = *s++)
				if(c < n)
	--- 13,28 ----
		l = 0;
		n = f->n;
		info = f->info;
	+       if (Keydefs && s) {
	+               while (*s) {
	+                       unsigned short r;
	+                       s += chartorune(&r, s);
	+                       if (r >= n || info[r].width == 0)
	+                               r = 0x7e;
	+                       l += info[r].width;
	+               }
	+               return Pt(l,f->height);
	+       }
		if(s)
			while(c = *s++)
				if(c < n)

Should I worry that I could find no place resembling the above
location to add this code?

=======================================================================
I won't rest till it's the best ...	   Software Production Engineer
Paul Jackson ([email-masked]; [email-masked]) 3x1373 http://sam.engr.sgi.com/pj

---

From: Bengt Kleberg <[email-masked]>
Date: Thu, 23 Mar 2000 05:26:47 -0500

Greetings,

Please note that I am trying to 'maintain' sam-9libs. So if I seem reluctant to make
any changes it could be plain lazyness :-)

ANyway, samx was news to me. I think (afer having read the man page and so for a short while)
that I rahter not include this in sam-9libs.

1 sam is supposed to be mouse driven, not keyboard driven.
2 auto placing of windows is something that acme/wily does (and I think they are better at
	user interfaceing than sam anyway)
3 auto indent, see 2
4 the perl scripts would be nice to include though. 

Best Wishes, Bengt
===============================================================
Everything aforementioned should be regarded as totally private
opinions, and nothing else. [email-masked]
``His great strength is that he is uncompromising. It would make
him physically ill to think of programming in C++.''