-
Notifications
You must be signed in to change notification settings - Fork 8
/
+patches.el
42 lines (40 loc) · 1.87 KB
/
+patches.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
;;; patches.el -*- lexical-binding: t; -*-
;; Patch to make the command-log-window respect the variable `command-log-mode-window-font-size'.
;; The original command-log-mode completely ignores this variable (i.e., the variable is never used)
(el-patch-feature command-log-mode)
(after! command-log-mode
(el-patch-defun clm/open-command-log-buffer (&optional arg)
"Opens (and creates, if non-existant) a buffer used for logging keyboard commands.
If ARG is Non-nil, the existing command log buffer is cleared."
(interactive "P")
(with-current-buffer
(setq clm/command-log-buffer
(get-buffer-create " *command-log*"))
(text-scale-set (el-patch-swap 1 command-log-mode-window-font-size)))
(when arg
(with-current-buffer clm/command-log-buffer
(erase-buffer)))
(let ((new-win (split-window-horizontally
(- 0 command-log-mode-window-size))))
(set-window-buffer new-win clm/command-log-buffer)
(set-window-dedicated-p new-win t))))
;; When switching to the latex output buffer, switch to the buffer.
;; ... Without this patch, the original buffer retains focus.
(el-patch-feature latex)
(after! latex
(el-patch-defun TeX-recenter-output-buffer (line)
"Redisplay buffer of TeX job output so that most recent output can be seen.
The last line of the buffer is displayed on line LINE of the window, or
at bottom if LINE is nil."
(interactive "P")
(let ((buffer (TeX-active-buffer)))
(if buffer
(let ((old-buffer (current-buffer)))
(TeX-pop-to-buffer buffer t t)
(bury-buffer buffer)
(goto-char (point-max))
(recenter (if line
(prefix-numeric-value line)
(/ (window-height) 2)))
(el-patch-remove (TeX-pop-to-buffer old-buffer nil t)))
(message "No process for this document.")))))