Customizing Emacs

Emacs is an extensible, customizable, real-time display editor. At the core of Emacs is the Emacs Lisp interpreter, in which the majority of Emacs' built-in functionality and extensions are implemented.

The QNX Developer Desktop comes with a basic Emacs configuration located at ~/.config/emacs/init.el, which is shown below:

; By default Emacs inserts tabs in place of multiple spaces. Turn this off.
(setq-default indent-tabs-mode nil)
 
; Set default tab width to 4
(setq-default tab-width 4)
 
; Set default tab width to 4 in files of language similar to C
(setq c-basic-offset 4)

To start Emacs, either run emacs from the Terminal, or launch it from the Applications tab: Applications > Development > Emacs.

To create a client mode shortcut, there is a file in ~/.local/share/applications/ called emacsclient.desktop. Edit this file and remove the line NoDisplay=true:

--- a.local/share/applications/emacsclient.desktop
+++ b.local/share/applications/emacsclient.desktop
@@ -6,7 +6,6 @@ MimeType=text/english;text/plain;text/x-makefile;text/x-c++hdr;text/x-c++src;tex
 Exec=sh -c "if [ -n \\"\\$*\\" ]; then exec /usr/bin/emacsclient --alternate-editor= --reuse-frame \\"\\$@\\"; else exec emacsclient --alternate-editor= --create-frame; fi" sh %F
 Icon=emacs
 Type=Application
-NoDisplay=true
 Terminal=false
 Categories=Development;Utility;TextEditor;
 StartupNotify=true

Emacs looks for it's configuration entrypoint in ~/.emacs, ~/.emacs.el, ~/.emacs.d/init.el, and ~/.config/emacs/init.el.

For more in-depth configurations, refer to the emacs-from-scratch repository: https://github.com/daviwil/emacs-from-scratch.

Page updated: