2023-12-03 18:57:36 +00:00
#+title : Emacs Graphical Display Configuration
#+author : Howard X. Abrams
#+date : 2020-09-10
#+tags : emacs macos
2021-11-02 00:27:14 +00:00
A literate programming file to configure the Emacs UI.
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp :exports none
2022-03-09 18:45:37 +00:00
;;; ha-display --- Emacs UI configuration. -*- lexical-binding: t; -* -
;;
2023-02-23 17:35:36 +00:00
;; © 2020-2023 Howard X. Abrams
2022-06-18 00:25:47 +00:00
;; Licensed under a Creative Commons Attribution 4.0 International License.
2022-03-09 18:45:37 +00:00
;; See http://creativecommons.org/licenses/by/4.0/
;;
;; Author: Howard X. Abrams <http://gitlab.com/howardabrams >
;; Maintainer: Howard X. Abrams
;; Created: September 10, 2020
;;
;; This file is not part of GNU Emacs.
;;
;; *NB:* Do not edit this file. Instead, edit the original literate file at:
;; ~/other/hamacs/ha-display.org
;; Using `find-file-at-point', and tangle the file to recreate this one .
;;
;;; Code:
2022-06-18 00:25:47 +00:00
#+end_src
2022-04-01 18:35:27 +00:00
2024-02-26 05:21:41 +00:00
Let's turn off the menu and other settings:
#+begin_src emacs-lisp
(when (display-graphic-p)
(context-menu-mode 1)
(tool-bar-mode -1)
(scroll-bar-mode -1)
(horizontal-scroll-bar-mode -1)
(setq visible-bell 1
frame-inhibit-implied-resize t))
#+end_src
2022-04-01 18:35:27 +00:00
And let’ s make this Emacs look more like a fancy IDE with [[https://github.com/domtronn/all-the-icons.el ][all-the-icons ]]:
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2022-04-01 18:35:27 +00:00
(use-package all-the-icons
:if (display-graphic-p))
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
* Mode Line
Let's install and load some of packages from the [[https://github.com/hlissner/doom-emacs ][Doom Emacs ]] project, like [[https://github.com/seagle0128/doom-modeline ][doom-modeline ]] and maybe the themes:
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-02 00:27:14 +00:00
(use-package doom-modeline
:init
(setq doom-modeline-minor-modes nil
doom-modeline-buffer-encoding nil
2023-11-06 17:36:06 +00:00
doom-modeline-major-mode-color-icon t
doom-modeline-buffer-state-icon t
doom-modeline-buffer-modification-icon t
doom-modeline-modal 'evil
doom-modeline-lsp-icon t
2021-11-02 00:27:14 +00:00
doom-modeline-percent-position nil)
2023-11-06 17:36:06 +00:00
(doom-modeline-mode 1))
2022-06-18 00:25:47 +00:00
#+end_src
2024-06-04 01:40:20 +00:00
* Window Dimmer
2024-02-20 19:08:52 +00:00
To make the active window /more noticeable/ , we /dim/ the in-active windows with the [[https://github.com/gonewest818/dimmer.el ][dimmer project ]].
2024-06-04 01:40:20 +00:00
2024-02-20 19:08:52 +00:00
#+begin_src emacs-lisp
(use-package dimmer
:custom
(dimmer-adjustment-mode :foreground)
:config
(dimmer-configure-which-key) ; Do not dim these special windows
(dimmer-configure-hydra)
(dimmer-configure-magit)
(dimmer-mode t))
#+end_src
As an interesting alternative, check out the [[https://www.emacs.dyerdwelling.family/emacs/20240208164549-emacs-selected-window-accent-mode-now-on-melpa/ ][selected-window-accent ]] project.
2022-02-26 01:13:44 +00:00
* Find the Bloody Cursor
2023-09-07 22:44:08 +00:00
Large screen, lots of windows, so where is the cursor? While I used to use =hl-line+= , I found that the prolific [[https://protesilaos.com/ ][Protesilaos Stavrou ]] [[https://protesilaos.com/codelog/2022-03-14-emacs-pulsar-demo/ ][introduced his Pulsar project ]] is just what I need. Specifically, I might /loose the cursor/ and need to have it highlighted (using ~F8~ ), but also, this automatically highlights the cursor line with specific /actions/ , like changing windows.
2022-02-26 01:13:44 +00:00
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2022-03-15 16:15:24 +00:00
(use-package pulsar
2023-04-01 23:35:00 +00:00
:straight (:host github :repo "protesilaos/pulsar")
2022-03-15 16:15:24 +00:00
:custom
2023-09-07 22:44:08 +00:00
(pulsar-face 'pulsar-generic)
2024-06-04 01:40:20 +00:00
(pulsar-delay 0.15)
2024-02-09 20:05:13 +00:00
:config
2024-02-20 19:08:52 +00:00
(dolist (built-in-function '(recenter-top-bottom move-to-window-line-top-bottom reposition-window
bookmark-jump other-window delete-window delete-other-windows
forward-page backward-page scroll-up-command scroll-down-command
ha-new-window tab-new tab-close tab-next org-next-visible-heading
org-previous-visible-heading org-forward-heading-same-level
org-backward-heading-same-level outline-backward-same-level
outline-forward-same-level outline-next-visible-heading
outline-previous-visible-heading outline-up-heading))
(add-to-list 'pulsar-pulse-functions built-in-function))
2024-02-09 20:05:13 +00:00
(when (fboundp 'winner-undo)
(add-to-list 'pulsar-pulse-functions 'winner-undo)
(add-to-list 'pulsar-pulse-functions 'winner-redo))
(when (fboundp 'winum-select-window-1)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-1)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-2)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-3)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-4)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-5)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-6)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-7)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-8)
(add-to-list 'pulsar-pulse-functions 'winum-select-window-9))
(when (fboundp 'aw-delete-window)
2024-02-20 19:08:52 +00:00
(add-to-list 'pulsar-pulse-functions 'aw-move-window)
(add-to-list 'pulsar-pulse-functions 'aw-swap-window)
(add-to-list 'pulsar-pulse-functions 'aw-copy-window)
(add-to-list 'pulsar-pulse-functions 'aw-split-window-vert)
(add-to-list 'pulsar-pulse-functions 'aw-split-window-horz)
(add-to-list 'pulsar-pulse-functions 'aw-split-window-fair)
(add-to-list 'pulsar-pulse-functions 'aw-delete-window))
2024-02-09 20:05:13 +00:00
(when (fboundp 'evil-window-right)
2024-02-20 19:08:52 +00:00
(add-to-list 'pulsar-pulse-functions 'evil-window-right)
(add-to-list 'pulsar-pulse-functions 'evil-window-left)
(add-to-list 'pulsar-pulse-functions 'evil-window-up)
(add-to-list 'pulsar-pulse-functions 'evil-window-down))
2024-02-09 20:05:13 +00:00
(pulsar-global-mode 1))
2022-06-18 00:25:47 +00:00
#+end_src
2024-02-20 19:08:52 +00:00
And if I can’ t find the cursor, and don’ t want to move it to see it, I can hit a key:
#+begin_src emacs-lisp
(use-package pulsar
:bind ("<f8 >" . pulsar-pulse-line))
#+end_src
2021-11-02 00:27:14 +00:00
* Font Configuration
Am I ever really ever satisfied with any font? I regularly change my font based on the monospace du jour... [[http://blogs.adobe.com/typblography/2012/09/source-code-pro.html ][Source Code Pro ]] is attractive, and has been a staple on every programmers' screen. However, we all want ligatures, [[https://github.com/i-tu/Hasklig ][Hasklig ]] is a nice font that is thinner and easier to read than [[https://github.com/tonsky/FiraCode ][Fira ]], but [[https://typeof.net/Iosevka/ ][Iosevka ]] seems to have it all. Oh, Microsoft just gave us [[https://docs.microsoft.com/en-us/windows/terminal/cascadia-code ][Cascadia ]] and that seems shiny. However, the [[https://github.com/ryanoasis/nerd-fonts ][Nerd Font project ]] adds the ligatures as well as all the other niceties to a font.
2022-09-12 05:28:09 +00:00
2021-11-02 00:27:14 +00:00
** Choosing a Font
I stole the following idea from [[https://protesilaos.com/dotemacs/#h:9035a1ed-e988-4731-89a5-0d9e302c3dea ][Protesilaos Stavrou's dotfile configuration ]], and the following should minimally be /readable/ :
2022-09-12 05:28:09 +00:00
#+begin_example
2021-11-02 00:27:14 +00:00
| Similarities | Regular |
|--------------+----------------------------|
| ()[]{}<>«»‹› | ABCDEFGHIJKLMNOPQRSTUVWXYZ |
| 6bB8& | abcdefghijklmnopqrstuvwxyz |
| 0ODdoaoOQGC | 0123456789 |
| I1tilIJL | ~!@#$%^&*+ |
| !¡ij | `'"‘’“”.,;:… |
| 5$§SsS5 | ()[]{}—-_=<>/\ |
| 17ZzZ2 | ΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩ |
| 9gqpG6 | αβγδεζηθικλμνξοπρστυφχψω |
| hnmMN | |
| uvvwWuuwvy | |
2022-09-12 05:28:09 +00:00
| x× X | |
| .,·°% | |
| ¡!¿? | |
| :; | |
| `''"‘’“” | |
| —-~≈=≠+*_ | |
| …⋯ | |
2021-11-02 00:27:14 +00:00
| ... | |
2022-09-12 05:28:09 +00:00
#+end_example
2021-11-02 00:27:14 +00:00
The following is from [[https://source-foundry.github.io/Hack/font-specimen.html ][Hack's website ]]:
2022-06-18 00:25:47 +00:00
#+begin_src c
2021-11-02 00:27:14 +00:00
// The four boxing wizards jump
#include <stdio.h > // <= quickly.
int main(int argc, char **argv) {
long il1[]={1-2/3.4,5+6= =7/8};
int OxFaced=0xBAD||"[{(CQUINE";
unsigned O0,l1,Z2,S5,G6,B8__XY;
printf("@$Hamburgefo%c`",'\n');
return ~7&8^9?0:l1|!"j->k+=*w";
}
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
To install a font, I use the following command on my Mac:
2022-06-18 00:25:47 +00:00
#+begin_src sh
2021-11-02 00:27:14 +00:00
brew tap homebrew/cask-fonts
brew install --cask font-hack-nerd-font
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
** Specifying a Font
2022-09-12 05:28:09 +00:00
My /current/ favorite font is actually the top list of fonts that may be installed on my system:
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-12 05:05:41 +00:00
(defvar ha-fixed-font
2021-11-02 00:27:14 +00:00
(when window-system
2022-09-12 05:28:09 +00:00
(or
(seq-first
(seq-filter (lambda (font) (when (x-list-fonts font) font))
2023-03-24 17:58:22 +00:00
'("CaskaydiaCove Nerd Font" ; finally found it
2023-12-20 04:13:33 +00:00
;; funky font with litagures and a dotted 0
"Cascadia Code PL"
;; clean font, but no litagures!?
"Hack Nerd Font"
2023-03-24 17:58:22 +00:00
"FiraCode Nerd Font" ; has litagures
2022-09-12 05:28:09 +00:00
"Cousine Nerd Font"
"Iosevka Nerd Font"
"FantasqueSansMono Nerd Font"
"Monoid Nerd Font"
"Hasklig"
"Source Code Pro")))
"monospaced"))
"My fixed width font based on what I have installed.")
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
2022-09-12 05:28:09 +00:00
I probably don't need to have such a ranking system, as chances are good I have them all installed.
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2022-09-12 05:28:09 +00:00
(defvar ha-variable-font
(when window-system
(or
(seq-first
(seq-filter (lambda (font) (when (x-list-fonts font) font))
2024-02-23 00:57:58 +00:00
'("SN Pro" ; https://supernotes.app/open-source/sn-pro
"Literata" ; Clean, readable with litagures
2023-12-20 04:13:33 +00:00
;; Next best can be downloaded here:
;; https://fontesk.com/xcharter-typeface/
"XCharter"
2023-03-24 17:58:22 +00:00
"Charter"
2023-12-20 04:13:33 +00:00
;; Interesting idea: "Iosevka Comfy Motion Duo"
2023-02-01 16:09:01 +00:00
"Serif")))
(warn "Cannot find a Serif Font. Install Source Sans Pro."))))
(defvar ha-variable-header-font
(when window-system
(or
(seq-first
(seq-filter (lambda (font) (when (x-list-fonts font) font))
2024-02-23 00:57:58 +00:00
'("SN Pro" "Overpass" "DejaVu Sans"
2023-12-20 04:13:33 +00:00
"Verdana" "Overpass"
"Source Sans Pro"
"Lucida Grande"
"Sans Serif")))
2022-09-12 05:28:09 +00:00
(warn "Cannot find a Sans Serif Font. Install Source Sans Pro."))))
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
2022-03-18 20:50:40 +00:00
Simple function that gives me the font information based on the size I need. Recently updated after reading [[https://protesilaos.com/codelog/2020-09-05-emacs-note-mixed-font-heights/ ][this essay ]], as I wanted my =fixed-pitch= to scale along with my =variable-pitch= font.
2021-11-02 00:27:14 +00:00
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-12 05:05:41 +00:00
(defun ha-set-favorite-font-size (size)
2022-03-18 20:50:40 +00:00
"Set the default font size as well as equalize the fixed and variable fonts."
2021-11-12 05:05:41 +00:00
(let ((fav-font (format "%s-%d" ha-fixed-font size)))
2022-03-18 20:50:40 +00:00
(set-face-attribute 'default nil :font fav-font)
(set-face-attribute 'fixed-pitch nil :family ha-fixed-font :inherit 'default :height 1.0)
2022-04-09 16:03:34 +00:00
(set-face-attribute 'variable-pitch nil :family ha-variable-font :inherit 'default :height 1.2)))
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
2022-03-18 20:50:40 +00:00
Define /interactive/ functions to quickly adjusting the font size based on my computing scenario:
2021-11-02 00:27:14 +00:00
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2022-01-03 06:42:22 +00:00
(defun ha-mac-monitor-fontsize ()
"Quickly set reset my font size when I connect my laptop to a monitor on a Mac."
(interactive)
2023-12-13 19:25:48 +00:00
(ha-set-favorite-font-size 13))
2021-11-02 00:27:14 +00:00
2022-01-03 06:42:22 +00:00
(defun ha-linux-monitor-fontsize ()
"Quickly set reset my font size when I connect my laptop to a monitor on Linux."
(interactive)
(ha-set-favorite-font-size 12))
2021-11-02 00:27:14 +00:00
2022-01-03 06:42:22 +00:00
(defun ha-mac-laptop-fontsize ()
"Quickly set reset my font size when I disconnect my laptop to a monitor from a Mac."
(interactive)
(ha-set-favorite-font-size 32))
2021-11-02 00:27:14 +00:00
2022-01-03 06:42:22 +00:00
(defun ha-linux-laptop-fontsize ()
"Quickly set reset my font size when I disconnect my laptop to a monitor from Linux."
(interactive)
2023-10-13 03:59:53 +00:00
(ha-set-favorite-font-size 10))
2022-01-03 06:42:22 +00:00
(defun ha-imac-fontsize ()
"Quickly set reset my font size when I am on my iMac."
(interactive)
(ha-set-favorite-font-size 16))
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-02 00:27:14 +00:00
Which font to choose?
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-12 05:05:41 +00:00
(defun font-monitor-size-default ()
"Set the default size according to my preference."
(interactive)
2022-01-03 06:42:22 +00:00
(cond
((eq system-type 'gnu/linux) (ha-linux-monitor-fontsize))
((s-starts-with? "imac" system-name) (ha-imac-fontsize))
(t (ha-mac-monitor-fontsize))))
2021-11-12 05:05:41 +00:00
(defun font-laptop-size-default ()
"Set the default size according to my preference."
(interactive)
(if (eq system-type 'gnu/linux)
(ha-linux-laptop-fontsize)
(ha-mac-laptop-fontsize)))
(font-monitor-size-default)
2022-06-18 00:25:47 +00:00
#+end_src
2024-02-26 21:18:05 +00:00
** Mixed Pitch
[[https://github.com/emacsmirror/mixed-pitch ][Mixed pitch ]] is a minor mode that enables mixing fixed-pitch (also known as fixed-width or monospace) and variable-pitch (AKA “proportional”) fonts. It tries to be smart about which fonts get which face.
#+begin_src emacs-lisp
2024-06-04 05:14:37 +00:00
(use-package mixed-pitch
:straight (:host github :repo "jabranham/mixed-pitch")
:hook (text-mode . mixed-pitch-mode))
2024-02-26 21:18:05 +00:00
#+end_src
2021-11-12 05:05:41 +00:00
** Zooming or Increasing Font Size
Do we want to increase the size of font in a single window (using =text-scale-increase= ), or globally (using my new =font-size-increase= )?
Increase or decrease the set size of the face:
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-12 05:05:41 +00:00
(defun font-size-adjust (delta)
"Adjust the current frame's font size.
DELTA would be something like 1 or -1."
(interactive "nFont size difference: ")
(when (null delta) (setq delta 1))
(let* ((font-family (face-attribute 'default :font))
(font-size (font-get font-family :size))
(new-size (+ delta font-size)))
(ha-set-favorite-font-size new-size)))
(defun font-size-increase ()
"Increase the `default' font size of all frames."
(interactive)
(font-size-adjust 1))
(defun font-size-decrease ()
"Decrease the `default' font size of all frames."
(interactive)
(font-size-adjust -1))
2022-06-18 00:25:47 +00:00
#+end_src
2021-11-12 05:05:41 +00:00
And some keybindings to call them:
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
2021-11-12 05:05:41 +00:00
(global-set-key (kbd "s-+") 'font-size-increase)
(global-set-key (kbd "s-=") 'font-size-increase)
(global-set-key (kbd "s--") 'font-size-decrease)
2022-06-18 00:25:47 +00:00
#+end_src
2024-06-04 05:14:37 +00:00
* Themes
2024-07-02 18:40:25 +00:00
One does get used to a particular collection of colors. After happily using Steve Purcell’ s port of the Tomorrow theme for many years, I decided I needed a change. First, I want Emacs to be less garish:
2024-06-04 05:14:37 +00:00
#+begin_src emacs-lisp
2024-07-02 18:40:25 +00:00
(use-package doom-themes
2024-06-04 05:14:37 +00:00
:config
2024-07-02 18:40:25 +00:00
;; Global settings (defaults)
(setq doom-themes-enable-bold t ; if nil, bold is universally disabled
doom-themes-enable-italic t) ; if nil, italics is universally disabled
(load-theme 'doom-wilmersdorf t))
2024-06-04 05:14:37 +00:00
#+end_src
Most of the time, Emacs is on my desk is a darkened room, so I choose the dark theme:
#+begin_src emacs-lisp
(defun laptop-inside ()
"Customize the theme for inside programming."
(interactive)
2024-07-02 18:40:25 +00:00
(load-theme 'doom-wilmersdorf t)
(ignore-errors
2024-07-05 06:20:11 +00:00
;; TODO: File in progress!
(load-file "~/other/hamacs/ha-theme-dark.el"))
2024-06-04 05:14:37 +00:00
(ha-word-processor-fonts))
#+end_src
But, when feeling adventurous, I /sometimes/ take my laptop outside:
#+begin_src emacs-lisp
(defun laptop-in-the-sun ()
"Customize the theme for outside programming."
(interactive)
2024-07-02 18:40:25 +00:00
(load-theme 'doom-ayu-light t)
(set-face-attribute 'default nil :foreground "#0c0906")
(set-face-attribute 'region nil :background "orange")
(set-face-attribute 'org-block nil :background "#f2f1ef")
(set-face-attribute 'org-block-begin-line nil :foreground "#999491" :background "#e5e4e3")
2024-06-04 05:14:37 +00:00
(ha-word-processor-fonts))
#+end_src
I’ ve been playing around with making the current window more pronounced.
This isn’ t needed as much with the [[*Window Dimmer ][Window Dimmer ]] feature, but if I do, this would be the settings:
#+begin_src emacs-lisp :tangle no
(set-face-attribute 'mode-line nil :background "#cccccc")
(set-face-attribute 'mode-line-inactive nil :background "#888888")
#+end_src
Oh, and turn off the line highlighting:
#+begin_src emacs-lisp
(global-hl-line-mode -1)
#+end_src
2024-08-08 05:20:26 +00:00
And of course, the default is /inside/ where it is dark and safe. Let’ s also wait til the world settles down before calling this.
2024-06-04 05:14:37 +00:00
#+begin_src emacs-lisp
2024-08-08 05:20:26 +00:00
(progn
(sit-for 2)
(laptop-inside))
2024-06-04 05:14:37 +00:00
#+end_src
2024-07-02 18:40:25 +00:00
** Highlight Task Labels
2024-06-04 18:47:54 +00:00
In code, if you drop a specific /text/ labels, we can highlight them with [[https://github.com/tarsius/hl-todo ][hl-todo package ]]:
#+begin_src emacs-lisp
(use-package hl-todo
:straight (:host github :repo "tarsius/hl-todo")
:init
(setq hl-todo-keyword-faces
2024-07-02 18:40:25 +00:00
`(("TODO" . ,(face-foreground 'warning))
("FIXME" . ,(face-foreground 'error))
("NOTE" . ,(face-foreground 'success))))
2024-06-04 18:47:54 +00:00
(global-hl-todo-mode 1))
#+end_src
This means that comments like the following visually standout:
2024-07-02 18:40:25 +00:00
TODO Attempt to validate that this shows something I need to do.
2024-06-04 18:47:54 +00:00
Suggests to bind some keys to =hl-todo-next= in order to jump from tag to tag, but the [[https://github.com/liuyinz/consult-todo ][consult-todo ]] implements that in a more visual way:
#+begin_src emacs-lisp
(use-package consult-todo
:init
(defconst consult-todo--narrow
'((?t . "TODO")
(?f . "FIXME")
(?n . "NOTE"))
"Mapping of narrow and keywords.")
:general (:states 'normal "g t" '("jump todos" . consult-todo)))
#+end_src
2024-06-04 05:14:37 +00:00
* Full Size Frame
Taken from [[https://emacsredux.com/blog/2020/12/04/maximize-the-emacs-frame-on-startup/ ][this essay ]], I figured I would start the initial frame automatically in fullscreen, but not any subsequent frames (as this could be part of the capturing system).
#+begin_src emacs-lisp
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
#+end_src
But when capturing, I subsequently open smaller frames that shouldn’ t be /odd looking/ :
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(ns-transparent-titlebar . t))
(add-to-list 'default-frame-alist '(ns-appearance . dark))
#+end_src
Now that I’ m using v29 of Emacs, I can /un-decorate/ the non-full-sized frames:
#+begin_src emacs-lisp
(add-to-list 'default-frame-alist '(undecorated-round . t))
#+end_src
2022-04-09 16:03:34 +00:00
* Emojis, Icons and Whatnot
2022-06-18 00:25:47 +00:00
Display these two symbols as one:
#+begin_src emacs-lisp
2022-05-02 23:31:26 +00:00
(add-hook 'text-mode-hook (lambda ()
2023-01-20 01:23:20 +00:00
(dolist (pair '(("!?" . "‽")
2023-11-06 17:36:06 +00:00
("ae" . "æ")
("AE" . "Æ")
;; If we have ligatures, why these?
;; ("->" . ?→)
;; ("<-" . ?←)
;; ("=>" . ?⇒)
))
2023-01-20 01:23:20 +00:00
(push pair prettify-symbols-alist))))
#+end_src
And turn the prettifier on:
#+begin_src emacs-lisp
(global-prettify-symbols-mode 1)
2022-06-18 00:25:47 +00:00
#+end_src
2022-05-02 23:31:26 +00:00
2022-06-18 00:25:47 +00:00
In Emacs 28.1, we have better Unicode 14 support. Which means, we need to install [[https://github.com/googlefonts/noto-emoji ][Noto Color Emoji ]]. My systems, seems to work fine, but I’ m leaving this code here in case I have issues, as I might use what Apple supplies when on a Mac (thanks [[http://xahlee.info/emacs/emacs/emacs_list_and_set_font.html ][Xah Lee ]]):
2023-07-05 06:47:44 +00:00
#+begin_src emacs-lisp
2022-05-02 23:31:26 +00:00
;; set font for symbols
(set-fontset-font t 'symbol
2022-04-09 16:03:34 +00:00
(cond
2023-11-06 17:36:06 +00:00
((ha-running-on-macos?)
2022-05-02 23:31:26 +00:00
(cond
((member "Apple Symbols" (font-family-list)) "Apple Symbols")))
2023-11-06 17:36:06 +00:00
((ha-running-on-linux?)
2022-05-02 23:31:26 +00:00
(cond
((member "Symbola" (font-family-list)) "Symbola")))))
;; set font for emoji (should come after setting symbols)
(set-fontset-font t 'emoji
2022-04-09 16:03:34 +00:00
(cond
2022-05-02 23:31:26 +00:00
((member "Apple Color Emoji" (font-family-list)) "Apple Color Emoji")
((member "Noto Color Emoji" (font-family-list)) "Noto Color Emoji")
((member "Symbola" (font-family-list)) "Symbola")))
2022-06-18 00:25:47 +00:00
#+end_src
2022-04-09 16:03:34 +00:00
Test this out: 😄 😱 😸 👸 👽 🙋
2021-11-14 06:14:55 +00:00
Not use what I'm doing with the [[https://github.com/domtronn/all-the-icons.el ][all-the-icons ]] package, but the Doom Modeline uses much of this.
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp
(use-package all-the-icons)
#+end_src
2021-11-14 06:14:55 +00:00
*Note:* Install everything with the function, =all-the-icons-install-fonts= .
2021-11-02 00:27:14 +00:00
* Ligatures
Seems like getting ligatures to work in Emacs has been a Holy Grail. On Mac, I've used special builds that have hacks, but now with Emacs 27 and Harfbuzz, I should be able to get --> to look like it should.
2022-06-18 00:25:47 +00:00
#+begin_src emacs-lisp :tangle no
(setq prettify-symbols-unprettify-at-point 'right-edge)
2021-11-02 00:27:14 +00:00
2022-06-18 00:25:47 +00:00
(global-prettify-symbols-mode +1)
(prettify-symbols-mode +1)
#+end_src
2021-11-02 00:27:14 +00:00
2023-03-24 17:58:22 +00:00
We'll start using that instead, but setting this [[file:ha-programming.org::*Ligatures ][over here ]] in the programming section.
2023-09-07 22:44:08 +00:00
Also note that adding a /little/ extra space between lines makes text files easier to read.
#+begin_src emacs-lisp
(add-hook 'text-mode-hook (lambda () (setq-local line-spacing 0.1)))
#+end_src
2021-11-02 00:27:14 +00:00
* Technical Artifacts :noexport:
2022-06-18 00:25:47 +00:00
Let's =provide= a name so we can =require= this file:
#+begin_src emacs-lisp :exports none
(provide 'ha-display)
;;; ha-display.el ends here
#+end_src
2021-11-02 00:27:14 +00:00
Before you can build this on a new system, make sure that you put the cursor over any of these properties, and hit: ~C-c C-c~
2024-03-07 04:02:25 +00:00
#+description : A literate programming file to configure the Emacs UI.
2021-11-02 00:27:14 +00:00
2024-03-07 04:02:25 +00:00
#+property : header-args:sh :tangle no
#+property : header-args:emacs-lisp :tangle yes
#+property : header-args :results none :eval no-export :comments no :mkdirp yes
2021-11-02 00:27:14 +00:00
2024-03-07 04:02:25 +00:00
#+options : num:nil toc:t todo:nil tasks:nil tags:nil date:nil
#+options : skip:nil author:nil email:nil creator:nil timestamp:nil
#+infojs_opt : view:nil toc:t ltoc:t mouse:underline buttons:0 path:http://orgmode.org/org-info.js