{"id":9575,"date":"2026-06-16T10:21:52","date_gmt":"2026-06-16T10:21:52","guid":{"rendered":"https:\/\/www.dyalog.com\/blog\/?p=9575"},"modified":"2026-06-17T09:10:43","modified_gmt":"2026-06-17T09:10:43","slug":"making-the-ide-my-own-part-1","status":"publish","type":"post","link":"https:\/\/www.dyalog.com\/blog\/2026\/06\/making-the-ide-my-own-part-1\/","title":{"rendered":"Making the IDE My Own \u2013 Part 1"},"content":{"rendered":"<p>Sometimes I want additional functionality in the IDE. Over the years I have collected a small collection of &#8220;tweaks&#8221;.<\/p>\n<p>I have a single tidy folder of small functions, each doing one thing. The session simply picks it up and applies it every time it starts. No need to save the session file any more! Let me show you some of what I\u2019ve built and, more interestingly, <em>how<\/em> it works.<\/p>\n<p>This is going to be a mini-series of blog posts. This first post will deal with the infrastructure and things that apply cross-platform. The next post will extend the graphical user interface (GUI) of the Windows IDE.<\/p>\n<p>I\u2019m assuming Dyalog v20.0 here. The principles hold in Dyalog v19.0, but you\u2019d have to substitute any <a href=\"https:\/\/docs.dyalog.com\/20.0\/release-notes\/new-enhanced\/\">new features<\/a> used, in particular, <a href=\"https:\/\/docs.dyalog.com\/20.0\/programming-reference-guide\/introduction\/arrays\/array-notation\/\">array notation<\/a>, <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/primitive-operators\/behind\/\"><em>behind<\/em><\/a> (<code>\u235b<\/code>), and <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-functions\/vget\/\"><code>\u2395VGET<\/code><\/a>.<\/p>\n<h2 id=\"the-startupsession-folder\">The StartupSession Folder<\/h2>\n<p>In my <a href=\"https:\/\/www.dyalog.com\/blog\/2018\/09\/enhanced-debugging-with-function-keys\/\">2018<\/a> and <a href=\"https:\/\/www.dyalog.com\/blog\/2020\/12\/enhanced-debugging-with-function-keys-evaluate-selection\/\">2020<\/a> posts on function keys, I kept this kind of thing in SALT\u2019s <code>Setup<\/code> mechanism by using a <code>Setup<\/code> function in <b style=\"font-weight: bold\">MyUCMDs\\setup.dyalog<\/b> that SALT runs at startup. That still works, but I have since migrated to the new <a href=\"https:\/\/docs.dyalog.com\/20.0\/windows-ui-guide\/the-session-object\/session-initialisation\/\">session initialisation<\/a>, which is altogether more versatile; it doesn\u2019t only run code, it can also leave functions (and more) resident in <code>\u2395SE<\/code> afterwards.<\/p>\n<p>The way it works is that, at startup, Dyalog populates the <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-functions\/se\/\">session namespace<\/a> (<code>\u2395SE<\/code>) from <b style=\"font-weight: bold\">StartupSession<\/b> folders within your documents folder, and, once everything has loaded, it automatically calls the <code>Run<\/code> function in each sub-folder of a <b style=\"font-weight: bold\">StartupSession<\/b> folder. There is one\u00a0<b style=\"font-weight: bold\">StartupSession<\/b> folder pertaining to all versions of Dyalog plus a separate one for each of the versions installed.<\/p>\n<p>For example, under Microsoft Windows, I\u2019d place all the functions listed in this blog post into a folder I\u2019ve named <b style=\"font-weight: bold\">C:\\Users\\adam\\Documents\\Dyalog APL Files\\StartupSession\\seext<\/b> (for <i><strong>se<\/strong>ssion <strong>ext<\/strong>ensions<\/i>). If I wanted it just for a specific version, such as Dyalog v20.0, I could put it into <b style=\"font-weight: bold\">C:\\Users\\adam\\Documents\\Dyalog APL-64 20.0 Unicode Files\\StartupSession\\seext<\/b> instead. If you also have older versions installed you might want to do exactly that, since the code as listed requires Dyalog v20.0 or later.<\/p>\n<p>On other platforms, the corresponding folders would be <b style=\"font-weight: bold\">\/home\/adam\/dyalog.files\/StartupSession\/seext<\/b> and <b style=\"font-weight: bold\">\/home\/adam\/dyalog.200U64.files\/StartupSession\/seext<\/b>, for all versions and specific versions respectively.<\/p>\n<p>The functions live in <code>\u2395SE<\/code>, so they are available even if the workspace is cleared or another one is loaded. They also do not interfere with the workspace content. I keep two types of functions side by side:<\/p>\n<dl>\n<dt>Feature<\/dt>\n<dd>Begins with a lowercase letter. Enables a specific behaviour.<\/dd>\n<dt>Utility<\/dt>\n<dd>Begins with an uppercase letter. Supports the functionality of a feature.<\/dd>\n<\/dl>\n<p>In this post I&#8217;ll only be dealing with the first type, but I&#8217;ll prepare the special <code>Run<\/code> function (technically a utility) so it is ready for next time. <code>Run<\/code> is the bootstrapping function that calls the feature functions:<\/p>\n<pre class=\"apl\"><code>\u2207 Run args\r\n \u235d Call niladic fns with lowercase initial except mentioned in exclude.config\r\n  ;path;exclude\r\n  :If \u2395NEXISTS path\u2190args\u2283\u235b,'\/exclude.config'\r\n      exclude\u2190\u2395NGET path 1\r\n  :Else\r\n      exclude\u21900\u2374\u2282''\r\n  :EndIf\r\n  \u234e\u00a8exclude~\u2368{0=11 \u2395ATX \u2375}\u235b\/\u2395A \u2395C\u235b\u2395NL \u00af3\r\n\u2207<\/code><\/pre>\n<p>The session initialisation code hands it a vector argument in which the first element specifies the directory from where it was loaded. The exclude-list&#8217;s filename is appended, and, if it exists, the exclude-list is read in as a vector of character vectors; otherwise, we just set a null list. Then comes a somewhat involved line, that benefits from being broken into chunks \u2013 reading these from right to left:<\/p>\n<ol>\n<li><code>\u2395A \u2395C\u235b\u2395NL \u00af3<\/code> asks for the names. <code>\u2395C<\/code> is <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-functions\/c\/\">Case Convert<\/a>. The <i>behind<\/i> operator <code>\u235b<\/code> modifies <code>\u2395NL<\/code> so that it pre-processes its left argument to be lowercased (actually case-folded, but it doesn\u2019t matter for the basic Latin alphabet). So, we are really evaluating <code>'abcdefghijklmnopqrstuvwxyz' \u2395NL \u00af3<\/code>, that is, \u201cgive me the names of all functions (<code>3<\/code>) beginning with a lowercase Latin letter\u201d as a nested vector of names.<\/li>\n<li><code>{0=11 \u2395ATX \u2375}\u235b\/<\/code> then filters that list. <code>\u2395ATX<\/code> reports <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-functions\/atx\/\">extended attributes<\/a> of a name; attribute <code>11<\/code> is the function\u2019s valence, so <code>0=<\/code> keeps only the niladic ones. The <code>\u235b\/<\/code> construct is my precious derived monadic <i>filtering<\/i> operator: <code>Predicate\u235b\/names<\/code> is <i>Predicate filtering names<\/i>, or <code>(Predicate names)\/names<\/code> pre-<i>behind<\/i>.<\/li>\n<li><code>exclude~\u2368<\/code> removes the features that have been manually excluded, if any.<\/li>\n<li><code>\u234e\u00a8<\/code> calls each survivor of the culling.<\/li>\n<\/ol>\n<p>The lowercase requirement isn\u2019t arbitrary. In accordance with <a href=\"https:\/\/abrudz.github.io\/style\/#nc\">my personal naming convention<\/a>, since a niladic function has the syntactic role of an array, its name needs a lowercase initial. This means that <em>either<\/em> test (lowercase initial or niladic valence) would already pick out exactly the features. <code>Run<\/code> checks both anyway; I like to err on the side of caution. Adding a feature or utility then simply involves dropping it into the folder; there is nothing to register, and as long as I adhere to my naming convention, it all just works. If you want to install the features, but want some disabled, create an <b style=\"font-weight: bold\">exclude.config<\/b> file with one feature function name on each line.<\/p>\n<p>Now to the features themselves.<\/p>\n<h2 id=\"output-settings\">Output Settings<\/h2>\n<p>Let&#8217;s begin by tidying up appearances. <code>setOutput<\/code> configures how results are displayed:<\/p>\n<pre class=\"apl\"><code>\u2207 setOutput\r\n \u235d Set ]Box and ]Rows\r\n  \u2395SE.UCMD\u00a8(\r\n      '\u2190OUTPUT.Box on -f=on -t=tree'\r\n      '\u2190OUTPUT.Rows on -s=long -fold=3'\r\n  )\r\n\u2207<\/code><\/pre>\n<p>These are the <code>]Box<\/code> and <code>]Rows<\/code> user commands. A leading <code>\u2190<\/code> on a user command invocation silences it, so the session comes up without two lines of <samp>Was OFF<\/samp> confirmations. The modifiers are where the behaviour lives (note that you can abbreviate any modifier as long as it stays unambiguous):<\/p>\n<dl>\n<dt><code>]Box<\/code><\/dt>\n<dd>\n<dl>\n<dt><code>-t=tree<\/code><\/dt>\n<dd style=\"margin-bottom: 0.8125em\">Short for <code>-trains=tree<\/code>, draws tacit functions as trees rather than boxes.<\/dd>\n<dt><code>-f=on<\/code><\/dt>\n<dd>Short for <code>-fns=on<\/code>, makes all of this apply to output produced <em>inside<\/em> functions (implicitly or using <code>\u2395\u2190<\/code>), in addition to results and outputs that were requested at the Session level.<\/dd>\n<\/dl>\n<\/dd>\n<dt><code>]Rows<\/code><\/dt>\n<dd>\n<dl>\n<dt><code>-s=long<\/code><\/dt>\n<dd style=\"margin-bottom: 0.8125em\">Short for <code>-style=long<\/code>, lets the session scroll horizontally instead of hard-wrapping long lines<\/dd>\n<dt><code>-fold=3<\/code><\/dt>\n<dd>Prevents a single tall result from flooding the screen; when output won\u2019t fit vertically, the middle lines are replaced with leader dots and only the last 3 rows are shown.<\/dd>\n<\/dl>\n<\/dd>\n<\/dl>\n<p>Traditionally, you&#8217;d save your session file to preserve these output settings, but since our code runs at every startup, there&#8217;s no need for that.<\/p>\n<h2 id=\"one-log-for-each-interpreter\">One Log for Each Interpreter<\/h2>\n<p><a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/primitive-operators\/i-beam\/log-file-for-deprecations\/\"><code>109\u2336<\/code><\/a> controls the file to which Dyalog writes its log of deprecated-feature usage. I run several interpreters \u2013 combinations of different versions, Unicode and Classic editions, 32- and 64-bit widths \u2013 and I don\u2019t want them all writing to one file, so <code>setLog<\/code> gives each its own, named after the active interpreter and parked in the temporary directory:<\/p>\n<pre class=\"apl\"><code>\u2207 setLog\r\n \u235d Set log file for usage of deprecated features\r\n  ;tmp;Log;file;target;version;platform;type\r\n  tmp\u2190739\u23360\r\n  Log\u2190109\u2336\r\n  file\u2190tmp,'\/'\r\n  (target version platform type)\u2190# \u2395WG'APLVersion'\r\n  file,\u2190  3\u2191version\u2229\u2395D\r\n  file,\u2190\u2283'CU'\u233d\u236880=\u2395DR''\r\n  file,\u2190\u00af2\u2191'32',target\u2229\u2395D\r\n  file,\u2190'.log'\r\n  file Log 0\r\n\u2207<\/code><\/pre>\n<p>(I rather enjoy the mnemonics of the two I-beams: <code>109<\/code> reads as the letters <i>log<\/i>, and <code>739<\/code> as <i>TMP<\/i> \u2014 a slanted <i>T<\/i>, a sideways <i>M<\/i>, a mirrored <i>P<\/i>). From <code>APLVersion<\/code> we keep the first three version digits, then choose <code>'U'<\/code> or <code>'C'<\/code> (<code>80=\u2395DR''<\/code> asks whether the empty character vector has a <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-functions\/data-representation-monadic\/\">Data Representation<\/a> of 80, meaning 8-bit Unicode, as opposed to 82 for 8-bit Classic, and <code>'CU'\u233d\u2368<\/code> rotates the pair so the correct letter falls first), then append <code>'64'<\/code> or <code>'32'<\/code> from the target platform. Under a Unicode-edition 64-bit Dyalog v20.0, this gives <code>200U64.log<\/code>.<\/p>\n<h2 id=\"a-name-and-a-home\">A Name and a Home<\/h2>\n<p>When I open a fresh interpreter (I do this a lot, and often have multiple running at the same time) to try something out, I often forget to save my noodling before I close the interpreter (or it crashes\u2026). In addition, due to old habits, I might end up saving a workspace rather than using <a href=\"https:\/\/dyalog.github.io\/link\/latest\/\">Link<\/a>. <code>autoLink<\/code> solves these issues:<\/p>\n<pre class=\"apl\"><code>\u2207 {msg}\u2190autoLink\r\n \u235d If CLEAR WS, Link # to timestamped dir and set \u2395WSID\r\n  ;tmp;\u2206DT;path\r\n  tmp\u2190739\u23360\r\n  \u2206DT\u21901200\u2336\r\n  path\u2190\u2395SE.Dyalog.Utils.Config'LOAD'\r\n  :If ''\u2261path\r\n  :AndIf 'CLEAR WS'\u2261\u2395WSID\r\n  :AndIf (\u2282\u2355#)~\u2364\u220a(\u2395VGET\u2282'\u2395SE.Link.Links'(ns:0)).ns\r\n      path\u2190tmp,\u2283'\/YYYYMMDD.hhmmss'\u2206DT 1 \u2395DT'J'\r\n      \u2395\u2190msg\u2190\u2395SE.Link.Create # path\r\n      \u2395WSID\u2190path,'\/'\r\n  :EndIf\r\n\u2207<\/code><\/pre>\n<p>This function does three things:<\/p>\n<ol>\n<li>First, it checks whether there is anything already loaded in or linked to the <a href=\"https:\/\/docs.dyalog.com\/20.0\/programming-reference-guide\/introduction\/namespaces\/namespaces\/\">root namespace (<code>#<\/code>)<\/a>.<\/li>\n<li>Then, if there is nothing, it creates a link between <code>#<\/code> and a new directory named with the current local timestamp.<\/li>\n<li>Finally, it sets the <a href=\"https:\/\/docs.dyalog.com\/20.0\/language-reference-guide\/system-commands\/wsid\/\">Workspace Identification (<code>\u2395WSID<\/code>)<\/a> to the path of the newly-created linked directory.<\/li>\n<\/ol>\n<p>As you can see, I lean heavily on Dyalog v20.0 features here: <code>\u2395VGET<\/code> reads <code>\u2395SE.Link.Links<\/code> (Link\u2019s memory of active links), but supplies the array-notation namespace <code>(ns:0)<\/code> as a default, so the line can\u2019t fall over with a <code>VALUE ERROR<\/code> (if the list hasn\u2019t even been created) or a <code>NONCE ERROR<\/code> (because there are no currently active links).<\/p>\n<p>Now, every function I create or modify using the Editor is written straight to disk as source (a throwaway scratchpad that nonetheless survives an early shut-down or a crash).<\/p>\n<p>Setting <code>\u2395WSID<\/code> has two positive effects:<\/p>\n<ul>\n<li>Both Ride and the Windows IDE display <code>\u2395WSID<\/code> in the titlebar, this helps me with situational awareness when I have many interpreter instances running in parallel.<\/li>\n<li>The trailing slash in <code>\u2395WSID<\/code> makes it an invalid filename, preventing me from accidentally saving the workspace (which would create a workspace with the same name as the directory, but with the file extension **.dws**, and with active links, both of which could lead to all sorts of unpleasantness), and further increases my situational awareness by telling me that the current workspace has a directory as source, rather than a binary blob workspace file.<\/li>\n<\/ul>\n<h2 id=\"to-be-continued\">To Be Continued\u2026<\/h2>\n<p>So far, I have looked at the setup, making output readable, and ensuring code is saved. In my next post I&#8217;ll look at customising the GUI. In the meantime, the easiest way to try out anything from this post is to paste all the function definitions into a clear workspace and enter (with <a href=\"#the-startupsession-folder\">the directory that&#8217;s appropriate for you<\/a>):<\/p>\n<pre><code>]LINK.Export # C:\\Users\\adam\\Documents\\Dyalog APL-64 20.0 Unicode Files\\StartupSession\\seext<\/code><\/pre>\n<p>If any of this is useful to you, take it. If it doesn\u2019t quite do what you want, adapt it. If you have an idea for additional cross-platform Session extensions, let me know!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes I want additional functionality in the IDE. Over the years I have collected a small collection of &#8220;tweaks&#8221;. I have a single tidy folder of small functions, each doing one thing. The session simply picks it up and applies &hellip; <a href=\"https:\/\/www.dyalog.com\/blog\/2026\/06\/making-the-ide-my-own-part-1\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18],"tags":[],"class_list":["post-9575","post","type-post","status-publish","format-standard","hentry","category-tips-tricks"],"_links":{"self":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/9575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/comments?post=9575"}],"version-history":[{"count":56,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/9575\/revisions"}],"predecessor-version":[{"id":9667,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/posts\/9575\/revisions\/9667"}],"wp:attachment":[{"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/media?parent=9575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/categories?post=9575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dyalog.com\/blog\/wp-json\/wp\/v2\/tags?post=9575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}