Archives For November 30, 1999

GNU Emacs editor released new 29.3 as an emergency bug-fix release this Sunday.

The new release intended to fix several security vulnerabilities described below:

  • Arbitrary Lisp code is no longer evaluated as part of turning on Org mode. This is for security reasons, to avoid evaluating malicious Lisp code.
  • New buffer-local variable ‘untrusted-content’. When this is non-nil, Lisp programs should treat buffer contents with extra caution.
  • Gnus now treats inline MIME contents as untrusted. To get back previous insecure behavior, ‘untrusted-content’ should be reset to nil in the buffer.
  • LaTeX preview is now by default disabled for email attachments. To get back previous insecure behavior, set the variable org--latex-preview-when-risky to a non-nil value.
  • Org mode now considers contents of remote files to be untrusted. Remote files are recognized by calling file-remote-p.

Continue Reading…

GNU Emacs text editor released version 29.4 on Jun 22, 2024. Here’s how to install it in Ubuntu 24.04, Ubuntu 23.10, Ubuntu 22.04, and Ubuntu 20.04

The new Emacs 29.2 is an emergency bugfix release intended to fix the security vulnerability. Arbitrary shell commands are no longer run when turning on Org mode. This is for security reasons, to avoid running malicious commands.

You may check the NEWS page for more changes. For the Emacs 29.1 release, it features:

  • Supports “pure GTK” (PGTK) build
  • Uses XInput 2 on X for input events
  • Uses tree-sitter parsers for several programming modes
  • Includes LSP client called Eglot
  • Includes the use-package package
  • Can access SQLite databases using sqlite3 library
  • Can display WebP images using libwebp library
  • Faster editing of files with very long lines
  • Better support for drag-and-drop on X
  • Pixel-precise scrolling with touchpad support
  • Enhanced support for editing and displaying Emoji
  • Support for Unicode 15.0 and many new scripts
  • Many enhancements of help and completion commands
  • Numerous enhancements to Image Dired
  • Double-buffering on MS-Windows

How to install Emacs (29.4 Updated) in Ubuntu:

GNU Emacs editor is easy to install in Ubuntu Linux with few different ways. Choose any one that you prefer!

Option 1: Snap package

For Ubuntu 20.04, Ubuntu 22.04 and Ubuntu 24.04, simply launch Ubuntu Software (or App Center for 24.04), then search and install GNU Emacs from Snap Store. Though, it’s a Snap package runs in sandbox environment.

The snap package so far provides version 29.4 for amd64, arm64, ppc64el, riscv64 platforms, and old versions for armhf, i386, and s390x.

For choice, user can run command in terminal (Ctrl+Alt+T) instead to install from command line:

snap install emacs --classic

The snap package installs updates automatically. To check updates manually, use command:

snap refresh emacs

Option 2: Ubuntu PPA

For those prefer the classic .deb package format, Debian upstream has built the new release package. And, I backported it into this PPA with support for for Ubuntu 22.04, Ubuntu 20.04, Ubuntu 23.10 and Ubuntu 24.04 on amd64, arm64 and armhf platforms.

NOTE: The PPA package is just no-change backport from 24.10 without testing! It may or may not work in your case!

First, press Ctrl+Alt+T on keyboard to open terminal. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:ubuntuhandbook1/emacs

Type user password (no asterisk feedback) when it asks and hit Enter to continue.

Then, either open Software Updater (Update Manager) to upgrade the package if an old version was installed.

Or, run the command below instead to install/update the Emacs package:

sudo apt install emacs emacs-common

Linux Mint user needs to run sudo apt update first to manually refresh package cache.

Option 3: Flatpak package

Emacs is also available to install as Flatpak package, which also runs in sandbox environment and supports amd64 and arm64 platforms.

Linux Mint 21 and Fedora 38/39 (with 3rd party repository enabled) users can search for and install the package from either Software Manager or GNOME Software.

While Ubuntu users can run the 2 commands below one by one to get the package:

  • First, run command to enable Flatpak support:
    sudo apt install flatpak

  • Then, run command to install Emacs Flatpak package:
    flatpak install https://dl.flathub.org/repo/appstream/org.gnu.emacs.flatpakref

If this is the first Flatpak package you installed on the system, then you may need a log out and back in to make app icon visible in system menu.

And, to update the Flatpak package, use command:

flatpak update org.gnu.emacs

Uninstall Emacs 29.4

For the snap package, also use Ubuntu Software to remove it. Or, run command in terminal:

sudo snap remove --purge emacs

For the package installed from Ubuntu PPA, open terminal (Ctrl+Alt+T) and run command:

  • purge the PPA as well as downgrade Emacs to stock version:
    sudo apt install ppa-purge && sudo ppa-purge ppa:ubuntuhandbook1/emacs
  • Or, simply remove Emacs by running command:
    sudo apt remove --autoremove emacs emacs-common

    As well, remove the PPA either from “Software & Updates -> Other Software” or by running command:

    sudo add-apt-repository --remove ppa:ubuntuhandbook1/emacs

To uninstall the Emacs Flatpak package, run command in terminal:

flatpak uninstall --delete-data org.gnu.emacs

Also run flatpak uninstall --unused to clear useless run-time libraries.

GNU Emacs text editor 27.2 was released as a new maintenance release.

Emacs 27.2 is a bug-fix release with no new features. According to the changelog, it changed the behavior of the user option ‘resize-mini-frames‘. If set to a non-nil value which isn’t a function, resize the mini frame using the new function ‘fit-mini-frame-to-buffer’ which won’t skip leading or trailing empty lines of the buffer.

Emacs now ignores modifier keys when IME input is used. By default, pressing Ctrl, Shift, and Alt keys while using IME input will no longer apply the modifiers to the produced characters, as there are IMEs which use keys with modifiers to input some characters. Customize the variable ‘w32-ignore-modifiers-on-IME-input’ to nil to get back the old behavior.

And the user option ‘tramp-completion-reread-directory-timeout’ is now obsolete.

How to Install Gnu Emacs in Ubuntu:

For those prefer the classic apt repository, keep an eye on the Kevin Kelley’s PPA, though it’s not been updated at the moment of writing.

For those do not like Flatpak and Snap packages, here’s also a step by step guide building Emacs from source tarball.

Emacs is also available as the containerized Snap package, which is however at version 27.1 at the moment.

The community maintained Flatpak package has built Emacs 27.2 for Linux users. Ubuntu 20.04 and higher users can open terminal and run following commands one by one to install it:

  • Install flatpak framework if you don’t have it:
    sudo apt install flatpak

  • Add flathub repository which hosts the flatpak packages:
    flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

  • Finally install Emacs flatpak package:
    flatpak install flathub org.gnu.emacs

(Optional) To remove the flatpak package, simply run command in terminal:

flatpak uninstall org.gnu.emacs

GNU Emacs text editor 26.3 was released last night. Here’s how to install it in Ubuntu 18.04 and higher.

Emacs 26.3 is a maintenance release contains following changes:

  • New GPG key for GNU ELPA package signature checking.
  • New option ‘help-enable-completion-auto-load’, allows disabling the new feature introduced in Emacs 26.1 which loads files during completion of ‘C-h f’ and ‘C-h v’ according to ‘definition-prefixes’.
  • Emacs now supports the new Japanese Era name.

How to Install Emacs 26.3 in Ubuntu 18.04 and higher:

Emacs 26.3 has made into Snap Store as containerized snap package. For Ubuntu 18.04 and higher, simply search for and install it via Ubuntu Software.

For those prefer native Ubuntu .deb package, this PPA repository contains the most recent Emacs packages for Ubuntu 16.04, Ubuntu 18.04 and higher. Emacs 26.3 packages should be made into the PPA in a few days.

This quick tutorial shows how to install the latest GNU Emacs 26.1 in Ubuntu 16.04, Ubuntu 18.04, Ubuntu 18.10, Linux Mint 18,x, 19.x, and their derivatives.

While Ubuntu ships old versions in its universe repositories and don’t provide future updates, a stable PPA repository maintained by Kevin Kelley contains the 26.1 packages with mailutils, systemd, and xwidgets support for all current Ubuntu releases.

1. Open terminal either via Ctrl+Alt+T keyboard shortcut or by searching for “Terminal” from start menu. When it opens, run command to add the PPA:

sudo add-apt-repository ppa:kelleyk/emacs

Type user password (no asterisk feedback due to security reason) when prompts and hit Enter.

2. Then install Emacs26 either via Synaptic package manager, or by running following commands one by one in terminal:

sudo apt update

sudo apt install emacs26

For text-only interface, replace emacs26 with emacs26-nox in the last command. And Ubuntu 18.04 and higher can skip apt update command.

Once installed, open emacs from your system application launcher and enjoy!

How to Remove:

To remove Emacs26, open terminal and run commands:

sudo apt remove --autoremove emacs26 emacs26-nox

The PPA can be removed by going to Software & Updates -> Other Software tab.

How to Install GNU Emacs 25.1 in Ubuntu 16.04

Last updated: September 18, 2016

emacs-icon245

GNU Emacs text editor finally reached the 25.1 release last night. Here’s how you can install it in Ubuntu 16.04 and Ubuntu 16.10.

Emacs 25.1 release highlights:

  • Emacs can now load shared/dynamic libraries (modules)
  • Experimental support for Cairo drawing
  • Enhanced network security (TLS/SSL certificate validity and the like)
  • New minor mode ‘electric-quote-mode’ for using curved quotes as you type
  • Character folding support in isearch.el
  • Xwidgets: a new feature for embedding native widgets inside Emacs buffers
  • New and improved facilities for inserting Unicode characters

gnu-emacs-25-1

How to install Emacs 25.1 in Ubuntu 16.04:

Besides installing the latest snapshot via the daily build PPA, it’s easy to build the 25.1 stable release by following the steps below one by one:

Remove previous Emacs if any before getting started:

1. Open terminal (Ctrl+Alt+T) and run command to install build tools:

sudo apt install build-essential checkinstall

Type in your password (no visual feedback) when it asks and hit Enter.

install-build-tools

2. Then install the build dependencies via command:

sudo apt-get build-dep emacs24

emacs-build-deps

1. Emacs 24 and 25 use the same build dependencies.

2. For those who have upgraded Intel driver using Intel Graphics Update Tool for Linux, like me, you won’t be able to install these dependencies. You need to downgrade the intel graphcs driver first.

3. Now download the source at ftp.gnu.org/gnu/emacs/, then extract:

emacs25-source

4. Open terminal and navigate to the “emacs-25.1” folder via command (or select “Open in terminal” from its context menu):

cd ~/Downloads/emacs-25.1

navigate-emacs-folder

5. In the same terminal window, once you’re in the source folder, run the commands below one by one:

./configure

make

For the default GTK version in Ubuntu 16.04, there’s a known bug for multiple displays.

6. Finally use checkinstall command to create .deb and install Emacs 25.1:

sudo checkinstall

While running the command, answer on screen questions, e.g., install docs, type package description, change package name, version, etc.

Emacs checkinstall

Once done, Emacs 25.1 is installed on your system and you can remove it anytime by running the command in the prompt with sudo privilege:

emacs-install-success

In my case it’s:

sudo dpkg -r emacs-25

And the last command create a .deb package in the source folder, and it can be used in another Ubuntu machine to install Emacs 25.1 (need to manually install dependencies via step 2).

Finally, run command emacs to launch the text editor, or launch it from Unity Dash (App Launcher) at next login (or next boot).

Emacs 24.4 in Ubuntu 14.04

NOTE: This post is outdated. Please read this new tutorial about compiling GNU Emacs from the source.

GNU Emacs has finally reached version 24.4 with many new features and improvements. The most notable is that the text editor brings a built-in web browser.

GNU Emacs is the most popular and most ported Emacs text editor, and it was created by Richard Stallman for the GNU Project.

The latest release Emacs 24.4 was released a few hours ago. The new release features:

  • A built-in web browser (M-x eww)
  • Improved multi-monitor and fullscreen support
  • “Electric” indentation is enabled by default
  • Support for saving and restoring the state of frames and windows
  • Emacs Lisp packages can now be digitally signed
  • A new “advice” mechanism for Emacs Lisp
  • File notification support
  • Pixel-based resizing for frames and windows
  • Support for menus in text terminals
  • A new rectangular mark mode (C-x SPC)

Emacs 24.4 in Ubuntu 14.04

How to Install Emacs 24.4 in Ubuntu:

At the moment of writing this tutorial, there’s no PPA repository that contains Emacs 24.4. Fortunately, it’s not hard to build it from the source tarball. I’ve done it successfully in 64-bit Ubuntu 14.04 LTS. Below steps will show you how:

1. If have the old Emacs 24.3 installed, you may first remove it from Ubuntu Software Center so that you can install the new version over it.

2. Press Ctrl+Alt+T on keyboard to open terminal, or open it from the Unity Dash.

Open Terminal to run commands

3. Run command below to install the build-essential:

sudo apt-get install build-essential

4. Install the required dependencies:

sudo apt-get build-dep emacs

While the installing process, you’ll be asked to configure the Postfix.

5. Now download Emacs 24.4 from its official FTP download page.

Emacs FTP download Page

6. Extract the source and go into the result folder in terminal:

cd ~/Downloads && tar -xf emacs-24.4.tar.* && cd emacs-24.4

7. Finally compile the package by running commands below one by one.

./configure

make

sudo make install

Once done, you should be able to launch Emacs by running emacs or emacs-24.4 in terminal and lock the shortcut to the Unity Launcher.

To create a launcher for Emacs 24.4. Thanks to Emad Khoury, run command to create a .desktop file and edit it with Gedit text editor:

sudo gedit /usr/share/applications/Emacs-24.desktop

When the file opens, paste below into it and save the file.

[Desktop Entry]
Version=1.0
Name=Emacs-24
Exec=env UBUNTU_MENUPROXY=0 /usr/local/bin/emacs
Terminal=false
Icon=emacs
Type=Application
Categories=IDE
X-Ayatana-Desktop-Shortcuts=NewWindow
[NewWindow Shortcut Group]
Name=New Window
TargetEnvironment=Unity

Depends on where you install Emacs 24, you may replace the value of Exec and Icon to the path to executable and shortcut icon file.

gnu emacsThis tutorial shows how to install the latest stable GNU Emacs (so far, it’s 24.3) in Ubuntu 13.04 Raring, Ubuntu 12.10, Ubuntu 12.04 Precise and their deviratives such as Linux Mint and Elementary OS Luna via PPA.

Highlights of Emacs 24.3 include:

  • Generalized variables are now in core Emacs Lisp.
  • An update for the Common Lisp emulation library.
  • A new major mode for Python.

There are many more changes; for a summary see the etc/NEWS file, which you can view from Emacs with `C-h n’.

Install / Upgrade Emacs 24.3 via PPA:

Press Ctrl+Alt+T on your keyboard to open terminal. When it opens, run below command to add the PPA:

sudo add-apt-repository ppa:cassou/emacs

Then update package lists on your system:

sudo apt-get update

After that, you can install or upgrade via synaptic package manager, which is available in Ubuntu Software Center. Or just run below command:

sudo apt-get install emacs24

Enjoy!