diff options
| author | Jakob L. Kreuze | 2020-06-01 16:53:50 -0400 |
|---|---|---|
| committer | Jakob L. Kreuze | 2020-06-01 16:53:50 -0400 |
| commit | 6c7f0b8ae2de30a808901b16b0d462fe833ea1b4 (patch) | |
| tree | 2cc0a3e9022fc43c39e5b91f4e7832b5387636e9 /lisp/appearance.el | |
| parent | 4d4f759881e310818055c31f286158da9db60d1c (diff) | |
Break config into files.
Diffstat (limited to 'lisp/appearance.el')
| -rw-r--r-- | lisp/appearance.el | 85 |
1 files changed, 85 insertions, 0 deletions
diff --git a/lisp/appearance.el b/lisp/appearance.el new file mode 100644 index 0000000..2d365f7 --- /dev/null +++ b/lisp/appearance.el @@ -0,0 +1,85 @@ +;;; appearance.el -*- lexical-binding: t; -*- +;;; +;;; Author: Jakob L. Kreuze <zerodaysfordays@sdf.org> +;;; URL: https://git.sr.ht/~jakob/.emacs.d/ +;;; +;;; Configuration for making Emacs look pretty. +;;; + + + +;; Use soft wrapping instead of "scrolling" when overflowing the width of a frame. + +(global-visual-line-mode t) + +;; The menu bar can be accessed with <M-`> if I really need it, so I don't see +;; the point in having it take up the space at the top. The rest of these rarely +;; see use from me, and I'd prefer to disable them and have access to the extra +;; screen real estate. + +(menu-bar-mode -1) +(scroll-bar-mode -1) +(tool-bar-mode -1) +(fringe-mode -1) + +;; Hacking is a lot more serene when visual stimulus is kept to a minimum. + +(blink-cursor-mode 0) + +;; Enable `prettify-symbols' globally. + +(global-prettify-symbols-mode t) + +;; This is snippet was taken verbatim from Emacs StackExchange [1] to enable +;; `prettify-symbols in Org source code blocks. Sadly, I can't think of a way to +;; implement this as advice. +;; +;; [1]: https://emacs.stackexchange.com/questions/17283/is-it-possible-to-get-prettified-symbols-in-org-mode-source-blocks + +(defun org-src-font-lock-fontify-block (lang start end) + "Fontify code block. +This function is called by emacs automatic fontification, as long +as `org-src-fontify-natively' is non-nil." + (let ((lang-mode (org-src--get-lang-mode lang))) + (when (fboundp lang-mode) + (let ((string (buffer-substring-no-properties start end)) + (modified (buffer-modified-p)) + (org-buffer (current-buffer)) pos next) + (remove-text-properties start end '(face nil)) + (with-current-buffer + (get-buffer-create + (concat " org-src-fontification:" (symbol-name lang-mode))) + (delete-region (point-min) (point-max)) + (insert string " ") ;; so there's a final property change + (unless (eq major-mode lang-mode) (funcall lang-mode)) + ;; Avoid `font-lock-ensure', which does not display fonts in + ;; source block. + (font-lock-fontify-buffer) + (setq pos (point-min)) + (while (setq next (next-single-property-change pos 'face)) + (put-text-property + (+ start (1- pos)) (1- (+ start next)) 'face + (get-text-property pos 'face) org-buffer) + (setq pos next)) + ;; Addition: also copy 'composition info for prettified symbols + (setq pos (point-min)) + (while (setq next (next-single-property-change pos 'composition)) + (put-text-property + (+ start (1- pos)) (1- (+ start next)) 'composition + (get-text-property pos 'composition) org-buffer) + (setq pos next)) + ;; End addition + ) + (add-text-properties + start end + '(font-lock-fontified t fontified t font-lock-multiline t)) + (set-buffer-modified-p modified))))) + +;; Although I'm usually not a fan of treating non-printable ASCII like this, the +;; lines act as sort more of a cue for me to use <C-x [> and <C-x ]> than a +;; plain ol' '^L'. + +(use-package page-break-lines + :demand t + :config + (global-page-break-lines-mode)) |