
Emacs 27.1 - ddavis
https://lists.gnu.org/archive/html/emacs-devel/2020-08/msg00237.html
======
smabie
I would strongly recommend everyone try the native-comp Emacs 28 branch.
Native compilation of Elisp files has greatly improved performance and start-
up time, with no downside.

Though it's bleeding edge, I haven't experienced any issues: everything just
works.. faster!

It always amazes me that some people are willing to put in such hard work,
alone, for open source. The fact that one guy managed to speed up all of Emacs
2x-20x in his spare time for no pay is frankly amazing. Certainly puts my
side-projects to shame.

~~~
jmnicolas
> It always amazes me that some people are willing to put in such hard work,
> alone, for open source.

Apart of a few well known projects, the open source world is not so rosy.

I'm building an app that exports GPX files (XML file where you can store GPS
positions, POIs, routes etc).

All the examples files on the official website (
[https://www.topografix.com/gpx.asp](https://www.topografix.com/gpx.asp) ) are
broken (they return a blank page) and to validate that your file is compliant
you have to compile a 15 years old C++ library first (for some reason they
refuse to release a binary).

~~~
gallexme
Have a look at [https://gdal.org/index.html](https://gdal.org/index.html)

Solved a lot of weird open formats issue we had

~~~
jmnicolas
Thanks but I already wrote the code and after catching a couple gotchas with
the validation tool it's fully compliant now.

My point was not that GPX is hard (it's not) but that when something is open
source most of the time you have to put some elbow grease in it because no one
is paid to make it polished.

FWIW, it took me less time to write the GPX export code than to look for a
binary of the validation tool, fail, then launch WSL and compile the goddam
tool.

------
dan-robertson
Lots of these changes are quite significant improvements under the hood. One
thing emacs has struggled with is that it has been around for a long time so
many features were added when the libraries around them were quite immature,
and emacs ended up with libraries that were difficult and outdated and
insufficient manpower to quickly move to newer libraries. Another issue is the
desire for backwards compatibility (which can rule out libraries which eg
require gtk or can’t sufficiently cope with non-UTF-8 encodings).

Adding harfbuzz gives emacs much better text shaping and let’s emacs get rid
of whatever ancient library they were using before. Similarly the old
dependency (and security liability) on imagemagick can be dropped.

Other improvements should just allow certain elisp code to use C functions to
run faster. I think it is a testament to the versatility of emacs lisp as a
language that these things were good enough while implemented in pure elisp
that they could still be productively used, so no one needed to first request
new C functions before they could implement e.g. lsp clients or calculators.

~~~
tome
> Adding harfbuzz gives emacs much better text shaping

FTI "If you give HarfBuzz a font and a string containing a sequence of Unicode
codepoints, HarfBuzz selects and positions the corresponding glyphs from the
font, applying all of the necessary layout rules and font features. HarfBuzz
then returns the string to you in the form that is correctly arranged for the
language and writing system."

[https://harfbuzz.github.io/what-is-harfbuzz.html#what-is-
tex...](https://harfbuzz.github.io/what-is-harfbuzz.html#what-is-text-shaping)

~~~
zikzak
Is "FTI" a thing or did you mean "FYI"?

~~~
iamthad
Perhaps "For The/Those Interested"?

~~~
tome
For Their Information. Like FYI, but presumably dan-robertson already knows!
It's for the benefit of everyone else.

------
anyfoo
Some goodies in there. For example, a clear direction into making more things
work when editing on remote hosts out of the box. I hope lsp/eglot pick that
up, so that I can now edit on a remote host via ssh just like I could on a
local one and still have semantic completion, references etc. Or the ability
to just run ripgrep on the remote host transparently.

~~~
smabie
Honest question: doesn't sshfs solve this problem? I've never understood the
appeal of TRAMP, mounting the remote resources seems like a much better and
less finicky solution.

~~~
znpy
You might not have the required host permission to mount a filesystem or you
might not have sshfs at all (think about gnu emacs on windows).

Tramp is agnostic in most things (well, you need an ssh client at least).

~~~
contravariant
Calling tramp a solution for windows is somewhat iffy though. So far I don't
think there's an easy way to simply get it to work on windows (the path
handling seems to _forbid_ tramp-like paths on windows, which messes with
things quite considerably).

~~~
znpy
Meh, it worked well enough for me when I had to use it on windows 7 first and
10 later (using putty as ssh client).

~~~
disgruntledphd2
Yeah, you can get it to work with putty, but it's nowhere near as reliable as
from Mac/Linux to server (and to be fair, network issues make it a less than
optimal solution if you have a choice).

These days I just tmux on the server, open emacs and hack away (as long as you
can install things on the server).

------
submeta
After seven years of not working with Emacs, a few weeks ago I gave it a try.
I was negative, biased and convinced that it would just be a distraction, a
time waster. But the more I dived into it, I realized that the Emacs that I
worked with in 2010-2013 was not the same anymore. Packages like `dash.el' or
`s.el' make programming in Elisp fun! Then there are beautiful themes like
`spacemacs'. Also packages for managing notes and files (`Deft' for instance).

Within a few days I migrated all my note-taking and task-managfement-systems
to Emacs. Previously I was using Evernote, Bear app, Ulysses app for note
taking and TaskPaper + OmniFocus for project management.

Emacs + Org-Mode replaced all those apps and many more. And it makes me
`dance' with my data by using Elisp to transform all my data into ways I need
and want.

I realized that I didn't use Emacs to its full potential in 2013 because I was
reluctant to dive into (E)Lisp. This time I made a full dive into it. And I am
absolutely loving it. I had some contanct with Scheme some twenty years ago,
and that influenced me very much. But CL and Elisp offer much more.

Emacs does not need to be an IDE, but it can be a decent one. (Yes, I know and
use intelliJ: PyCharm and PHPStorm). It can be used for everything text: Note
taking, programming, transforming text. But via org-mode for much more than
text: Project- and task-management, ascii-tables, note-management system. I
even initiate my Google searches from within Emacs and keep a track of my
searches via org-capture.

Thank you for all the maintainers!

\--

Edit:

\- I am a user of a Mac with a US keyboard. Using an app named "Karabiner
Elements" to remap my keys. I have my caps and enter key behave like a Control
key whenever I hit them in combo with other keys. That way I have two control
keys in reach of both my pinkies.

\- r/emacs and r/orgmode are super helpful communities

\- learn to program in Lisp and have a look at Lisp macros. That's a very
useful concept to write DSLs to transform code very easily. \- _scratch_
buffer is your friend in learning elisp. Place the cursor after the last colon
of your code and hit `C-x C-e`, that will evaluate that line.

\- Learn about debugging your Elisp code. Edebug (`edebug-defun`) is your
friend. See [http://blog.binchen.org/posts/my-work-flow-to-debug-emacs-
pl...](http://blog.binchen.org/posts/my-work-flow-to-debug-emacs-plugin.html)

\- Be patient. Once you have mastered the basics, you'll fly!

~~~
davydog187
Wow, thank you for introducing me to `dash.el` and `s.el`. I tried to learn
Elisp a year back and was frustrating by the lack of basic functional
facilities that I'm used to in my primary language (Elixir).

How do you recommend diving deeper? I feel like there is so much to Emacs that
would make me much more productive, but I'm apprehensive to dive below the
surface

~~~
submeta
Elixir is a beautiful language. I love the pipe operator and the elegance of
the language. Much more consistent than the language I use daily (Python).
Also: Coming to Python from Scheme I was missing the difference between
destructive vs non-destructive operators [^1]. In Python I'd use
`my_list.sort()'. That does not return the sorted list but `None', whereas
`sorted(my_list)' returns a sorted copy of `my_list'. That's why I can't use
method chaining in Python like this: `my_list.sort().first().to_str()'.

Re diving in Lisp:

1\. I deleted my previous `.emacs` file and started from scratch.

2\. I learned all about the internal help system of Emacs. `C-h f' will let me
look up help for a function (it's "docstring"), `C-h v' will let me look up a
variable, etc. - Navigating help via `C-h i' and then 'm' (for menu) will let
me search the TOC entries in the help page. `l' (lower L) will let me go back
in help.

3\. Read good old recommended Lisp books. Seibel and many more are the
classics.

4\. Write code! Practical code that you need. Solve problems. Think of use-
cases. - For instance, I needed to parse my Kindle annotations, which are
saved like a log file in a file on the Kindle itself (the file is named `My
Clippings.txt'. I had written a parser in Python to get the entries out of the
file, now I did it in Elisp. Or you need a convenience function that performs
several steps you need daily in your text-editing or org-files (creating
template files, navigating the headars, whatnot).

5\. Read the source code of the packages. They have wonderful examples for how
to write code in Elisp. For instance `org-table.el'. It gave me many ideas for
how to write idiomatic Elisp. - You can go to the source code of a package by
looking up a function you use (`C-h f org-table-create RET', then click the
hyperlinked package name `org-table.el'; that'll bring you right to the
function in the package).

6\. Read good code. For instance: Magnar Sveen. He has written many excellent
packages. `dash.el' and `s.el' and some more. Check his github, read the code,
and check his [http://emacsrocks.com/](http://emacsrocks.com/) videos.

\---

[^1]: "The names of procedures and syntactic forms that cause side effects end
with an exclamation point ( ! ).". Source:
[https://www.scheme.com/tspl2d/intro.html](https://www.scheme.com/tspl2d/intro.html)

------
amake
This is a very important release for LSP users, as Emacs now has a fast,
C-based JSON parser that speeds up e.g. lsp-mode significantly.

~~~
pandatigox
Just a quick question on this, what's the best way to emulate an ide in emacs?
I feel so overwhelmed by the options, and the additional tools you have to
install alongside it. For example, python ide in emacs alone requires
pyflakes, autopep8, jedi and so on... What's the most catchall, generic ide
system where I don't have to fiddle with the config too much?

~~~
amake
To my mind there are two camps of language support in Emacs:

1\. Languages where people put a lot of effort into implementing bespoke
support inside Emacs itself (as Elisp packages)

2\. Languages where no one bothered to make Emacs-specific features, but are
now supported quite well via LSP

Python seems to be in the #1 camp, and that seems to be what you describe.

The #2 camp, however, is superior in my experience, so I would suggest trying
that instead.

I haven't worked that much with Python for a while, but at one point I used
lsp-mode and pyls and it seemed pretty good: [https://emacs-lsp.github.io/lsp-
mode/page/lsp-pyls/](https://emacs-lsp.github.io/lsp-mode/page/lsp-pyls/)

You can also choose Microsoft's Python LSP server instead: [https://emacs-
lsp.github.io/lsp-python-ms/](https://emacs-lsp.github.io/lsp-python-ms/)

~~~
kqr
Category 1 can be further subdivided into

1.1. Languages where people have written full parsers and analysers in Emacs
Lisp.

1.2. Languages where the Emacs support relies on external programs to provide
intelligence.

Only very few languages (e.g. JavaScript) fall in subcategory 1.1.

~~~
throwanem
Unfortunately, js2-mode's parser isn't updated to keep pace with modern
language development. I've had much better results over the last year with an
LSP integration, and rarely if ever go back to js2-mode these days.

Similarly, while js2-mode's built-in formatter is quite good, Prettier is both
more (and more easily) configurable and more shareable - it can enforce an
agreed-upon style at the codebase level without any editor-specific tooling or
configuration, and the consequent absence of bikeshedding is welcome.

~~~
brlewis
Yeah LSP is taking over. I don't think category 1.1 is going to last.

------
smabie
Emacs felt like it was stagnating around 5 to 10 years ago, but now things are
just getting better and better. LSP had been a game changer, for Emacs and all
other editors. The days of IDEs are numbered.

~~~
zelly
It's still stagnating. Emacs has something like 2% of market share. LSP
doesn't add many new features. We had jump to definition etc. for decades with
TAGS which was much many orders of magnitude faster than LSP. LSP just serves
to foster IDE envy and make users switch to a real IDE (and honestly why
wouldn't you, if you acknowledge that even a smidgen of IDE features makes you
more productive). Emacs will never ever have as the same features or same
types of users as IDEs--pursuing that is a losing battle. Emacs should focus
on becoming as fast as vim. That's its real competition, not IDEs.

~~~
zarkov99
My perspective, as a mostly C++ programmer, is completely different from
yours. LSP is great when it works, which unfortunately in my experience is
seldom, and it is absolutely key to retaining advanced users. If someone like
me, who knows emacs lisp, hates Microsoft and has used emacs for 25 years, is
tempted to switch over to VSCode because of its superior C++ IDE tools then
surely new programmers will not give Emacs a second look.

~~~
zelly
Is this not the exact phenomenon I was talking about? You have been able to
write C++ for 25 years without Microsoft, but now you've gotten IDE envy and
want to switch. Of course LSP will always work best on VS Code, which is the
platform it was designed for.

~~~
zarkov99
I re-read your comment and yes, I think I ended up confirming your point.
However, I do not agree with the conclusion that its not possible or desirable
to compete with an IDE, not at all. A functioning LSP, which is completely
achievable, will cure mine and probably many other's IDE envy, and that is why
I think its a crucial project.

------
rayalez
Did anyone manage to make a good Emacs config for effective React webdev?

I'm really missing graphql and styled components syntax highlighting and
generally a bugless properly working webdev mode. Currently it keeps messing
up indentation and losing syntax highlighting.

I tried moving to VS code, and I saw how amazing an editor designed for webdev
can be. But despite all the issues, I'm still much more productive in emacs,
so I went back.

I really wish it was possible to setup emacs for modern webdev, but I haven't
found a way yet.

Any tips/advice?

~~~
jidiculous
I use web-mode, tide, react-snippets combined with yasnippets, and prettier.
You can see my config
[here]([https://github.com/jidicula/dotfiles/blob/master/init.el#L61...](https://github.com/jidicula/dotfiles/blob/master/init.el#L610))
(or search for "react-snippets" if that line number is outdated).

------
Kaze404
I love the change to adopt XDG standards. It surprised me that this wasn't
implemented sooner when I first found out about it.

~~~
andreareina
IIRC 26 adopted ~/.config. Proper XDG support was coded in last year[1] but
has been waiting for the next major release.

[1]
[https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=41182...](https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=4118297ae2fab4886b20d193ba511a229637aea3)

------
tome
Another emacs thread with no mention[1] of straight.el. How do people sanely
manage their emacs configurations without it? Is there a way to pin dependency
versions that you get from MELPA or ELPA? Otherwise one risks one's setup
completely breaking with a new dependency release and having no way of getting
back to the old configuration!

[1] OK, one brief mention

~~~
daptaq
Simple: You use ELPA or MELPA Stable, and if necessary clone the repo and
install the package via M-x package-install-file.

~~~
tome
Hmm, but as I understand it neither ELPA nor MELPA can be rolled back.

[https://emacs.stackexchange.com/questions/28731/easiest-
way-...](https://emacs.stackexchange.com/questions/28731/easiest-way-to-
downgrade-a-package-installed-via-melpa)

------
globular-toast
Lots of people mentioning LSP. I've been an emacs user for over 10 years now.
I've installed and tried the LSP modes. I've done it with 27 and jsonc as
well. They are slow as hell and buggy. Is this just the accepted way of things
now? I like emacs because it's fast. I can't stand using tools that are slower
than the speed I can think.

~~~
zelly
Yes you're not alone, it slows Emacs to an absolute crawl. I was excited about
LSP a couple years ago when it came out, but it turns out that it's another
one of those things that's better in theory than in practice. There's nothing
worse than having your editor freeze up while you're typing. I've had bad
experiences with clangd especially where it consumes all available memory when
faced with large codebases. It's not just slow on Emacs, it's slow on the
other editors that use LSP like VS Code. If I were conspiracy minded, I would
think this was an elaborate a conspiracy by Microsoft to kill off programming
on Linux and get everyone on Visual Studio and WSL.

~~~
zarkov99
When I tried LSP for C++, speed wasn't the issue, though you do have to jump
through some hoops to make sure emacs uses native JSON parsing. The problem
was just stability as LSP for C++ was stupid buggy as recently as a couple of
months ago.

------
p4bl0
It seems to be the end of the infamous `unexec` function. I hope its story
will not be forgotten, it's a very amusing hack :).

------
maxgfaraday
Emacs has been my power weapon for 30 years now and it has never left me
wanting for anything else. Thanks for another great release! The last several
years I have been using the “Prelude” distribution of packages and it has been
great, it does just enough and doesn’t overreach. Go EMACS!!!!

------
flaxton
Thank you for updating my favorite editor of all time ;-)

------
ycombinete
Is there a way to find out if/when this version will be available for Windows?

------
clircle
Awesome! Great list of updates. But what is early init?

~~~
sjm
early-init.el is loaded before the package system is initialized (which also
lets you disable the package system before it can possibly be loaded -- useful
for people like me who use straight.el instead), while the normal init.el
happens after package-initialize.

------
ashton314
I’ve been running on bleeding edge releases for about a month now. It’s been a
bit rocky at times but I’ve overall been surprised at how stable master has
been. I’m delighted to see 27 is out now. If I get fed up with 28 maybe I’ll
downgrade to the new stable. :-P

The best thing with this release (as far as I am aware) is the JSON parser
implemented in C. This should make lsp-more a lot snappier.

~~~
disgruntledphd2
I normally do this in the lead-up to a new release, but downgrade aftwerwards.

Often, there'll be big changes on the master branch after a release, so it
tends to be a little less stable (and I normally just need Emacs to work, so
not interested).

------
phoe-krk
_> Lexical-binding is used by default_

Finally, about time!

------
k_bx
I wonder whether there's any discussion around addressing the elephant in the
room: big config files.

Is there any work towards making Emacs be usable immediately, while config
being loaded asynchronously in background, adding features like syntax
highlighting without blocking the main editing experience?

~~~
fiddlerwoaroof
use-package already has a way to defer configuration until it’s needed.

~~~
k_bx
Yes, I'm certainly using that, but it's far from being enough to make emacs-
with-config a usable replacement for the in-terminal editor.

~~~
fiddlerwoaroof
It’s probably not what you want to hear, but I just use emacsclient for that.
I agree that the startup time is annoying, though.

~~~
k_bx
Yes, I just use "emacs -nw -q" (aliased as eq) when in terminals, and it's
surprisingly good most of the time. But having good startup time always would
make a huge difference imho, including Emacs's popularity.

~~~
natrys
Parent is talking about using "emacsclient". Basically you start Emacs in
daemon mode (e.g. add "(server-start)" at end of config), and you never kill
it. You just pay slow startup cost once, any subsequent client invocation
after that is instantaneous.

~~~
k_bx
I understand. I use it for my git commit editing in my “master” emacs. It’s
just not usable when you want multiple instances in different tmux windows

~~~
fiddlerwoaroof
I have this little handy shell function for that:

    
    
        semacs () {
            emacs --eval "(setq server-name \"$1\")" --daemon
        }
    

`semacs foo` then starts an emacs server named foo and and `emacsclient -s foo
-c` attaches to it.

------
maxgfaraday
Prelude Emacs is a great ‘distribution’ and this is great to have another
amazing emacs release.

------
arminiusreturns
Check out sane-emacs for a sane yet simple starting config.

