Diakonos – version 0.8.8

April 3, 2009 at 14:17

Filed under: Computing — Pistos @ 14:17

Version 0.8.8 of Diakonos is now available. This release delivers several new features, and also brings about a big change…

No more gem

Beginning with this release, I am doing something radical: I am not releasing Diakonos as a Ruby gem. While that may seem strange to some, I think the move is not only justified, but better for Diakonos.

I don’t believe Diakonos has a tremendously large user base at the moment. According to DistroWatch and LinuxRank, Ubuntu is easily the most popular Linux distribution. If Diakonos is to gain any popularity, it behooves me to ensure that it installs onto and plays well with Ubuntu.

I noticed that the Debian package for Diakonos had fallen behind my upstream releases (it was stuck at 0.8.4). I exchanged e-mails with Ralph Amissah, the maintainer of the Debian package (and, by extension, indirect maintaner of the Ubuntu package too), and was thereby informed that the inception of the new help system (introduced in 0.8.6) impeded the downstream updates. In particular, Diakonos’ downloading of configuration and help files for first time users was behaviour that ran contrary to Debian policy.

I think Debian and Ubuntu users who are not advanced Linux users would be more inclined to install packages via the apt system, as opposed to via RubyGems.

Furthermore, I have concluded that the RubyGems system is tailored much more towards libraries, and not applications. It’s great for putting files where Ruby’s require and load statements can find them. But it’s not so well suited to moving global configuration files into /etc, or system-wide documentation into /usr/share/doc. I mumbled about this over two years ago. At first, I worked around the problem by having Diakonos installed via RubyGems, and then downloading configuration files (and, later, help files) from the Internet when the user first runs Diakonos. But, as I’ve mentioned, this prevented smooth inclusion into the Debian package repositories.

RubyGems is focused on letting Ruby developers disseminate their libraries to other Ruby developers; Diakonos is an end-user application. That it is written in Ruby is secondary and peripheral; it is not my intention to present a cute novelty to the amusement and delight of a fraction of the developers of a subculture programming language. My goal is to create the most user-friendly console editor for Linux (“a Linux editor for the masses”).

In light of these facts, I elected to abandon the RubyGems system in favour of a custom installer (install.rb in the package). This installer would allow a distro package maintainer to install Diakonos to specific locations of his or her choosing in the filesystem. I envision that package maintainers for all distros should have little difficulty using it to create or update their packages. Of course, it is easy to use for the end user himself, as well. It can be used to install Diakonos completely in userspace (i.e. somewhere under a user’s home directory, without the need for root/sudo privileges).

The new package (simply a tarball) contains everything needed to run Diakonos, including default configuration files and a full set of help files. Diakonos no longer accesses the Internet for these like it used to in previous versions.

Configuration is loaded from the system-wide location (specified during installation), but user-specific overrides are (as before) loaded from ~/.diakonos/diakonos.conf.

Configuration inheritance

Configuration settings can now be inherited (cascaded). Simply use an equals sign (=) to set one setting to the value of another.

one.setting = another.setting

For an example, have a look at the Ruby language definition in the default config file. See how the shared settings are defined earlier in the file.

This inheritance will work for any setting, not just formatting. The important thing to remember is that Diakonos will parse configuration files top to bottom, and visit each included file in the order the include directives are encountered, with a depth-first strategy. So you should define ancestor settings before descendant settings.

Block selection

You can now switch between block (columnar) selection and normal (flow) selection. Default keychains: <Alt-Shift-M, B> for block, <Alt-Shift-M, N> for normal. Mnemonic: M for Mark, B for Block, N for Normal.

Line numbering

Default keychord <Alt-Shift-L> can be used to toggle line numbering on and off. Line numbers appear in a left-side margin. Enable line numbering permanently by setting view.line_numbers to true in your config. Set view.line_numbers.width to the number of columns to use for the line numbering margin. view.line_numbers.number_format is the setting to use to define a sprintf format for the line numbers. Set the colour and brightness with view.line_numbers.format.

Code block navigation

A cool thing I’ve added in this release is code block navigation. Using Ctrl-PageDown, you can jump to the next code block of the same indentation level as the current line. Ctrl-PageUp goes back in the opposite direction (up or previous block). You might use this to easily browse: the methods of a class; or the different when clauses of a Ruby case expression; or the components of an if-elsif-else tree; or the rules of a CSS stylesheet; and so on. Diakonos will automatically limit the extent of the navigation, so if you start your browsing within an if-elsif tree, your cursor won’t jump outside that tree if you press Ctrl-PageDown too many times.

Alt-PageDown brings the cursor one block level deeper; Alt-PageUp brings you out one level.

Column markers

You can now define column markers using the view.column_markers.* settings. I’ve provided an example in the default config:

view.column_markers.margin.column 80
view.column_markers.margin.format 9

Uncommenting or adding these lines would set up a column marker named “margin”. The name “margin” is arbitrary; use whatever names you want for your markers. The “margin” marker would highlight the 80th column using the format code 9 (white on red in the default 16-colour configuration).

You might use such a column marker as a visual cue to help you not exceed a certain line length. You can set up as many column markers as you like.

Remove word from input line

Pressing Ctrl-W on the input line will now delete the last word on the line. I mainly included this to lop off file path components when opening new files or grepping directories.

Ruby 1.9 and 1.8 support

Ruby 1.9 support is even better now. There are no known issues with Diakonos running under Ruby 1.9.1. If you encounter anything, please let me know.

As I move forward with development, I am preferring 1.9 styles and constructions where there is a choice. As such, some functions of Diakonos may no longer function under Ruby 1.8. I encourage you to install Ruby 1.9 if you have not already, and to keep both versions concurrently installed on your systems. The Ruby community benefits when people move forward to adopt and use this latest stable release of Ruby.

A corollary of running under 1.9 is the ability to open and edit files with encodings other than ASCII. The little test files I opened were handled by Diakonos without difficulty. I could insert and delete UTF-8 characters and save the file. Any real world usage (testing) of Diakonos with non-ASCII files is appreciated!

Also, don’t forget that things run faster under Ruby 1.9, and Diakonos is no exception!

Et cetera

Several bugs were fixed (see the git commit log for details). If you subscribed to the particular LinisTrac tickets in question, you would have already been notified.

The rest of the changes are described in this version’s full changelog:

  • New installation and uninstallation method: tarball + install.rb.
  • Added configuration setting inheritance.
  • Added block selection mode (Alt-Shift-M B; Alt-Shift-M N).
  • Added line numbering settings.
  • Added spawn function.
  • Added go_block_previous, go_block_next (Ctrl-PageUp, Ctrl-PageDown).
  • Added go_block_outer, go_block_inner (Alt-PageUp, Alt-PageDown).
  • “Remove word” functionality (Ctrl-W) added to readline.
  • Added find.show_context_after setting.
  • Added view.column_markers.
  • Added lang.____.indent.not_indented setting.
  • Introduced $d shell variable: current buffer’s directory.
  • $f and $d now expand to absolute paths.
  • delete_to and delete_to_and_from can now operate over multiple lines.
  • delete_to_and_from can now delete between matching brackets.
  • Added git diff (F9).
  • Ruby 1.9 support smoothed out. Ruby 1.8 support being deprecated.
  • Support for non-ASCII encodings tentatively confirmed.
  • Several bugs fixed.
  • Help files updated.

As usual, report any bugs here, or come visit me in IRC. If you like Diakonos, please consider making a small donation.

Enjoy version 0.8.8!

  • Share/Bookmark

Related posts:

  1. Diakonos – version 0.8.12
  2. Diakonos – version 0.8.11
  3. Diakonos – version 0.8.10
  4. Diakonos – version 0.8.9

4 Comments »

  • Glad to hear you are interested in working in this direction. I (I’m another Debian dev) just tried Diakonos and filed a bug in our system about it. It seems like things will work well when the help files are installed and the configuration is fixed to match the package’s layout (all packaging stuff, not a problem with your code).

    If you are interested in getting that config-and-help-downloading stuff out of Diakonos entirely, I’d love to help (see my comments in the bug). I would definitely like to see “apt-get install diakonos; diakonos” Just Work without any dotfiles in $HOME. But check your fork queue, I slapped a band-aid on the uncaught exception I hit for now :-)

  • Pistos says:

    Decklin: Thank you for your interest in Diakonos; and thank you for testing the package out, and putting in the effort to file such a detailed bug report on the Debian bug tracker. Also, thanks for the patch; I’ve accepted, applied and pushed it.

    Now, AFAIK, “apt-get install diakonos; diakonos” should Just Work, if you allow for that friendly prompt about no local user config. If you think even that is problematic, I can introduce a new setting that can be placed in the global conf which would suppress this prompt.

    The actual ~/.diakonos dir, though, is something I think I’d like to keep, because many little temporary items go in there while Diakonos is running.

    Thanks again. I look forward to getting and keeping Diakonos cleanly integrated into Debian and Ubuntu.

  • With my Linux distro hat on, I think that that “friendly” prompt may unfortunately send experienced users running. Emacs, for example, has potentially much hairier configuration, but it just starts right up with default settings until you change some — and then, only the settings you change need to go into your ~/.emacs. I think this behavior is expected. If a sysadmin’s first thought after installation is “this thing is going to fall over if I’m trying to recover a crashed system with no /home?”, they’ll probably stick with their old editor.

    (Speaking only for myself, there’s also: “if I want to check my config file into my dotfiles repository, I’m going to have to include the whole default config and therefore track and merge changes from the diakonos repository? No thanks.” That might not actually be the case, but the prompt makes it look that way.)

    But enough talk :) I’ll work on a patch to do I would consider “normal” configuration handling, and you can see what you think of it.

  • Pistos says:

    Diakonos is able to start up and function without a user conf (or with a totally empty one). My concern was that users would hit F12 at some point to begin configuring, and be greeted with a blank file.

    There’s no need to keep upstream defaults in your user config and merge them as the versions roll along. Your user conf only needs specific settings that differ from the defaults.

    But yes, feel free to commit to your fork, and I will pull as I see fit. Thanks again.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You may use Markdown syntax in your comment.

Powered by WP Hashcash

Powered by WordPress.