My private version of NEdit
April 2014
Nedit
is my favorite editor not only for programming since more then 10
years. It is known to be a very sophisticated editor because
- it is perfectly integrated into the X11 windowing system.
Independent editor sessions can be run simultaneously on
multiple desktops, in multiple windows containing tabbed
subwindows which finally may be split up into "panes". The
sessions can be grouped together in so called servers, each
server working on its own set of files in one or more windows.
- it is convenient for gui-less server installations (only a
minimum of X11 libraries is required on the server)
- it has many powerful features for programming. Most notable is
a configurable source code highlighting system. You can define
highlighting patterns of your own and are not stuck with those
more or less hardcoded as in many other editors.
- It can be highly customized via X11 resources and private
editor settings.
- is has a very powerful and straightforward macro engine which
allows to extend the editor with self defined functions. These
may be simple shortcuts for a few menu or keyboard actions as
well as complex macro systems performing ide tasks (save all
modified files, run compiler, walk through error messages and
jump to the error locations etc).
There are some serious issues with NEdit however:
- NEdit uses the Motif toolkit which may be considered to be
somewhat outdated. NEdit is connected to X11 and Motif so
tightly that it is rather impossible to switch to some other,
perhaps more modern widget system.
- NEdit development has slowed down a decade ago (there has not
been an official release since version 5.5 in 2004) and seems to
have stopped at all in 2010. This is not neccesarily bad news as
it sometimes may be better to leave a mature software as it is.
On the other hand on NEdit's development
site on Sourceforge there are many feature requests and
dozens of patches which address nasty bugs or add interesting
new features.
- For many years NEdit was built on Debian using LessTif. This
was to replace OpenMotif due to some licensing reasons*).
The problem is LessTif never has reached a quality level to be
an adequate replacement for OpenMotif. Development progress on
LessTif is very slow and sometimes essential things get worse.
The bug
which crashed NEdit and others when pressing escape to close a
menu existed for about three years. Other important issues are
still unsolved (copy and paste frequently fails, especially but
not only in dialogs, focus problems with dialogs leading to
temporary program hangs etc).
At least the bugs mentioned here render NEdit as it came with
Debian releases 5 ... 7 nearly unusable. New users who may give
NEdit a first try will likely evaluate it as crap (not knowing
the problems come from LessTif, not NEdit). The impact on
NEdit's user base on the long term is obvious.
*) Debian 5 was the last version containing OpenMotif in the
non-free section (Version 2.2.3-4). Debian releases 6 and 7
are missing OpenMotif at all. Still the binary packages from
Debian 5 can be installed on Debian 6 and 7 via "dpkg -i".
What I have done:
-
Since I ever have enjoyed NEdit (starting with version 5.4,
later version 5.5, from SuSE 7.x and later), I tried to work
with that one coming with Debian 4 (1:5.5-2). To my surprise
it turned out to be nearly unusable (see above), but since I
knew NEdit from SuSE I decided to recompile the package using
OpenMotif, resulting the same quality editor as I used to have
on SuSE.
- After NEdit had been dropped from SuSE I assumed its time is
over and I started to look for an replacement. But none of the
alternatives I inspected satisfied my needs. (I heavily depend
on self written highlighting patterns and macros.) So I decided
to run my own NEdit package. Based on the 1:5.5-2 version from
Debian I created my local derivatives 1:5.5-2.1 (2008) and
1:5.5-2.2 (2010), implementing only minor, but useful changes.
- In September 2012 I just for curiousity walked through NEdit's
patchlist on Sourceforge and found two interesting entries:
Patch #2337783 "EWMH raise support" and patch #2190783 "move tab
by drag and drop". After applying I had NEdit 2:5.5-2.3
(incremented epoch to prevent Debian from overwriting my
version).
- In November 2012 I took a look on NEdit 1:5.6~cvs20081118-7
from Debian. I added patches #2337783 ("EWMH raise support") and
#2190783 (move tab by drag and drop). This could be done without
a problem.
More or less by accident I found out, the so called Microline
folder widgets (which implement the tabbed interface) allow more
than one tab row. To enable it only a X11 resource setting is
needed (nedit*XmLFolder.tabsPerRow: 8). Unfortunately with
LessTif this setting is ignored at all. With OpenMotif it can be
made working but a one line patch for NEdit is needed.
- In March 2014 I had to upgrade my system to Debian 8
(jessie/sid, not yet released) because the CAD-program I have
(commercial product, developed on Ubuntu) is not supported on
Debian 7 any more. Debian 8 reintroduces OpenMotif (which is now
under LGPL v2.1) with version 2.3.4-5 and the old version from
Debian 5 cannot be used anymore. (One could leave it installed
but there other programs which want the new version.)
- As a consequence I dropped my NEdit version 2:5.5-2.x and
switched over to Debians 1:5.6~cvs20081118-8. I added a few
things I had on my previous version already and what I am used
to for years. My private NEdit version is now
1:5.6~cvs20081118-8.2.
* Patch source/preferences.c for language mode setting
when a file is loaded:
Now first use the file extension and then
look in its contents. The former
order prevented correct language detection
due to ambigous recognition
patterns.
* Patch "ewmh-raise"
URL:
http://sourceforge.net/p/nedit/patches/172/
Raise a (partially) hidden nedit window when
opening a new file from
nedit-nc.
* Patch "move tab by drag and drop"
URL:
http://sourceforge.net/p/nedit/patches/170/
This needs OpenMotif what happens to be met
since it is (again) part of
Debian.
* Patch source/window.c to show multiple tab rows.
* Add a small patch to Microline/XmL/Folder.c to make
longer parts of
filenames visible on tabs when many files are
open. TODO: Still more
characters could be shown.
* Improve desktop integration (nedit.desktop)
Known problems with NEdit 1:5.6~cvs20081118-8.2:
This is the version I use for my daily work. It is stable and does
what I need. There are some minor issues however.
- The 3D visualization of tabs (a small bright horizontal line)
is drawn at a wrong vertical location when more than one tab row
is active. Nearly invisible.
- Using drag and drop with tabs on multiple rows is hard to use.
Obviously this combination never has been tested. Drag and drop
with one tab row is fine though.
- The Microline folder widget originally rotates the tab rows so
the row with the active tab is always at the bottom. Others and
I find this is irritating. So I simply switched this off by
commenting out a few lines of code. Preferable this should be
user configurable.
- The number of open files shown in the windows menu is limited
by the vertical screen size. In cases with very many open files
(and depending of the font size) there may not be enough room to
show all entries. Is there is an option in Open Motif which lets
menus expand horizontally (additional rows) when needed?
In order to return my findings to the community I release the
files and packages I have created here. This is not an official
release, of course, and no support can be supplied. Nevertheless I
hope it may be helpful for all those coming here across.
Markus
Download