diff options
author | jao <jao@gnu.org> | 2021-04-17 02:41:57 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-17 02:41:57 +0100 |
commit | 45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24 (patch) | |
tree | a5aa1c1a1a634ac964bb5b189b0c34d58bcaddeb | |
parent | d82155d445a9c1f4630d2b667cd91f57730fa458 (diff) | |
download | elibs-45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24.tar.gz elibs-45bf5ca9f1ab4fcec6388ba9624e6eac719e0b24.tar.bz2 |
nits
-rw-r--r-- | completion.org | 7 | ||||
-rw-r--r-- | init.org | 8 | ||||
-rw-r--r-- | lib/doc/jao-doc-view.el | 3 | ||||
-rw-r--r-- | lib/eos/jao-afio.el | 19 |
4 files changed, 18 insertions, 19 deletions
diff --git a/completion.org b/completion.org index d195d93..dc8e959 100644 --- a/completion.org +++ b/completion.org @@ -22,12 +22,13 @@ :init (setq tab-always-indent 'complete completion-styles '(orderless) + completion-cycle-threshold 3 corfu-cycle t) ;; Optionally use TAB for cycling, default is `corfu-complete'. - :bind (:map corfu-map - ("TAB" . corfu-next) - ("S-TAB" . corfu-previous)) + ;; :bind (:map corfu-map + ;; ("TAB" . corfu-next) + ;; ("S-TAB" . corfu-previous)) :hook ((eshell-mode . corfu-mode) (haskell-interactive-mode . corfu-mode) @@ -2196,7 +2196,7 @@ #+end_src *** open pdfs #+begin_src emacs-lisp - (defvar jao-open-doc-fun 'jao-find-or-open) + (setq jao-open-doc-fun 'jao-find-or-open) (defun jao-find-or-open (file) (let* ((buffs (buffer-list)) @@ -2215,12 +2215,6 @@ (concat jao-org-dir "/doc/")))) (funcall jao-open-doc-fun file))) - (defun jao-open-pdf-session () - (interactive) - (dolist (doc (jao-doc-view-session)) - (when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc))) - (jao-open-doc doc)))) - (defun jao-afio-open-pdf (file page &optional height) (jao-open-doc file) (when page (jao-doc-view-goto-page page height))) diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el index 0687518..058fc04 100644 --- a/lib/doc/jao-doc-view.el +++ b/lib/doc/jao-doc-view.el @@ -64,8 +64,7 @@ (when-let (fn (and (not (equalp cb b)) (jao-doc-view--is-pdf))) (add-to-list 'docs fn)))) (when (> (length docs) 0) - (jao-doc-view--save-to-file jao-doc-view-session-file docs) - (message "%s docs saved" (length docs))))) + (jao-doc-view--save-to-file jao-doc-view-session-file docs)))) (defun jao-doc-view--save-session-1 () (when (jao-doc-view--is-pdf) (jao-doc-view-save-session t))) diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index 90abc7f..7ebaf5d 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -64,22 +64,27 @@ (jao-afio--goto-frame next))) ;;;###autoload +(defvar jao-open-doc-fun 'find-file) + +;;;###autoload +(defun jao-afio-open-pdf-session () + (interactive) + (dolist (doc (jao-doc-view-session)) + (when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc))) + (jao-open-doc doc)))) + (defun jao-afio-open-doc () (interactive) (delete-other-windows) (split-window-right) (let ((docs (remove-if-not (lambda (b) - (eq (buffer-local-value 'major-mode b) - 'pdf-view-mode)) + (with-current-buffer b (jao-doc-view--is-pdf))) (buffer-list)))) (if (car docs) (progn (switch-to-buffer (car docs)) (switch-to-buffer-other-window (or (cadr docs) (car docs)))) - (when (and (jao-doc-view-session) - (y-or-n-p "Load saved session? ")) - (dolist (doc (jao-doc-view-session)) - (when (and (file-exists-p doc) (y-or-n-p (format "Open %s? " doc))) - (find-file doc))))))) + (when (and (jao-doc-view-session) (y-or-n-p "Load saved session? ")) + (jao-afio-open-pdf-session))))) (defvar jao-afio-use-w3m nil) (declare w3m "w3m") |