Sometimes my mind goes back to text editing and text editors. I have a love/hate relationship with ed(1). I kind of like the deliberate mindset I need to bring. But I also don’t like to think in terms of lines. Maybe if each sentence is a line, that’s better. But I often think about better semantic addressing.
Example: `p` prints a range of line(s) is the standard. What I would also like is "print a range of paragraph", "print a range of sentences", "print a range of words". There's a hierarchy, here. So once there's a "current" paragraph, you can list its sentences or its words. My hope is that this is more useful than working on lines.
I’m still struggling to invent a command language, however. “Print paragraph. Next. Next. Number sentences. Third sentence. Replace this with that. Print paragraph.” I think this how I would work? “Last paragraph. Insert paragraph. Start typing.” Would that be `p p n 3s /this/that/ p` and `par $ i …` Effectively, `p` switches to paragraphs and prints them, and moves to the next one if used without a range. `n` numbers the items one level down. In this case, with a paragraph selected, `n` numbers the sentences. `s` switches to sentences and prints them. I'm not sure about the search & replace command. Is that also `s`?
Should the data be kept in a tree? Should reading the text involve a real parser that delivers a sort of abstract syntax tree and names the nodes which automatically turn into commands?
And then: should this be written in Perl? 😍
@mxp@mastodon.acm.org said he had written «an Emacs interface to a syntactic parser», but I'm not sure this is what I'm looking for. A natural language parser (NLP) is maybe not what I'm looking for. I suspect it would help avoid grammar mistakes, which makes sense to me. But is it what need as I write?
He then pointed me at Engelbart's A research center for augmenting human intellect. There, we find purple numbers:
A research center for augmenting human intellect
The principal manifestation of this hierarchical structure is the breaking up of text into arbitrary segments called "statements," each of which bears a number showing its serial location in the text and its "level" in an "outline" of the text.
I'm not sure about the use of an outline. Many people seem to like outlines, but for me an outline as a writing tool is weird. I never start with an outline, except for cases where I know I need to follow a structure and even then the structure is usually trivial: Introduction, Materials and Methods, Results, Discussion, References, or something along these lines. A bunch of headings is all I need. Do I need an outline view? I agree that showing all the headings is important to navigate any non-trivial text document when you're reading and working with it. But if I focus on writing, the outline doesn't seem too important. It's too far "up" in the structure, for me.
@CerstinMahlow@mastodon.acm.org wrote a position paper: Writing Tools: Looking Back to Look Ahead where she argues that «new writing tools should be inspired by "failed" projects from the 1970s and 1980s» and discusses the current state of affairs:
Writing Tools: Looking Back to Look Ahead
One type of functionality that Mahlow and Piotrowski suggest are information functions that use NLP techniques to highlight certain aspects of the evolving text, commonly referred to as “syntax highlighting.” Since 2013, iA Writer has offered such a feature in a commercial product to specifically highlight nouns, verbs, adjectives, etc., advertising it as “using parts of speech to improve your writing” and explicitly stating that writers deserve the same professional support as programmers.
This goes in a different direction, "down" to the grammar roles of words. Nouns, verbs, adjectives, adverbs. The problem is that when I write, I hardly ever worry about a particular verb. I never want to navigate to the accusative object of this sentence or focus on the subject. This is a very detailed view that I don't care about.
The question is: What do I care about? Moving sentences around. Starting sentences between some other sentences and then realizing that I started at the wrong place and moving that fragments around. I think what I need is a prototype editor that I can start using and where I can easily add and remove functionality. And I'm not sure that Emacs is the correct environment because there is so damn much to distract me.
#Editors
Use an address prefix like ed:
Use address prefixes like ed:
Currently whitespace is not significant:
Example, based on Warfare:
alex@subterraneobombus ~> scr Documents/Homepage/Warfare.md Read Documents/Homepage/Warfare.md 0 : p # Warfare 0 0: 1p Im Telepolis Artikel _Der Krieg wird zum Terroranschlag_ [¹](http://www.heise.de/tp/deutsch/special/irak/15069/1.html) steht, was mich auch schon im Fall von [Israel](Israel) graust: Auf blossen Verdacht hin werden Leute erschossen. Kein Gericht. Keine Verteidigung. Ein Geheimdiensturteil, und schon wird ein Auto beschossen, um irgendeinen Anführer zu töten. Dabei sterben Leibwächtern, Unbeteiligte, und wohlmöglich noch eine Frau oder ein Kind. Sowas kennt man aus Israel. Im Iraq ist man nun eine Stufe weiter. Man bombardiert Luxuslimousinen (die sicher irgendeinem Schuft gehören – aber haben er und _alle_ Insassen wirklich die Todesstrafe verdient? Gehört die nicht vielmehr abgeschafft?) – und nachher ist nicht mal klar, wenn man überhaupt _versucht_ hat zu töten. Unfassbar. 0 1: 2s Keine Verteidigung. 0 1 2: 0w Keine 0 1 2 0: q
The prompt current prints file number, paragraph number, sentence number, word number.
The example also shows problems handling parentheticals (or quote).
I think before I can move on to insert or append operations, I need to further investigate navigation and selection. I'd like to remember context, so 1p p should print paragraph number one and then the next one without me having to type +1p. Perhaps we can use a period for the current one. So .p prints the current paragraph again.
I also think that a paragraph print should forget the sentence and word position. That currently doesn't happen.