Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Sam (text editor)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Design and features== Sam is designed as two synchronous programs: a command interpreter and a mouse-oriented bitmap windowing interface. The interpreter's command set is modeled after the UNIX editor [[ed (text editor)|ed]] and may be used to operate the editor from a standard text terminal. By default, however, Sam presents its own [[graphical user interface]] (GUI) window, ''samterm'', which additionally allows point-and-click operations through pop-up context menus. This two-process structure allowed sam to access files on networked host systems through remote execution of the file-access process while running the windowing interface locally, thereby bypassing latency over slow connections. Samterm presents windows to files being edited and to a persistent command window which accepts input as sam commands. Most common editing operations are quickly and naturally accomplished with the point-and-click interface, which also functions inside the command window. This latter fact allows commands to be edited (and resubmitted) just as any other text, a function inherited from the [[Blit (computer terminal)|DMD 5620]] terminal interface. ===Command syntax=== Sam's command syntax is formally similar to ed's or [[ex (text editor)|ex's]], containing (structural-) [[regular expression]] based conditional and loop functions and scope addressing, even sharing some of ed's syntax for such functions. But while ed's commands are line-oriented, sam's are selection-oriented. Selections are contiguous strings of text (which may span multiple lines), and are specified either with the mouse (by ''[[Drag and drop|sweeping]]'' it over a region of text) or by a [[pattern matching|pattern match]]. Sam's commands take such selections as basic—more or less as other Unix tools treat lines; thus, multi-line and sub-line patterns are as naturally handled by Sam as whole-line patterns are by [[ed (text editor)|ed]], [[Vi (text editor)|vi]], [[AWK]], [[Perl]], etc. This is implemented through a model called ''structural regular expressions'',<ref>{{cite journal |last=Pike |first=Rob |title=Structural Regular Expressions |url=http://doc.cat-v.org/bell_labs/structural_regexps/se.pdf |access-date=2008-11-01 |journal=EUUG Spring 1987}}</ref> which can recursively apply regular-expression matching to obtain other (sub)selections within a given selection. In this way, sam's command set can be applied to substrings that are identified by arbitrarily complex context. Sam extends its basic text-editing command set to handling of multiple files, providing similar pattern-based conditional and loop commands for filename specification. Any sequence of text-editing commands may be applied as a unit to each such specification. ===Infinite undos=== Sam was one of the first text editors to support "infinite" [[undo]] to revert any number of editing errors. This feature, combined with Sam's facility to easily edit its own commands and, fundamentally, its small, orthogonal command set (containing only 33 commands), represent the program's bias toward a low learning threshold over other more expressive "power editors."
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)