Emacs 27.1 Features (released 2020-08)

By Xah Lee. Date: . Last updated: .

2020-08-14 todo, work in progress

This page is a on-going list of tips and tricks about emacs 27. I'll be adding stuff here few times a week.

2.1 Emacs can now use the XDG convention for init files.

The XDG_CONFIG_HOME environment variable (which defaults to ~/.config) specifies the XDG configuration parent directory. Emacs checks for init.el and other configuration files inside the emacs subdirectory of XDG_CONFIG_HOME, i.e. $XDG_CONFIG_HOME_/emacs/init.el

However, Emacs will still initially look for init files in their traditional locations if ~/.emacs.d or ~/.emacs exist, even if $XDG_CONFIG_HOME_/emacs also exists. This means that you must delete or rename any existing ~/.emacs.d and ~/.emacs to enable use of the XDG directory.

If ~/.emacs.d does not exist, and Emacs has decided to use it (i.e. $XDG_CONFIG_HOME_/emacs does not exist), Emacs will create it. Emacs will never create $XDG_CONFIG_HOME_/emacs.

Whichever directory Emacs decides to use, it will set user-emacs-directory to point to it.

2.2 Emacs can now be configured using an early init file.

The file is called early-init.el, in user-emacs-directory. It is loaded very early in the startup process: before graphical elements such as the tool bar are initialized, and before the package manager is initialized. The primary purpose is to allow customizing how the package system is initialized given that initialization now happens before loading the regular init file (see below).

We recommend against putting any customizations in this file that don't need to be set up before initializing installed add-on packages, because the early init file is read too early into the startup process, and some important parts of the Emacs session, such as window-system and other GUI features, are not yet set up, which could make some customization fail to work.

2.3 Installed packages are now activated before loading the init file.

As a result of this change, it is no longer necessary to call package-initialize in your init file.

Previously, a call to package-initialize was automatically inserted into the init file when Emacs was started. This call can now safely be removed. Alternatively, if you want to ensure that your init file is still compatible with earlier versions of Emacs, change it to:

(when (< emacs-major-version 27) (package-initialize))

However, if your init file changes the values of package-load-list or package-user-dir, or sets package-enable-at-startup to nil then it won't work right without some adjustment:

  • You can move that code to the early init file (see above), so those settings apply before Emacs tries to activate the packages.
  • You can use the new package-quickstart so activation of packages does not need to pay attention to package-load-list or package-user-dir any more.

3.1 Emacs now supports Unicode Standard version 13.0.

3.2 Emacs now supports resizing and rotating images without ImageMagick.

All modern systems support this feature. (On GNU and Unix systems, Cairo drawing or the XRender extension to X11 is required for this to be available; the configure script will test for it and, if found, enable scaling.)

The new function image-transforms-p can be used to test whether any given frame supports these capabilities.

4.20 Control+ mouse scroll to change the font size

also works with images. see Emacs: View Image File

3 Changes in Emacs 27.1

3.25 New function libxml-available-p.

This function returns non-nil if libxml support is both compiled in and available at run time. Lisp programs should use this function to detect built-in libxml support, instead of testing for that indirectly, e.g., by checking that functions like libxml-parse-html-region return nil.

3.26 libxml-parse-xml-region and libxml-parse-html-region take

a parameter that's called DISCARD-COMMENTS, but it really only discards the top-level comment. Therefore this parameter is now obsolete, and the new utility function xml-remove-comments can be used to remove comments before calling the libxml functions to parse the data.

3.27 A new DOM (the XML/HTML document structure returned by functions

such as libxml-parse-html-region) traversal function has been added: dom-search, which takes a DOM and a predicate and returns all nodes that match.

3.30 The German prefix and postfix input methods now support Capital sharp S.

3.31 New input methods hawaiian-postfix and hawaiian-prefix.

3.32 New input methods georgian-qwerty and georgian-nuskhuri.

3.33 New input methods for several variants of the Sami language.

The Sami input methods include: norwegian-sami-prefix, bergsland-hasselbrink-sami-prefix, southern-sami-prefix, ume-sami-prefix, northern-sami-prefix, inari-sami-prefix, skolt-sami-prefix, and kildin-sami-prefix.

3.34 Japanese environments use UTF-8 by default.

In Japanese environments that do not specify encodings and are not based on MS-Windows, the default encoding is now utf-8 instead of japanese-iso-8bit.

3.41 The user option switch-to-visible-buffer is now obsolete.

Customize switch-to-prev-buffer-skip instead.

3.42 New user option switch-to-prev-buffer-skip.

This user option allows specifying the set of buffers that may be shown by switch-to-prev-buffer and switch-to-next-buffer more stringently than the now obsolete switch-to-visible-buffer.

3.35 New function exec-path.

This function by default returns the value of the corresponding user option, but can optionally return the equivalent of exec-path from a remote host.

3.36 The function executable-find supports an optional argument REMOTE.

This triggers searching for the program on the remote host as indicated by default-directory.

3.43 New flex completion style.

An implementation of popular flex/fuzzy/scatter completion which matches strings where the pattern appears as a subsequence. Put simply, makes "foo" complete to both "barfoo" and "frodo". Add flex to completion-styles or completion-category-overrides to use it.

2020-08-15 xahnote update Emacs: Name Completion and also possibly add config to my init and to my init tutorial

3.51 Emacs now optionally displays a fill column indicator.

This is similar to what fill-column-indicator package provides, but much faster and compatible with show-trailing-whitespace.

Customize the buffer-local user options display-fill-column-indicator and display-fill-column-indicator-character to activate the indicator.

The indicator is not displayed at all in minibuffer windows and in tooltips, as it is not useful there.

There are 2 new buffer local variables and 1 face to customize this mode, they are described in the manual "(emacs) Display".

2020-08-15 xahnote update my tutorial and also possibly add config to my init and to my init tutorial

 '(5 ((shift) . 1) ((control) . nil)))

4.7 New command make-empty-file.

4.9 New user option electric-quote-replace-double.

This option controls whether '"' is replaced in electric-quote-mode, in addition to other quote characters. If non-nil, ASCII double-quote characters that quote text "like this" are replaced by double typographic quotes, “like this”, in text modes, and in comments in non-text modes.

to read

Emacs Version History

If you have a question, put $5 at patreon and message me.
Or Buy Xah Emacs Tutorial
Or buy JavaScript in Depth