summaryrefslogtreecommitdiffhomepage
path: root/init.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-12 03:52:37 +0100
committerjao <jao@gnu.org>2021-04-12 03:52:37 +0100
commita3b7219f2ae29bb74ac897665bfa46cb395932eb (patch)
tree2394c67372babeab366391e1281aaf54187a82f6 /init.org
parent37160309dd11a857c68abe7cc6abbaa2bdfb993e (diff)
downloadelibs-a3b7219f2ae29bb74ac897665bfa46cb395932eb.tar.gz
elibs-a3b7219f2ae29bb74ac897665bfa46cb395932eb.tar.bz2
section shuffled
Diffstat (limited to 'init.org')
-rw-r--r--init.org141
1 files changed, 73 insertions, 68 deletions
diff --git a/init.org b/init.org
index f9a150a..5c36405 100644
--- a/init.org
+++ b/init.org
@@ -1492,74 +1492,6 @@
;; for M-x biblio-lookup
;; (use-package biblio :ensure t)
#+END_SRC
-* PDFs
-*** doc-view
- #+begin_src emacs-lisp
- (use-package doc-view
- :init
- (setq doc-view-cache-directory "~/.emacs.d/cache/docview"
- doc-view-resolution 110
- doc-view-continuous t
- doc-view-conversion-refresh-interval 1)
- :custom ((mailcap-user-mime-data '((doc-view-mode "application/pdf")))))
-
- (use-package jao-doc-view
- :bind (:map doc-view-mode-map
- ("b" . jao-doc-view-back)
- ("B" . jao-doc-view-forward)
- ("S" . jao-doc-view-save-session)
- ("u" . jao-doc-view-visit-url)))
-
- (use-package saveplace-pdf-view :ensure t :demand t :after doc-view)
- #+end_src
-*** open pds
- #+begin_src emacs-lisp
- (defvar jao-open-doc-fun 'jao-find-or-open)
-
- (defun jao-find-or-open (file)
- (let* ((buffs (buffer-list))
- (b (catch 'done
- (while buffs
- (when (string-equal (buffer-file-name (car buffs)) file)
- (throw 'done (car buffs)))
- (setq buffs (cdr buffs))))))
- (jao-afio--goto-docs)
- (if b (pop-to-buffer b) (find-file file))))
-
- (defun jao-open-doc (file)
- (message "Opening %s" file)
- (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-find-or-open doc))))
-
- (defun jao-afio-open-pdf (file page &optional height)
- (jao-open-doc file)
- (when page (jao-doc-view-goto-page page height)))
-
- (setq jao-org-open-pdf-fun #'jao-afio-open-pdf)
- #+end_src
-*** Hydra
- #+begin_src emacs-lisp
- (major-mode-hydra-define doc-view-mode nil
- ("Notes"
- (("o" jao-org-pdf-goto-org "notes file")
- ("O" (jao-org-pdf-goto-org 4) "notes file, linking"))
- "Navigation"
- (("b" jao-doc-view-back "back jump")
- ("B" jao-doc-view-back "forward jump")
- ("u" jao-doc-view-visit-url "visit URL"))
- "Slices"
- (("cb" doc-view-set-slice-from-bounding-box "bounding box")
- ("cm" doc-view-set-slice-using-mouse "using mouse"))
- "Session"
- (("s" jao-open-pdf-session "load session")
- ("S" jao-doc-view-save-session "save session")
- ("d" doc-view-dired-cache "visit cache directory"))))
- #+end_src
* Email
*** message mode
***** Customization
@@ -2241,6 +2173,79 @@
(jao-load-org "eww")
;; (jao-load-org "w3m")
#+end_src
+* PDFs
+*** doc-view
+ #+begin_src emacs-lisp
+ (use-package doc-view
+ :init
+ (setq doc-view-cache-directory "~/.emacs.d/cache/docview"
+ doc-view-resolution 110
+ doc-view-continuous t
+ doc-view-conversion-refresh-interval 1)
+ :bind (:map doc-view-mode-map
+ ("j" . doc-view-next-line-or-next-page)
+ ("k" . doc-view-previous-line-or-previous-page))
+ :custom ((mailcap-user-mime-data
+ '((doc-view-mode "application/pdf" jao-browse-doc-use-emacs-p)
+ ("zathura %s" "application/pdf")))))
+
+ (use-package jao-doc-view
+ :bind (:map doc-view-mode-map
+ ("b" . jao-doc-view-back)
+ ("B" . jao-doc-view-forward)
+ ("S" . jao-doc-view-save-session)
+ ("u" . jao-doc-view-visit-url)))
+
+ (use-package saveplace-pdf-view :ensure t :demand t :after doc-view)
+ #+end_src
+*** open pdfs
+ #+begin_src emacs-lisp
+ (defvar jao-open-doc-fun 'jao-find-or-open)
+
+ (defun jao-find-or-open (file)
+ (let* ((buffs (buffer-list))
+ (b (catch 'done
+ (while buffs
+ (when (string-equal (buffer-file-name (car buffs)) file)
+ (throw 'done (car buffs)))
+ (setq buffs (cdr buffs))))))
+ (jao-afio--goto-docs)
+ (if b (pop-to-buffer b) (find-file file))))
+
+ (defun jao-open-doc (file)
+ (message "Opening %s" file)
+ (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-find-or-open doc))))
+
+ (defun jao-afio-open-pdf (file page &optional height)
+ (jao-open-doc file)
+ (when page (jao-doc-view-goto-page page height)))
+
+ (setq jao-org-open-pdf-fun #'jao-afio-open-pdf)
+ #+end_src
+*** Hydra
+ #+begin_src emacs-lisp
+ (major-mode-hydra-define doc-view-mode nil
+ ("Notes"
+ (("o" jao-org-pdf-goto-org "notes file")
+ ("O" (jao-org-pdf-goto-org 4) "notes file, linking"))
+ "Navigation"
+ (("b" jao-doc-view-back "back jump")
+ ("B" jao-doc-view-back "forward jump")
+ ("u" jao-doc-view-visit-url "visit URL"))
+ "Slices"
+ (("cb" doc-view-set-slice-from-bounding-box "bounding box")
+ ("cm" doc-view-set-slice-using-mouse "using mouse"))
+ "Session"
+ (("s" jao-open-pdf-session "load session")
+ ("S" jao-doc-view-save-session "save session")
+ ("d" doc-view-dired-cache "visit cache directory"))))
+ #+end_src
* Shells
*** shell modes
#+begin_src emacs-lisp