From 21344bee1c07134529323ed2f2c53cd525c3b14f Mon Sep 17 00:00:00 2001 From: Kin Date: Sun, 24 May 2020 09:12:35 +0800 Subject: [PATCH] make eaf-pdf-outline buffer read-only and bind "q" to close window (#299) Co-authored-by: Andy Stewart --- eaf.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/eaf.el b/eaf.el index 2831fd3..e95252f 100644 --- a/eaf.el +++ b/eaf.el @@ -1937,6 +1937,7 @@ Make sure that your smartphone is connected to the same WiFi network as this com "eaf pdf outline mode." :keymap (let ((map (make-sparse-keymap))) (define-key map (kbd "RET") 'eaf-pdf-outline-jump) + (define-key map (kbd "q") 'quit-window) map)) (defun eaf-pdf-outline () @@ -1948,10 +1949,12 @@ Make sure that your smartphone is connected to the same WiFi network as this com ;; Insert outline content. (with-current-buffer (get-buffer-create eaf-pdf-outline-buffer-name) + (setq buffer-read-only nil) (erase-buffer) (insert toc) (goto-char (point-min)) (set (make-local-variable 'eaf-pdf-outline-original-buffer-name) buffer-name) + (read-only-mode 1) (eaf-pdf-outline-mode 1)) ;; Popup ouline buffer.