Author Topic: Emacs - how and where?  (Read 8167 times)

0 Members and 1 Guest are viewing this topic.

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: Emacs - how and where?
« Reply #25 on: November 27, 2018, 07:48:03 pm »
Does Tetris belong in a text editor?
Not really, but I would appreciate a good implementation of Tetris much more :)

What text editor has Tetris in it?

Early versions of Excel had 3D flying simulator in them, this puts things into perspective, I guess.
Alex
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #26 on: November 27, 2018, 09:55:31 pm »
What text editor has Tetris in it?
Did you really have to ask?

And it's not the worse I've used, too.

FYI, there's also a "Towers of Hanoi" demo/playable puzzle:
Code: [Select]
                                                                               
            |                          |                          |           
            |                          |                          |           
            |                          |                          |           
           <0>                         |                          |           
          <-1->                        |                          |           
       <----4---->                     |                          |           
      <-----5----->                    |                          |           
     <------6------>                   |                       <--2-->         
    <-------7------->              <---3--->                      |           
===============================================================================


Now to less serious matters:
I'm a long-time Emacs user (and in college was a hired typist for rms for a few sessions until I couldn't take it anymore...)

For me, Emacs features that I have a hard-time finding replacements for:
1. Shell mode. Run processes in buffers, having a quick way to save the output for later remembering, documentation, or whatever.
2. Keyboard macros. As described above. More powerful than they first appear.
3. Mark-ring (multiple clipboards, done right)
4. Tramp - edit files on remote systems as if they were local (sort of).
5. Scripting is first-class. You can write code to edit files.
6. Incremental search
7. Template.el for new files-programmable
8. Dabbrev (auto-completion)
9. Babel-mode.

Point for point, these are definitely good things in an editor.
And many, though admittedly not all, I have found in a more easy going implementation in VS Code (as for a different list that Legacy proposed in the other thread).

1. Shell integration in VS Code is very good. Often I use that instead of opening a separate PowerShell or Linux terminal prompt...same as I used to do with Emacs
2. These are missing in Code. A glaring omission, though for 90% of my usage they are replaced by multiple cursors.
3. There's a number of extensions for that.
4. Missing (unless invoking nano from an ssh session in the terminal windows counts  ;))
5. As keyboard macros, missing unless you write an extension (I never felt the need, though)  :--
6. Default behaviour, easy to switch between search and S&R, and from plain text to case sensitive or regexp
7. Snippets are a good substitute, and extensions are available
8. Intellisense for most languages and dabbrev-like behaviour for plain text.
9. Not available natively, I frankly ignored its existence in Emacs  :-[, but many extension available.

I'll add that I find rectangle editing in Emacs quite clunky, and very natural in VS Code.
Native git support, possibility to open a folder (or even multiple unrelated folders), easier windowing and easier code navigation make up for the missing parts (tramp and macro/easy scripting).

Emacs is, basically, a lisp interpreter with good screen access, a foundation upon which a 300 pound gorilla editor has been built; in fact, a structure not very dissimilar from the new(ish) wave of editors: Atom, Code, and I imagine Sublime and many others.

Mind, I still think Emacs is a great editor, but I in my normal working day (and free time coding) I found VS Code to be a better fit; as usual IMHO, YMMV. :blah:
Now I'll go and find me a bootleg copy of Brief, just for nostalgia's sake.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Emacs - how and where?
« Reply #27 on: November 27, 2018, 10:17:31 pm »
Mind, I still think Emacs is a great editor, but I in my normal working day (and free time coding) I found VS Code to be a better fit; as usual IMHO, YMMV. :blah:

OK, I am intrigued. I checked out whether VSCode has VHDL editing support, and it turns out that there are at least three extensions. So, what the hell, I'll give it a go.

Quote
Now I'll go and find me a bootleg copy of Brief, just for nostalgia's sake.

Masochist, eh?
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Emacs - how and where?
« Reply #28 on: November 27, 2018, 10:42:00 pm »
EMACS? You are all big girls blouses, the only editor of testicular fortitude is DEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.  :-DD


 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #29 on: November 27, 2018, 11:17:51 pm »
Emacs automatically goes into vhdl mode if you load in VHDL source code

I was talking about the emulation on Sigasi, where you have to enable/disable the Emacs VHDL mode.
You simply need to press a key for this.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14476
  • Country: fr
Re: Emacs - how and where?
« Reply #30 on: November 27, 2018, 11:40:59 pm »
One thing I still have to understand ... is why people still want modal text editor features through emulation

See Sigasi? There is Emacs emulation mode
See Kate? There is Vi emulation mode

Both these two features are modal-text-editor emulations  :-//

Your nickname should give you a good hint as to why... ;D

 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4037
  • Country: nz
Re: Emacs - how and where?
« Reply #31 on: November 28, 2018, 12:23:02 am »
EMACS? You are all big girls blouses, the only editor of testicular fortitude is DEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.  :-DD

You'd love Data General's "speed", a bad clone of TECO.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4037
  • Country: nz
Re: Emacs - how and where?
« Reply #32 on: November 28, 2018, 12:39:58 am »
I'm a long-time Emacs user (and in college was a hired typist for rms for a few sessions until I couldn't take it anymore...)

For me, Emacs features that I have a hard-time finding replacements for:
1. Shell mode. Run processes in buffers, having a quick way to save the output for later remembering, documentation, or whatever.
2. Keyboard macros. As described above. More powerful than they first appear.
3. Mark-ring (multiple clipboards, done right)
4. Tramp - edit files on remote systems as if they were local (sort of).
5. Scripting is first-class. You can write code to edit files.
6. Incremental search
7. Template.el for new files-programmable
8. Dabbrev (auto-completion)
9. Babel-mode.

10. diredit. browse the filesystem. Rename or delete or move or run a shell command on selected files.

11. vc mode. Check out, check in, see diffs, see log and other common operations with the same keystrokes no matter whether you're using Bazaar, CVS, Git, Mercurial, Monotone, RCS, SRC, SCCS, or Subversion (and user-extensible to others naturally)

12. compilation mode. Browse through compiler error messages with the source file and line for each shown in another pane. Not just for compiler errors! Also works with grep output, and patch, and any other script or program you hack up to produce lines with the format "<file>:<line>:<char> Error:"


There is nothing to prevent other user-extensible editors from doing any or all of these, for example Sublime with Python or VSCode with Javascript. It's just a simple matter of someone doing creating it.

The advantage emacs has is that over the last 30 or so years a lot of people have created and refined a lot of extensions.

These days, using an HTML engine for the display and Javascript for the extension language makes a lot of sense, and so VSCode probably has a great future.
 

Offline Cerebus

  • Super Contributor
  • ***
  • Posts: 10576
  • Country: gb
Re: Emacs - how and where?
« Reply #33 on: November 28, 2018, 12:53:03 am »
EMACS? You are all big girls blouses, the only editor of testicular fortitude is DEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.  :-DD

TECO is for wimps who can't use a proper card punch and a fan-fold listing.  :)

For the record I have actually written AI software in FORTRAN (for a living in the late eighties - don't ask), do not and have never either eaten quiche or written code in Pascal.

The wise will infer of what I speak.  ;)
Anybody got a syringe I can use to squeeze the magic smoke back into this?
 

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: Emacs - how and where?
« Reply #34 on: November 28, 2018, 01:14:48 am »
You'd love Data General's "speed", a bad clone of TECO.

OK, so you had it pretty easy then. We wrote our own serial transfer program on DG RDOS using ICOS. We did have 1/2" tape which was nice. On some systems our main text editor was a HB Pencil, all upper case on coding sheets submitted to Data Entry. It's amazing how lazy as a profession we have become.
 

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: Emacs - how and where?
« Reply #35 on: November 28, 2018, 01:30:22 am »
There seems to be a lot of Emacs knowledge here, maybe someone has a quick answer.

I use Xemacs (if that makes a difference). Usually, it is very pleasant to use for my C code. BUT... I am writing a lot of embedded code with inline assembler, and Xemacs gets really confused about the assembly code where some lines have comments with the semi-colon and some don't. Xemacs totally destroys my indentation.

I guess I _could_ move all the assembly to a separate .s file and maybe Xemacs will understand that I want assembly indentation. But I really do like having the C function wrappers, and I would rather not add more files and rules to Makefile.

My "temporary" fix to help my sanity is to toggle off "syntactic indentation" under the "C" tab. It works. Is there a better way? Thanks!
Currently developing STM8 and STM32. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Emacs - how and where?
« Reply #36 on: November 28, 2018, 02:57:24 am »
If the code is open, post a link the problematic file and you'll get a pack of rabid emacs fans tearing into it to try to give the smartest answer. (Haha, only serious.)

If the code is closed, can you create the same problem with a dummy file?

In either case, express what you think you'd like to happen (if it's not obvious).
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4037
  • Country: nz
Re: Emacs - how and where?
« Reply #37 on: November 28, 2018, 03:07:44 am »
Sorry, I don't know the answer. I very rarely embed more than one or two asm instructions in C, and any comment is outside of that.

(I write a lot of asm code, but in .s files)
 

Offline rhodges

  • Frequent Contributor
  • **
  • Posts: 306
  • Country: us
  • Available for embedded projects.
    • My public libraries, code samples, and projects for STM8.
Re: Emacs - how and where?
« Reply #38 on: November 28, 2018, 04:00:46 am »
If the code is open, post a link the problematic file and you'll get a pack of rabid emacs fans tearing into it to try to give the smartest answer. (Haha, only serious.)
The code is or will be open, so I have no problem with sharing. But I think that my post has enough information: Xemacs thinks it is is C indentation mode, and gets really angry with my inline assembler where some lines have comments (with semicolon) and some that do not.
Quote
In either case, express what you think you'd like to happen (if it's not obvious).
I would like to get an Xemacs extension that would see "__asm" and "__endasm" tokens to change from C indentation to just "what I type". I am not asking anyone to create a new thing, just asking if someone has already made one. Thanks.
Currently developing STM8 and STM32. Past includes 6809, Z80, 8086, PIC, MIPS, PNX1302, and some 8748 and 6805. Check out my public code on github. https://github.com/unfrozen
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Emacs - how and where?
« Reply #39 on: November 28, 2018, 09:01:09 am »
Quote
Xemacs gets really confused about the assembly code where some lines have comments with the semi-colon and some don't. Xemacs totally destroys my indentation.
Sounds tricky, but ...
Why are you using asm comments (with semicolon) instead of C comments?
Code: [Select]
  asm volatile ("  sbi %[portdir], %[lbit]  \n"    // Set bit direction
      "3: "                                        // main loop label
      "   sbi %[port], %[lbit] \n"                 //  Turn on.
          /*
           * About the delay loop:
           *   The inner loop (dec, brne) is 3 cycles.
           *   For one second, we want 16million cycles, or 16000000/(3*256*256) loops.
           *   This is "about" 81.
           */
      "    clr r16  \n"
      "    clr r17  \n"
      "    ldi r18, 81  \n"   // 100 * 256
      "1:"  // 1st delay loop label
// (etc)
      :
      : [portdir] "I" (_SFR_IO_ADDR(LEDPORT_DIR)),
        [port] "I" (_SFR_IO_ADDR(LEDPORT)),
        [lbit] "I" (LEDBIT)
      );
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Emacs - how and where?
« Reply #40 on: December 01, 2018, 10:19:45 am »
EMACS? You are all big girls blouses, the only editor of testicular fortitude is DEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.  :-DD
When I was in school, we had an assembly language class that was taught on a PDP-11. The whole machine had a whopping 10 megabytes of disk in which to hold unix, and personal accounts for all the students. There was dialup access, but I think maybe we had 1200 baud or something fancy.

The editor on that machine was ed. No screen stuff at all... just commands. It forced a certain kind of discipline because "big" programs (i.e., more than a screen or two) became hard to work with. To survive, you had to be able to visualize how your code looked inside your head--without seeing it actually displayed all in one go.

The following year, I got some time on an LMI Lambda and learned emacs. Been using it ever since.  ;D
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4037
  • Country: nz
Re: Emacs - how and where?
« Reply #41 on: December 01, 2018, 12:23:19 pm »
EMACS? You are all big girls blouses, the only editor of testicular fortitude is DEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.  :-DD
When I was in school, we had an assembly language class that was taught on a PDP-11. The whole machine had a whopping 10 megabytes of disk in which to hold unix, and personal accounts for all the students. There was dialup access, but I think maybe we had 1200 baud or something fancy.

My first year at university we learned Pascal on a PDP 11/34 with a 5 MB disk for the OS and another 5 MB disk for the student home directories. It had 256 KB of RAM. It had 24 serial ports, 22 of them attached to VT100 (or Visual 100) terminals and 2 to LA120 printers. If I remember correctly, we were allowed to use about 100 KB of disk space while we were logged on, but had to reduce it to 20 KB to log off. There were around 300 students in my course, plus another 200 maybe learning BASIC on the same machine (at different times).

Quote
The editor on that machine was ed. No screen stuff at all... just commands. It forced a certain kind of discipline because "big" programs (i.e., more than a screen or two) became hard to work with. To survive, you had to be able to visualize how your code looked inside your head--without seeing it actually displayed all in one go.

We also had only a line editor, though it was written specifically for that machine, to use as little resources as possible. I think the maximum text file size was 4 KB.

One of the first things I did was write my own personal screen editor (in Pascal). It was very very simple, able only to self-insert characters, move around using the arrow keys and BOL/EOL and delete things with the backspace key. And delete a range of lines and insert them somewhere else. Primitive, but a vast improvement over an ed-like editor.

Due to lack of disk space, I had to compile my editor every time I logged on and delete it before I logged off!
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19509
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #42 on: December 01, 2018, 01:03:02 pm »
LOL, is it included in Emacs?  :-DD
Yes, but the novelty wears off quite fast. And then you think - does this belong in a text editor?

Emacs is like a kitchen sink: useful, and you can choose to put just about anything and everything in it :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19509
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #43 on: December 01, 2018, 01:04:33 pm »
LOL, is it included in Emacs?  :-DD
Yes, but the novelty wears off quite fast. And then you think - does this belong in a text editor?

Does Tetris belong in a text editor?

Does asteroids belong in a scope, or a flight simulator in a spreadsheet? Both exist :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19509
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #44 on: December 01, 2018, 01:09:18 pm »
However, no matter how good any of those were in their home territory (e.g. DOS, Windows, Mac), they were restricted to one OS, and possibly one language.

When I started out we just had "ed" on serial terminals. Pretty sure there's a variant out there for any OS, I worked on COBOL using an "ed" variant on several propitiatory systems. Still don't see compatibility as a compelling reason to go back to it.

Lucky you (except for the COBOL). When I started out it was 5 channel paper tape.

Deleting a character was possible by manually punching out all holes in wrong character.
Inserting a character required either cut-and-tape operations, or copying the tape until the relevant character, then typing the insertions, then continuing copying. All at 5 or 10 cps.

At least dropping the tape didn't cause howls of anguish, unlike punch cards.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 19509
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #45 on: December 01, 2018, 01:16:26 pm »
One thing I still have to understand ... is why people still want modal text editor features through emulation

Quite.

I still remember the horrors of the VAX editor. Pressing the "delete char/word/line" keys deleted different bits of text depending on what you had been doing sometime in the past. The "bright idea" was that they continued the direction of movement of the cursor. If the last move was backward it deleted the character/etc before, else it deleted the character/etc after.

I spent a day learning the editors macros, so I could get the numeric keypad keys to behave sensibly :)
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline Macbeth

  • Super Contributor
  • ***
  • Posts: 2571
  • Country: gb
Re: Emacs - how and where?
« Reply #46 on: December 02, 2018, 12:01:00 am »
...and you try and tell the young people of today that ..... they won't believe you.
 
The following users thanked this post: rhodges

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #47 on: December 03, 2018, 08:58:39 pm »
 

Offline splin

  • Frequent Contributor
  • **
  • Posts: 999
  • Country: gb
Re: Emacs - how and where?
« Reply #48 on: December 04, 2018, 03:02:02 am »

At least dropping the tape didn't cause howls of anguish, unlike punch cards.

Except that dropping your pack gave you the chance to use the card sorter - and watch in total awe at the speed and sheer electro-mechanical brilliance as it restored your cards to the proper state.

Of course it took ages to pick up the cards and put them all the right way round.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Emacs - how and where?
« Reply #49 on: December 04, 2018, 03:29:18 am »
What was the basis for sorting? (IOW, what was the machine keying off of?)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf