The Entities within a Programmer's Editor
1 The Entitites within a Programmer's Editor
1.1 A Text Editor
- Can we state criteria so that a given program can be called a "text
editor"?
- string search/replace
- selection of text
- cut/copy and paste
- text fill into para
- text folding
- word wrapping
- undo, redo
- Language specific: spell check, suggested words
- kbd/mouse/… macros
1.2 A Programmer's Editor
- What distinguishes a programmers' editor from an ordinary text
editor?
- PL syntax is recognized to a good extent
- Code blocks, even in the presence of some syntax errors
- Jumping from one element to another, perhaps using ctags/etags
kind of tools
- Abstract Syntax Trees (AST) awareness
- regex find/capture/replace
- aware of syntax
- Abstract Syntax Trees (AST)
- comments
- "special things": paren, bracket, braces
- if-fi, do-od, …
2 Text Editor Passive Entitites
2.1 Files
- File Name
- File Content
- Lines of Text
- Meta data?
- Text encoding
- EOLN, EOF
- All the above well understood … so sweep it under the …
- Particular classes of files: help, macros, uml, …
2.1.1 Edit Buffers
- An internal data str; holds (file) content
- Associated with a file? Always?
- Numerous designs are possible
- A Linked List of Lines
- A chunk of dynamically allocated area of memory, viewed as
left-part, gap, right-part. Content == left-part + right-part.
- How to choose?
2.1.2 Clip Registers
- "Emacs registers are compartments …"
- Kill Rings, Cut areas, Clipboards
- Different from Buffer?
2.1.3 View
- 2-D "scroll" of text content – mostly hidden
- visible: R lines, C columns
- appearance: fonts, cursors, …
2.1.4 Markers
- Traditional: Dot and Mark; Generalized: Book marks
- (x, y) coord address within text-content that should remain
"stable" even after insert/deletes
- Perhaps number all lines or paragraphs. Cf. a legal document.
2.2 Folding
- A tree structure view of content
2.3 Plugins
- What is a plugin?
- What does a new plugin "deliver"?
- A "bad" plugin can crash the parent
- pre- post- invariants?
2.5 Help Files
3 Programmer's Editor Passive Entitites?
4 Text Editor Active Entitites
4.1 Text Ed Operations
- Ops on Files, Buffers, Registers, Markers, …
- Semantics of Undo/Redo
- Feasibility of some "Undo"
4.2 Engine v UI-binding ("Key" Bindings)
- Software Architecture
- Engine == Collection of all "operations"
- UI-In == How an op of the engine is invoked
- UI-Out == How the state of the engine is "shown"
- A Goal: Do the UI both interactively and non-interactively
- Study Emacs binding mechanism
4.3 Help
- Browse pre-existing pages
- Context-sensitive
4.4 Syntax Awareness
- Highlighting
- Comments
- Matching "corresponding entries"
- paren, bracket, brace matching
- if-fi, do-od, …
4.5 Features that we get as a result of using certain API
- window resize, move, …;
- Is printing done by jEdit/ BlueJ/ … or a Java "service"?