This repository has been archived by the owner on Jul 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aside-hook-functions.el
62 lines (46 loc) · 2.07 KB
/
aside-hook-functions.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
;;; aside-hook-functions.el --- Hook functions -*- lexical-binding: t -*-
;; Copyright 2021 Matt Beshara
;; Author: Matt Beshara <[email protected]>
;; URL: https://github.com/mattbeshara/aside-el
;; Version: 1.4.1
;; This file is NOT part of GNU Emacs.
;; This program is free software: you can redistribute it and/or modify it
;; under the terms of the GNU General Public License as published by the Free
;; Software Foundation, either version 3 of the License, or (at your option)
;; any later version.
;;
;; This program is distributed in the hope that it will be useful, but WITHOUT
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
;; more details.
;;
;; You should have received a copy of the GNU General Public License along
;; with this program. If not, see <https://www.gnu.org/licenses/>.
;;; Commentary:
;;
;; This file contains some functions which I use to improve the presentation
;; of buffers displayed in Aside windows.
;;; Code:
(defun aside-hook-enable-truncate-lines ()
"Enables line truncation, without displaying a message about it."
(let ((inhibit-message t))
(toggle-truncate-lines 1)))
(defun aside-hook-disable-display-line-numbers-mode ()
"Call command ‘display-line-numbers-mode’ to disable line numbers."
(when (fboundp 'display-line-numbers-mode)
(display-line-numbers-mode -1)))
(defun aside-hook-change-default-face-pitch ()
"Make the default face inherit from ‘variable-pitch’."
(face-remap-add-relative 'default :inherit 'variable-pitch))
(defun aside-hook-change-default-face-height ()
"Change the height of the default face in the current buffer."
(face-remap-add-relative 'default :height aside-default-face-height))
(defgroup aside ()
"Options for Aside side windows.")
(defcustom aside-default-face-height 120
"The default face height to use in buffers in a side window.
Used in ‘aside-hook-change-default-face-height’."
:group 'aside
:type 'integer)
(provide 'aside-hook-functions)
;;; aside-hook-functions.el ends here