back to article Google man drags Emacs into the 1990s

Software developer and Google employee Daniel Colascione has cooked up what he calls “Buttery smooth Emacs” by adding rendering code to the venerable text editor that does away with long-standing flickering and resizing issues. Colascione took to Facebook to promise that his mod for Emacs adds “support for double-buffered …

  1. Dan 55 Silver badge
    Paris Hilton

    Would this work over a simple telnet/ssh connection?

    I get the feeling it'll only work if the X display is forwarded to another machine.

    1. Anonymous Coward
      Anonymous Coward

      Re: Would this work over a simple telnet/ssh connection?

      Even so, not a problem here. Even the Windows laptop has X11 client.

      1. Dan 55 Silver badge

        Re: Would this work over a simple telnet/ssh connection?

        This still seems back to front to me even a couple of hours after first reading about it. It should be up to the terminal software on the client computer to double buffer and/or repaint on vsync, that way it'd work for any connection type instead of one with X11 forwarding. All he's done is patch X Windows repainting so it looks less dreadful, which says more about X Windows than Emacs.

        1. ThomH

          Re: Would this work over a simple telnet/ssh connection?

          How could a terminal emulation double buffer? They're character oriented and half the character sets are control codes. After how many characters is that the end of the frame? How does the terminal know when to show its double buffer?

          1. Dan 55 Silver badge

            Re: Would this work over a simple telnet/ssh connection?

            The way it's always been done, start painting the changes to the terminal window when the window contents are not being drawn on the monitor (i.e. the beam is just under the window contents). However most window managers are compositing these days.

        2. choleric

          Re: Would this work over a simple telnet/ssh connection?

          I think you're missing the subtle point that really the X Window System is actually a part of Emacs.

          1. Anonymous Coward
            Anonymous Coward

            Old but obligatory

            @Choleric; My god, Emacs seems to contain *everything* an operating system needs. (#)

            Except a decent text editor.

            (#) Actually it seems to contain pretty much everything whether it's needed or not (^_^)

  2. Anonymous Coward
    Anonymous Coward

    “do what the f*ck I want when I want it” redisplay strategy Emacs uses.

    That reminds me of someone. Who could that be?

    Still my fave editor, but I really am certified as insane.

    1. MyffyW Silver badge

      Re: “do what the f*ck I want when I want it” redisplay strategy Emacs uses.

      Maybe it's because I haven't had my fluoxetine this morning, but I always thought "do whatever the frack you like" was the whole point of Emacs.

  3. Jusme
    WTF?

    Great....

    ...soon we'll need a GTX1080 and be fiddling with vsync just to edit text.

    (Actually I never use xemacs, only the text-mode-in-a-terminal-under-screen flavour)

    1. herman

      Re: Great....

      Dude, ed is the standard UNIX editor, not emacs:

      http://www.gnu.org/software/ed/manual/ed_manual.html

      a

      ed is the standard Unix text editor.

      This is line number two.

      .

      2i

      1. Anonymous Coward
        Anonymous Coward

        Re: Great....

        Of course Emacs was never UNIX anything (GNU is not UNIX, fapping motion). Unlike ed or vi it was never under Berkeley or AT&T license and unlike the other two not mentioned in POSIX at all. Like bash its another GNU monstrosity that has wormed its way in to Linux and seldom much else by default. Good thing for GNU then that Red Hat is making sure there will be precious little else but Linux going forward.

        1. anonymous boring coward Silver badge

          Re: Great....

          Yeah, beware those Gnu monstrosities!

          BTW, yesterday I killed a single webpage under Safari that used up 1.9GB of RAM...

          And I used to think emacs was a bit heavyweight!

      2. anonymous boring coward Silver badge

        Re: Great....

        None of that poncy visual "vi" stuff!

  4. Anonymous Coward
    Anonymous Coward

    Never had that problem with Vim. ;)

    1. Adrian 4

      Never seen it with emacs either, tbh.

      Web browsers, with their constant juggling, redraws and annoying scrolling tricks however ..

      1. Anonymous Coward
        FAIL

        Latest redesigned Apple music app on the iPhone deserves an award...

        ...for bring back Windows 3.1 GDI levels of screen flicker and rendering oddness.

        Apple's developers must have worked hard to create such a homage to times passed.

      2. Herby

        Problems with web browsers is...

        That web sites insist on transferring megabytes to put up "hello world" text. Then including gobs of javascript to be special.

        Note: For the most part ElReg doesn't do this.

    2. Dwarf
      Joke

      Aren't we always told that there is a setting for that.

      I'm sure its in the manual somewhere ;-)

      +1 for vi / vim

      1. Anonymous Coward
        Anonymous Coward

        Only if it's been "properly installed"

        The man pages for GNU are always hilariously passive aggressive on this point.

        "If the documentation has been correctly installed at your site" is what I recall it saying. But I always imagined the real meaning to be something like

        "If your sysadmin has drunk the entire bottle of GNU Kool-Aid, you can find an incredibly dense manual by typing ``info foo''. But if they are a normal person who just untarred and ran, well, dear peasant, you are stuck with this man page."

  5. Torben Mogensen

    Already in the 1980s

    Double buffering was widely used on home computers in the early 1980s -- I remember doing it on my BBC micro, and most games did it to get smoother updates. I suspect the method is much earlier than that.

    1. ThomH

      Re: Already in the 1980s

      You obviously weren't using modes 0–3.

      1. Torben Mogensen

        Re: Already in the 1980s

        You could, if you added sideways RAM. In any case, most games used lower resolution screen modes not only to save space but also to make updates faster.

  6. anthonyhegedus Silver badge

    zx80

    I seem to remember double-buffering was not needed on the zx80, a computer so primitive that it didn't have enough memory to store the whole display and could run out of memory if it had too much to display. It also didn't have enough hardware/processing power to keep the display going at the same time as doing any processing on anything else. Consequently every time you pressed a key, or a program ran for a bit, the display went off. This meant that you could have a program assemble the screen, and you wouldn't see anything happen until it stopped for user input. Great for an untidy redisplay of a screen, but not so good for things looking like they're moving about. Typical Sinclair shite in my opinion. The tech was there to have a screen that didn't flicker every time you pressed a key, but sinclair wanted to make the computer really cheap.

    1. Sam Liddicott

      Re: zx80

      "sinclair wanted to make the computer really cheap"

      Also likely true of those who bought it over more expensive options like the PET Commodore which didn't flicker like that.

    2. Dan 55 Silver badge

      Re: zx80

      Sinclair understood that a) he had to be first and b) the price point made or broke a piece of hardware. The devices he released were usually just good enough and probably did more than most to bring a new device type to the mass market.

    3. Anonymous Coward
      Anonymous Coward

      Re: zx80

      > The tech was there to have a screen that didn't flicker every time you pressed a key, but sinclair wanted to make the computer really cheap.

      Which is how many kids (and adults) of the era could afford their first computer, so no need to bash them for that decision.

      1. Stevey

        Re: zx80

        Trying to figure out just /why/ it ran out of memory and what to do about it was my first experience with figuring out how the internals of a computer really worked - like many people here, I suspect.

        The fact that it was cheap got it, and the later Sinclair computers, into a lot of homes. The corners that had to be cut to make them cheap made for some great opportunities to introduce kids to real-world engineering.

      2. anthonyhegedus Silver badge

        Re: zx80

        I owned sinclair computers and that is precisely how I could afford my first computer. But the quality was incredibly poor. I was only 14 at the time and I was really upset at having to wait 3 or 4 months for the sodding zx81 to arrive, and then even more upset when it didn't work due to overheating. And then when I got the rampack, I began to see a pattern in quality control insofar as it had to remain absolutely still or the machine would crash. These things certainly taught me a lot. It taught me about sharp business practices, selling shit that didn't work right.

        Later, when I had saved up enough for a sinclair QL, the quality hadn't improved much. It was advertised for sale before it had been designed! I bought one of the later "JS ROM" versions, which was a lot better, but the microdrives were a nightmare.

        One thing that can be said about sinclair was that the software was on the whole good, and the manuals were excellent.

        Then I got into PCs and found that the hardware was good but it was the software that was not so reliable.

        1. Arisia
          Coat

          Re: zx80

          The workaround for a wobbly ram pack was to blu tack it onto the back of the zx81.

          Also when the keys stopped working from overuse, you used a pencil to drawn around the button and it popped up again. For a while.

          You could have just looked that up on the intern.... oh....

          1. Anonymous Coward
            Anonymous Coward

            Re: zx80

            > The workaround for a wobbly ram pack was to blu tack it onto the back of the zx81.

            Nothing like a good piece of advice that arrives 35 years too late. :-)

      3. Missing Semicolon Silver badge
        Boffin

        Re: zx80 -> ZX81

        The screen bounce on key press was, as you say, a consequence of the Z80 doing the screen rendering. Well, actually, it was being the display address counter - the ULA did the actual bit-shifting into the modulator.

        The ZX81 had "slow mode" where the screen refresh was done under interrupt. Now the screen didn't bounce on key press, but the machine ran dog-slow as it only spent 20% of it's time actually running your program.

        The technology is ancient - there's a summary here: http://laughtonelectronics.com/Arcana/KimKlone/BrideOfSon%20KK%20Lancaster.html

    4. wikkity

      Re: didn't flicker every time you pressed a key

      Never noticed, I had to look at the keyboard when typing on a zx80, I guess by teh time I looked back up it had been drawn.

  7. wolfetone Silver badge

    But what if I like the misery of terminal flickering?

    1. MyffyW Silver badge

      Mrs Doyle - is that you?

      1. wolfetone Silver badge

        That would be an ecumenical matter.

  8. MyffyW Silver badge

    "The buffer was merely resting in my account"

  9. Anonymous Coward
    Anonymous Coward

    Whats this GUI thingy?

    Emacs in a GUI? WTF?

    Some of us use Emacs in a simple shell as God (aka Stallman) intended.

    As I sit here, I have three Emacs sessions in three HD windows, each of those sessions have split screens as I debug some stupid Cordova notification code.

    If I want to resize the windows I simply drag the window size and it resizes. No flickering and zero hassles. Works perfectly well.

    Now I understand that certain people like to use a doo-hickie called a 'mousie' or something similar with their Emacs. Well, there is a ring of hell reserved for these heretics. I suspect this person who implemented 'dooble Booofering' might well be joining them shortly. Christ, they'll be adding colours next.

    Bloody developers should not play with forces they don't understand....

    1. Brewster's Angle Grinder Silver badge

      Re: Whats this GUI thingy?

      That wouldn't be the truly abysmal local notifications plugin, would it?

      1. Rob Willett

        Re: Whats this GUI thingy?

        Not sure, we use the local notifications plugin which worked well for us until IOS 10 and then it broke, There's a fork from EV that works so we use that, We also use the PushWoosh plugin. That also broke (badly) for IOS10. However to be fair to PushWoosh they worked with us pretty well to get the bug found and fixed.

        We need both plugins to provide a sensible notification system that works when IOS and Android are both foreground, background, not started and to handle silent notifications for IOS and Android. Our use cases are pretty exacting :)

        None of the plugins do this by themselves, especially the Android silent notifications, so we wrote our own hybrid system to do it all.

        After saying that, notifications are by far the biggest chunk of code in our app. Handling the differences is a complete nightmare, hence we wrote our own hybrid to hide the pain,

        1. Brewster's Angle Grinder Silver badge

          Re: Whats this GUI thingy?

          Oh local notifications work. And I'll cut him some slack for iOS10. But it somehow modifies the `at` member of the structure so you can't reuse it. Then there's the whole not coalescing multiple schedule calls. And the cancellation architecture. And, as you say, the issue with foreground notifications not happening. And there are a whole bunch of PRs on the github page that should be in the mainline Android release. None of which bodes well for the source when I look at it. (Come to that, the work around for iOS10---set the alert to repeat---doesn't smell great; I hope that's down to Apple)

          I'm not annoyed with the author; who's writing it in his weekends for free. But notifications are pivotal part of mobile. Cordova could do with getting their act together, particularly as there is a spec which Chrome implements on the desktop.

          Anyway, it allowed us to gauge interest. We'll probably fork it next iteration and modify the java/objective C. By the sounds of it, you should probably be doing the same.

          1. Rob Willett

            Re: Whats this GUI thingy?

            We've invested a hell of a lot of time in notifications as they are a core part of what our app does. I have to say that the support for notifications is pretty poor though across the board.

            We've experimented with OneSignal, OpenShift and finally went to PushWoosh as they were the only ones that had a model that worked across Android and IOS, specifically at the time with silent notifications for IOS. They didn't do silent notifications for Android but they do that now, just that their documentation is about 10 years out of date so they didn't announce it or tell anybody. Their model wasn't great, but at least it worked. Hence we built our own notifications system that work the way we think that mobile notifications should work. Our system handles silent and rich foreground, background, suspended and app not started in a consistent single code base across IOS 8, 9, 10 as well as Android 5.0 and 6.0. Whilst we're rather pleased with it, we shouldn't need to write a framework like this, it should be standardised and open to all.

            We don't get into the structure of the local notification, so hadn't picked up on the at modification. That doesn't sound good. We are aware of the limitations and are looking to see if PushWoosh can pick up the local notifications. However we're trying to keep our notification framework vendor neutral. So we keep an eye on OneSignal and every few months check we can use their systems if need be. We don't want to be too tied into a paid for vendor.

            We'd seen the PR's on GitHub and as you say, it doesn't bode well. I hadn't checked the fix for IOS 10, I do suspect/hope/pray thats an Apple cock up.

            We don't touch Objective-C or Java. We detest and hate Java and everything about it. We're C hackers really. We think Objective-C is OK-ish but far too high level for us :)

    2. wikkity

      Re: Whats this GUI thingy?

      "I have three Emacs sessions"

      But if you use the GUI version you only need 1 session with C-x 5 2 (make-frame).

      As for a mouse with Emacs, I do like/love using nothing but a few mouse clicks to cut and paste a block of code, to non believers it looks like Jimi Hendrix playing his guitar with his teeth.

      1. Anonymous Coward
        Coat

        Re: Whats this GUI thingy?

        No, it looks like a man who should know better than to floss with his E-string is using the wrong tool for the job.

        yy

        j (or k)

        p

        FTFY.

      2. Rob Willett

        Re: Whats this GUI thingy?

        Agreed, each of my emacs sessions has multiple frames within it.

        As I survey the disaster zone that is commonly known as my desktop, I can see three sessions, two of them are editing multiple docs within the same session, basically a split session with a total of six docs being carefully edited (or as my colleagues would say, hacked together with little regard for coding or professional standards).

        Another is ssh'ed through a number of servers to run some tests in our servers located abroard.

        Another is setting up test data on a different server. Again with multiple sessions.

        Ctrl-X-2, 3, Ctrl X-b, Ctrl-X-o are well know key combinations. So much so, I had to stop and think what the actual keypresses are.

        Whilst I could run everything in one window, I have three HD monitors so use them.

  10. Anonymous Coward
    Joke

    Resource constrained

    > Emacs uses code called redisplay that assumes it's in a very resource-constrained environment

    That's because it assumes the rest of memory is being consumed by Emacs.

  11. -tim
    Coat

    emacs vs vi there is only one true and real argument

    If you have cats that jump on the keyboard while you are editing, the answer is clear.

    1. phuzz Silver badge
      Trollface

      Re: emacs vs vi there is only one true and real argument

      Yep, nano all the way.

  12. Indolent Wretch
    Facepalm

    Wow now put the guy onto the Aptana people and ask them to fix the flicker on/off horizontal scroll bar with every key press issue.

    (That's not a face palm it's just a headache)

  13. Anonymous Coward
    Anonymous Coward

    Noo! you'll break my workflow.

    But I rely on the flickering! I hacked together a macro that triggers a predictable flash pattern. a Raspberry Pi on the other side of the room decodes the flickering to change between my Pandora streams by blaring a loud noise which causes my cat to scamper around the room, eventually stepping on an iPad in the corner.

    #1172, if xkcd fans are having a GOMHAC moment...

  14. Chris Gray 1
    Go

    text mode!

    I'm with those who run (g)emacs in text mode in an xterm. Don't need no bloody mousey stuff. I do have to fix the dang key bindings so that backspace and DEL work properly. My startup for emacs is this:

    #!/bin/sh

    xterm -cm -dc -rvc -ulc +bdc -bg "#c09060" -xrm 'XTerm.ttyModes: erase ^?' -e emacs

    (And yes, I really do run my xterms with that tan background - I find it much easier on the eyes for long-term use than black on white.)

    1. Julian Bradfield

      Re: text mode!

      xrdb -query | grep Background

      *Background: #d8c078

      XEmacs*Background: #D8c078

      is my choice. Really annoys me that all these Gtk programs ignore it.

  15. Anonymous Coward
    Anonymous Coward

    Whats wrong

    With Nano? :(

    1. Herby
      Trollface

      Re: Whats wrong

      Nano??

      Isn't that for script kiddies.

      He ducks as the flames fly by.

  16. A. Coatsworth Silver badge
    FAIL

    Going on a tangent

    A Google employee makes an interesting hack and posts it... in Facebook.

    Did Plus really die *that* hard?

    1. Spacedman
      Joke

      Re: Going on a tangent

      He's probably got Richard Stallman on his Facebook friends list.

      1. Anonymous Coward
        Anonymous Coward

        Re: Going on a tangent

        RMS may well be oblivious to such, but probably would, if he were not, demand that his name be removed from that list.

  17. sitta_europea Silver badge

    Hey, I solved the problem I just created!

  18. kain preacher

    I'm I crazy? Imagine emacs merged with office 1016. Emacs with the ribbon.

    1. Anonymous Coward
      Anonymous Coward

      " Imagine emacs merged with office 1016. Emacs with the ribbon."

      Office 1016 eh? Did it run on an abacus?

    2. A. Coatsworth Silver badge
      Joke

      The Ribbon always felt like it was made by someone with a medieval understanding of computers anyway.

  19. kain preacher

    i meant 2016

  20. Windrose

    Flickering? WHAT flickering?

    None to be seen since 1987 or thereabouts, in gui or terminal. Zip, nada.

    Another "I've invented this great thing thing which does thing!" post.

  21. anonymous boring coward Silver badge

    Flicker, what flicker? Ctrl-L if you have issues.

    Anyhow, after MS sorts out using a touch pad to scroll where you want to scroll, then perhaps we can start worrying about Emacs.

  22. anonymous boring coward Silver badge

    Since he is a Google man, could he also fix Chome so it doesn't start playing video-ads whenever I load a friggin web page? That would be smashing, and surely score higher than anti-flicker emacs!

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Other stories you might like