make eaf-pdf-outline buffer read-only and bind "q" to close window (#299)

Co-authored-by: Andy Stewart <lazycat.manatee@gmail.com>
master
Kin 6 years ago committed by GitHub
parent 314278c6bb
commit 21344bee1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      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.

Loading…
Cancel
Save