]> git.mdlowis.com Git - projs/tide.git/commitdiff
switched from markdown to asciidoc
authorMichael D. Lowis <mike@mdlowis.com>
Sun, 16 Feb 2020 03:44:31 +0000 (22:44 -0500)
committerMichael D. Lowis <mike@mdlowis.com>
Sun, 16 Feb 2020 03:44:31 +0000 (22:44 -0500)
19 files changed:
LICENSE.adoc [new file with mode: 0644]
Makefile
README.adoc
Rsconscript
TODO.adoc [moved from TODO.md with 69% similarity]
docs/c_scripts.adoc [moved from docs/c_scripts.md with 100% similarity]
docs/debugging.adoc [moved from docs/debugging.md with 100% similarity]
docs/edit_scripts.adoc [moved from docs/edit_scripts.md with 100% similarity]
docs/pick_scripts.adoc [moved from docs/pick_scripts.md with 100% similarity]
docs/sys_design.adoc [moved from docs/sys_design.md with 100% similarity]
docs/tide.1 [deleted file]
src/edit.adoc [moved from src/edit.md with 100% similarity]
src/fetch.adoc [moved from src/fetch.md with 100% similarity]
src/fetchsel.adoc [moved from src/fetchsel.md with 100% similarity]
src/lib/x11_gc.c
src/pick.adoc [moved from src/pick.md with 100% similarity]
src/registrar.adoc [moved from src/registrar.md with 100% similarity]
src/tide.1.adoc [moved from docs/tide.1.md with 57% similarity]
src/tide.adoc [moved from src/tide.md with 100% similarity]

diff --git a/LICENSE.adoc b/LICENSE.adoc
new file mode 100644 (file)
index 0000000..ff7d971
--- /dev/null
@@ -0,0 +1,25 @@
+= LICENSE
+
+Copyright (c) 2016, Michael D. Lowis
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+  this list of conditions and the following disclaimer in the documentation
+  and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
index ea39903e4945c9b1845b96c96678e207de8f1924..b101fe60af5ef93115ee57dddfa5908042bffff3 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -10,7 +10,6 @@ build:
 
 clean:
        ./rscons $(RFLAGS) clean
-       rm -rf html
 
 distclean:
        ./rscons $(RFLAGS) distclean
index 453f7b8734faf54c4d7de47bab88c0957c7d387f..2aaa0cb60a3fe0096384a1e50444b632ef3a53d8 100644 (file)
@@ -11,23 +11,30 @@ A minimal text editor inspired by the Acme text editor from Plan 9.
 
 Execute the following command to produce all of the binaries into bin/:
 
+----
 make
+----
 
 == Installation
 
-    # optionally set the prefix for where it will be installed (*Default:* /usr/local/)
-    export PREFIX=$HOME
+----
+# optionally set the prefix for where it will be installed (*Default:* /usr/local/)
+export PREFIX=$HOME
 
-    # build and install
-    make install
+# build and install
+make install
+----
 
 == Usage
 
-    edit file1 file 2 file3
+----
+edit file1 file 2 file3
+----
 
 == System Overview
 
 === Use Case: Editing a file that is not already open
+
 @startuml
 actor User
 User -> Edit : edit foo.txt
@@ -38,6 +45,7 @@ Edit -> User : Success
 @enduml
 
 === Use Case: Editing a file that is already open
+
 @startuml
 actor User
 User -> Edit : edit foo.txt
@@ -48,6 +56,7 @@ Edit -> User : Success
 @enduml
 
 === Use Case: Editing a file at a specific line number
+
 @startuml
 actor User
 User -> Edit : edit foo.txt:42
@@ -65,17 +74,17 @@ Edit -> User : Success
 |===
 | *Executable* | *Description*
 
-| link:src/edit.adoc[edit]
+| link:src/edit.html[edit]
     | Main executable used to open files for editing
-| link:src/fetch.adoc[fetch]
+| link:src/fetch.html[fetch]
     | Executes pattern matching rules on input text
-| link:src/fetch.adoc[fetchsel]
+| link:src/fetch.html[fetchsel]
     | Executes pattern matching rules on selected text
-| link:src/pick.adoc[pick]
+| link:src/pick.html[pick]
     | Performs fuzzy search on a set of strings
-| link:src/registrar.adoc[registrar]
+| link:src/registrar.html[registrar]
     | Tracks open windows and the files they contain
-| link:src/tide.adoc[tide]
+| link:src/tide.html[tide]
     | The main tide editor executable
 |===
 
@@ -84,36 +93,36 @@ Edit -> User : Success
 |===
 | *Executable* | *Description*
 
-| link:docs/c_scripts.md[E-S and S-E]
+| link:docs/c_scripts.html[E-S and S-E]
     | Convert C functions between static and extern scoping
-| link:docs/edit_scripts.md[c+ and c-]
+| link:docs/edit_scripts.html[c+ and c-]
     | Comment and uncomment selected text
-| link:docs/pick_scripts.md[fcomplete]
+| link:docs/pick_scripts.html[fcomplete]
     | Uses @ref pick to complete a file or directory path
-| link:docs/edit_scripts.md[findall]
+| link:docs/edit_scripts.html[findall]
     | Find all occurrences of a string in the project or directory
-| link:docs/edit_scripts.md[grepn]
+| link:docs/edit_scripts.html[grepn]
     | Executes grep -n on input and outputs to a new window
-| link:docs/edit_scripts.md[i+ and i-]
+| link:docs/edit_scripts.html[i+ and i-]
     | Indent or deindent input text
-| link:docs/c_scripts.md[jmpsrc]
+| link:docs/c_scripts.html[jmpsrc]
     | Jump between related C source and header files
-| link:docs/edit_scripts.md[lang]
+| link:docs/edit_scripts.html[lang]
     | Determine by extension the programming language of source file
-| link:docs/c_scripts.md[no-c++]
+| link:docs/c_scripts.html[no-c++]
     | Convert all C++ style comments to C style comments
-| link:docs/pick_scripts.md[pickexec]
+| link:docs/pick_scripts.html[pickexec]
     | Uses @ref pick to find and execute an command in $PATH
-| link:docs/pick_scripts.md[pickfile]
+| link:docs/pick_scripts.html[pickfile]
     | Uses @ref pick to find and open a file for editing
-| link:docs/pick_scripts.md[picktag]
+| link:docs/pick_scripts.html[picktag]
     | Uses @ref pick to jump to a symbol using CTags index file
-| link:docs/edit_scripts.md[term]
+| link:docs/edit_scripts.html[term]
     | Executes command shell in @ref tide in pseudo-terminal mode
-| link:docs/c_scripts.md[tofn]
+| link:docs/c_scripts.html[tofn]
     | Converts C function prototypes to function definitions
-| link:docs/debugging.md[view-telem]
+| link:docs/debugging.html[view-telem]
     | Prints @ref tide telemetry data to stdout for debugging
-| link:docs/edit_scripts.md[w+ and x+]
+| link:docs/edit_scripts.html[w+ and x+]
     | Marks the current file as writable and/or executable
 |===
index 524f4ae15cacbf571c6c3f44497f8b25104ba399..0564c1042515501590bf69acba2c756e4ddd3de1 100644 (file)
@@ -40,12 +40,14 @@ build do
     "CMD_DESC" => "TEST")
   env.depends("${prefix}/bin", "")
 
-  # Install the compiled binaries
-  Dir.glob("bin/*").each{|bin| env.Install("${prefix}/bin", bin) }
+  env.Directory("#{env.build_root}/uml/")
   Dir.glob("**/*.adoc").each do |doc|
-    ofile = "build/html/#{doc.sub(/\.[a-zA-Z0-9]+$/, '.html')}"
-    puts "#{ofile} #{doc}"
+    ofile = "#{env.build_root}/html/#{doc.sub(/\.adoc$/, '.html')}"
     env.Command(ofile, doc,
-      "CMD" => %w[asciidoc -a toc -o${_TARGET} ${_SOURCES}])
+      "CMD" => %w[./gendoc ${UMLROOT} ${_TARGET} ${_SOURCES}],
+      "UMLROOT" => "#{env.build_root}/uml/")
   end
+
+  # Install the compiled binaries
+  Dir.glob("bin/*").each{|bin| env.Install("${prefix}/bin", bin) }
 end
similarity index 69%
rename from TODO.md
rename to TODO.adoc
index 0144b707653ab4d5d9fb03d0c1edd901997b7eff..553812e7dcd52c8444150aa05be0e86e6b4d59c7 100644 (file)
--- a/TODO.md
+++ b/TODO.adoc
@@ -1,8 +1,6 @@
-# Issue List
+= TODO
 
-### VERIFYING
-
-### STAGING
+== STAGING
 
 * tide: point should be added to editlog to ensure undo/redo behave appropriately
 * picktag: reimplement in C using binary search
@@ -12,7 +10,7 @@
 * all: eliminate multiple return statements and other lint
 * tide: byrune, byword, byline functions should be hidden in buf.c
 
-### BACKLOG
+== BACKLOG
 
 * tide: commands unadorned by a sigil should direct output to new scratch window
 * tide: gap buffer does not handle UTF-8 currently
 * anvil: add support for session management
 * tsed: implement a mini-sed command to standardize scripts across platforms without relying on sed
 
-Tags:
+=== Tags
 
 * ID - Get window id of the X window
 * Zerox - Create a copy of the window
 
-The Future:
+=== The Future
 
 * Wily-like rc file for registering builtins
 * Case insensitive search
@@ -41,7 +39,7 @@ The Future:
 * move by words is inconsistent. Example:
     var infoId = 'readerinfo'+reader.id;
 
-Maybe think about addressing these later:
+=== Maybe think about addressing these later
 
 * add current dir to PATH variable
 * add support for guidefiles
@@ -49,16 +47,18 @@ Maybe think about addressing these later:
 * implement command diffing logic to optimize the undo/redo log
 * right click negative numbers should jump to that many lines from the end of file
 
-Mouse Chords:
+=== Mouse Chords
+
+|===
+| Sequence | Action
 
-| Sequence       | Action                             |
-|----------------|------------------------------------|
-| 1P             | Move the cursor                    |
-| 1P 1R 1P       | Select clicked on word             |
-| 1P 1R 1P 1R 1P | Select whole non whitespace thing  |
-| 2P 2R          | Execute clicked word               |
-| 2P 1P 2R       | Execute clicked word with argument |
-| 3P 3R          | Fetch clicked word                 |
-| 3P 1P 3R       | ?? Go to definition ??             |
-| 1P 2P 2R       | Cut the selected text              |
-| 1P 3P 3R       | Paste the selection                |
+| 1P             | Move the cursor
+| 1P 1R 1P       | Select clicked on word
+| 1P 1R 1P 1R 1P | Select whole non whitespace thing
+| 2P 2R          | Execute clicked word
+| 2P 1P 2R       | Execute clicked word with argument
+| 3P 3R          | Fetch clicked word
+| 3P 1P 3R       | ?? Go to definition ??
+| 1P 2P 2R       | Cut the selected text
+| 1P 3P 3R       | Paste the selection
+|===
\ No newline at end of file
similarity index 100%
rename from docs/c_scripts.md
rename to docs/c_scripts.adoc
similarity index 100%
rename from docs/debugging.md
rename to docs/debugging.adoc
similarity index 100%
rename from docs/edit_scripts.md
rename to docs/edit_scripts.adoc
similarity index 100%
rename from docs/pick_scripts.md
rename to docs/pick_scripts.adoc
similarity index 100%
rename from docs/sys_design.md
rename to docs/sys_design.adoc
diff --git a/docs/tide.1 b/docs/tide.1
deleted file mode 100644 (file)
index ee57548..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-.\" generated with Ronn/v0.7.3
-.\" http://github.com/rtomayko/ronn/tree/0.7.3
-.
-.TH "TIDE" "1" "June 2017" "" ""
-.
-.SH "NAME"
-\fBtide\fR \- a text editor inspired by acme(1) from Plan 9 and Inferno
-.
-.SH "SYNOPSIS"
-\fBtide\fR [\fIfile\fR\.\.\.]
-.
-.SH "DESCRIPTION"
-\fBtide\fR is a text editor inspired by the Acme editor from the Plan 9 and Inferno operating systems\. Unlike Acme, \fBtide\fR is a single window, single file editor\. Instead of baking a window manager into the editor, this job is relegated to an X11 window manager\. It is recommended that \fBtide\fR be used with a tiling window manager such as dwm(1) or spectrwm(1)\. These window managers will make dealing with multiple windows much easier and more efficient\.
-.
-.SS "Windows"
-\fBtide\fR windows are divided into four basic regions: a one\-line status, an expanding tags region, a main content region and an adjacent scroll region\. The status region contains a set of symbolic flags indicating the current state of the editor followed by the path of the file being edited\. The tags region acts as scratch buffer for commands that can be executed to affect the file or the state of the editor\. As the content of this region grows it will expand up to a quarter of the size of the window shrinking the main coantent region in kind\. The main content region displays a view of the file currently being edited\. To the left of the content region is a narrow vertical region matching the height of the content region\. This region acts as a scrollbar for the content region\.
-.
-.SS "Scrolling"
-The scroll bar is located to the left of the content region\. It\'s operation is similar to that of acme(1) or 9term(1)\. A left click on the scroll bar will scroll the adjacent line in the content region to the bottom of the window\. A right click will move the adjacent line in the content region to the top of the window\. A middle click will jump to an approximate location in the file determined by calculating the vertical distance from the top of the scrollbar and applying that as a percentage to the offset in the file\.
-.
-.SS "Typing and Editing"
-Typed characters in \fBtide\fR are delivered to the currently active region\. Which region is active is determined by the placement of the mouse or by keyboard shortcut\. That is to say, the focus follows the mouse much as it does in acme(1) but there is a keyboard shortcut that allows users to toggle focus between the content region and the tag region without using the mouse\.
-.
-.P
-The mechanics of editing text in the tag and content region is identical with the exception of searching and saving\. Edited content in the tag region is not saved to disk unlike the content region\. This region is considered a scratch buffer for commands, notes, and other bits of text that are placed there temporarily\. The content region displays the current view of the file being edited and can be flushed to disk when requested\.
-.
-.P
-Searching with a term selected in the tags region will search for the term in the content region rather than the tags region\. In this way a user can edit the search term incrementally and perform repeated searches through the content region\. Searching for a term in the content region \fIwill\fR search for the term in the content region however\.
-.
-.SH "TEXT SELECTION"
-\fBtide\fR uses a series of rules to determine how much text to select when the user executes a context sensitive selection, a search, or a context sensitive execution\. The following rules are applied in order until a match is found\.
-.
-.IP "1." 4
-\fBCursor over \'(\' or \')\'\fR: Highlight text between the parentheses including nested parentheses\.
-.
-.IP "2." 4
-\fBCursor over \'[\' or \']\'\fR: Highlight text between the brackets including nested brackets\.
-.
-.IP "3." 4
-\fBCursor over \'{\' or \'}\'\fR: Highlight text between the braces including nested braces\.
-.
-.IP "4." 4
-\fBCursor at beginning or end of line\fR: Highlight the entire line (including the newline)
-.
-.IP "5." 4
-\fBCursor over alphanumeric character or underscore\fR: Highlight the word under the cursor consisting of only alphanumeric and underscore characters\.
-.
-.IP "" 0
-.
-.P
-If none of the above rules match, \fBtide\fR will simply highlight the block of non\-whitespace characters under the cursor\.
-.
-.SH "MOUSE HANDLING"
-.
-.TP
-\fBLeft Button\fR
-The left mouse button is used for selecting text or moving the cursor\. A single\-click will move the mose to the clicked location\. A double\-click will will select the object under the clicked location based on context as described in \fBTEXT SELECTION\fR\. A triple\-click will select the largest contiguous chunk of non\-whitespace characters at the clicked location\.
-.
-.TP
-\fBMiddle Button\fR
-The middle mouse button is used for executing text at the clicked location\. The command to be executed is determined by the context rules defined in the \fBTEXT SELECTION\fR section\. The cursor position is not changed on a middle click\.
-.
-.TP
-\fBRight Button\fR
-The right button is used to search for the next occurrence of the clicked text\. The search term is determined by the context rules defined in the \fBTEXT SELECTION\fR section\. The search direction follows the direction of the previous search operation\. The \fBShift\fR key can be held in combination with a click of the right mosue button in order to reverse the search direction\.
-.
-.SH "COMMAND EXECUTION"
-\fBtide\fR allows for the execution of any arbitrary text as a command\. The input and output to/from each command executed can be controlled by prepending one of a set of sigils defined below\. These sigils instruct \fBtide\fR from where the command will receive its input and where it will place its output (both standard and errors)\.
-.
-.TP
-\fB\'!\' \- Run command detached from editor\fR
-The command will be executed in the background and all of its input and output file descriptors will be closed\.
-.
-.TP
-\fB\'<\' \- Input from command\fR
-The command will be executed in the background and its standard output will be placed in the content region\. Its error output will be placed in the tags region\.
-.
-.TP
-\fB\'>\' \- Output to command\fR
-The command will be executed in the background\. The currently selected text will be written to the command\'s standard input\. The command\'s standard output and standard error content will be written to the tags region\.
-.
-.TP
-\fB\'|\' \- Pipe through command\fR
-The command will be executed in the background\. The currently selected text will be written to the command\'s standard input\. The command\'s standard output will replace the currently selected text\. Any error output will be placed in the tags region\.
-.
-.TP
-\fB\':\' \- Pipe through sed(1)\fR
-Identical to \'|\' except that the command is always sed(1)\. This is a convenience shortcut to allow quick and easy access to sed for editing blocks of text\.
-.
-.TP
-\fBCommands with no sigil\fR
-Commands with none of the aforementioned sigils will be executed in the background and have their standard output placed in the content region and their error output placed in the tags region\.
-.
-.SH "KEYBOARD SHORTCUTS"
-.
-.SS "Unix Standard Shortcuts"
-.
-.TP
-\fBCtrl+u\fR
-Delete from the cursor position to the beginning of the line\.
-.
-.TP
-\fBCtrl+k\fR
-Delete from the cursor position to the end of the line\.
-.
-.TP
-\fBCtrl+w\fR
-Delete the word to the left\.
-.
-.TP
-\fBCtrl+a\fR
-Move cursor to the beginning of the line\.
-.
-.TP
-\fBCtrl+e\fR
-Move cursor to the end of the line\.
-.
-.SS "Cursor Movement and Selection"
-The key combinations below are responsible for moving the cursor around the document by character, by word, or by line\. The \fBShift\fR modifier key can be applied to any of them to also extend the current selection to the new cursor position\.
-.
-.TP
-\fBEscape\fR
-Highlight the last contiguous block of inserted text or clear the current selection (deselect the currently selected text)\.
-.
-.TP
-\fBLeft\fR
-Move the cursor one character to the left\.
-.
-.TP
-\fBRight\fR
-Move the cursor one character to the right\.
-.
-.TP
-\fBUp\fR
-Move the cursor to the previous line\.
-.
-.TP
-\fBDown\fR
-Move the cursor to the next line\.
-.
-.TP
-\fBCtrl+Up\fR
-Move the current line or selection up a line\.
-.
-.TP
-\fBCtrl+Down\fR
-Move the current line or selection down a line\.
-.
-.TP
-\fBCtrl+Left\fR
-Move the cursor to the beginning of the word to the left\.
-.
-.TP
-\fBCtrl+Right\fR
-Move the cursor to the end of the word to the right\.
-.
-.SS "Modern Text Editing Shortcuts"
-.
-.TP
-\fBCtrl+s\fR
-Save the contents of the content region to disk\.
-.
-.TP
-\fBCtrl+z\fR
-Undo the last change performed on the active region\.
-.
-.TP
-\fBCtrl+y\fR
-Redo the previously undone change on the active region\.
-.
-.TP
-\fBCtrl+x\fR
-Cut the selected text to the X11 CLIPBOARD selection\. If no text is selected then the current line is cut\.
-.
-.TP
-\fBCtrl+c\fR
-Copy the selected text to the X11 CLIPBOARD selection\. If no text is selected then the current line is copied\.
-.
-.TP
-\fBCtrl+v\fR
-Paste the contents of the X11 CLIPBOARD selection to the active region\.
-.
-.TP
-\fBCtrl+j\fR
-Join the current line and the next line\.
-.
-.TP
-\fBCtrl+l\fR
-Select the current line\.
-.
-.TP
-\fBCtrl+Shift+a\fR
-Select all text in the buffer\.
-.
-.TP
-\fBDelete\fR
-Delete the character to the right\.
-.
-.TP
-\fBCtrl+Delete\fR
-Delete the word to the right\.
-.
-.TP
-\fBBackspace\fR
-Delete the character to the left\.
-.
-.TP
-\fBCtrl+Backspace\fR
-Delete the word to the left\.
-.
-.TP
-\fBCtrl+Enter\fR
-Create a new line after the current line and place the cursor there\.
-.
-.TP
-\fBCtrl+Shift+Enter\fR
-Create a new line before the current line and place the cursor there\.
-.
-.TP
-\fBPageUp\fR
-Scroll the active region up by one screenful of text\. The cursor is not affected by this operation\.
-.
-.TP
-\fBPageDn\fR
-Scroll the active region down by one screenful of text\. The cursor is not affected by this operation\.
-.
-.SS "Bookmark Shortcuts"
-\fBtide\fR supports marking locations in a document to quickly jump to later\. This eases navigation between multiple locations in a large document\.
-.
-.TP
-\fBCtrl+[0\-9]\fR
-Jump to a bookmarked location\.
-.
-.TP
-\fBCtrl+Alt+[0\-9]\fR
-Save the cursor location as a bookmark
-.
-.SS "Search Shortcuts"
-The shortcuts below allow the user to search for selected text or by context\. The direction of the search defaults to the forward direction with regard to the position in the file\. Each search follows the direction of the previous search unless the \fBShift\fR modifier is applied\. The \fBShift\fR modifier causes the current search operation to be applied in the opposite direction of the previous\.
-.
-.TP
-\fBCtrl+f\fR
-Search for the next occurrence of the selected text in the content region\. If no text is currently selected, the text under the cursor is selected based on context as described in \fBTEXT SELECTION\fR\.
-.
-.TP
-\fBCtrl+Alt+f\fR
-Search for the next occurence previous search term in the content region\.
-.
-.SS "Implementation\-specific Shortcuts"
-.
-.TP
-\fBCtrl+[\fR
-Decrease the indent level of the selected text\.
-.
-.TP
-\fBCtrl+]\fR
-Increase the indent level of the selected text\.
-.
-.TP
-\fBCtrl+h\fR
-Highlight the item under cursor following the rules in \fBTEXT SELECTION\fR
-.
-.TP
-\fBCtrl+t\fR
-Toggle focus between the tags region and the content region\.
-.
-.TP
-\fBCtrl+q\fR
-Quit the editor\. If the file is modified a warning will be printed in the tags region and the editor will not quit\. Executing the shortcut twice within 250ms will ignore the warning and quit the editor without saving\.
-.
-.TP
-\fBCtrl+d\fR
-Execute the selected text as described in \fBCOMMAND EXECUTION\fR\. If no text is selected, the text under cursor is selecte dbased on context as described in \fBTEXT SELECTION\fR\.
-.
-.TP
-\fBCtrl+o\fR
-Launch pickfile(1) to choose a file from a recursive list of files in the current directory and sub directories\. This file will be opened in a new instance of \fBtide\fR\.
-.
-.TP
-\fBCtrl+Shift+o\fR
-Launch pickfile(1) to choose a file from a recursive list of files in the current directory and sub directories\. This file will be opened in the current instance of \fBtide\fR replacing the currently open file\. In the event that the current instance of \fBtide\fR has modifications, the file will be opened in a new instance\.
-.
-.TP
-\fBCtrl+p\fR
-Launch picktag(1) to select a tag from a ctags(1) generated index file\. \fBtide\fR will jump to the selected ctag definition in the current window if the file is currently being edited\. Otherwise, a new instance of \fBtide\fR will be launched with the target file and the cursor set to the line containing the definition\.
-.
-.TP
-\fBCtrl+g\fR
-Lookup the selected symbol or symbol under the cursor in a ctags(1) generated index file\. Jump to the location of the definition if it exist in the current file\. Otherwise, a new instance of \fBtide\fR will be launched with the target file and the cursor set to the line containing the definition\.
-.
-.TP
-\fBCtrl+Shift+g\fR
-Jump to the last implicitly marked location\. In general, actions that move the cursor potentially greate distances will set an implicit mark before performing the move\. These actions include, jumping to a ctag definition, jumping to a line, or clicking with the mouse\.
-.
-.TP
-\fBCtrl+n\fR
-Open a new instance of \fBtide\fR with no filename\.
-.
-.SH "BUILTINS"
-.
-.TP
-\fBCut\fR
-Cut the selection to the X11 CLIPBOARD selection\.
-.
-.TP
-\fBCopy\fR
-Copy the selection to the X11 CLIPBOARD selection\.
-.
-.TP
-\fBEol\fR
-Toggle the line\-ending style for the buffers contents between LF and CRLF
-.
-.TP
-\fBFind [term]\fR
-Find the next occurrence of the selected text\.
-.
-.TP
-\fBGoTo [arg]\fR
-Jump to a specific line number or symbol\.
-.
-.TP
-\fBIndent\fR
-Toggle the autoindent feature on or off\.
-.
-.TP
-\fBOverwrite\fR
-Save the file to disk even if the file has been modified externally\.
-.
-.TP
-\fBPaste\fR
-Paste the contents of the X11 CLIPBOARD selection into the buffer\.
-.
-.TP
-\fBQuit\fR
-Quit the editor\.
-.
-.TP
-\fBRedo\fR
-Redo the last undone change\.
-.
-.TP
-\fBReload\fR
-Reload the buffer contents from the on\-disk file\.
-.
-.TP
-\fBSave\fR
-Save the contents of the buffer to disk\.
-.
-.TP
-\fBSaveAs [path]\fR
-Save the contents of the buffer to disk\. If a path argument is provided, the buffer will be saved to the new path\.
-.
-.TP
-\fBTabs\fR
-Toggle the expand tabs featuer on or off\.
-.
-.TP
-\fBUndo\fR
-Undo the previous edit\.
-.
-.SH "FILES"
-.
-.TP
-\fB$HOME/\.config/edit/editrc\fR
-Shell script loaded in current environment to make shell functions and environment variables available to tide(1)
-.
-.SH "ENVIRONMENT"
-.
-.TP
-\fBEDITTAGS\fR
-The contents of this environment variable is used to initialize the contents of the tags region of the window\.
-.
-.TP
-\fBSHELL\fR
-The contents of this variable are used as the shell in which all non\-builtin commands are executed\. If this variable is not defined, sh(1) is used as a fallback shell\.
-.
-.SH "AUTHOR"
-Michael D\. Lowis
-.
-.SH "SEE ALSO"
-tide(1) pick(1) pickfile(1) picktag(1)
similarity index 100%
rename from src/edit.md
rename to src/edit.adoc
similarity index 100%
rename from src/fetch.md
rename to src/fetch.adoc
similarity index 100%
rename from src/fetchsel.md
rename to src/fetchsel.adoc
index f075b4b4f73dcaefce7798082adc022fbf2d13ca..c939e538eb47379dfc999cc1538742ce537b9c9a 100644 (file)
@@ -3,15 +3,6 @@
 #include <io.h>
 #include <X11/extensions/Xinerama.h>
 
-static void xfocus(XConf* x, XEvent* e)
-{
-    telem_send("XFOCUS(focus: %d)\n", (e->type == FocusIn));
-    if (x->xic)
-    {
-        (e->type == FocusIn ? XSetICFocus : XUnsetICFocus)(x->xic);
-    }
-}
-
 void x11_resize(XConf* x, XEvent* e)
 {
     telem_send("XRESIZE(w: %d, h: %d)\n", e->xconfigure.width, e->xconfigure.height);
@@ -44,8 +35,6 @@ void x11_init_gc(XConf* x)
     gcv.foreground = WhitePixel(x->display, x->screen);
     gcv.graphics_exposures = False;
     x->gc = XCreateGC(x->display, x->self, GCGraphicsExposures, &gcv);
-    x->eventfns[FocusIn] = xfocus;
-    x->eventfns[FocusOut] = xfocus;
     x->eventfns[ConfigureNotify] = x11_resize;
     x->eventfns[MapNotify] = x11_mapnotify;
 }
similarity index 100%
rename from src/pick.md
rename to src/pick.adoc
similarity index 100%
rename from src/registrar.md
rename to src/registrar.adoc
similarity index 57%
rename from docs/tide.1.md
rename to src/tide.1.adoc
index dc9006e481d1fde079861d85642dae24466fb3c3..82bbad2df38954cfeb7d005d8d56559cc3051588 100644 (file)
@@ -1,52 +1,46 @@
-# tide -- a text editor inspired by acme(1) from Plan 9 and Inferno
+= tide(1)
+:doctype: manpage
 
-## SYNOPSIS
+== NAME
 
-`tide` [_file_...]
+tide - a text editor inspired by acme(1) from Plan 9 and Inferno
 
-## DESCRIPTION
+== SYNOPSIS
 
-`tide` is a text editor inspired by the Acme editor from the Plan 9 and Inferno
-operating systems. Unlike Acme, `tide` is a single window, single file editor.
+*tide* [FILE...]
+
+== DESCRIPTION
+
+*tide* is a text editor inspired by the Acme editor from the Plan 9 and Inferno
+operating systems. Unlike Acme, *tide* is a single window, single file editor.
 Instead of baking a window manager into the editor, this job is relegated to an
-X11 window manager. It is recommended that `tide` be used with a tiling window
+X11 window manager. It is recommended that *tide* be used with a tiling window
 manager such as dwm(1) or spectrwm(1). These window managers will make dealing
 with multiple windows much easier and more efficient.
 
-### Windows
+=== Windows
 
-`tide` windows are divided into four basic regions: a one-line status, an
-expanding tags region, a main content region and an adjacent scroll region. The
-status region contains a set of symbolic flags indicating the current state of
-the editor followed by the path of the file being edited. The tags region acts
-as scratch buffer for commands that can be executed to affect the file or the
-state of the editor. As the content of this region grows it will expand up to a
-quarter of the size of the window shrinking the main coantent region in kind.
+*tide* windows are divided into three basic regions: an expanding tags region, a
+main content region and an adjacent scroll region. The tags region acts as
+scratch buffer for commands that can be executed to affect the file or the state
+of the editor. As the content of this region grows it will expand up to a
+quarter of the size of the window, shrinking the main content region in kind.
 The main content region displays a view of the file currently being edited. To
 the left of the content region is a narrow vertical region matching the height
-of the content region. This region acts as a scrollbar for the content region.
-
-### Scrolling
-
-The scroll bar is located to the left of the content region. It's operation is
-similar to that of acme(1) or 9term(1). A left click on the scroll bar will
-scroll the adjacent line in the content region to the bottom of the window. A
-right click will move the adjacent line in the content region to the top of the
-window. A middle click will jump to an approximate location in the file
-determined by calculating the vertical distance from the top of the scrollbar
-and applying that as a percentage to the offset in the file.
+of the content region. This region gives the user visibility into how much of
+the document is currently visible as well as their position in the document.
 
-### Typing and Editing
+=== Typing and Editing
 
-Typed characters in `tide` are delivered to the currently active region. Which
-region is active is determined by the placement of the mouse or by keyboard
-shortcut. That is to say, the focus follows the mouse much as it does in acme(1)
-but there is a keyboard shortcut that allows users to toggle focus between the
-content region and the tag region without using the mouse.
+Typed characters in *tide* are delivered to the currently active region. The
+active region is the one currently under the mouse cursor.  That is to say, the
+focus follows the mouse much as it does in acme(1) but there is a keyboard
+shortcut that allows users to toggle focus between the content region and the
+tag region by warping the mouse cursor from one region to the next.
 
 The mechanics of editing text in the tag and content region is identical with
 the exception of searching and saving. Edited content in the tag region is not
-saved to disk unlike the content region. This region is considered a scratch
+saved to disk while the content region is. This region is considered a scratch
 buffer for commands, notes, and other bits of text that are placed there
 temporarily. The content region displays the current view of the file being
 edited and can be flushed to disk when requested.
@@ -54,13 +48,13 @@ edited and can be flushed to disk when requested.
 Searching with a term selected in the tags region will search for the term in
 the content region rather than the tags region. In this way a user can edit the
 search term incrementally and perform repeated searches through the content
-region. Searching for a term in the content region *will* search for the term in
+region. Searching for a term in the content region will search for the term in
 the content region however.
 
-## TEXT SELECTION
+== TEXT SELECTION [[S1]]
 
-`tide` uses a series of rules to determine how much text to select when the
-user executes a context sensitive selection, a search, or a context sensitive
+*tide* uses a series of rules to determine how much text to select when the user
+executes a context sensitive selection, a search, or a context sensitive
 execution. The following rules are applied in order until a match is found.
 
 1. `Cursor over '(' or ')'`:
@@ -79,334 +73,301 @@ execution. The following rules are applied in order until a match is found.
     Highlight the word under the cursor consisting of only alphanumeric and
     underscore characters.
 
-If none of the above rules match, `tide` will simply highlight the block of
+If none of the above rules match, *tide* will simply highlight the block of
 non-whitespace characters under the cursor.
 
-## MOUSE HANDLING
+== MOUSE HANDLING
 
-* `Left Button`:
+*Left Button*::
     The left mouse button is used for selecting text or moving the cursor. A
     single-click will move the mose to the clicked location. A double-click will
     will select the object under the clicked location based on context as
-    described in `TEXT SELECTION`. A triple-click will select the largest
+    described in <<S1,TEXT SELECTION>>. A triple-click will select the largest
     contiguous chunk of non-whitespace characters at the clicked location.
 
-* `Middle Button`:
+*Middle Button*::
     The middle mouse button is used for executing text at the clicked location.
-    The command to be executed is determined by the context rules defined in
-    the `TEXT SELECTION` section. The cursor position is not changed on a middle
-    click.
+    The command to be executed is determined by the context rules defined in the
+    <<S1,TEXT SELECTION>> section. The cursor position is not changed on a
+    middle click.
 
-* `Right Button`:
+*Right Button*::
     The right button is used to search for the next occurrence of the clicked
     text. The search term is determined by the context rules defined in the
-    `TEXT SELECTION` section. The search direction follows the direction of the
-    previous search operation. The `Shift` key can be held in combination with a
-    click of the right mosue button in order to reverse the search direction.
+    <<S1,TEXT SELECTION>> section. The search direction follows the direction of
+    the previous search operation. The *Shift* key can be held in combination
+    with a click of the right mosue button in order to reverse the search
+    direction.
 
-## COMMAND EXECUTION
+== COMMAND EXECUTION
 
-`tide` allows for the execution of any arbitrary text as a command. The input
+*tide* allows for the execution of any arbitrary text as a command. The input
 and output to/from each command executed can be controlled by prepending one of
-a set of sigils defined below. These sigils instruct `tide` from where the
+a set of sigils defined below. These sigils instruct *tide* from where the
 command will receive its input and where it will place its output (both standard
 and errors).
 
-* `'!' - Run command detached from editor`:
+*! - Run command detached from editor*::
     The command will be executed in the background and all of its input and
     output file descriptors will be closed.
 
-* `'<' - Input from command`:
+*< - Input from command*:
     The command will be executed in the background and its standard output will
     be placed in the content region. Its error output will be placed in the tags
     region.
 
-* `'>' - Output to command`:
+*> - Output to command*::
     The command will be executed in the background. The currently selected text
     will be written to the command's standard input. The command's standard
     output and standard error content will be written to the tags region.
 
-* `'|' - Pipe through command`:
+*| - Pipe through command*::
     The command will be executed in the background. The currently selected text
     will be written to the command's standard input. The command's standard
     output will replace the currently selected text. Any error output will be
     placed in the tags region.
 
-* `':' - Pipe through sed(1)`:
+*: - Pipe through sed(1)*::
     Identical to '|' except that the command is always sed(1). This is a
     convenience shortcut to allow  quick and easy access to sed for editing
     blocks of text.
 
-* `Commands with no sigil`:
+*Commands with no sigil*::
     Commands with none of the aforementioned sigils will be executed in the
     background and have their standard output placed in the content region and
     their error output placed in the tags region.
 
-## KEYBOARD SHORTCUTS
+== KEYBOARD SHORTCUTS
 
-### Unix Standard Shortcuts
+=== Unix Standard Shortcuts
 
-* `Ctrl+u`:
+*Ctrl+u*::
     Delete from the cursor position to the beginning of the line.
 
-* `Ctrl+k`:
+*Ctrl+k*::
     Delete from the cursor position to the end of the line.
 
-* `Ctrl+w`:
+*Ctrl+w*::
     Delete the word to the left.
 
-* `Ctrl+a`:
+*Ctrl+a*::
     Move cursor to the beginning of the line.
 
-* `Ctrl+e`:
+*Ctrl+e*::
     Move cursor to the end of the line.
 
-### Cursor Movement and Selection
+=== Cursor Movement and Selection
 
 The key combinations below are responsible for moving the cursor around the
-document by character, by word, or by line. The `Shift` modifier key can be
+document by character, by word, or by line. The *Shift* modifier key can be
 applied to any of them to also extend the current selection to the new cursor
 position.
 
-* `Escape`:
+*Escape*::
     Highlight the last contiguous block of inserted text or clear the current
     selection (deselect the currently selected text).
 
-* `Left`:
+*Left*::
     Move the cursor one character to the left.
 
-* `Right`:
+*Right*::
     Move the cursor one character to the right.
 
-* `Up`:
+*Up*::
     Move the cursor to the previous line.
 
-* `Down`:
+*Down*::
     Move the cursor to the next line.
 
-* `Ctrl+Up`:
+*Ctrl+Up*::
     Move the current line or selection up a line.
 
-* `Ctrl+Down`:
+*Ctrl+Down*::
     Move the current line or selection down a line.
 
-* `Ctrl+Left`:
+*Ctrl+Left*::
     Move the cursor to the beginning of the word to the left.
 
-* `Ctrl+Right`:
+*Ctrl+Right*::
     Move the cursor to the end of the word to the right.
 
-### Modern Text Editing Shortcuts
+=== Modern Text Editing Shortcuts
 
-* `Ctrl+s`:
+*Ctrl+s*::
     Save the contents of the content region to disk.
 
-* `Ctrl+z`:
+*Ctrl+z*::
     Undo the last change performed on the active region.
 
-* `Ctrl+y`:
+*Ctrl+y*::
     Redo the previously undone change on the active region.
 
-* `Ctrl+x`:
+*Ctrl+x*::
     Cut the selected text to the X11 CLIPBOARD selection. If no text is selected
     then the current line is cut.
 
-* `Ctrl+c`:
-    Copy the selected text to the X11 CLIPBOARD selection. If no text is selected
-    then the current line is copied.
+*Ctrl+c*::
+    Copy the selected text to the X11 CLIPBOARD selection. If no text is
+    selected then the current line is copied.
 
-* `Ctrl+v`:
+*Ctrl+v*::
     Paste the contents of the X11 CLIPBOARD selection to the active region.
 
-* `Ctrl+j`:
+*Ctrl+j*::
     Join the current line and the next line.
 
-* `Ctrl+l`:
+*Ctrl+l*::
     Select the current line.
 
-* `Ctrl+Shift+a`:
+*Ctrl+Shift+a*::
     Select all text in the buffer.
 
-* `Delete`:
+*Delete*::
     Delete the character to the right.
 
-* `Ctrl+Delete`:
+*Ctrl+Delete*::
     Delete the word to the right.
 
-* `Backspace`:
+*Backspace*::
     Delete the character to the left.
 
-* `Ctrl+Backspace`:
+*Ctrl+Backspace*::
     Delete the word to the left.
 
-* `Ctrl+Enter`:
+*Ctrl+Enter*::
     Create a new line after the current line and place the cursor there.
 
-* `Ctrl+Shift+Enter`:
+*Ctrl+Shift+Enter*::
     Create a new line before the current line and place the cursor there.
 
-* `PageUp`:
+*PageUp*::
     Scroll the active region up by one screenful of text. The cursor is not
     affected by this operation.
 
-* `PageDn`:
+*PageDn*::
     Scroll the active region down by one screenful of text. The cursor is not
     affected by this  operation.
 
-### Bookmark Shortcuts
-
-`tide` supports marking locations in a document to quickly jump to later. This
-eases navigation between multiple locations in a large document.
-
-* `Ctrl+[0-9]`:
-    Jump to a bookmarked location.
-
-* `Ctrl+Alt+[0-9]`:
-    Save the cursor location as a bookmark
-
-### Search Shortcuts
+=== Search Shortcuts
 
 The shortcuts below allow the user to search for selected text or by context.
 The direction of the search defaults to the forward direction with regard to the
 position in the file. Each search follows the direction of the previous search
-unless the `Shift` modifier is applied. The `Shift` modifier causes the current
+unless the *Shift* modifier is applied. The *Shift* modifier causes the current
 search operation to be applied in the opposite direction of the previous.
 
-* `Ctrl+f`:
+*Ctrl+f*::
     Search for the next occurrence of the selected text in the content region.
     If no text is currently selected, the text under the cursor is selected
-    based on context as described in `TEXT SELECTION`.
+    based on context as described in <<S1,TEXT SELECTION>>.
 
-* `Ctrl+Alt+f`:
+*Ctrl+Alt+f*::
     Search for the next occurence previous search term in the content region.
 
-### Implementation-specific Shortcuts
+=== Implementation-specific Shortcuts
 
-* `Ctrl+[`:
+*Ctrl+[*::
     Decrease the indent level of the selected text.
 
-* `Ctrl+]`:
+*Ctrl+]*::
     Increase the indent level of the selected text.
 
-* `Ctrl+h`:
-    Highlight the item under cursor following the rules in `TEXT SELECTION`
+*Ctrl+h*::
+    Highlight the item under cursor following the rules in <<S1,TEXT SELECTION>>
 
-* `Ctrl+t`:
+*Ctrl+t*::
     Toggle focus between the tags region and the content region.
 
-* `Ctrl+q`:
+*Ctrl+q*::
     Quit the editor. If the file is modified a warning will be printed in the
     tags region and the editor will not quit. Executing the  shortcut twice
     within 250ms will ignore the warning and quit the editor without saving.
 
-* `Ctrl+d`:
-    Execute the selected text as described in `COMMAND EXECUTION`. If no text
-    is selected, the text under cursor is selecte dbased on context as described
-    in `TEXT SELECTION`.
+*Ctrl+d*::
+    Execute the selected text as described in `COMMAND EXECUTION`. If no text is
+    selected, the text under cursor is selecte dbased on context as described in
+    <<S1,TEXT SELECTION>>.
 
-* `Ctrl+o`:
-    Launch pickfile(1) to choose a file from a recursive list of files in the
-    current directory and sub directories. This file will be opened in a new 
-    instance of `tide`.
-    
-* `Ctrl+Shift+o`:
+*Ctrl+o*::
     Launch pickfile(1) to choose a file from a recursive list of files in the
-    current directory and sub directories. This file will be opened in the 
-    current instance of `tide` replacing the currently open file. In the event 
-    that the current instance of `tide` has modifications, the file will be 
-    opened in a new instance.
-    
-* `Ctrl+p`:
+    current directory and sub directories. This file will be opened in a new
+    instance of *tide*.
+
+*Ctrl+p*::
     Launch picktag(1) to select a tag from a ctags(1) generated index file.
-    `tide` will jump to the selected ctag definition in the current window if
-    the file is currently being edited. Otherwise, a new instance of `tide`
-    will be launched with the target file and the cursor set to the line
-    containing the definition.
+    *tide* will jump to the selected ctag definition in the current window if
+    the file is currently being edited. Otherwise, a new instance of *tide* will
+    be launched with the target file and the cursor set to the line containing
+    the definition.
 
-* `Ctrl+g`:
+*Ctrl+g*::
     Lookup the selected symbol or symbol under the cursor in a ctags(1)
     generated index file. Jump to the location of the definition if it exist in
-    the current file. Otherwise, a new instance of `tide` will be launched with
+    the current file. Otherwise, a new instance of *tide* will be launched with
     the target file and the cursor set to the line containing the definition.
 
-* `Ctrl+Shift+g`:
-    Jump to the last implicitly marked location. In general, actions that move
-    the cursor potentially greate distances will set an implicit mark before
-    performing the move. These actions include, jumping to a ctag definition,
-    jumping to a line, or clicking with the mouse.
-
-* `Ctrl+n`:
-    Open a new instance of `tide` with no filename.
+*Ctrl+n*::
+    Open a new instance of *tide* with no filename.
 
-## BUILTINS
+== BUILTINS
 
-* `Cut`:
+*Cut*::
     Cut the selection to the X11 CLIPBOARD selection.
 
-* `Copy`:
+*Copy*::
     Copy the selection to the X11 CLIPBOARD selection.
 
-* `Eol`:
+*Eol*::
     Toggle the line-ending style for the buffers contents between LF and CRLF
 
-* `Find [term]`:
+*Find [term]*::
     Find the next occurrence of the selected text.
 
-* `GoTo [arg]`:
+*GoTo [arg]*::
     Jump to a specific line number or symbol.
 
-* `Indent`:
+*Indent*::
     Toggle the autoindent feature on or off.
 
-* `Overwrite`:
+*Overwrite*::
     Save the file to disk even if the file has been modified externally.
 
-* `Paste`:
+*Paste*::
     Paste the contents of the X11 CLIPBOARD selection into the buffer.
 
-* `Quit`:
+*Quit*::
     Quit the editor.
 
-* `Redo`:
+*Redo*::
     Redo the last undone change.
 
-* `Reload`:
+*Reload*::
     Reload the buffer contents from the on-disk file.
 
-* `Save`:
+*Save*::
     Save the contents of the buffer to disk.
 
-* `SaveAs [path]`:
+*SaveAs [path]*::
     Save the contents of the buffer to disk. If a path argument is provided, the
     buffer will be saved to the new path.
 
-* `Tabs`:
+*Tabs*::
     Toggle the expand tabs featuer on or off.
 
-* `Undo`:
+*Undo*::
     Undo the previous edit.
 
-## FILES
-
-* `$HOME/.config/edit/editrc`:
-    Shell script loaded in current environment to make shell functions and
-    environment variables available to tide(1)
-
-## ENVIRONMENT
-
-* `EDITTAGS`:
-    The contents of this environment variable is used to initialize the contents
-    of the tags region of the window.
+== ENVIRONMENT
 
-* `SHELL`:
+*SHELL*::
     The contents of this variable are used as the shell in which all non-builtin
-    commands are executed. If this variable is not defined, sh(1) is used
-    as a fallback shell.
+    commands are executed. If this variable is not defined, sh(1) is used as a
+    fallback shell.
 
-## AUTHOR
+== AUTHOR
 
 Michael D. Lowis
 
-## SEE ALSO
+== SEE ALSO
 
 tide(1) pick(1) pickfile(1) picktag(1)
similarity index 100%
rename from src/tide.md
rename to src/tide.adoc