.
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 1 Dec 2026 15:09:27 +0000 (15:09 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 1 Dec 2026 15:09:27 +0000 (15:09 +0000)
.gitignore
developer/document/development-environment.html [new file with mode: 0644]

index be24c0f..2a21024 100644 (file)
@@ -7,7 +7,6 @@
 temp.*
 **/scratchpad/*
 !**/scratchpad/.gitignore
-*.patch
 
 # Python
 __pycache__/
diff --git a/developer/document/development-environment.html b/developer/document/development-environment.html
new file mode 100644 (file)
index 0000000..669e31f
--- /dev/null
@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html lang="en">
+  <head>
+    <meta charset="UTF-8">
+    <title>Development environment</title>
+    <script>
+      {
+        let dirpr_library = null;
+        try{ dirpr_library = localStorage.getItem("RT.dirpr_library"); }catch(e){}
+        window.RT = window.RT || {};
+        RT.dirpr_library = RT.dirpr_library || dirpr_library || "https://style.ReasoningTechnology.com/Manuscript";
+        document.write('<script src="' + RT.dirpr_library + '/Core/RT-Manuscript_make.js"><\/script>');
+      }
+    </script>
+    <script>
+      window.RT.theme_preference('inverse_wheat');
+      window.RT.load('Layout/paginate');
+      window.RT.load('Layout/article_tech_ref');
+      window.RT.load('Element/theme_selector');
+    </script>
+  </head>
+  <body>
+    <RT·theme-selector></RT·theme-selector>
+    <RT·article>
+      <RT·title
+        author="Thomas Walker Lynch"
+        date="2026-12-01"
+        title="Development environment">
+      </RT·title>
+
+      <RT·TOC level="1"></RT·TOC>
+
+      <h1>A shell for each role</h1>
+
+      <p>
+        A Harmony project is worked on through its roles, each entered with <RT·code>./setup &lt;role&gt;</RT·code> from the top of the project, <RT·code>$REPO_HOME</RT·code> (see Product development roles and workflow). Whatever the editor, the arrangement that works is a shell for each role, kept open for the whole session, each in its role's own directory:
+      </p>
+
+      <ol>
+        <li><RT·term>administrator</RT·term>, in <RT·code>$REPO_HOME</RT·code>: <RT·code>git</RT·code>, such as <RT·code>git apply</RT·code> and <RT·code>git commit</RT·code>, and the scripts that repair or migrate the project's data.</li>
+        <li><RT·term>developer</RT·term>, in <RT·code>$REPO_HOME/developer</RT·code>: <RT·code>build</RT·code> and <RT·code>promote</RT·code>.</li>
+        <li><RT·term>tester</RT·term>, in <RT·code>$REPO_HOME/tester</RT·code>: the tests, run on what was promoted to <RT·code>consumer</RT·code>.</li>
+        <li>a shell under no role, in <RT·code>$REPO_HOME/scratchpad</RT·code>, for running the installed program as its users do.</li>
+        <li>a root shell, in a terminal of its own, outside the editor, for installing what was promoted to <RT·code>consumer</RT·code>.</li>
+      </ol>
+
+      <p>
+        Partitioned so, each shell's history holds one kind of work. The administrator's is the project's git history in the making; the developer's is builds; the tester's is test runs. <RT·code>history</RT·code> in a shell, or searching back through its input, finds the command wanted among others of its kind, and reads as a log of that role's part of the session. A shell's working directory does not change, so every path typed in it is relative to the same place, and a command found in its history runs again as it did before.
+      </p>
+
+      <p>
+        Files handed to the project, such as patches and the scripts that come with them, are put in <RT·code>$REPO_HOME/scratchpad</RT·code>, which git ignores, so they never end up in the repository. The administrator applies a patch from there, <RT·code>git apply scratchpad/&lt;name&gt;.patch</RT·code>, and runs a script from there, <RT·code>scratchpad/&lt;name&gt;</RT·code>.
+      </p>
+
+      <p>
+        The root shell is kept out of the editor because root does not run code another account can change. Emacs runs under the developer's account, and loads that account's files as code each time it starts: its init file, and every package. Any of that code can send text to any buffer's process, so a root shell in a buffer would take input from code the account can change. A terminal of its own, entered with <RT·code>su</RT·code>, keeps root's input out of that code's reach.
+      </p>
+
+      <h1>Emacs</h1>
+
+      <p>
+        Emacs holds the role shells as buffers, one shell buffer for each, named for its role. Emacs's buffer list, <RT·code>C-x C-b</RT·code>, then reads as the session's layout:
+      </p>
+
+      <RT·code>
+        . * administrator              40279 Shell:run        ~/project/Jizo/
+          * run                      2551302 Shell:run        ~/project/Jizo/scratchpad/
+          * developer                  81001 Shell:run        ~/project/Jizo/developer/
+          * tester                    456830 Shell:run        ~/project/Jizo/tester/
+            *scratch*                    147 Lisp Interaction
+         %* *Messages*                 22707 Messages
+      </RT·code>
+
+      <p>
+        The last column is each shell's working directory, as Emacs follows it. The size column is the buffer's text: a shell buffer keeps everything printed in it, so the session's output can be searched with <RT·code>C-s</RT·code> and saved as a file.
+      </p>
+
+      <h2>Making the shells</h2>
+
+      <p>
+        <RT·code>M-x shell</RT·code> opens a shell in a buffer named <RT·code>*shell*</RT·code>, and called again it goes back to that buffer. Given a prefix argument, <RT·code>C-u M-x shell</RT·code>, it asks for the buffer's name, and a new name makes a new shell. So for each role:
+      </p>
+
+      <RT·code>
+        C-u M-x shell RET developer RET
+        cd ~/project/Jizo
+        ./setup developer
+      </RT·code>
+
+      <p>
+        <RT·code>setup</RT·code> starts the role's shell inside the buffer's shell, in the role's directory; <RT·code>exit</RT·code> leaves it, back to the shell the buffer started with. A buffer already open is renamed with <RT·code>M-x rename-buffer</RT·code>. The shell under no role is made the same way, named <RT·code>run</RT·code>, with <RT·code>cd ~/project/Jizo/scratchpad</RT·code> and no <RT·code>setup</RT·code>.
+      </p>
+
+      <h2>History in a shell buffer</h2>
+
+      <p>
+        A shell buffer has two histories. The shell keeps its own, read with <RT·code>history</RT·code>, and written to the history file when it exits. Emacs keeps the input typed in the buffer, its <RT·term>input ring</RT·term>, one for each buffer:
+      </p>
+
+      <RT·code>
+        M-p, M-n      the previous or next input, to edit and send again
+        M-r           search back through the inputs, incrementally
+        C-c C-l       list the inputs in a buffer of their own
+        C-c C-o       delete the output of the last command
+        C-c C-r       move to the start of the last command's output
+      </RT·code>
+
+      <p>
+        As each buffer holds one role's work, <RT·code>M-r build</RT·code> in the developer's buffer finds builds, and <RT·code>M-r apply</RT·code> in the administrator's finds the patches applied, with nothing of the other roles among them.
+      </p>
+
+      <h2>The working directory</h2>
+
+      <p>
+        Emacs follows a shell's working directory by watching the <RT·code>cd</RT·code>, <RT·code>pushd</RT·code> and <RT·code>popd</RT·code> commands typed in it, and uses it as the buffer's default directory: <RT·code>C-x C-f</RT·code> in the developer's buffer starts in <RT·code>developer/</RT·code>, and <RT·code>M-x compile</RT·code> runs there. A directory changed some other way, such as by <RT·code>setup</RT·code> or a script, is not seen; <RT·code>M-x dirs</RT·code> asks the shell, and puts Emacs right. A role's shell staying in its directory keeps this right without thought.
+      </p>
+
+      <h1>Other environments</h1>
+
+      <p>
+        A chapter for Eclipse or IntelliJ IDEA waits for someone working in one of them: what was written for them earlier is old, and is not kept here.
+      </p>
+
+    </RT·article>
+  </body>
+</html>