Difference between revisions of "GNU Emacs 26"
Revision as of 03:13, 30 July 2019
- 1 What's new in Emacs 26
- 1.1 Emacs now provides a limited form of concurrency with Lisp threads.
- 1.2 Flymake has been completely redesigned
- 1.3 Emacs now uses double buffering to reduce flicker on the X Window System
- 1.4 A systemd user unit file is provided
- 1.5 Support for 24-bit colors on capable text terminals
- 1.6 The networking code has been reworked so that it's more asynchronous
- 1.7 Emacs can scroll horizontally using mouse, touchpad, and trackbar
- 1.8 Emacs now supports optional display of line numbers in the buffer.
- 1.9 The 'occur' command can now operate on the region
- 1.10 Emacs no longer prompts about editing a changed file when the file's content is unchanged
- 1.11 File local and directory local variables are now initialized each time the major mode is set
- 1.12 A second dir-local file (.dir-locals-2.el) is now accepted
- 1.13 Connection-local variables can be used to specify local variables
- 1.14 'switch-to-buffer-preserve-window-point' now defaults to t
- 1.15 Emacsclient has a new option '-T' / '--tramp'
- 1.16 Changes in packages and specialized modes
- 2 See more
What's new in Emacs 26
Emacs now provides a limited form of concurrency with Lisp threads.
Emacs now provides a limited form of concurrency with Lisp threads. Concurrency in Emacs Lisp is "mostly cooperative", meaning that Emacs will only switch execution between threads at well-defined times: when Emacs waits for input, during blocking operations related to threads (such as mutex locking), or when the current thread explicitly yields. Global variables are shared among all threads, but a 'let' binding is thread-local. Each thread also has its own current buffer and its own match data.
See the chapter "(elisp) Threads" in the ELisp manual for full documentation of these facilities.
Flymake has been completely redesigned
Flymake now annotates arbitrary buffer regions, not just lines. It supports arbitrary diagnostic types, not just errors and warnings (see variable 'flymake-diagnostic-types-alist').
It also supports multiple simultaneous backends, meaning that you can check your buffer from different perspectives (see variable 'flymake-diagnostic-functions'). Backends for Emacs Lisp mode are provided.
The old Flymake behavior is preserved in the so-called "legacy backend", which has been updated to benefit from the new UI features.
(note: see Flycheck)
Emacs now uses double buffering to reduce flicker on the X Window System
A systemd user unit file is provided
Support for 24-bit colors on capable text terminals
The networking code has been reworked so that it's more asynchronous
The networking code has been reworked so that it's more asynchronous than it was (when specifying :nowait t in 'make-network-process'). How asynchronous it is varies based on the capabilities of the system, but on a typical GNU/Linux system the DNS resolution, the connection, and (for TLS streams) the TLS negotiation are all done without blocking the main Emacs thread. To get asynchronous TLS, the TLS boot parameters have to be passed in (see the manual for details).
Certain process oriented functions (like 'process-datagram-address') will block until socket setup has been performed. The recommended way to deal with asynchronous sockets is to avoid interacting with them until they have changed status to "run". This is most easily done from a process sentinel.
Emacs can scroll horizontally using mouse, touchpad, and trackbar
You can enable this by customizing 'mouse-wheel-tilt-scroll'. If you want to reverse the direction of the scroll, customize 'mouse-wheel-flip-direction'.
Emacs now supports optional display of line numbers in the buffer.
This is similar to what 'linum-mode' provides, but much faster and doesn't usurp the display margin for the line numbers. Customize the buffer-local variable 'display-line-numbers' to activate this optional display. Alternatively, you can use the 'display-line-numbers-mode' minor mode or the global 'global-display-line-numbers-mode'. When using these modes, customize 'display-line-numbers-type' with the same value as you would use with 'display-line-numbers'.
The 'occur' command can now operate on the region
(but don't miss the awesome helm-occur, swoop and helm-swoop packages)
Emacs no longer prompts about editing a changed file when the file's content is unchanged
Instead of only checking the modification time, Emacs now also checks the file's actual content before prompting the user.
File local and directory local variables are now initialized each time the major mode is set
not just when the file is first visited. These local variables will thus not vanish on setting a major mode.
A second dir-local file (.dir-locals-2.el) is now accepted
Connection-local variables can be used to specify local variables
with a value depending on the connected remote server
'switch-to-buffer-preserve-window-point' now defaults to t
Applications that call 'switch-to-buffer' and want to show the buffer at the position of its point should use 'pop-to-buffer-same-window' in lieu of 'switch-to-buffer'.
Emacsclient has a new option '-T' / '--tramp'
This helps with using a local Emacs session as the server for a remote emacsclient. With appropriate setup, one can now set the EDITOR environment variable on a remote machine to emacsclient, and use the local Emacs to edit remote files via Tramp. See the node "(emacs) emacsclient Options" in the user manual for the details.
Changes in packages and specialized modes
- Emacs 26.1 comes with Org v9.1.6.
- You can answer 'all' in 'dired-do-delete' to delete recursively all remaining directories without more prompts
- Dired supports wildcards in the directory part of the file names.
(no more need of find-name-dired for simple globbing)
- Users can now customize mouse clicks in Dired in a more flexible way.
The new command 'dired-mouse-find-file' can be bound to a mouse click and used to visit files/directories in Dired in the selected window. The new command 'dired-mouse-find-file-other-frame' similarly visits files/directories in another frame. You can write your own commands that invoke 'dired-mouse-find-file' with non-default optional arguments, to tailor the effects of mouse clicks on file names in Dired buffers.
- In wdired, when editing files to contain slash characters,
the resulting directories are automatically created
- 'W' is now bound to 'browse-url-of-dired-file', and is useful for
viewing HTML files and the like
In compilation mode, Messages from CMake are now recognized.
Emacs Web Browser (EWW)
- New 'M-RET' command for opening a link at point in a new eww buffer.
- A new 's' command for switching to another eww buffer via the minibuffer.
- A new command 'C' ('eww-toggle-colors') can be used to toggle
whether to use the HTML-specified colors or not. The user can also customize the 'shr-use-colors' variable.
A new library for creating and manipulating SVG images has been added. See the "(elisp) SVG Images" section in the ELisp reference manual for details.
Thumbnail generation is now asynchronous.
Access to Google Drive
New connection method "gdrive", which allows access to Google Drive onsite repositories.
Prog mode has some support for multi-mode indentation. This allows better indentation support in modes that support multiple programming languages in the same buffer, like literate programming environments or ANTLR programs with embedded Python code.
Enchant is now supported as a spell-checker
Enchant is a meta-spell-checker that uses providers such as Hunspell to do the actual checking. With it, users can use spell-checkers not directly supported by Emacs, such as Voikko, Hspell and AppleSpell, more easily share personal word-lists with other programs, and configure different spelling-checkers for different languages. (Version 2.1.0 or later of Enchant is required.)
For a full review of what's new in Emacs 26: https://www.masteringemacs.org/article/whats-new-in-emacs-26-1
See the NEWS file here: https://www.gnu.org/savannah-checkouts/gnu/emacs/news/NEWS.26.1