Emacs - how and where? - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: November 26, 2018, 10:19:26 pm
content: 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

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: November 26, 2018, 10:41:37 pm
content: Quote from: legacy on November 26, 2018, 10:19:26 pmWhy? Use whatever works best for your workflow. I use VI/VIM, Quartus, or MSVS depending on what I'm doing.

author: NegativeONE
author_rank: Contributor
timestamp: November 26, 2018, 11:07:25 pm
content: Quote from: legacy on November 26, 2018, 10:19:26 pmYou will be able to join The Church of Emacs and became a follower ofSaint IGNUcius

author: ataradov
author_rank: Super Contributor
timestamp: November 26, 2018, 11:42:15 pm
content: It is not. Most of the people using it got used to it when there were no decent alternatives.

author: jmelson
author_rank: Super Contributor
timestamp: November 26, 2018, 11:50:21 pm
content: Quote from: legacy on November 26, 2018, 10:19:26 pmUm, 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

author: boffin
author_rank: Unknown
timestamp: November 27, 2018, 12:14:56 am
content: joe:Joe's Own Editor. Much overlooked, but powerful and small; been my go to for many years.

author: brucehoult
author_rank: Super Contributor
timestamp: November 27, 2018, 03:24:53 am
content: Quote from: ataradov on November 26, 2018, 11:42:15 pmI 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 PascalHowever, 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.

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: November 27, 2018, 03:47:30 am
content: Quote from: brucehoult on November 27, 2018, 03:24:53 amWhen 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.

author: agehall
author_rank: Frequent Contributor
timestamp: November 27, 2018, 05:15:38 am
content: 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!)

author: westfw
author_rank: Super Contributor
timestamp: November 27, 2018, 05:43:38 am
content: QuoteQuoteThat 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)

author: brucehoult
author_rank: Super Contributor
timestamp: November 27, 2018, 06:08:50 am
content: 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

author: newbrain
author_rank: Super Contributor
timestamp: November 27, 2018, 07:57:30 am
content: Let's see if Eliza can convince you...though I doubt itM-x doctorCode:I am the psychotherapist. Please, describe your problems. Each timeyou 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 viYou have your mind on computers, it seems.Yes, since I was 13What happened when you were 13?Let's talk about EmacsEmacs? Hah! I would appreciate it if you would continue.I was expecting some insight from youIs it because of your plans that you say you were expecting someinsight from me?No, just someone asked on a forum I contribute toMaybe your life has something to do with this.You might be rightIs it because of the people you hang around with that you say I mightbe right?They are mostly nice personsIs it because of any hobbies you have that you say they are mostlynice persons?You nailed it

author: bson
author_rank: Unknown
timestamp: November 27, 2018, 08:16:56 am
content: 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 paste2. Remove "RESERVED" entries3. Format one entry, recording it as a keyboard macro, leaving the point at the start of the next entry4. Repeat the keyboard macro for the rest5. Various cleanups (e.g. "0x00h" -> "0x00")6. Comment7. Donehttps://youtu.be/jIYTXWF8EO8I 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).

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 08:17:32 am
content: Quote from: newbrain on November 27, 2018, 07:57:30 amLOL, is it included in Emacs?

author: ataradov
author_rank: Super Contributor
timestamp: November 27, 2018, 08:18:47 am
content: Quote from: legacy on November 27, 2018, 08:17:32 amYes, but the novelty wears off quite fast. And then you think - does this belong in a text editor?

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 08:25:59 am
content: 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.

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 08:30:16 am
content: Quote from: jmelson on November 26, 2018, 11:50:21 pmThis 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.

author: newbrain
author_rank: Super Contributor
timestamp: November 27, 2018, 08:33:08 am
content: Quote from: bson on November 27, 2018, 08:16:56 amThat'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&P2. Make non-repeating edits3. 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 edits6. Hit Esc to return to a single cursor.But this would more in topic for the IDE thread...Quote from: ataradov on November 27, 2018, 08:18:47 amWell, Emacs icon was not chosen at random...

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 08:49:32 am
content: Quote from: ataradov on November 27, 2018, 08:18:47 amMine 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:2018-11-27--00-03-22---2018-11-27--00-05-40 - [ app-editors/emacs ] - failure - root@dev2.25.1/5.4.0net-libs/webkit-gtk-2.22.2: GCC 6.0.0 is required to build WebKitGTK+, use a newer GCC version2018-11-27--00-03-22---2018-11-27--00-05-41 - [ =sys-devel/gcc-6.4.0-r1 ] - failure -use a newer glibc version2018-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 updatedNo problem, I will! That machine hasn't been updated recently.Anyway, Emacs has too many dependencies, anyway. There is too much stuff there.Code:app-editors/emacsversion=26.1-r3needs=C,C++,lispUSE="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?

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 09:05:07 am
content: One thing I still have to understand ... is why people still want modal text editor features through emulationSee Sigasi? There isEmacsemulation modeSee Kate? There isViemulation modeBoth these two features are modal-text-editor emulations

author: newbrain
author_rank: Super Contributor
timestamp: November 27, 2018, 01:06:08 pm
content: Quote from: legacy on November 27, 2018, 09:05:07 amBut 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...

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 02:19:18 pm
content: Quote from: newbrain on November 27, 2018, 01:06:08 pmTo 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.

author: Bassman59
author_rank: Super Contributor
timestamp: November 27, 2018, 05:23:29 pm
content: Quote from: legacy on November 27, 2018, 02:19:18 pmEmacs 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 lettersprthen 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? Typesithen 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 theGnu website. For the Mac I get it from theEmacs for Mac OS Xwebsite.

author: sokoloff
author_rank: Super Contributor
timestamp: November 27, 2018, 06:28:15 pm
content: 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 search7. Template.el for new files-programmable8. Dabbrev (auto-completion)9. Babel-mode.

author: Bassman59
author_rank: Super Contributor
timestamp: November 27, 2018, 07:16:52 pm
content: Quote from: ataradov on November 27, 2018, 08:18:47 amDoes Tetris belong in a text editor?

author: ataradov
author_rank: Super Contributor
timestamp: November 27, 2018, 07:48:03 pm
content: Quote from: Bassman59 on November 27, 2018, 07:16:52 pmNot really, but I would appreciate a good implementation of Tetris much moreWhat text editor has Tetris in it?Early versions of Excel had 3D flying simulator in them, this puts things into perspective, I guess.

author: newbrain
author_rank: Super Contributor
timestamp: November 27, 2018, 09:55:31 pm
content: Quote from: ataradov on November 27, 2018, 07:48:03 pmDid 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:| | || | || | |<0> | |<-1-> | |<----4----> | |<-----5-----> | |<------6------> | <--2--><-------7-------> <---3---> |===============================================================================Now to less serious matters:Quote from: sokoloff on November 27, 2018, 06:28:15 pmPoint 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 Emacs2. 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 regexp7. Snippets are a good substitute, and extensions are available8. 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.Now I'll go and find me a bootleg copy of Brief, just for nostalgia's sake.

author: Bassman59
author_rank: Super Contributor
timestamp: November 27, 2018, 10:17:31 pm
content: Quote from: newbrain on November 27, 2018, 09:55:31 pmOK, I am intrigued. I checked out whether VSCode has VHDL editing support, and it turns out that there are atleast three extensions.So, what the hell, I'll give it a go.QuoteMasochist, eh?

author: Macbeth
author_rank: Super Contributor
timestamp: November 27, 2018, 10:42:00 pm
content: EMACS? You are all big girls blouses, the only editor of testicular fortitude isDEC TECO. Where command line noise from a 300 baud acoustic coupled modem could totally change your world.

author: legacy
author_rank: Super Contributor
timestamp: November 27, 2018, 11:17:51 pm
content: Quote from: Bassman59 on November 27, 2018, 05:23:29 pmI 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.

author: SiliconWizard
author_rank: Super Contributor
timestamp: November 27, 2018, 11:40:59 pm
content: Quote from: legacy on November 27, 2018, 09:05:07 amYour nickname should give you a good hint as to why...

author: brucehoult
author_rank: Super Contributor
timestamp: November 28, 2018, 12:23:02 am
content: Quote from: Macbeth on November 27, 2018, 10:42:00 pmYou'd love Data General's "speed", a bad clone of TECO.

author: brucehoult
author_rank: Super Contributor
timestamp: November 28, 2018, 12:39:58 am
content: Quote from: sokoloff on November 27, 2018, 06:28:15 pm10. 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.

author: Cerebus
author_rank: Super Contributor
timestamp: November 28, 2018, 12:53:03 am
content: Quote from: Macbeth on November 27, 2018, 10:42:00 pmTECO 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.

author: blacksheeplogic
author_rank: Frequent Contributor
timestamp: November 28, 2018, 01:14:48 am
content: Quote from: brucehoult on November 28, 2018, 12:23:02 amOK, 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.

author: rhodges
author_rank: Frequent Contributor
timestamp: November 28, 2018, 01:30:22 am
content: 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!

author: sokoloff
author_rank: Super Contributor
timestamp: November 28, 2018, 02:57:24 am
content: 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).

author: brucehoult
author_rank: Super Contributor
timestamp: November 28, 2018, 03:07:44 am
content: 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)

author: rhodges
author_rank: Frequent Contributor
timestamp: November 28, 2018, 04:00:46 am
content: Quote from: sokoloff on November 28, 2018, 02:57:24 amThe 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.QuoteI 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.

author: westfw
author_rank: Super Contributor
timestamp: November 28, 2018, 09:01:09 am
content: QuoteSounds tricky, but ...Why are you using asm comments (with semicolon) instead of C comments?Code:asm volatile (" sbi %, % \n" // Set bit direction"3: " // main loop label" sbi %, % \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)::  "I" (_SFR_IO_ADDR(LEDPORT_DIR)), "I" (_SFR_IO_ADDR(LEDPORT)), "I" (LEDBIT));

author: andyturk
author_rank: Frequent Contributor
timestamp: December 01, 2018, 10:19:45 am
content: Quote from: Macbeth on November 27, 2018, 10:42:00 pmWhen 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 wased. 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.

author: brucehoult
author_rank: Super Contributor
timestamp: December 01, 2018, 12:23:19 pm
content: Quote from: andyturk on December 01, 2018, 10:19:45 amMy 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).QuoteWe 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!

author: tggzzz
author_rank: Super Contributor
timestamp: December 01, 2018, 01:03:02 pm
content: Quote from: ataradov on November 27, 2018, 08:18:47 amEmacs is like a kitchen sink: useful, and youcan chooseto put just about anything and everything in it

author: tggzzz
author_rank: Super Contributor
timestamp: December 01, 2018, 01:04:33 pm
content: Quote from: Bassman59 on November 27, 2018, 07:16:52 pmDoes asteroids belong in a scope, or a flight simulator in a spreadsheet? Both exist

author: tggzzz
author_rank: Super Contributor
timestamp: December 01, 2018, 01:09:18 pm
content: Quote from: blacksheeplogic on November 27, 2018, 03:47:30 amLucky 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.

author: tggzzz
author_rank: Super Contributor
timestamp: December 01, 2018, 01:16:26 pm
content: Quote from: legacy on November 27, 2018, 09:05:07 amQuite.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

author: Macbeth
author_rank: Super Contributor
timestamp: December 02, 2018, 12:01:00 am
content: ...and you try and tell the young people of today that ..... they won't believe you.

author: legacy
author_rank: Super Contributor
timestamp: December 03, 2018, 08:58:39 pm
content: Emacs vs Sigasi

author: splin
author_rank: Frequent Contributor
timestamp: December 04, 2018, 03:02:02 am
content: Quote from: tggzzz on December 01, 2018, 01:09:18 pmExcept 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.

author: sokoloff
author_rank: Super Contributor
timestamp: December 04, 2018, 03:29:18 am
content: What was the basis for sorting? (IOW, what was the machine keying off of?)

author: brucehoult
author_rank: Super Contributor
timestamp: December 04, 2018, 05:29:55 am
content: Quote from: sokoloff on December 04, 2018, 03:29:18 amYeah, that's not going to work for much of any programming language except traditional BASIC.

author: newbrain
author_rank: Super Contributor
timestamp: December 04, 2018, 06:36:08 am
content: Quote from: brucehoult on December 04, 2018, 05:29:55 amIt 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.

author: tggzzz
author_rank: Super Contributor
timestamp: December 04, 2018, 08:38:18 am
content: Quote from: newbrain on December 04, 2018, 06:36:08 amFor Fortran programs, but not for other uses.

author: newbrain
author_rank: Super Contributor
timestamp: December 04, 2018, 09:56:44 am
content: Quote from: tggzzz on December 04, 2018, 08:38:18 amIIRC, 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...

author: tggzzz
author_rank: Super Contributor
timestamp: December 04, 2018, 06:50:46 pm
content: Quote from: newbrain on December 04, 2018, 09:56:44 amI 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 andthencame 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.

author: legacy
author_rank: Super Contributor
timestamp: December 04, 2018, 08:00:36 pm
content: Code:[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-25cooking on { HPPA, PPCBE, MIPSBE }

author: legacy
author_rank: Super Contributor
timestamp: December 04, 2018, 08:01:45 pm
content: (yes, decent-essential profile. It took me 45 min to choose flags)

author: boffin
author_rank: Unknown
timestamp: December 13, 2018, 04:29:27 pm
content: Quote from: tggzzz on December 01, 2018, 01:16:26 pmThat'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.

author: legacy
author_rank: Super Contributor
timestamp: December 13, 2018, 06:48:14 pm
content: dunno, yesterday I bought a new license forSource 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 preferSciTools 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:2018-12-04--18-50-20---2018-12-04--19-26-00 - [ app-editors/emacs ] - success - @2.29.1/7.3.0But it's up on my Linux/HPPA workstation, thus I am ready

author: brucehoult
author_rank: Super Contributor
timestamp: December 14, 2018, 03:46:33 am
content: Quote from: legacy on December 13, 2018, 06:48:14 pmThe 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 UndoC-x C-s for SaveC-x C-c to exit emacsC-g to cancel any partially entered commandThen 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.)ModernEmacsC-xC-wC-cM-wC-vC-yI'd say that's enough for someone to be immediately reasonably productive in emacs.

author: andyturk
author_rank: Frequent Contributor
timestamp: December 14, 2018, 11:21:30 am
content: Quote from: brucehoult on December 14, 2018, 03:46:33 amYep. After that, add in C-x C-f (find-file) and C-x d (dired)

author: sokoloff
author_rank: Super Contributor
timestamp: December 14, 2018, 11:24:20 am
content: There’s an emacs tutorial built into it that’s well worth following for new users.C-h t

author: legacy
author_rank: Super Contributor
timestamp: December 14, 2018, 12:30:28 pm
content: Quote from: sokoloff on December 14, 2018, 11:24:20 amit requires the flag 'doc' which was not set when I emerge it

author: legacy
author_rank: Super Contributor
timestamp: December 14, 2018, 12:31:47 pm
content: @brucehoultthanks, today I have time, and I will use Emacs.Thanks for your mini-guide.