Subject: sam X11 extensions

From: Ed Kubaitis - CCSO <[email-masked]>
Date: Mon, 18 Jan 1993 12:47:32 -0500

Hi,

When Chris Siebenmann told me about sam-fans, he warned that most people on
it were probably "more purist in their approach" than me. So sam-fans may
be a poor place for this.                                                  

Anyway, I have developed mods to support additional features in sam's X11
interface. Perhaps some of you might be interested in some of them. If so
I welcome your comments. The man page is attached.                           

The materials are available from uxc.cso.uiuc.edu in pub/sam/samx1.0.shar.
They apply to the 11/13/92 sam from att.research.com in dist/sam/bundle.Z.
The samKeys feature requires perl for a script invoked by samterm.

Ed
----------------------------------
Ed Kubaitis ([email-masked])
Computing & Communications Services Office - University of Illinois, Urbana
===============================================================================
SAMX(1L)               ConvexOS Man Pages                SAMX(1L)

NAME
     samx - X11 extensions to the sam text editor.

SYNOPSIS
     Optional sam X11 features selectable by resources in
     $HOME/Sam or $HOME/.Xdefaults.

DESCRIPTION
     The resources below enable optional features in sam's X11
     interface (samterm). The features required modifications to
     the standard sam source distribution and are thus not avail-
     able on systems without the modifications installed.

     Features are requested by including resources in $HOME/Sam
     or $HOME/.Xdefaults. If no features are requested, sam
     should behave identically to a standard, unmodified sam.

RESOURCES
     samterm*samKeys: on
             Enables user-tailorable key definitions in
             $HOME/Samkeys.  If the file doesn't exist, one is
             created with example entries and comments describing
             the format.  The file maps keyboard keys to samterm
             actions and sam commands.  More than thirty actions
             are provided for window selection, simulated typing,
             scrolling, cursor control, and most menu items.

     samterm*autoIndent: on
             Enables vi-like autoindent when a newline is entered
             from the keyboard in a file window. Unlike vi
             though, one can simply backspace over the provided
             automatic whitespace.

     samterm*autoStart: on
             Automatically selects the first file (alphabeti-
             cally) in the list of files provided on the sam com-
             mand line. Use of this feature causes a spurious
             ?blank expected message in the sam command window.

     samterm*autoSweep: on
             Uses a default window when a file is first selected
             rather than prompting for a rectangle to be swept
             with the mouse.  The Reshape menu 2 item turns
             autosweep off. The Samkeys autosweep action toggles
             autosweep on and off.

     samterm*autoSweepWindow: top,bottom
             Sets the size and location of the default window
             used when autosweep is in effect. The parameters are
             fractions (from 0 through 1) of the full height of
             the sam screen. The default value is .2,1. That is,
             the bottom 80% of the screen.

     samterm*samWindow: top,bottom
             Sets the initial size and location of the sam com-
             mand window.  The parameters are fractions (from 0
             through 1) of the full height of the sam screen. The
             default value is 0,.2. That is, the top 20% of the
             screen.

     samterm*samWindowAlt: top,bottom
             Sets an alternate size and location for the sam com-
             mand window.  The Samkeys samalt action toggles the
             sam window between the two locations.  The default
             value is .4,.6. That is, the middle 20% of the
             screen.

     samterm*fileTitle: on
             Requests display of the current file name in the X11
             window manager title bar.

     samterm*shiftWidth: n
             Sets the shiftwidth (0<n<17) used by the Samkeys
             indent and outdent actions.

BUGS & DEFICIENCIES
     Up and down cursor control actions do not automatically
     scroll and occasionally misbehave near the top or bottom of
     the window.

     Samkeys allows a key to map to a theoretical 1023 actions
     and type() characters. But rapid use of multiple very long
     action list keys occasionally led to sam panics.

     Shiftwidth is useful only for empty or whitespace-only
     lines. It behaves strangely if there is unnoticed additional
     whitespace to the right of dot.

     If samKeys is on, the undocumented latin1/unicode composition
     feature is not available.

FILES
     $HOME/.Xdefaults
     $HOME/Sam
     $HOME/Samkeys

SEE ALSO
     sam(1)

AUTHORS
     Rob Pike and Howard Trickey (AT&T Bell Labs) developed sam.
     Modifications for the features described here were developed
     by Ed Kubaitis, Computing & Communications Services Office,
     University of Illinois.

---

From: Ed Kubaitis - CCSO <[email-masked]>
Date: Tue, 19 Jan 1993 07:44:10 -0500

Sites with a version of perl earlier than 4.035 will need the attached
patch (from Bob Gibson <[email-masked]>)

Ed
-------------------------------------------------------------------------------
*** samkeys_parse-      Mon Jan 18 19:14:37 1993
--- samkeys_parse       Mon Jan 18 19:00:56 1993
***************
*** 74,80 ****
            warn "Multiple key symbols in $Source:\n$line\n";
            next SourceLine;
            }
!        else { $keyhex = $Key{$k} };
         }
        elsif ($m = $Mod{$k}) { $mod |= $m; }
        else {
--- 74,80 ----
            warn "Multiple key symbols in $Source:\n$line\n";
            next SourceLine;
            }
!        else { $keyhex = $Key{$k}; }
         }
        elsif ($m = $Mod{$k}) { $mod |= $m; }
        else {
-------------------------------------------------------------------------------