MicroEmacs and other editors (except QD)

Anything QL Software or Programming Related.
User avatar
ql_freak
Super Gold Card
Posts: 503
Joined: Sun Jan 18, 2015 1:29 am

MicroEmacs and other editors (except QD)

Post by ql_freak »

One drawback of QDOS, QPC2, ... is, that there is no freeware editor. QD-Demo delivered with QPC2 can only read files, but "Saving files" is disabled. I have tried some other editors, Ralfs SEDIT works as does Master_Spy. But they all have one drawback on QPC2 with a high resolution:

They all open at screen position 0,0 (top left). I've tried to patch the CON-channel in an older version of Master_Spy, but it didn''t work. There was an additional window with the new CON position, but the real editor was at 0,0. With the newest version of master from Dilwyns page, master uses the full screen, but unfortunately really the full screen. You can patch it, to show fewer lines on startup, but even then it uses the full screen (the rest is black). A "software" would be needed, which simulates a smaller screen, than it could perhaps work.

So I have tried MicroEmacs, which is a really excellent editor, surely the most powerfull for QDOS (even more powerfull than DME), AND it is a Pointer program. It has menus, can be moved around the screen, ...

But unfortunately it is too complex for beginners. Also MicroEmacs was my favourite editor at Windows 3.1 times (under Windows), I don't know the most key bindings any more. I have now played with the QDOS version (the latest 4.x or so) and its really superb. As it seems to be the only free editor which supports the Extended Environment, I want to start a thread here, for discussing it.

What I have found, and what is most usefull, if you start using uEmacs (short uE) is a reference card, with the most important commands (most commands are the same for the QDOS version):

http://www.jamesie.de/microemacs/

The page itself is in German, but the downloadable reference card is in English.

The most important keys in uE are:

CTRL (abbreviated with ^ e. g. ^-S to start a search)

M (M for "Meta", esc on the reference card, e. in the menus of uE for QDOS) is ESC in QDOS (and most other systems) and must be pressed first, afterwards another character must be typed, e. g. M-x to execute a named (MicroEmacs) command (You must press ESC, than x and then you can enter a command in the bottom most line of uE, e. g.: region-to-scrap).

If you look into the menus, some commands are prefixed with a tilde (~), this means the ALT-key. You can only use those key bindings, if there is no hotkey with this letter defined. If you e. g. have defined "ERT HOTPICK('s','') to pick SuperBASIC you can't use the key binding ~-S from the Search menu in uE (QDOS version). But you can of course use M-x and then enter hunt-forward or you define a key binding as on the reference card (see link above): ^-X h (press first CTRL-x and then the H-key). NOte: Fortunately Thierry has bound the F3 key on the QDOS version to hunt-forward to repeat the last search :-)

It is left as an excercise to the user, how to define a key binding.

If you want to search (^-S) it is important, that you must use ESC to start the search, as with ENTER you can enter newlines and so search for newlines (e. g. to search a string only if it occures at the end of a line).

MicroEmacs on QDOS searches the normal emacs_rc file on start up (as on every implementation) and on qdos also uelocal_rc. It is important that you have both files in your EMACS_HOME directory (you should at least define EMACS_HOME with SETENV 'EMACS_HOME=WIN1_myEmacsHomeDir'), else uE will always acces FLP1_ and FLP2_ (hard coded in uE), which takes a lot of time in QPC2 (it seems the floppies are not cached as on a real QL). If anyone will compile uE new, please remove FLP1_ and FLP2_, it is described in "emacs_hlp" (can be changed in the epath_h file). After all: Another complex programming language for a QDOS program. Look at the emacs_rc file (make a copy before) and change e. g. the variable $sscroll to FALSE - the result will be horrible - it comes from times with slow terminals, 9600 baud or so).

When loading (^-X) or viewing (read only) files (^-V) it is the easiest to click on the file name in the Files menu, so that the filename is in the hotkey stuffer and insert it with ALT-SPACE as the Menu_rext delivered with QPC2 seems to have a horrible bug (the same with QD), if a filename is already given, you can't list the directories, but this I will discuss not today, I'm now tired.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Ralf R.

Re: MicroEmacs and other editors (except QD)

Post by Ralf R. »

Surely, S_Edit can be moved around the Screen. use the latest Version from Dilwyn's site, start it and press CTRL-F4.


User avatar
ql_freak
Super Gold Card
Posts: 503
Joined: Sun Jan 18, 2015 1:29 am

Re: MicroEmacs and other editors (except QD)

Post by ql_freak »

Nice to know, as for small tasks it is better suited than the (Micro?)Emacs monster.

But it seems CTRL-F4 isn't documented, so my false assumption.

Cheers Peter


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Ralf R.

Re: MicroEmacs and other editors (except QD)

Post by Ralf R. »

Yes, seems so ;)


swensont
Forum Moderator
Posts: 325
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: MicroEmacs and other editors (except QD)

Post by swensont »

The editors that I use are:

1. ED from Metacomco (got it with the Pascal compiler)
2. QED from Jan B. Just like ED but is officially free and can take longer file names.
3. MicroEmacs

I used MicroEmacs a lot back in the day when I was programming more. I was able to get Thierry to add some features that I wanted. He also modified it so that the syntax highlighting supported Structured SuperBasic ( a SuperBasic prepocessor that I wrote). With some extra tools, it is possible to use MicroEmacs in the form of an IDE. From MicroEmacs you can all other executables (like SSB or a C compiler). When done you are returned to MicroEmacs. It has a nice Macro language that you can use to automate things. You can even use CSM to control MicroEmacs from some other application (never really tried this). I even used it for general writing, since I supports word wrap and right margins.

Tim


User avatar
ql_freak
Super Gold Card
Posts: 503
Joined: Sun Jan 18, 2015 1:29 am

Re: MicroEmacs and other editors (except QD)

Post by ql_freak »

Yes uE is an absolute superb Editor, I have used it a lot at Windows 3.1 times on Windows (at this time there was unfotunately no QL version available). But I have forgotten the most commands. For normal tasks (I have no QD licence) I now use SEDIT, cause it seems to be the only free editor (besides uE) which can move its Window. And BTW (don't tell it Jochen), I find it 's usage is easier than QD (at least for a QL user who knows about F3 : -) ).

Today I used it, to report a bug in Q-Dir (a nice File Manager from software.ok). I wrote it (just to [re]learn uE) in MicroEmacs, than copied it to my DOS Device and converted it with my charConvert to Windows (I have created two links in Windows: qdosToWin and winToQdos, with specialised *.ini files for charConvert).

But what I don't understand in the QL version: Sometimes text (e. g. the region, or search result) is hilighted, but I don't know, how to remove the hilight?

For the Windows 3.1 version I have had written an extension, which implemented a block (as most QL editors) with 2 marks (the two last ones, I think mark 7 and 8, the old version did not support so much marks as the 4.0 version). I will try to find it (it should be on a floppy) and try to port it for the QL version. Does anyone know, how to hilight text from a uE macro (the Windows version hasn't had a hilight - as the QL editors at that time).


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
swensont
Forum Moderator
Posts: 325
Joined: Tue Dec 06, 2011 3:30 am
Location: SF Bay Area
Contact:

Re: MicroEmacs and other editors (except QD)

Post by swensont »

> Sometimes text (e. g. the region, or search result) is hilighted, but I don't know, how to remove the hilight?

MicroEmacs for the QL has HILITE, which does Syntax highlighting. If his is the mode you are in, you can get rid of the mode by the delete-mode ( ^X^M ) command.

For highlighting text, if you want to do it like a C language mode, I believe the QL MicroEmacs docs talks about creating your own language support. If you want to just a highlight a specific word from a Macro, I'm not too sure. I'd suggest the definitive MicroEmacs manua (http://www.aquest.com/emacs.pdf) from Daniel Lawrence. It details all of the normal MicroEmacs commands.

Tim


User avatar
Giorgio Garabello
Gold Card
Posts: 299
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: MicroEmacs and other editors (except QD)

Post by Giorgio Garabello »

ql_freak wrote: But what I don't understand in the QL version: Sometimes text (e. g. the region, or search result) is hilighted, but I don't know, how to remove the hilight?
- menu Var/modes
- click on "HILITE"
- click on DELETE A MODE


As in this image (thanks Dilwyn)
http://www.dilwyn.me.uk/editview/microemacs2.png


User avatar
Giorgio Garabello
Gold Card
Posts: 299
Joined: Tue Jun 30, 2015 8:39 am
Location: Turin, Italy
Contact:

Re: MicroEmacs and other editors (except QD)

Post by Giorgio Garabello »



User avatar
ql_freak
Super Gold Card
Posts: 503
Joined: Sun Jan 18, 2015 1:29 am

Re: MicroEmacs and other editors (except QD)

Post by ql_freak »

Giorgio Garabello wrote:
ql_freak wrote: - menu Var/modes
- click on "HILITE"
- click on DELETE A MODE

As in this image (thanks Dilwyn)
http://www.dilwyn.me.uk/editview/microemacs2.png
Thank You Giorgio, I didn't know this. But unfortunately it doesn't work here :-(

I have also tried ^X^M and than entered HILITE also no success :-(

Any other suggestions?

EDIT:

I have now also tried:

<ESC> redraw-display<NL>

Also no success :-( Even worse this enters a new line at the beginning of the buffer/window :-| And sometimes uEmacs crashes my QPC2 :-|

I'm afraid my version is buggy


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply