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
TECO (text editor)
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!
{{Short description|Programmable text editor}} {{Infobox software | name = TECO | title = | logo = <!-- [[File: ]] --> | screenshot = <!-- [[File: ]] --> | caption = | collapsible = | author = [[Daniel Murphy (computer scientist)|Dan Murphy]] | developer = | released = 1962/63 <!-- {{Start date|YYYY|MM|DD}} --> | discontinued = | latest release version = | latest release date = <!-- {{Start date and age|YYYY|MM|DD}} --> | latest preview version = | latest preview date = <!-- {{Start date and age|YYYY|MM|DD}} --> | programming language = | operating system = [[OS/8]], [[Incompatible Timesharing System|ITS]], [[TOPS-10]], [[TOPS-20]], [[RT-11]], [[RSTS/E]], [[RSX-11]], [[OpenVMS]], [[Multics]] | platform = | size = | language = | genre = [[Text editor]] | license = | website = }} '''TECO''' ({{IPAc-en|ˈ|t|iː|k|oʊ}}<ref>{{cite magazine |magazine=The DEC Professional |title=DEC Timesharing |quote=Tee'koh }}</ref>), short for '''''Text Editor & Corrector''''', <ref name=BELL>"A powerful and sophisticated text editor, TECO (Text Editor and Corrector) ... {{cite book |title=Computer Engineering: A DEC View of Hardware Systems Design |url=https://books.google.com/books?isbn=1483221105 |isbn=978-1483221106 |date=2014 |last1=Bell |first1=C. Gordon |last2=Mudge |first2=J. Craig |last3=McNamara |first3=John E. | publisher=Digital Press }} See also {{cite book |title=Computer Engineering: A DEC View of Hardware Systems Design |isbn=9780932376008 |date=1978 |last1=Bell |first1=C. Gordon |last2=Mudge |first2=J. Craig |last3=McNamara |first3=John E. | publisher=Elsevier Science & Technology Books }} </ref> <ref>The name on the cover of DEC's DEC-10-UTECA-A-D manual is "Introduction To TECO (Text Editor And Corrector)"</ref><ref name=PDP8>{{cite book |title=PDP 8/e small computer handbook |date=1970 |pages=2–30}}</ref> is both a character-oriented [[text editor]] and a [[programming language]],<ref name=AnecD/><ref>citing Comm. of the ACM (see vol. 19, no. 12, 1976)</ref> that was developed in 1962 for use on [[Digital Equipment Corporation]] computers, and has since become available on [[Personal computer|PCs]] and [[Unix]]. [[Daniel Murphy (computer scientist)|Dan Murphy]] developed TECO while a student at the [[Massachusetts Institute of Technology]] (MIT).<ref name=AnecD>{{cite journal |title= The Beginnings of TECO |first= Dan|last= Murphy |date= October–December 2009 |journal= IEEE Annals of the History of Computing |volume= 31 |number= 4 |url=http://tenex.opost.com/anhc-31-4-anec.pdf | doi = 10.1109/mahc.2009.127 |pages=110–115|s2cid= 18805607}}</ref> According to Murphy, the initial acronym was '''''Tape Editor and Corrector''''' because "[[Paper tape|punched paper tape]] was the only medium for the storage of program source on our PDP-1. There was no hard disk, floppy disk, magnetic tape (magtape), or network."<ref name=AnecD/> By the time TECO was made available for general use, the name had become "Text Editor and Corrector",<ref name=PDP8/> since even the PDP-1 version by then supported other media.<ref name=AnecD/> It was subsequently modified by many other people<ref>{{cite web |title=TECO |work=The Jargon File |version=v.4.4.7 |publisher=[[ibiblio]] |url=http://www.catb.org/jargon/html/T/TECO.html}}</ref> and is a direct ancestor of [[Emacs]], which was originally implemented in TECO macros.<ref>{{cite web |url=http://www.xemacs.org/Documentation/21.5/html/internals_3.html |title=A History of EMACS}}</ref><ref>{{cite book <!---Google category = Law --> |author1=Mario Biagioli |author2=Peter Jaszi |author3=Martha Woodmansee |date=2015 |title=Making and Unmaking Intellectual Property: Creative Production |url=https://books.google.com/books?isbn=022617249X |isbn=022617249X |quote=EMACS was originally built on top of TECO}}</ref><ref>{{cite book |title=Harley Hahn's Emacs Field Guide |page=9 |url=https://books.google.com/books?isbn=1484217039 |isbn=978-1484217030 |author=Harley Hahn |date=2016|publisher=Apress }}</ref> ==Description== TECO is not only an editor but also an [[interpreter (computer software)|interpreted]] [[programming language]] for text manipulation. Arbitrary programs (called "macros") for searching and modifying text give it great power. Unlike [[regular expressions]], however, the language was [[Imperative programming|imperative]], though some versions had an "or" operator in string search. TECO does not really have [[syntax]]; each character in a program is an imperative command, dispatched to its corresponding routine. That routine may read further characters from the program stream (giving the effect of string arguments), change the position of the "program counter" (giving the effect of control structures), or push values onto a value stack (giving the effect of nested parentheses). But there is nothing to prevent operations like jumping into the middle of a comment, since there is no syntax and no parsing. TECO ignores [[letter case|case]] and [[whitespace character|whitespace]] (except [[tab character|tab]], which is an insertion command).<ref>{{cite web |quote=<tab>text$, Inserts specified text preceded by a tab. |url=http://www.avanthar.com/healyzh/teco/TecoPocketGuide.html |title=TECO Pocket Guide}}</ref> A satirical essay on computer programming, "[[Real Programmers Don't Use Pascal]]", suggested that a common game for TECO fans was to enter their name as a command sequence, and then try to work out what would happen. The same essay in describing TECO coined the [[acronym]] ''YAFIYGI'', meaning "You Asked For It You Got It" (in contrast to [[WYSIWYG]]). ==Impact== The [[EMACS]] editor originally started by [[David A. Moon]] and [[Guy L. Steele Jr.]] was implemented in TECO as a set of Editor MACroS. TECO became more widely used following a [[Digital Equipment Corporation]] (DEC) [[PDP-6]] implementation developed at MIT's [[Project MAC]] in 1964. This implementation continuously displayed the edited text visually on a [[CRT screen]], and was used as an interactive online editor. Later versions of TECO were capable of driving full-screen mode on various DEC [[RS-232]] video terminals such as the [[VT52]] or [[VT100]]. TECO was available for several operating systems and computers, including the [[PDP-1]] computer, the [[PDP-8]] (under OS/8),<ref name=StdTeco>{{cite web |quote=Standard TECO. Text Editor and Corrector for the. VAX, PDP-11, PDP-10, and. PDP-8. |url=https://livingcomputers.org/Discover/Online-Systems/User-Documentation/OpenVMS-7-3/3_(Editor)_DEC_Standard_TECO.aspx |title=Standard TECO Text Editor and Corrector}}</ref><ref>{{cite web |title=Doug Jones's DEC PDP-8 FAQs |url=http://homepage.divms.uiowa.edu/~jones/pdp8/faqs |quote=What programming languages were supported on the PDP-8? ... TECO, the text editor, was included in the standard OS/8 distributions}}</ref> the [[Incompatible Timesharing System]] (ITS) on the PDP-6 and [[PDP-10]], and [[TOPS-10]] and [[TOPS-20]] on the [[PDP-10]]. A version of TECO was provided with all DEC operating systems; the version available for [[RT11]] was able to drive the GT40 graphics display while the version available for [[RSTS/E]] was implemented as a multi-user [[run-time system]] and could be used as the user's complete operating environment; the user never actually had to exit TECO. The VTEDIT (Video Terminal Editor) TECO macro was commonly used on [[RSTS/E]] and [[VAX]] systems with terminals capable of direct-cursor control (e.g. [[VT52]] and [[VT100]]) to provide a full-screen visual editor similar in function to the contemporaneously developed [[Emacs]]. TECO continues to be included in [[OpenVMS]] by VSI, and is invoked with the <code>EDIT/TECO</code> command.<ref>{{cite web|url=https://vmssoftware.com/docs/VSI_DCL_DICT_VOL_I.pdf|website=vmssoftware.com|access-date=2020-09-13|date=April 2020|title=VSI OpenVMS DCL Dictionary: A-Z}}</ref> A descendant of the version DEC distributed for the PDP-10 is still available on the Internet, along with several partial implementations for the [[MS-DOS]]/[[Microsoft Windows]] environment. ==History== TECO was originally developed at MIT<ref> {{cite web |title = Summary of TECO commands |url = http://www.bitsavers.org/bits/DEC/pdp1/papertapeImages/20031202/MIT_TS_box1/_text/tecoBlurb.txt |version = From a collection of MIT PDP-1 paper tapes at the Computer History Museum |access-date = 2007-09-12 |url-status = dead |archive-url = https://web.archive.org/web/20080118030225/http://www.bitsavers.org/bits/DEC/pdp1/papertapeImages/20031202/MIT_TS_box1/_text/tecoBlurb.txt |archive-date = 2008-01-18 }}</ref> in around 1963 by [[Daniel L. Murphy]] for use on two [[PDP-1]] computers, belonging to different departments, both housed in MIT's Building 26.<ref> {{cite journal |last=Murphy |first=Dan |year=2009 |title=The Beginnings of TECO |url=http://tenex.opost.com/anhc-31-4-anec.pdf |journal=[[IEEE Annals of the History of Computing]] |volume=31 |issue=4 |pages=110–115 |doi=10.1109/MAHC.2009.127 |s2cid=18805607 }}</ref> On these machines, the normal development process involved the use of a [[Friden Flexowriter]] to prepare source code offline on a continuous strip of punched paper tape. Programmers of the big [[IBM mainframe]]s customarily punched their [[source code]] on [[punched card|card]]s, using [[key punch]]es which printed human-readable [[dot-matrix]] characters along the top of every card at the same time as they punched each machine-readable character. Thus IBM programmers could read, insert, delete, and move lines of code by physically manipulating the cards in the deck. Punched paper tape offered no such amenities, leading to the development of online editing. An early editor for the PDP-1 was named "[[Expensive Typewriter]]". Written by Stephen D. Piner, it was the most rudimentary imaginable line-oriented editor, lacking even search-and-replace capabilities. Its name was chosen as a wry poke at an earlier, rather bloated, editor called "[[Colossal Typewriter]]". Even in those days, online editing could save time in the debugging cycle. Another program written by the PDP-1 [[Hacker (programmer subculture)|hackers]] was [[Expensive Desk Calculator]], in a similar vein. The original stated purpose of TECO was to make more efficient use of the PDP-1. As envisioned in the manual, rather than performing editing "expensively" by sitting at a [[System console|console]], one would simply examine the faulty text and prepare a "correction tape" describing the editing operations to be performed on the text. One would efficiently feed the source tape and the correction tape into the PDP-1 via its high-speed (200 characters per second) reader. Running TECO, it immediately would punch an edited tape with its high-speed (60 characters per second) punch. One could then immediately proceed to load and run the assembler, with no time wasted in online editing. TECO's sophisticated searching operations were motivated by the fact that the offline Flexowriter printouts were not line-numbered. Editing locations therefore needed to be specified by context rather than by line number. The various looping and conditional constructs (which made TECO [[Turing-complete]]) were included in order to provide sufficient descriptive power for the correction tape. The terse syntax minimized the number of keystrokes needed to prepare the correction tape. The correction tape was a program, and required debugging just like any other program. The pitfalls of even the simplest global search-and-replace soon became evident. In practice, TECO editing was performed online just as it had been with Expensive Typewriter (although TECO was certainly a more feature-complete editor than Expensive Typewriter, so editing was much more efficient with TECO). The original PDP-1 version had no screen display. The only way to observe the state of the text during the editing process was to type in commands that would cause the text (or portions thereof) to be typed out on the console typewriter. By 1964, a special Version of TECO (''TECO-6'') had been implemented on the [[PDP-6]] at MIT. That version supported visual editing, using a screen display that showed the contents of the editing buffer in real time, updating as it changed.<ref> {{cite web |last=Samson |first=Peter |date=July 23, 1965 |title=PDP-6 TECO |url=https://dspace.mit.edu/handle/1721.1/5917 |version=Memorandum MAC-M-250 |pages=9 |hdl=1721.1/5917 |access-date=2007-09-12 }}</ref> Amongst the creators of TECO-6 were [[Richard Greenblatt (programmer)|Richard Greenblatt]] and [[Stewart Nelson (Hacker)|Stewart Nelson]].<ref> {{cite web |last=Edwards |first=Daniel J. |title=TECO 6 |url=http://www.transbay.net/~enf/lore/teco/teco-64.html |version=Memorandum MAC-M-191 |date=October 29, 1964 |pages=2 |access-date=2007-09-12 |archive-url=https://web.archive.org/web/20070928094124/http://www.transbay.net/~enf/lore/teco/teco-64.html <!-- Bot retrieved archive --> |archive-date=2007-09-28 }}</ref> At MIT, TECO development continued in the fall of 1971.{{Citation needed|date=October 2009}} Carl Mikkelsen had implemented a real-time edit mode loosely based on the TECO-6 graphic console commands, but working with the newly installed [[Datapoint]]-3300 CRT text displays.<ref name=datapoint> {{Cite web |title=For the Time Sharing Computer User: Datapoint 3300 |url=http://archive.computerhistory.org/resources/text/Computer_Terminal_Corporation/ComputerTerminalCorporation.Datapoint3300.1969.102646159.pdf |publisher=[[Computer Terminal Corporation]] |access-date=2009-10-27 }}</ref> The TECO buffer implementation, however, was terribly inefficient for processing single character insert or delete functions—editing consumed 100% of the PDP-10. With [[Richard Greenblatt (programmer)|Richard Greenblatt]]'s support, in summer of 1972 Carl reimplemented the TECO buffer storage and reformed the macros as native PDP-10 code. {{Citation needed|date=October 2009}} As entering the real-time mode was by typing {{keypress|cntl|R}}, this was known as control-R mode. At the same time, Rici Liknaitski added input-time macros ({{keypress|cntl|]}}), which operated as the command string was read rather than when executed.{{Citation needed|date=October 2009}} Read-time macros made the TECO auxiliary text buffers, called Q-registers, more useful.{{Citation needed|date=October 2009}} Carl expanded the Q-register name space. With read-time macros, a large Q-register name space, and efficient buffer operations, the stage was set for binding each key to a macro.<ref name=c2wiki> {{Cite web |date=August 16, 2010 |title=Teco Editor |publisher=[[c2.com]] |url=http://c2.com/cgi/wiki?TecoEditor |access-date=2013-08-17 }}</ref> These edit macros evolved into [[Emacs]].<ref> {{Cite web |date = January 1978 |title = An Introduction to the EMACS Editor |publisher = MIT |url = ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-447.pdf |archive-url = https://web.archive.org/web/20170706132101/ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-447.pdf |archive-date = 2017-07-06 |url-status = dead |access-date = 2016-11-15 }}</ref> The VMS implementation has a long history - it began as TECO-8, implemented in PDP-8 assembly. This code was translated into PDP-11 assembly to produce TECO-11. TECO-11 was used in early versions of VAX/VMS in PDP-11 compatibility mode. It was later translated from PDP-11 assembly into VAX assembly to produce TECO32. TECO32 was then converted with the VEST and AEST binary translation utilities to make it compatible with OpenVMS on the [[DEC Alpha|Alpha]] and [[Itanium]] respectively.<ref>{{cite web|url=https://github.com/tesneddon/tecox|access-date=2020-09-13|date=2019-06-10|website=github.com|title=tecox Readme}}</ref><ref>{{cite web|url=https://comp.os.vms.narkive.com/k3rjJnUI/vax-pdp11-compatibility-mode|title=VAX PDP11 Compatibility Mode|access-date=2020-09-13|date=2019-08-06|website=comp.os.vms.narkive.com}}</ref><ref>{{cite web|url=https://comp.os.vms.narkive.com/gxzatfU8/andy-museumpiece-goldstein-retirement#post26|title=Andy Goldstein retirement|date=2009-06-12|access-date=2020-09-13|website=comp.os.vms.narkive.com}}</ref> ===OS/8 MUNG command=== The OS/8 [[Concise Command Language|CCL]] '''MUNG''' command invoked TECO to read and execute the specified .TE TECO macro. Optional command line parameters gave added adaptability.<ref>{{cite web |url=http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp8/os8/AA-H608A-TA_os8teco_mar79.pdf |title=TECO Reference Manual digital equipment corporation}}</ref> ==As a programmer's tool== During and shortly following the years of [[Computer programming in the punched card era|the punched card era]], there were source programs that had begun as [[punched card]]-based. Comments were often a series of lines that included single marginal asterisks and top/bottom full lines of asterisks. Once the cards were transferred online, it was difficult to realign the marginal stars. TECO aimed to solve this problem.<ref name=WhyTeco>{{citation |title=Why Teco |author=Martin Pring |date=July 1982}}</ref><ref>He wrote this years after his colleague Carl B. Marbach became editor of a DEC-oriented periodical and wrote "Why Teco?". Both items were published together.</ref> ==As a programming language== The obscurity of the TECO programming language is described in the following quote from "[[Real Programmers Don't Use Pascal]]", a letter from Ed Post to Datamation, July 1983: {{quote|It has been observed that a TECO command sequence more closely resembles transmission line noise than readable text. One of the more entertaining games to play with TECO is to type your name in as a command line and try to guess what it does. Just about any possible typing error while talking with TECO will probably destroy your program, or even worse - introduce subtle and mysterious bugs in a once working subroutine.<ref> {{cite journal |last=Post |first=Ed |date=July 1983 |title=Real Programmers Don't Use PASCAL |url=http://www.pbm.com/~lindahl/real.programmers.html |journal=[[Datamation]] |volume=29 |issue=7 |pages=263–265 }}</ref>}} According to Craig Finseth, author of ''The Craft of Text Editing'',<ref> {{cite book |last=Finseth |first=Craig A. |year=2006 |title=The Craft of Text Editing |publisher=[[Lulu.com]] |url=http://www.finseth.com/craft |isbn=978-1-4116-8297-9 }}</ref> TECO has been described as a "write-only" language, implying that once a program is written in TECO, it is extremely difficult to comprehend what it did without appropriate documentation. Despite its syntax, the TECO command language was tremendously powerful, and clones are still available for [[MS-DOS]] and for [[Unix]]. TECO commands are characters (including control-characters), and the prompt is a single asterisk: * The escape key displays as a dollar sign, pressed once it delineates the end of a command requiring an argument and pressed twice initiates the execution of the entered commands: *$$ ==Example code== Given a file named hello.c with the following contents: <syntaxhighlight lang="c"> int main(int argc, char **argv) { printf("Hello world!\n"); return 0; } </syntaxhighlight> one could use the following TECO session (noting that the prompt is "*" and "$" is how ESC is echoed) to change "Hello" into "Goodbye": :{| class="wikitable" ! TECO session !! explanation |-- | <code>*EBhello.c$$</code> | Open file for read/write with backup |-- | <code>*P$$</code> | Read in the first page |-- | <code>*SHello$0TT$$</code> | Search for "Hello" and print the line (pointer placed after searched string) printf("Hello world!\n"); The line |-- | <code>*-5DIGoodbye$0TT$$</code> | Delete five characters before pointer (ie "Hello"), insert "Goodbye", and print the line<br> printf("Goodbye world!\n"); The updated line |-- | <code>*EX$$</code> | Copy the remainder of the file and exit |} These two example programs are a simple interchange sort of the current text buffer, based on the 1st character of each line, taken from the PDP-11 TECO User's Guide.<ref name=StdTeco/> A "[[GOTO|goto]]" and "[[structured programming|structured]]" version are shown. The second program originally had a bug that prevented the program terminating and the fixed version is used here instead. ===Example 1=== !START! j 0aua ! jump to beginning, load 1st char in register A ! !CONT! l 0aub ! load first char of next line in register B ! qa-qb"g xa k -l ga 1uz ' ! if A>B, switch lines and set flag in register Z ! qbua ! load B into A ! l z-."g -l @o/CONT/ ' ! loop back if another line in buffer ! qz"g 0uz @o/START/ ' ! repeat if a switch was made on last pass ! ===Example 2=== <0uz ! clear repeat flag ! j 0aua l ! load 1st char into register A ! <0aub ! load 1st char of next line into B ! qa-qb"g xa k -l ga -1uz ' ! if A>B, switch lines and set flag ! qbua ! load B into A ! l .-z;> ! loop back if another line in buffer ! qz;> ! repeat if a switch was made last pass ! ==Notes== {{reflist|30em}} ==References== *{{cite book |year=1978 |title=TECO pocket guide |url=http://zane.brouhaha.com/~healyzh/teco/TecoPocketGuide.html |publisher=[[Digital Equipment Corporation]] |archive-url=https://web.archive.org/web/20080207025702/http://zane.brouhaha.com/~healyzh/teco/TecoPocketGuide.html |archive-date=2008-02-07 |access-date=2012-05-24 }} *{{cite journal |last=Murphy |first=Dan |year=2009 |title=The Beginnings of TECO |url=http://tenex.opost.com/anhc-31-4-anec.pdf |journal=[[IEEE Annals of the History of Computing]] |volume=31 |issue=4 |pages=110–115 |doi=10.1109/MAHC.2009.127 |s2cid=18805607 }} *{{cite book |year=1990 |title=TECO Historic Archive |url=http://www.ibiblio.org/pub/academic/computer-science/history/pdp-11/teco/ }} == External links == *[http://www.opost.com/dlm/ Dan Murphy's personal site] *[http://www.sourceforge.net/projects/teco/ Pete Siemsen's TECO collection] *[http://almy.us/teco.html Tom Almy's TECO page], includes a TECO based on Pete Siemsen's TECOC and DECUS documentation (MS-DOS, Windows (console), Linux, Mac OS X, and OS/2 versions) *[http://scienceblogs.com/goodmath/2006/09/22/worlds-greatest-pathological-l-1/ Introduction to the TECO syntax] *[http://www.pdp8online.com/editors/teco/teco.shtml TECO Information] *[http://bitsavers.org/pdf/dec/pdp8/os8/AA-H608A-TA_os8teco_mar79.pdf TECO Manual (OS/8)] {{JargonFile}} {{DEFAULTSORT:Text Editor And Corrector}} [[Category:History of software]] [[Category:Massachusetts Institute of Technology software]] [[Category:OpenVMS text editors]] [[Category:Line editor]] [[Category:Text-oriented programming languages]]
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)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation
(
edit
)
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite magazine
(
edit
)
Template:Cite web
(
edit
)
Template:IPAc-en
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:JargonFile
(
edit
)
Template:Keypress
(
edit
)
Template:Main other
(
edit
)
Template:Quote
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Template other
(
edit
)