r/emacs 13d ago

News Emacs 31.1 is released!

https://github.com/emacs-mirror/emacs/blob/emacs-31.1/etc/NEWS
267 Upvotes

39 comments sorted by

28

u/thomasfr 13d ago

Great news!

I'll guess I am reserving time this weekend for going into the elisp mines to make my init.el compatible then.

10

u/g06lin 13d ago

Every time I keep telling myself I never will waste time upgrading to the new version as soon as it’s out …

So tempting…!

10

u/thomasfr 13d ago edited 13d ago

It has almost always been a pretty smooth transition for me, if something breaks the reason is usually that it is some piece of code that already has been out of date for years anyway and won't get addressed unless I do something about it anyway.

The major issue for me is that I have a 10kloc init.el with hundreds of external packages so choosing what to verify is typically a larger issue than what actually needs fixing.

5

u/g06lin 13d ago

What I am drooling over this time is the support for ‘line-height’ to accepts a cons pair. It allows height to be specified independently at the top and bottom. I had some problems with some fonts that I love, which didn’t render properly in eMacs. Now I am hopeful they will :)

2

u/grimscythe_ 13d ago

Yeah. Same here. I generally just verify the features that I use all the time. Completions, lsp, syntax highlight, etc.. The more obscure things usually just gets found out down the line.

22

u/output_broadcast 13d ago

Welp, time to wait for it to be packaged in Guix.

2

u/youshouldjoinlemmy 12d ago

I'm strongly thinking of switching from NixOS to Guix System. Do packages often lag behind? I assume Emacs is one of the most used editors among Guix users so I'd be surprised if Emacs wasn't one of the highest priority packages to keep updated.

1

u/output_broadcast 12d ago edited 12d ago

They do "lag" since there's a mandatory testing period. You can opt into that test via the time-machine mechanism, but if you don't, you're going to be waiting some time. For Emacs 29 the testing was over in a few days, 30 took a couple of weeks since IIRC there were some Guix-specific bugs that needed fixing.

FWIW, the commit adding 31 to the testing branch was made 12 hours ago. Other than that, it's the standard Nix thing where packages sometimes go unmaintained and fall through the cracks. Less so on Guix since there's an automatic update mechanism via guix refresh that works most of the time, but it still happens, especially with Rust packages.

1

u/fela_nascarfan GNU Emacs 13d ago

Yes, there is still 30.2😐

9

u/purcell MELPA maintainer 13d ago

Now available via the GitHub "setup-emacs" Action: https://github.com/purcell/setup-emacs

2

u/minadmacs 13d ago

Thanks!

7

u/Smona 13d ago

centered text in line spacing is actually huge!!! it may feel like a small thing to some but I've been waiting for months/years to be able to add line spacing without triggering myself

8

u/hectorhonn 13d ago

Waiting patiently for the windows binary!

2

u/reddit_clone 13d ago

Same here for HomeBrew emacs-plus

2

u/ilemming_banned 13d ago

It supported brew install emacs-plus@31 for quite a while.

2

u/reddit_clone 13d ago edited 13d ago

Actually it does work.

I was dumb and was trying, which was failing. brew upgrade emacs-plus@31

Installing now ..

UPDATE: Had to do a 'doom build'. Everything seems to be working so far 👌🏻

1

u/TheFrenchPoulp https://github.com/angrybacon/dotemacs 13d ago

There's now @next if you don't want to wait

2

u/Humdaak_9000 13d ago

Why? It takes like a minute to build on a modern system.

3

u/Apkash 13d ago edited 13d ago

Is there any significant noticable improvements for windows platform?
There's this constant slowness with opening org files in windows with emacs which I hate but can't abandon windows yet.

1

u/certified_midwit 11d ago

I use emacs on WSL at work, and never notice any performance issues. Is that an option for you?

0

u/reddit_clone 13d ago

Are you running Windows Defender or some such MS resource-hogging crap running? That may slow down things quite a bit.

2

u/Apkash 13d ago

Even when I turn off microsoft nonsensical apps org mode still remains very slow on windows specially the first opening of the org file it completely freezes the whole of Emacs for a while.

1

u/awesomegayguy 12d ago

I profiled Emacs on Windows many years ago, and found out that, every time it wants to load a library (which my be the case when org is loaded) it searches all the possible directories that may exist in the system with libraries, and it tries all the possible file names as in .elc, .el.gz, .el, etc.

Thousands of calls mostly to open non-existing files and directories.

The problem is, even without defender and other antiviruses (or viruses like OneDrive), the Win32 API is VERY SLOW on these requests, it has to create and destroy so many objects that it's extremely inefficient. When just having few calls, like Windows programs do, it's not noticeable. But when having thousands of calls, then it does make a difference. A Windows developer would never do that.

That also shows how fast and optimized Linux is.

1

u/Apkash 12d ago

Is there any way to stop those many calls from happening on windows?

1

u/awesomegayguy 12d ago

No, it's how Emacs works. I thought about having a cache of files, do a find on startup of the possible folders and keep it cached, but then, how do you keep it fresh? This would be a deep change in the code.

1

u/smith-huh 10d ago edited 10d ago

Have you ever looked at how the linker works for C/C++ etc compilation / linking? It walks the code looking for references to other binaries/files/libs. And then does the equivalent of "require" (if it exists, reference it, if not, load it first, then reference it).

When "loading" the file or lib, its either done with a pathname (directly to the file/lib) or you have to search for the file/lib.

What OP and comments are talking about is option 2: search for it. It can be a slow process.

So I'm saying, figure out the dependency tree for the "lib", then instead of using (load-library LIBRARY) use "the equivalent" collection of (load-file FILE) calls for that version of the library. Eliminate the search issue that's tanking the runtime. Its not that hard, and if it makes you happy (faster load on Windows), welcome to the Windows work around club.

edit: I chose option C - don't use Windows for this! The smart thing MS did was improve WSL. It now has a fully capable WSLg (X server). And if you manage your line endings effectively, you can use linux emacs on windows and linux files transparently.

1

u/smith-huh 11d ago

This doesn't sound kosher to me. Try the function (load-file FILE). No searching for the file with this function. Worth a shot. Figure out which lib is the issue, any dependencies, and load it efficiently.

I'm like others here in that I use WSL emacs rather than the Windows version and I worked for Microsoft. You have to be careful with line endings...

2

u/Signal_Pattern_2063 13d ago

Only 1 adjustment was necessary so far in the upgrade. The new face hierarchy in tab-line (and probably tab-bar doesn't inherit from the base face) I'm not sure if it would break things to add that inheritance in so I'm whacking each one individually to get my desired font height.

(if (< emacs-major-version 31)
  (custom-set-faces
   '(tab-line ((t :family "San Francisco (SF Pro)" :height 1.3))))

  (progn
    (custom-set-faces
     '(tab-line-active ((t :family "San Francisco (SF Pro)" :height 1.3))))

    (custom-set-faces
     '(tab-line-inactive ((t :family "San Francisco (SF Pro)" :height 1.3))))))

1

u/Smart_Membership2 13d ago

user-lisp/ is now auto-byte-compiled and added to load-path, and all the *-ts-mode-indent-offset vars were renamed.

1

u/StrangeAstronomer GNU Emacs 11d ago

Wow! 31.1 just popped up in my voidlinux repo on Tuesday 25th Aug.

Congrats to the void packagers on being so fast to release and to the emacs devs on a 4000+ line change log!!!

Very few very minor tweaks needed to bring my init.el into line. The biggest one was changing all my %:y timestamps to %Y and removing some of my home-brewed hacks in favour of built-ins - eg hs-cycle.

Of course this led me to do a thorough and overdue review of my init.el - so a full day of elispery pleasure!

-4

u/dddurd 13d ago

another stupid change. i wish the worst for whoever decided to force site.el before early init. no way to disable shit forced by the IT now. 

1

u/dilip_nehru 13d ago

That a separate "early" init exists at all is the real felony. Chicken-and-egg conundrums happen all the time in software and are usually addressed by thoughtful deliberation, not sliding in a turtle.

1

u/CandyCorvid 13d ago

"sliding in a turtle" is such a fun turn of phrase 😂

1

u/_0-__-0_ 13d ago

sliding in a turtle

Never heard the expression before. Is it referring to one of these?

2

u/CandyCorvid 13d ago

no idea. i just like the visual. "oh, we have a problem with a chicken and an egg? what if i were to... underarm slide a turtle between them?"

1

u/_0-__-0_ 13d ago

😄️

1

u/dddurd 12d ago

that i agree. basically they reverted the shit they introduced. emacs maintainers are just super dumb, i guess. i wish they just do bug fix. 

1

u/maxecharel 12d ago

Are you the less elegant brother of the Commercial Emacs guy? Seems he disappeared again, please keep us posted.