alited, a lite editor

alited v1.3.3 stands for "a lite editor".

The main features of alited are:

  • structured code
  • easy access to the code
  • born for Tcl/Tk development only

It satisfies most requirements of Tcl Editors, adding its own features.

Edited by alited are Tcl/Tk files. The C/C++ code is another target of alited, still for Tcl/Tk development only all the same.

alited facilitates the development and the maintenance of Tcl/Tk code, particularly because of the unit tree being a sort of documentation.

alited is suspected of being very good with large Tcl/Tk projects, i.e. when, in one session, you deal with 30-40-50... Tcl/Tk scripts, to say nothing of others.

It's quick at starting.

It's quick at switching projects.

It's quick at organizing Tcl/Tk code.

It's quick at navigating Tcl/Tk code.

It's quick at searching Tcl/Tk code.

It's quick at writing Tcl/Tk code.

It's quick at testing Tcl/Tk code.

It's quick at saving Tcl/Tk code.

It's quick at maintaining Tcl/Tk code.

Briefly, alited is totally quick, being at that a pure Tcl/Tk application.

Links:

For a quick acquaintance of alited, a few of demo videos are available:

... or the same, just light themed:

Below is a screenshot of alited, just to glance at it (though a bit outdated, as well as the demos):

alited-en

... and its localized and themed variant:

alited-ru

... and its themed variant on Windows 10:

alited-win10

Changes in v1.3.3 against v1.3.0:

  - BUGFIX: (not critical) saving files after "Save" in Preferences -> Tcl error
  - BUGFIX: (not critical) calling e_menu as external with alited's CS tinted (CS=47)
  - BUGFIX: (not critical) in Projects: default project's dir is empty at first start
  - BUGFIX: (not critical) focus a text at add/rename/delete files from the file tree
  - NEW   : delete selected files in file tree
  - NEW   : Comment/Uncomment: escaping/unescaping braces with #\{ #\} patterns
  - NEW   : Comment/Uncomment: selecting the changed lines
  - NEW   : Projects: "Create project by template" and "Project directory" buttons
  - NEW   : Projects: "Templates" tab to set a template of project file tree
  - NEW   : Projects: check for outdated TODOs of *all projects* at starting / opening
  - NEW   : bindings F2, Ctrl+S etc. for "info" listbox, "find units" combobox and tree
  - NEW   : allow tinting CS for rdbende's themes
  - NEW   : highlight current & original tints in "Setup/Tint" menu
  - NEW   : restoring full geometry of dir/file choosers in Linux
  - CHANGE: index.html (alited docs) revised
  - CHANGE: focusing a current text after "Open all Tcl files" of file tree
  - CHANGE: in Projects: focusing appropriate fields at user's errors
  - CHANGE: scrollbars for Preferences/Editor syntax fields
  - CHANGE: remove "File/Restart" menu item (made for testing only)
  - CHANGE: in Preferences - okcancel for Save button
  - CHANGE: docs: on Tcl/Tk 8.7 help
  - CHANGE: themes: azure, forest, sunvalley
  - CHANGE: insure against double-clicks of some icons
  - CHANGE: use normalized file names at filling the file lists of alited.ini
  - CHANGE: theming Projects file list's popup menu
  - CHANGE: tips of unit tree with TODOs
  - CHANGE: check and fix widths of tree's columns (they can overlap the scrollbar)
  - CHANGE: allow to run *in console* "forced command" for "%f ..." pattern
  - CHANGE: update GUI after "Projects" dialogue's closing, anyway
  - CHANGE: About / Acknowledgements
  - CHANGE: packages: apave/e_menu 3.5.4, hl_tcl 0.9.42

Changes in v1.3.0 against v1.2.3:

  - BUGFIX: at start, forget alited's own packages & namespaces
            (big-bug making alited unusable in some Magicsplat & Bawt distros)
  - BUGFIX: Preferences/Editor: don't touch snippets' bg color at choosing colors
  - BUGFIX: update "Save all" icon at removing trail spaces & "Replace in Session"
  - BUGFIX: choose e_menu items in Preferences, when set ornament (o=1) in menu.mnu
  - BUGFIX: switch projects at running alited in tkcon (skip ini::SaveCurrentIni)
  - BUGFIX: e_menu: corrected (for Windows, esp. XP), incl. test*.mnu
  - BUGFIX: e_menu: selected text as a code snippet for "Run Tcl {all selection}" item
  - BUGFIX: check for file modifications when "internal" e_menu opens a submenu
  - BUGFIX: check for existing menu of "internal" e_menu at running tools
  - BUGFIX: customized hotkeys in tooltips of tool icons
  - NEW   : "Setup/Before Run": a "forced command" to run by "Run" tool
            in console (or in Tkcon if the command begins with %f or file.tcl)
  - NEW   : tag the unit tree items with red color for TODO comments (#!...todo...),
            these TODOs being in tooltips of the tree
  - NEW   : "Move TODO to day/week" buttons in "Projects..."
  - NEW   : MS cmd.exe & powershell.exe as choices for MS shell
  - NEW   : let ~/.config be default, last config directory be saved in last.ini
  - NEW   : "Setup/Configurations..." to switch configs
  - NEW   : "Configurations..." has combobox of configs, "Clear" of popup menu, "Help"
  - NEW   : tooltips: statusbar message; Preferences themes/CS; rename-file button;
            "Tools/Run" menu item & "Run" icon (on forced run)
  - NEW   : warning at EXEC/SHELL of e_menu
  - NEW   : "Help" button / F1 in "Setup / After Start (Before Run)"
  - NEW   : between sessions, save/restore "Wrap lines" mode for files of projects
  - NEW   : Default & Test buttons in Preferences/Tools/e_menu
  - NEW   : About / Packages
  - NEW   : "Don't show anymore" checkbutton for Open... multiple files & Open all Tcl
  - NEW   : "Setup/Favorites...": "Current favorites" button added
  - NEW   : doubleclick on Projects' file list to open a file (was declared, not done)
  - CHANGE: "save" icon instead of "heart" for saved lists of favorites
  - CHANGE: tips of the tree are X-shifted relative to the mouse pointer (better view)
  - CHANGE: #RUNF: and #EXEC: comments may be used along with old #RUNF1:, #EXEC2:
  - CHANGE: "Preferences/Tools/Diff tool" to compare left & right tabs (in utils.mnu)
  - CHANGE: font size in "external" e_menu is "middle" of Preferences/General
  - CHANGE: save geometry of main menu of "internal" e_menu, ignoring other menus
  - CHANGE: "Setup/Favorites...": "Back" button: come-back to project's initial favs
  - CHANGE: queries for Favorites/LastVisits popup menu items be close to mouse pointer
  - CHANGE: switch to Favorites at choosing "Setup/Favorites..."
  - CHANGE: killing Tcl-runs corrected
  - CHANGE: e_menu: a hot key (F4) for "Run me" item
  - CHANGE: "Lists of Favorites" dialogue's appearance
  - CHANGE: remove README of alited's own packages
  - CHANGE: check info+statusbar height: must be >50 for the layout being viable
  - CHANGE: "Find all in session": no excessive reading of all texts after "Find unit"
  - CHANGE: edit::RemoveTrailWhites: TID vs wtxtcurr (no reading of all texts)
  - CHANGE: raise existing alited app: Linux / Windows own way
  - CHANGE: create Preferences/Tools/e_menu tab (if not current) with a delay
  - CHANGE: Preferences/Tools/Run replaces "Tkcon topmost" ("in console" by default)
  - CHANGE: tips and docs corrected (country/language in locale)
  - CHANGE: About / Acknowledgements & docs
  - CHANGE: packages: apave/e_menu 3.5, bartabs 1.5.7, hl_tcl 0.9.41, baltip 1.4.0

Changes in v1.2.3 against v1.2.2:

  - BUGFIX: doctest of tests.mnu failed with vanillawish taking -v argument
  - BUGFIX: at 1st start, issues with choosing non-default config directory
  - BUGFIX: switching projects with no file or with "No name" tab
  - BUGFIX: not save "No name" of project's file list
  - BUGFIX: clearing messages in status bar of Projects
  - BUGFIX: checking for duplicate icons of tools
  - BUGFIX: Projects dialogue after deploying alited 1st time (vars not existing)
  - BUGFIX: evaluation of Tcl commands of "Setup / After Start (Before Run)"
  - BUGFIX: switching projects with files unsaved
  - NEW   : displaying numbers of selected tabs (at Ctrl+click etc.)
  - NEW   : catching errors of alited's settings
  - NEW   : e_menu's "3. Edit/create file" edits "file name" of text selection
  - NEW   : error message at passing a non-existing file name to alited
  - NEW   : status bar: info on Run; detailed tooltip
  - NEW   : "Default" & "Default 2" buttons of Preferences/Tools/tkcon; new colors
  - NEW   : "New" and "Open..." items in popup menu of tab bar
  - NEW   : checkbox "Don't ask anymore" at closing unsaved files
  - NEW   : checkbox "Do it in other Tcl files" at asking "Correct indentation"
  - NEW   : checkbox "Do it in other files" at asking "Remove trailing whitespaces"
  - NEW   : in List of Templates: "Import templates" button; tiny-ups
  - NEW   : new templates in alited.ini (view variables; enter a command)
  - NEW   : look for a declaration (Ctrl+L) - at first in the current tab
  - NEW   : "Tools / Run..." to choose console/tkcon to run Tcl code
  - NEW   : in Projects, clear project name and choose its dir -> make its name
  - NEW   : (customizable) F9 key to show a list of open files, at mouse pointer
  - NEW   : "Tools / File List" menu item
  - NEW   : hint on running in console/tkcon (in Preferences/Tools/tkcon)
  - CHANGE: Find/Replace: updated "In session" buttons at entering the dialogue
  - CHANGE: git.mnu, fossil.mnu (OK button focused), tests.mnu (DT* args)
  - CHANGE: Preferences/Saving: port to listen = 51807 by default
  - CHANGE: menu labels in Setup menu (Projects... etc.)
  - CHANGE: status bar's messages with bell - in red color
  - CHANGE: "Unit lines per 1 red bar": N lines of a unit considered normal; 4 minimum
  - CHANGE: 12 rows of list in "Templates"
  - CHANGE: checking start of main::UpdateTextGutterTreeIcons & alited::Message
  - CHANGE: at 1st start, geometry of "Preferences", incl. minimal dimensions
  - CHANGE: enable Edit menu items ("Correct indentation" & "Remove trailing spaces")
  - CHANGE: Help window is made non-modal, to see the help & work together
  - CHANGE: "Tools / tkcon" and "Tools / e_menu/bar" exchanged seats
  - CHANGE: at closing a file by Ctrl+W, go to a previously viewed file
  - CHANGE: simplify checking keys to save last visits
  - CHANGE: tooltips of file list with (optional) file info
  - CHANGE: save dir chooser's geometry of choosing ~/.config (the very 1st dialogue)
  - CHANGE: apave, e_menu, bartabs, hl_tcl, baltip, doctest packages

Changes in v1.2.2 against v1.2.0:

  - BUGFIX: save TODO of Projects at "Undo changes"
  - BUGFIX: selection of unit/file tree at file operations
  - BUGFIX: default option values for projects (ignored dirs etc.)
  - BUGFIX: line numbers in the gutter
  - NEW   : "Edit / Remove Trailing Whitespaces" to trimright line/selection/text
  - NEW   : "Preferences / Projects / Remove trailing whitespaces" option (for all texts)
  - NEW   : "Projects / Options / Remove trailing whitespaces" option (for all texts)
  - CHANGE: set the current month if no blinking TODO in Projects
  - CHANGE: %D & %f wildcards filled in bar/menu icon tips & Tools/bar/menu items
  - CHANGE: additional checking to avoid duplicates in "Last Visited"
  - CHANGE: Preferences' code snippets: curr.line & TODO comment (#!..) colors
  - CHANGE: at completion, some commands need no adding a space
  - CHANGE: helps for Preferences & Projects dialogues
  - CHANGE: About / Acknowledgements
  - CHANGE: apave, e_menu, hl_tcl, klnd packages

Changes in v1.2.0 against v1.1.0:

  - BUGFIX: issue with debug & log 'puts' at using tclkits
  - BUGFIX: in "Projects", switching to other project after changing a reminder
  - BUGFIX: in alited.tcl: mistaken FILEDIR variable; mistaken exec {*}; clearances
  - BUGFIX: closing "Check Tcl" and "Find be List" at closing app
  - BUGFIX: at starting, message "The file %f seems to be not of types"
  - BUGFIX: passing alited (if open) a file name containing spaces
  - BUGFIX: "update" after selection from menu (some DEs need it)
  - BUGFIX: uk.msg instead of ua.msg
  - BUGFIX: "Run me" at setting e_menu as non-external app
  - BUGFIX: failed double click on a project list in "Projects" (annoying bug)
  - BUGFIX: text selection fg/bg at tinting
  - BUGFIX: issue with ignored dirs at using tclkits
  - NEW   : "Run me" runs tcl source in tkcon (with benefits of introspection)
  - NEW   : "Run me" runs tcl source in console, if "Preferences/Tools/Tkcon/Stay on top"
  - NEW   : restoring selected texts at switching tabs
  - NEW   : passing dir&file choosers' geometry to "external" e_menu
  - NEW   : passing theme name to "external" e_menu
  - NEW   : "Setup/After Start" setting to run Tcl & external commands
  - NEW   : "Setup/Before Run" setting allows Tcl commands
  - CHANGE: required version of Tcl/Tk is 8.6.10+
  - CHANGE: tkcon.tcl modified for sourcing a Tcl/Tk script
  - CHANGE: tkcon's default settings modified
  - CHANGE: minsizes for Projects & Preferences set static
  - CHANGE: saving "Setup/Before Run" setting in project.ale
  - CHANGE: running e_menu faster
  - CHANGE: statusbar font size = small font size of Preferences
  - CHANGE: "Comment/Uncomment" enabled for all
  - CHANGE: reminder's saves simplified
  - CHANGE: notes and reminders got a current line highlighted
  - CHANGE: html Tcl/Tk man pages allowed along with htm
  - CHANGE: e_menu's menus shown at position of Preference/Tools/e_menu/Geometry
  - CHANGE: apave, e_menu, hl_tcl packages

tma 2021-12-30: Under Windows 'alited' creates a directory '.config' in the users home directory with every start. Application config files should be in APPDATA=C:\Users\<UserName>\AppData\Roaming\<AppName>.


HE 2021-12-30: Alited looks promising but directly after starting I found one or better, two issues which let me directly stop my experiments.

Opening a ticket on github is only possible for registered users so this is not a possible way for me to inform the author.

Therefore, I added a Discussion section to provide what I found.

Alited opens a server socket on 127.0.0.1:51837 by using the package comm. This is not possible to change without changing the code. Neither the used port nor that the port is opened for listening.

This is an issue in a couple of cases:

  • The port is used for some reason other than alited. Alited will never show itself on the GUI. Moreover, there is no warning what went wrong and a look into the task list shows that alited is still running.
    That means it hangs forever. Or, at least for a couple of minutes before I killed these processes.
    Reason is a missing timeout when using "::comm::comm send $comm_port" to test if the task using the port is a alited instance. There is no guarantee that a listener port is answering the connection attempt. And then alited hangs.
  • It is not possible to use two instances of alited in parallel. For example, I'm often working on different programs at the same time using different virtual work spaces. In such cases I want different instances.
    Reason is that the used port is not configurable. We can use more than one configuration file but, they use always the same port.
  • This open port is a security thread because it allows other users on the same machine to send commands to a running alited instance. I tried:
                Two user foo and foo1.
                foo starts alited.
                foo1 starts tclsh and executes the following:
                        package require comm
                        comm::comm send 51837 exec touch ~/securityIssue.txt
                        comm::comm send 51837 exit
                        exit

This created a new text file and than closed the alited instance of foo. To make it clear, this allows everything to be executed by foo1 in context of foo what exec accepts. So you can destroy all the data foo can reach.

I don't understand the need to use comm with -listener 1 for alited. The documentation does not describe a use case for it. At least I doesn't find it.

To remote control an application to be tested, the listener mode of comm is not needed in alited.

To check for another running instance of the user also can be done in a different way. For example, assuming a local installation of the user with a lock file.

Perhaps one can explain the reason for using comm in listener mode?


aplsimple - 2021-12-31 01:55:17

Happy New Year for all of you!

Hi TMA,

Hopefully, in the upcoming 2022 Bill (or anyone who'd be after him) will not change his mind and the Roaming directory will not turn to some RoamingNeverSayNever.

alited might finely do without the starting question on .config, still it's one of its nice features - to have as much configuration directories as you need. Somewhere in the docs I mention this, it seems to be First start section.

Starting from v1.3.0, alited remembers the last used configuration directory, so that no need to pass it alited as its first argument. And no happy year similar to this one.

---

Hi Holger,

Why don't register in Github? Making so nice analysis on comm and two instances of alited - and so averting from Github? The Git and Github aren't wild beasts, they don't bite:) Still the issues of Github would allow guys to get the troubles immediately on the mail, the feature alas they have not with Wiki's Comments and Chiselapp's Tickets.

That said, alited is more about Tcl/Tk development than those entourage things. The alited is better than Geany and TKE. Imho much better. You might see it in its demos .

HE 2021-12-31: Hello Alex,

Thanks for the fast answer. That means at least that you now knows about the security issue in alited. So, my way worked even without to be registered in Github.

By the way, Github is software and it can't bite without hardware. So I'm pretty sure before your comment that Github don't byte ;-)
But, I don't want to register in all the different platforms only to open a ticket. At the end I have to remember all the accounts and passwords for one ticket every n years.

Tcl and Tk for example you can open a ticket without having an account. For sure you have to give an email address but, this is okay because it is not public shown.

And you don't need to advertise alited again. I would be more interested what you want to do with the listed cases.

As you can see I made an analysis with two instances of alited, two users and also some steps showing possibly dangerous commands.
And I documented it here for all potential users.
I also tried a quick search through the provided documentation why alited needs that listener port beside to find out that an instance is still running.

I can change the behavior that it would fit my needs but I can't provide you a patch for that, because I don't know why you programmed it in this way or what is the use case behind it.

And it makes no sense to create a patch to make the port configurable if the only use case is to detect a running instance of alited. Because in that case I would use a different approach.

And it makes also no sense to make a deep dive into the comm package for me. The mechanism has that possible security issue. Perhaps it can be solved by using tls and certificates. But, this is behind my current experience and far to much effort to make a foreign program running safely. I'm even not sure if there is an easy way by using sockets.

Keep in mind that I simply wanted to try alited.


aplsimple - 2021-12-31 07:30:34

Okay, let the port be a preference option, its empty value would mean no watching it and multiple aliteds allowed to be run. By default, its combobox value will be empty.

Thank you for your remarks. If you don't mind I'd ask you for sending me a mail with your code about the port.

As for advertising, it seems you mean my demos, probably a bit (or much, for other taste) boastful stuff. Still I think they are very good as kind of live documentation.

Without advertising here Tcl/Tk things made by tclers, this alited would be impossible, as it uses (often by a direct borrowing!) a lot of Tcl/Tk software made by others. tk_optionCascade by Richard Suchenwirth, scrolled frame by Paul Walton, ttk themes by rdbende... As well as poApps by Paul Obermeier greatly facilitating the development, baltip greatly helped by Csaba Nemethi, loupe tool inspired by Johann Oberdorfer. And so on and on.

What is the wiki if not a site to share with one's own works? It's all for Tcl/Tk's boon, not?

Though, it's probably not a best site to put questions in the hope they would be answered quickly. Some time ago I'd missed a question on my Pave, sort of geometry manager and answered it only too late :(

But mostly you are right and I've made too haste with the publishing this alited here.

HE 2022-01-01: Happy New Year Alex.

Sorry to be not clear enough about advertising. I don't meant advertising in general or this side in general. I only meant advertising as an answer of a comment/message is the wrong place for me.

During code investigation I found out that there is a parameter to use with alited which stops the check for running instances:

alited.tcl NOSEND

For sure it is better to make it other way round for safety reason. Then an unexperienced user doesn't open the listener port by accident. Therefore, I created a version which use SEND. I hope I found all occurence where NOSEND has an effect.

alited.tcl SEND

To make port configurable will not work in the current structure of alited because configuration is loaded after the listener port is opened. At least the configuration array ::alite::al is not filled at that time. Therefore, I not spend additional work on it.

In addition I created de locale. Only a rough translation. Some entries are still looking strange. Beside the help pages in data/help it will be possible to use alited as a German native.

I will send you all changed/new files to you by email.

SEH 2021-01-02 - I've been experimenting with alited over the holiday break, and so far I think it has a lot of potential for making it easier to comprehend and work with multi-file Tcl projects. I hope more people give it a try.