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

0 Members and 1 Guest are viewing this topic.

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Emacs - how and where?
« on: November 26, 2018, 10:19:26 pm »
I have noted that "Emacs" is usually quoted a lot of times in this forum. On topics about C, IDE, VHDL, ... there are a lot of matching quotes but without convincing details.

Try to convince me that it's a really good thing  :D
 

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: Emacs - how and where?
« Reply #1 on: November 26, 2018, 10:41:37 pm »
Try to convince me that it's a really good thing  :D

Why?   Use whatever works best for your workflow. I use VI/VIM, Quartus, or  MSVS depending on what I'm doing.
 

Offline NegativeONE

  • Contributor
  • Posts: 20
  • Country: pl
    • NegativeONE - personal page
Re: Emacs - how and where?
« Reply #2 on: November 26, 2018, 11:07:25 pm »
Try to convince me that it's a really good thing  :D

You will be able to join The Church of Emacs and became a follower of Saint IGNUcius :)

ONE never notices what has been done;
ONE can only see what remains to be done;

http://www.negativeone.pl
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Emacs - how and where?
« Reply #3 on: November 26, 2018, 11:42:15 pm »
It is not. Most of the people using it got used to it when there were no decent alternatives.
Alex
 

Offline jmelson

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: Emacs - how and where?
« Reply #4 on: November 26, 2018, 11:50:21 pm »
I have noted that "Emacs" is usually quoted a lot of times in this forum. On topics about C, IDE, VHDL, ... there are a lot of matching quotes but without convincing details.

Try to convince me that it's a really good thing  :D
Um, well, emacs does have language-specific features, but I really don't care for them.  I've been using emacs for about 20 years, but I only use about 1% of the available features.  It does have some good pattern matching and bulk find and replace operations that come in handy pretty often.

Jon
 

Offline boffin

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Re: Emacs - how and where?
« Reply #5 on: November 27, 2018, 12:14:56 am »
joe:
Joe's Own Editor. Much overlooked, but powerful and small; been my go to for many years.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4028
  • Country: nz
Re: Emacs - how and where?
« Reply #6 on: November 27, 2018, 03:24:53 am »
It is not. Most of the people using it got used to it when there were no decent alternatives.

I can't address "most". That would imply people who got used to emacs before, say, 1985 -- and even that will surely draw protests that vi was available before that and is a decent alternative. As was EDT/TPU.

In my own case, I didn't switch to emacs until 1997, at which time I was already experienced with (at least) the following decent alternatives:

- Brief
- Visual Studio
- MPW
- BBEdit
- CodeWarrior
- THINK C
- THINK Pascal

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.

Emacs might have some slight weakness compared to some of those in some areas, but it has the HUGE HUGE benefit that I was able to adopt it immediately and share my .emacs customisations on all of Windows, MacOS, Linux, Solaris, HP/UX and (the first places I used emacs) Tandem NonStop OS and Stratus VOS fault-tolerant computers.
 

Offline blacksheeplogic

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: nz
Re: Emacs - how and where?
« Reply #7 on: November 27, 2018, 03:47:30 am »
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.
 

Online agehall

  • Frequent Contributor
  • **
  • Posts: 383
  • Country: se
Re: Emacs - how and where?
« Reply #8 on: November 27, 2018, 05:15:38 am »
I would argue that Emacs is one of the most powerful editors out there but unfortunately it is outdated in many ways.

There are many other editors which has comparable potential, but Emacs has a looooong history and it caught on so there are extensions for more or less everything that works really well for it. Most other editors does not have the same ecosystem.

I'm still use Emacs for a lot of things since it was my primary IDE for over 20 years but today there are many alternatives that works just as well or better.

Emacs still has a few edges here and there imho, but they are getting fewer and fewer. I would no longer recommend anyone to use Emacs as their primary editor, but I would still recommend that all serious developers on non-windows platforms learn the basics of both Emacs and Vi - you never know when you'll need it! (Like, for example, when you need to exit one of them!)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4199
  • Country: us
Re: Emacs - how and where?
« Reply #9 on: November 27, 2018, 05:43:38 am »
Quote
Most of the people using it got used to it when there were no decent alternatives.
Quote
[especially when in came to multi-OS editors.]
That would be me.  In the early days, there were EMACS-like editors for TOPS10 (FINE), ITS, TOPS20, and TENEX ("real, TECO-based EMACS!"), cp/m (MINCE) and unix/vms (elle, via Eunice) - everything I used or was likely to use.  When unix became available to mortals, there were additional OSSW and commercial versions.
Prior to EMACS, I used actual DEC TECO (which is awful, but which I still occasionally miss) and SPF (IBM3270 full-screen editor.  Really nice, actually, especially for the time.)
Between EMACS and assorted IDE editors that I'm more-or-less compelled to use if I want to used the vendors' IDEs (most of which are pretty sucky) (and, you know, actual document-editing SW for actual documents), I haven't been very motivated to look for anything else.  Yeah, it's pretty bloated, and includes thousands of features I have no interest in, and its window management (in particular) dates to the pure-text days and is rarely "native-feeling" on any OS.  But it would take something that was obviously substantially better to get me to switch, and that seems ... unlikely - there just isn't that much I want a code editor to do.  (to be fair, I may be a bit of a luddite; it took me ages to turn on colorization!)  (ok, when programming in a less familiar environment, the context-sensitive help/autocomplete in some IDEs is pretty nice...)

One of the things I like about emacs at the moment, is that keyboard macros can be rendered as text, edited, and included in the source code.  So if I use some macro to convert an intel .hex file to a C string, I can just plunk that macro down in a comment in case I need to use it again, sometime.  (like: https://github.com/WestfW/OptiLoader/blob/master/optiLoader.ino#L682)

 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4028
  • Country: nz
Re: Emacs - how and where?
« Reply #10 on: November 27, 2018, 06:08:50 am »
You can also do that as

(setq last-kbd-macro
   [?  ?  ?  ?  ?\" ?\C-e ?\" ?\\ ?n ?\C-a ?\C-n])

Type C-x C-e after the closing paren to evaluate it, and then it's just the same as if it was freshly define i.e. type C-X e to apply it.

Or give it a real function name, or bind it to a key
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #11 on: November 27, 2018, 07:57:30 am »
Let's see if Eliza can convince you...though I doubt it  :-//
M-x doctor
Code: [Select]
I am the psychotherapist.  Please, describe your problems.  Each time
you are finished talking, type RET twice.

Is emacs a good thing?

What do you think?

Well, I personally like it...

Why do you say you personally like it?

It's powerful enough, not really bloated for current computers and it's not vi

You have your mind on computers, it seems.

Yes, since I was 13

What happened when you were 13?

Let's talk about Emacs

Emacs?  Hah!  I would appreciate it if you would continue.

I was expecting some insight from you

Is it because of your plans that you say you were expecting some
insight from me?

No, just someone asked on a forum I contribute to

Maybe your life has something to do with this.

You might be right

Is it because of the people you hang around with that you say I might
be right?

They are mostly nice persons

Is it because of any hobbies you have that you say they are mostly
nice persons?

You nailed it
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline bson

  • Supporter
  • ****
  • Posts: 2269
  • Country: us
Re: Emacs - how and where?
« Reply #12 on: November 27, 2018, 08:16:56 am »
I typically reach for emacs whenever I need to do substantial original work as opposed to just fix bugs or make minor rearrangements.  Here's a video where I grab a register map from a datasheet and turn it into an enum:

1. Copy and paste
2. Remove "RESERVED" entries
3. Format one entry, recording it as a keyboard macro, leaving the point at the start of the next entry
4. Repeat the keyboard macro for the rest
5. Various cleanups (e.g. "0x00h" -> "0x00")
6. Comment
7. Done

https://youtu.be/jIYTXWF8EO8

I use similar techniques a lot when I need to generate tables or turn tables in e.g. datasheets or word documents into code.  Emacs being legacy enough to strip all text formatting and turn it into ASCII is actually a benefit here.

I also prefer to use emacs whenever I use gdb to debug - which is when doing more complex work that requires evaluating expressions that involve type casting or calling functions (gdb is one of the few debuggers that will do this), useful if you have more elaborate debug support code like dumping complex data structure state, like buffer pools.  For example, given const uint8_t* buffer pointing to an ethernet frame, "print/x *(tcphdr*)((buffer+14+(iph*)(buffer+14))->ip_hlen*4+buffer+14))".  Since it's a general expression the same can be used e.g. to conditionally stop on a watchpoint or breakpoint, for example if you see a TCP SYN.  It just makes for really quick and effective tracking down of complex bugs.  Many of the IDE based tools simply can't do many of the same things (although MSVS is programmable and also quite capable).
 
« Last Edit: November 27, 2018, 08:20:22 am by bson »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #13 on: November 27, 2018, 08:17:32 am »
Let's see if Eliza can convince you

LOL, is it included in Emacs?  :-DD
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • Country: us
    • Personal site
Re: Emacs - how and where?
« Reply #14 on: November 27, 2018, 08:18:47 am »
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?
Alex
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #15 on: November 27, 2018, 08:25:59 am »
Talking about VHDL, the big difference in approach between Sigasi and Emacs VHDL mode is this: Emacs uses regular expressions to make guesses about your code, while Sigasi has a real parser that understands your VHDL code.

As a result, you get:
  • Error messages while you type thanks to the ultra fast built-in compiler that gives you error messages while you are typing, much like a spell checker in a word processor.
  • Navigation Every declaration is just one button away. Do you want to go to the declaration of a certain constant, signal or entity? Just press F3! (tags are sometimes broken on Emacs)
  • Mouse-over hovers Learn about any identifier just by hovering your mouse over the name.
  • Compile your files Export the correct build order and library mapping of your VHDL files as an automatically updated csv file.

This, plus code analysis.


During the next weekend, I am willing to try Emacs Vhdl-mode (and Sigasi Emacs Vhdl-mode emulation) more deeply, anyway.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #16 on: November 27, 2018, 08:30:16 am »
It does have some good pattern matching and bulk find and replace operations that come in handy pretty often.

This may be a reason for using it. Or for copying this feature into a dedicated tool.

I find "sed" useful when I have to replace a lot of sparse patterns in large projects (hundred files), and I usually use "find" combined with "grep" and "sed" in a bash script.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #17 on: November 27, 2018, 08:33:08 am »
I typically reach for emacs whenever I need to do substantial original work as opposed to just fix bugs or make minor rearrangements.  Here's a video where I grab a register map from a datasheet and turn it into an enum:

1. Copy and paste
2. Remove "RESERVED" entries
3. Format one entry, recording it as a keyboard macro, leaving the point at the start of the next entry
4. Repeat the keyboard macro for the rest
...
That's also what I (and I imagine most Emacs users past basics) used to do.
But what I do now with Code (and a bit less with VS) is using multiple cursors, the same applies to many modern editors such as Sublime:
1. C&P
2. Make non-repeating edits
3. Match one entry (either separator, regex, whatever)
4. Extend the selection to all matches (or just alt-click them if they are few)
5. Do the common edits
6. Hit Esc to return to a single cursor.

But this would more in topic for the IDE thread...

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?
Well, Emacs icon was not chosen at random...
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #18 on: November 27, 2018, 08:49:32 am »
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?

Mine doesn't have it. It was compiled in 2009 with just the essential flags (Gentoo L1-profile).
I see I can also rebuild emacs with X11 support. Umm.

I will compile a modern version of Emacs, but first I have to update the remote server ...

Code: [Select]
2018-11-27--00-03-22---2018-11-27--00-05-40 - [ app-editors/emacs ] - failure - root@dev2.25.1/5.4.0
net-libs/webkit-gtk-2.22.2: GCC 6.0.0 is required to build WebKitGTK+, use a newer GCC version
2018-11-27--00-03-22---2018-11-27--00-05-41 - [ =sys-devel/gcc-6.4.0-r1 ] - failure -
use a newer glibc version
2018-11-27--00-27-14---2018-11-27--00-27-35 - [ sys-libs/glibc ] - failure - root@dev2.25.1/5.4.0
 * Checking gcc for __thread support ...     
 * Checking running kernel version (2.6.39-flash-eating-bats-II-gentoo-ia32-t23 >= 3.2.0) ...   
You need a kernel of at least 3.2.0!

glibc, gcc, and the kernel need to be updated  :-DD

No problem, I will! That machine hasn't been updated recently.

Anyway, Emacs has too many dependencies, anyway. There is too much stuff there.

Code: [Select]
app-editors/emacs
version=26.1-r3
needs=C,C++,lisp
USE="X acl gif gpm gtk imagemagick inotify jpeg motif png source ssl svg threads tiff toolkit-scroll-bars wide-int xft xpm xwidgets zlib -Xaw3d -alsa (-aqua) -athena (-cairo) -dbus -dynamic-loading -games -gconf -gfile -gsettings -gtk2 -gzip-el -kerberos -lcms -libxml2 -livecd -m17n-lib -mailutils (-selinux) -sound -systemd"

Among flags .... imagemagick inotify jpeg motif png livecd ssl alsa games kerberos sound ?!?!? WTF?!?

It's not an "editor", it's ... what is it? an OS?  :-//
« Last Edit: November 27, 2018, 08:52:43 am by legacy »
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #19 on: November 27, 2018, 09:05:07 am »
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  :-//
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #20 on: November 27, 2018, 01:06:08 pm »
See Sigasi? There is Emacs emulation mode
[...]
Both these two features are modal-text-editor emulations  :-//
But have you ever used Emacs?
I don't think it can be called "modal" for any reasonable definition of the term!

It has got primary "modes", as in C-mode, fortran-mode, picture-mode (unconstrained cursor movement etc.) or hexl-mode, and secondary ones that refine part of the behaviour, e.g. font-lock-mode (AKA syntax highlighting) , or transient-mark-mode (selection behaviour).

But, in general, you move where you want to edit and edit, editing commands are attached to non-self-inserting keys (or key combinations).
No switching to a different "mode" to save or quit. Just like notepad.exe, with a bit more power...
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #21 on: November 27, 2018, 02:19:18 pm »
But have you ever used Emacs?

To enable/disable the "Emacs VHDL mode" emulation you have to press a key. By looking at what he types, I have noted that my colleague, during a work, enables and disables the emulation mode several times.

Ok, it's not the same, but it looks very similar to what you have to do with VI.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Emacs - how and where?
« Reply #22 on: November 27, 2018, 05:23:29 pm »
But have you ever used Emacs?

To enable/disable the "Emacs VHDL mode" emulation you have to press a key. By looking at what he types, I have noted that my colleague, during a work, enables and disables the emulation mode several times.

Ok, it's not the same, but it looks very similar to what you have to do with VI.

Emacs automatically goes into vhdl mode if you load in VHDL source code, as indicated by the file extension. There is no need to go into and out of the mode. And the mode is active only for VHDL source buffers, so if you switch to a makefile, emacs goes into its makefile mode. If you switch to a plain text file, it switches to a plain text editing mode.

The real power of emacs' vhdl-mode is not that it doesn't analyze the code as you type (like Sigasi). Rather, it's the templating.

Again, type the two letters pr then hit the tab key, and it'll create a process skeleton for you. If you've specified them, it'll even put in the clock and reset signals. This saves a whole lot of typing, and I haven't seen another editor that does this. There are similar autocomplete/templates for pretty much every VHDL construct you can think of. Declaring signals? Type si then hit tab, and it'll autocomplete the word "signal," then when you hit the space bar it asks for the signal name, enter it, space again, then it asks for the signal type (which can autocomplete itself), then it'll ask for an initializer value (if you have none, hit enter, then it'll ask for a comment. It's truly great.

Something else that makes the emacs-mode invaluable is the autocomplete. Start typing something, like a signal name, and hit tab, and it'll autocomplete. Repeatedly hit tab and it'll cycle through everything that might fit.

Wanna create a test bench skeleton? Put your cursor in an entity's port list, and from the menu select VHDL -> Port -> Copy (or use the keyboard shortcuts Ctrl-C Ctrl-P Ctrl-W). Then visit a new file (Ctrl-X Ctrl-F, then give it a name) and in that new file, choose from the menu VHDL -> Port -> Paste As Testbench (or Ctrl-c Ctrl-c Ctrl-t). Bam -- it creates a testbench skeleton, with signal declarations, an instance of the DUT and a clock-generator process.

And so on.

As for obtaining emacs, I don't build from source. For Windows I just grab it from the Gnu website. For the Mac I get it from the Emacs for Mac OS X website.
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Emacs - how and where?
« Reply #23 on: November 27, 2018, 06:28:15 pm »
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.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: Emacs - how and where?
« Reply #24 on: November 27, 2018, 07:16:52 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?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11238
  • 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: 14445
  • 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: 4028
  • 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: 4028
  • 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: 4028
  • 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: 4028
  • 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!
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • 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
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • 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
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • 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
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • 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?)
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4028
  • Country: nz
Re: Emacs - how and where?
« Reply #50 on: December 04, 2018, 05:29:55 am »
What was the basis for sorting? (IOW, what was the machine keying off of?)

Yeah, that's not going to work for much of any programming language except traditional BASIC.
 

Offline newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #51 on: December 04, 2018, 06:36:08 am »
What was the basis for sorting? (IOW, what was the machine keying off of?)

Yeah, that's not going to work for much of any programming language except traditional BASIC.

It was not mandatory to use them, but the columns after 72 in a Fortran card were ignored by the compiler.
It was good practice to put a sequence number there.
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #52 on: December 04, 2018, 08:38:18 am »
What was the basis for sorting? (IOW, what was the machine keying off of?)

Yeah, that's not going to work for much of any programming language except traditional BASIC.

It was not mandatory to use them, but the columns after 72 in a Fortran card were ignored by the compiler.
It was good practice to put a sequence number there.

For Fortran programs, but not for other uses.
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 newbrain

  • Super Contributor
  • ***
  • Posts: 1719
  • Country: se
Re: Emacs - how and where?
« Reply #53 on: December 04, 2018, 09:56:44 am »
It was not mandatory to use them, but the columns after 72 in a Fortran card were ignored by the compiler.
It was good practice to put a sequence number there.

For Fortran programs, but not for other uses.
IIRC, but I'm talking of stuff I came in contact (briefly, thanks $DEITY) 35 years ago, also the job control language ("shell scripts"  ::)) had the same provision.
I suspect many punched card era languages might have done the same...
Nandemo wa shiranai wa yo, shitteru koto dake.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19469
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Emacs - how and where?
« Reply #54 on: December 04, 2018, 06:50:46 pm »
It was not mandatory to use them, but the columns after 72 in a Fortran card were ignored by the compiler.
It was good practice to put a sequence number there.

For Fortran programs, but not for other uses.
IIRC, but I'm talking of stuff I came in contact (briefly, thanks $DEITY) 35 years ago, also the job control language ("shell scripts"  ::)) had the same provision.
I suspect many punched card era languages might have done the same...

I only came into contact with punched cards at school and a tiny bit at university - which was enough to put me off.

At school I also learned Algol-60 and then came across a book on COBOL. 80% of the way through that book there was a section on advanced COBOL, e.g. "A=B+C" (cf "add C to B giving A"). That was a useful "formative experience" since it enabled me to avoid a whole section of industry that would have destroyed my soul.
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 legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #55 on: December 04, 2018, 08:00:36 pm »
Code: [Select]
[ebuild  N     ] net-libs/liblockfile-1.09
[ebuild  N     ] app-eselect/eselect-ctags-1.18
[ebuild  N     ] app-eselect/eselect-emacs-1.18
[ebuild  N     ] app-emacs/emacs-common-gentoo-1.6-r1  USE="X -games"
[ebuild  N     ] app-editors/emacs-25.3-r4  USE="X acl gpm gtk3 inotify ssl xpm zlib -Xaw3d -alsa (-aqua) -athena (-cairo) -dbus -dynamic-loading -games (-gconf) -gfile -gif -gsettings -gtk -gzip-el -imagemagick -jpeg -kerberos -libxml2 -livecd -m17n-lib -motif -png (-selinux) -sound -source -svg -tiff -toolkit-scroll-bars -wide-int -xft"
[ebuild  N     ] virtual/emacs-25

cooking on { HPPA, PPCBE, MIPSBE } :D
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #56 on: December 04, 2018, 08:01:45 pm »
(yes, decent-essential profile. It took me 45 min to choose flags)
 

Offline boffin

  • Supporter
  • ****
  • Posts: 1027
  • Country: ca
Re: Emacs - how and where?
« Reply #57 on: December 13, 2018, 04:29:27 pm »
One thing I still have to understand ... is why people still want modal text editor features through emulation
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 :)

That's weird, I don't remember EDT having those idiosyncrasies. Didn't you have to set the direction 1st if you wanted to go backwards? 

I do remember the GOLD key (Go onto Lower Designation), and still to this day I'm sure I could drop into EDT without really thinking about it.
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #58 on: December 13, 2018, 06:48:14 pm »
dunno, yesterday I bought a new license for Source Insight v4 (upgraded from v3, but on a different laptop), and ... I am still using it with a great satisfaction and productivity. I tend to avoid Eclipse CDT &C, I really prefer SciTools Understand (Ada), Source Insight(C), HDL companion (VHDL) on Windows, and Geany (C) + HDL Scriptum (VHDL) on Linux.

I still have to learn Emacs from scratch, since I am afraid I lost the minimal practical know/how (keys shortcut and tricks) I got 10 years ago when I used it at my university.

Code: [Select]
2018-12-04--18-50-20---2018-12-04--19-26-00 - [ app-editors/emacs ] - success - @2.29.1/7.3.0

But it's up on my Linux/HPPA workstation, thus I am ready  :D
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4028
  • Country: nz
Re: Emacs - how and where?
« Reply #59 on: December 14, 2018, 03:46:33 am »
dunno, yesterday I bought a new license for Source Insight v4 (upgraded from v3, but on a different laptop), and ... I am still using it with a great satisfaction and productivity. I tend to avoid Eclipse CDT &C, I really prefer SciTools Understand (Ada), Source Insight(C), HDL companion (VHDL) on Windows, and Geany (C) + HDL Scriptum (VHDL) on Linux.

I still have to learn Emacs from scratch, since I am afraid I lost the minimal practical know/how (keys shortcut and tricks) I got 10 years ago when I used it at my university.

Code: [Select]
2018-12-04--18-50-20---2018-12-04--19-26-00 - [ app-editors/emacs ] - success - @2.29.1/7.3.0

But it's up on my Linux/HPPA workstation, thus I am ready  :D

The good thing about emacs is that (with X or a decent terminal setting) you can largely use it just like NotePad or MS Word or whatever: type a character to insert it, backspace to delete left, arrow keys to move around, Home/End/PgUp/PgDn/Insert/Delete all work exactly as you'd expect. The default editing modes mean that most types of text files are automatically recognised and hitting Enter moves you to the next line and also properly indents it. Hitting TAB while at the start of a line will also properly indent it.

The only weirdness you absolutely need to know is:

C-k where k is any letter means press and hold the Control key and while it is pressed also press and release the "k" key.  M-k means to press the "ESC" key AND THEN the "k" key. Holding "META" on a special keyboard or more likely "ALT" on a PC one (or option on a Mac) while you press and release "k" might also work for M-k, depending on your terminal setting, but the "ESC" version will always work.

C-x C-u for Undo
C-x C-s for Save
C-x C-c to exit emacs
C-g to cancel any partially entered command

Then kinda useful :-)

C-s to start an incremental forward search, C-r for incremental backward search. Then just start typing what you what to look for. A 2nd C-s or C-r with an empty search string will search for the last thing you searched for.
C-s or C-r again to search for the next/previous of the same thing.
Type some more characters at any time to narrow the search, or C-w to add the next word in front of the cursor to the string being searched for (this is SUPER HANDY) or backspace to remove something from the search string.
At any time C-g to cancel the search and go back to where you started, or ENTER to cancel the search and stay where the cursor is now.

To move text around:

C-space on the first character you want to move (or one character after the last character you want to move) starts a selection. Then use arrow keys or PgUp/PgDn or C-s/C-r searching to move around. The selection between where you started and where you are might or might not be highlighted (depending on settings). You can use C-x C-x to move to the other end of the selection to extend or reduce it -- or just to confirm where it is if the selection is not highlighted.

Once you're happy press C-w to Cut the select or M-w to Copy it. Move to where you want it and press C-y to Paste it. (I'm using modern terms here, not emacs terms.)

ModernEmacs
C-xC-w
C-cM-w
C-vC-y

I'd say that's enough for someone to be immediately reasonably productive in emacs.
« Last Edit: December 14, 2018, 11:39:07 am by brucehoult »
 

Offline andyturk

  • Frequent Contributor
  • **
  • Posts: 895
  • Country: us
Re: Emacs - how and where?
« Reply #60 on: December 14, 2018, 11:21:30 am »
I'd say that's enough for someone to be immediately reasonably productive in emacs.

Yep. After that, add in C-x C-f (find-file) and C-x d (dired)
 

Offline sokoloff

  • Super Contributor
  • ***
  • Posts: 1799
  • Country: us
Re: Emacs - how and where?
« Reply #61 on: December 14, 2018, 11:24:20 am »
There’s an emacs tutorial built into it that’s well worth following for new users.

C-h t
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #62 on: December 14, 2018, 12:30:28 pm »
There’s an emacs tutorial built into it that’s well worth following for new users.

C-h t

it requires the flag 'doc' which was not set when I emerge it  :palm:
 

Offline legacyTopic starter

  • Super Contributor
  • ***
  • !
  • Posts: 4415
  • Country: ch
Re: Emacs - how and where?
« Reply #63 on: December 14, 2018, 12:31:47 pm »
@brucehoult
thanks, today I have time, and I will use Emacs.
Thanks for your mini-guide.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf