News for hackers. Stuff that matters.
Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @03:45PM (#28078595)
Rant incoming. Dub it flamey or justified, it's up to you. I am posting it because this is one of my last hopes to make amends with Emacs. I accidentally used it for ~19 years -- my first ever team taught me it and I've never bothered to learn anything much else beyond Eclipse and VS Code.

So how about a more modern take on Emacs that doesn't pull punches? Let's go.

1. Finally use a proper LISP like Common Lisp, SBCL or Racket? (Maybe even Gerbil Scheme, last I checked it it was pretty nice to look at and code in.) While you're at it, make a transpiler from Elisp to the LISP you end up using?

2. Make sure your core editor is mega ultra super fast for a change? It's frankly pitiful to have Emacs lag on a server-grade / workstation CPU with an NVMe SSD when you are trying to pick one of 2000 files in a project. I should not even NOTICE a lag on this machine! I can enumerate ~10,000 files in the Alacritty terminal before I manage to blink and press Ctrl-C, so what does that say about Emacs? (And make ahead-of-time / JIT LISP compilation the default and only option for running LISP code, please!)

3. Drop GUI efforts and just make a full-blown terminal-only version? (This might be achievable with build flags and/or fetching certain packages if I remember correctly.) I mean, the GUI efforts are historically nothing short of heroic but if Emacs is going to lag severely on a retina 5K screen (iMac Pro) then obviously somebody is hard-coding assumptions into some GUI code somewhere. Not a good software design.

4. Use async interfaces to external tools like language servers? It's baffling to have my editor completely locked for 5-10 seconds when I first open a file in a project. I am sure I'll survive without compiler warnings for that period of time.

5. Oh, and can we stop lagging the editor on every scroll because the font has more than 1000 graphemes, please? My Apple IIc computer could handle a file with 1000 records in 2-3 ms (excluding time loading it from the floppy disc, of course). I know it's not the same but come on.

---

Emacs is dated in many ways. But I am not seeing any will for a change. It seems the team is happy with gradual super-careful steps until the end of time.

I mean, that's fine, obviously it's their prerogative and all others can't do anyhing.

But this here is one last cry from me; a cry for some common sense and perspective before I swallow my low-energy levels (pre-diabetes) and lack of time (family man) and sacrifice my not-so-much sleep and me-time and finally learn NeoVim. I am sure it's going to be worth it even if it ruins my health for a few weeks because the people there are actually invested in performance, lightweight operation and ergonomics.

Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @03:59PM (#28078833)
I'm curious what OS you are in. Unless I am over a slow tramp connection, it isn't common for me to see any lag in the editor.

And it is amusing that async through a buffer has always been possible. Just far more common for folks to not go that route on round one.

Re:EmacsConf 2021 Call for Proposals by zdragnar on Thursday August 05, 2021 @04:21PM (#28079180)
Not OP, but macOS here on a MacBook Pro less than a year old. Emacs has always tempted me, but a number of commands take roughly 2-5x the time compared to something like vscode.

Every time I get back to trying out emacs again, I find myself wondering why I would bother with the massive time sink to get it customized to be a sub-par equivalent to another tool that works better for me.

Doom emacs comes the closest for pre-configured setups, but even that isn't halfway to the productivity of what I am trying to replace.

What I really wish is sublime had gone with something other than python for plugins, and was more scriptable overall...

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:29PM (#28079303)
That's why I am 99% likely to move to NeoVim (or LunarVim which steps on it). LuaJIT looks like a very easy script language to learn, with minimal quirks -- at least on the first few looks.
Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @04:39PM (#28079432)
What commands, in particular?
Re:EmacsConf 2021 Call for Proposals by zdragnar on Thursday August 05, 2021 @05:44PM (#28080350)
The most distinctive one is when you start typing a chord- it can take up to a good second to populate the command list. Compare this to vscodes command palette which is instant.

I admit that perhaps there is a configurable lag built in (it would make sense to do so) and while there are other examples that I know bother me, this is the one that jumped out straight away. I'd have to dig back in to have more specifics.

Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @06:00PM (#28080552)
I'm not sure what chord menu you mean. :(. I /think/ you are describing "echo-keystrokes", which defaults to one second.

M-x is basically instant for me, though. So, not sure why anything like that would be slow.

Re:EmacsConf 2021 Call for Proposals by jasonmorton on Thursday August 05, 2021 @04:46PM (#28079525)
Not OP, but for me adding or deleting a character in the middle of a paragraph in a latex doc hangs for maybe .5s or more, often. This is a fairly new phenomenon, never happened 2+ years ago.
Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @06:05PM (#28080596)
That sounds broken. :(

Good luck getting it fixed, if you are still trying. A basic profiler-start, type, profiler-stop, profiler-report can probably pay the blame easily.

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:03PM (#28078897)
macOS.

Can you give me a hint on how to do the async LSP thing then? I never was actually interested in becoming a master in Emacs. ¯\_(ツ)_/¯

Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @04:15PM (#28079095)
Apologies, I meant that async had long been doable in emacs. Compilation mode being a clear example of what that could look like.

That said, most of the newest lsp code is built with the idea that calls out to the server are fast enough to just block.

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:32PM (#28079344)
Thank you for clarifying, much appreciated. <3
Re:EmacsConf 2021 Call for Proposals by dbmikus on Thursday August 05, 2021 @06:32PM (#28080916)
Looks like LSP mode is async [1], but I haven't set it up myself. I mostly use Emacs as an org-mode app.

[1] https://emacs-lsp.github.io/lsp-mode/

Re:EmacsConf 2021 Call for Proposals by taeric on Thursday August 05, 2021 @08:13PM (#28081710)
I'm the same. I do still edit all of my code in emacs, but I grew to dislike most auto complete setups years ago. :(

I sometimes fear it hurts my productivity, but I'm not seeing any real boost in the folks that use them.

Re:EmacsConf 2021 Call for Proposals by Jtsummers on Thursday August 05, 2021 @04:23PM (#28079213)
Re (3):

There is a terminal-only version, and it's not even new. It should be available without any build flags, though maybe you'll need a launch flag. Try emacs -nw from the terminal if emacs by itself launches a GUI window for you.

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:28PM (#28079288)
Yep, did that a while ago, was very disappointed how much coloring do you lose by doing it, for seemingly no good reason. :(

Could be my config but dude, it's a 99% almost pristine Spacemacs config. You can't get much more vanilla than that.

Re:EmacsConf 2021 Call for Proposals by alex_smart on Thursday August 05, 2021 @04:37PM (#28079401)
>pristine Spacemacs

>vanilla

What? :O

Spacemacs is like 50k LOC away from vanilla config.

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:42PM (#28079481)
Ah, I mean vanilla Spacemacs. :D

I also meant I barely changed it, nothing more. Hence why I was baffled that switching to terminal mode lost like half the syntax coloring. :|

Re:EmacsConf 2021 Call for Proposals by alex_smart on Thursday August 05, 2021 @05:06PM (#28079834)
>lost like half the syntax coloring

Spacemacs's default theme works quite well in the terminal. Of course, when you are mapping a theme designed for a colorspace with millions of colors to one with 256 colors, there might some issues, but that is to be expected.

If even trying a different theme is too much of an effort for you, why in God's name are you wasting your time on an editor whose main USP is customizability?

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @05:35PM (#28080238)
Because I had no idea Emacs is about that when I started (loooooong ago, almost 20 years ago) and by the time I found out I was already burned out. Sigh.

But I'll make time to migrate away, seems like it's time.

Re:EmacsConf 2021 Call for Proposals by Jtsummers on Thursday August 05, 2021 @04:47PM (#28079550)
Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @04:52PM (#28079620)
Well okay, fair enough but it doesn't actually solve the problem. Modern terminals can render basically all colors your DE / display supports so I am not sure why there isn't a check for that and utilize the feature if it's there.
Re:EmacsConf 2021 Call for Proposals by alex_smart on Thursday August 05, 2021 @05:31PM (#28080179)
https://i.imgur.com/TFTOj8Z.png

This is with the default spacemacs theme. Can you tell which one is the terminal and which one the GUI?

https://www.gnu.org/software/emacs/manual/html_node/efaq/Col...

Emacs does have the feature you want. Perhaps your setup wasn't supported. Which terminal/os were you on?

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @05:33PM (#28080209)
Ouch.

macOS with iTerm2 and then Alacritty.

Now I am even more confused why it doesn't work well for me.

Re:EmacsConf 2021 Call for Proposals by spudlyo on Thursday August 05, 2021 @06:36PM (#28080948)
For your possible inspiration: Emacs in iterm2/tmux with 24-bit color, and a bunch of fancy icon sets mapped into the private use area running LSP mode looking a large Python code base[0].

[0]: https://muppetlabs.com/~mikeh/ttyemacs.png

Re:EmacsConf 2021 Call for Proposals by bloopernova on Thursday August 05, 2021 @08:47PM (#28081974)
Oh good lord, how do you get that sort of layout?

(I need to learn how Emacs manages its windows; Mostly I have one Treemacs buffer open on the left, then a single large editor window with Olivetti mode on the right.)

Re:EmacsConf 2021 Call for Proposals by spudlyo on Friday August 06, 2021 @12:07AM (#28083228)
If you have xterm-mouse-mode set it's pretty easy to size windows with your mouse. I just create the splits with the usual emacs window commands and then move things around with my mouse until I have things just right.
Re:EmacsConf 2021 Call for Proposals by alex_smart on Thursday August 05, 2021 @05:45PM (#28080362)
>why it doesn't work well for me

Possible reasons:

1. (macOS + inside terminal) isn't a common workflow for emacs contributors, or perhaps for people with that workflow working with 256 colors isn't an issue

2. people who want that workflow who care about having 24 bit colors didn't bother to file a bug report (did you?)

Bitter pill, but I hope it helps: as a beginner to an ecosystem, if you are going to be opinioniated about having an unusual workflow, you are always going to run into problems. If you are running Emacs locally, just run it in GUI mode, that's what most people do.

Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @06:04PM (#28080591)
I do run Emacs in GUI mode and it's embarrassingly slow due to various factors I gradually managed to pinpoint:

1. 5K retina display (other Mac owners seem to share the experience)

2. A font with a lot of graphemes (those without emoji seem to render faster)

3. The synchronous nature of LSP; I still don't get it why LSP can't work asynchronously in Emacs -- it does in VIM.

Hence me asking about terminal mode where it also works rather confusingly to me (I mean the colors).

> (macOS + inside terminal) isn't a common workflow for emacs contributors

As a guy who worked on OSS before -- and wants to do it again -- I am never feeling entitled to other people's work. I just wonder why those scenarios are supported in the first place (if no contributors are interested in making them work well).

> as a beginner to an ecosystem, if you are going to be opinioniated about having an unusual workflow, you are always going to run into problems

Fair enough and I don't think it's a bitter pill at all, I appreciate the feedback. But again, I am wondering why the supposedly first-class option (GUI) is also having problems. :(

> 2. people who want that workflow who care about having 24 bit colors didn't bother to file a bug report (did you?)

I wouldn't even know where to begin. The whole community and ecosystem seem extremely foreign to me and I never even got as far as to find a bug report template (admittedly I didn't try very hard). There's just something... alienating about this community, especially Emacs devs. Maybe I am wrong, I hope I am wrong but, just an accumulated feeling.

In any case, the reason I am getting a bit ticked off is that Emacs is supposedly hugely popular. I'd expect a 5K screen and some richer fonts to not trip it but perhaps you're right that macOS isn't a focus.

Re:EmacsConf 2021 Call for Proposals by alex_smart on Thursday August 05, 2021 @06:52PM (#28081113)
>5K retina display >A font with a lot of graphemes

You might have fun reading the article linked here:

https://news.ycombinator.com/item?id=12830206

>The synchronous nature of LSP; I still don't get it why LSP can't work asynchronously in Emacs

Oh god, that is actually terrible.

> I never even got as far as to find a bug report template

The official way to file a bug report is M-x report-emacs-bug.

>especially Emacs devs

What's that feeling based on?

Re:EmacsConf 2021 Call for Proposals by geofft on Thursday August 05, 2021 @07:31PM (#28081421)
What is the output of "echo $TERM" and "tput colors"?
Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @07:36PM (#28081458)
It's actually 256 for both. WTF, apparently I didn't setup iTerm2 correctly. Let me get to it...
Re:EmacsConf 2021 Call for Proposals by geofft on Thursday August 05, 2021 @08:31PM (#28081865)
Actually never mind, those commands don't know anything about true colors (> 256). I think you want to check for $COLORTERM according to https://gist.github.com/XVilka/8346728 ?
Re:EmacsConf 2021 Call for Proposals by pdimitar on Friday August 06, 2021 @03:33AM (#28084269)
It returns "truecolor" alright.
Re:EmacsConf 2021 Call for Proposals by Jtsummers on Thursday August 05, 2021 @04:57PM (#28079689)
You'll need to make sure that your terminal actually supports the variety of colors that emacs is emitting and that your terminal palette matches your emacs GUI color palette. Emacs can't magically switch your terminal from a 16-color mode to 256-colors, or change the palette.
Re:EmacsConf 2021 Call for Proposals by pdimitar on Thursday August 05, 2021 @05:34PM (#28080223)
I guess I have to tinker with the palette. Thought I didn't have to when the terminal supports a lot of colors.
Re:EmacsConf 2021 Call for Proposals by gnubison on Friday August 06, 2021 @12:13AM (#28083261)
Yeah, that’s part of using a terminal. Color support is janky and many keystrokes are indistinguishable from another (for example, C-i and TAB, C-[ and ESC, C-S-anything, C-arrow keys, and so forth). You can’t have a terminal emacs without these flaws.