summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-08 04:59:16 +0100
committerjao <jao@gnu.org>2021-04-08 04:59:16 +0100
commit7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b (patch)
treed996a3cb2c91a8586405d482439883d182b62ba4
parent86f38468a5ae8d527dbd633b51f52796c882bf06 (diff)
downloadelibs-7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b.tar.gz
elibs-7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b.tar.bz2
nits
-rw-r--r--eww.org9
-rw-r--r--exwm.org2
-rw-r--r--init.org9
-rw-r--r--lib/doc/jao-doc-view.el18
-rw-r--r--lib/themes/jao-themes.el2
5 files changed, 27 insertions, 13 deletions
diff --git a/eww.org b/eww.org
index e0b12b3..031eba4 100644
--- a/eww.org
+++ b/eww.org
@@ -106,6 +106,12 @@
* Visiting links in a page
#+begin_src emacs-lisp
+ (defun jao-eww-copy-link ()
+ (interactive)
+ (when-let (lnk (or (car (eww-links-at-point)) (eww-current-url)))
+ (message "%s" lnk)
+ (kill-new lnk)))
+
(defun jao-eww--at-link ()
(and (get-text-property (point) 'shr-url)
(not (get-text-property (point) 'eww-form))))
@@ -188,6 +194,7 @@
:bind (:map eww-mode-map (("b" . eww-back-url)
("B" . eww-forward-url)
+ ("c" . jao-eww-copy-link)
("d" . eww-download)
("D" . jao-download)
("f" . eww-lnum-follow)
@@ -206,7 +213,7 @@
("w" . org-eww-copy-for-org-mode)
("W" . jao-eww-close)
("x" . jao-rss-subscribe)
- ("y" . eww-copy-page-url)
+ ("y" . jao-eww-copy-link)
("C-c C-w" . jao-eww-close))))
#+end_src
diff --git a/exwm.org b/exwm.org
index 5b4df6c..e984d29 100644
--- a/exwm.org
+++ b/exwm.org
@@ -370,7 +370,7 @@
#+end_src
* Hydras
#+begin_src emacs-lisp
- (major-mode-hydra-define+ pdf-view-mode nil
+ (major-mode-hydra-define+ (doc-view-mode pdf-view-mode) nil
("External"
(("z" jao-exwm-open-with-zathura "open with zathura")
("m" jao-exwm-open-with-mupdf "open with mupdf"))))
diff --git a/init.org b/init.org
index bdfb40a..0056220 100644
--- a/init.org
+++ b/init.org
@@ -1485,7 +1485,6 @@
;; (use-package biblio :ensure t)
#+END_SRC
* PDFs
- - ~M-x doc-view-presentation~
*** doc-view
#+begin_src emacs-lisp
(use-package doc-view
@@ -3095,7 +3094,7 @@
(defun jao-org--set-geiser-impl () (setq-local geiser-repl--impl 'guile))
(add-hook 'org-mode-hook #'jao-org--set-geiser-impl)
- (jao-load-path "geiser/geiser")
+ (jao-load-path "geiser/geiser/elisp")
(use-package geiser
:init
(setq geiser-repl-history-filename "~/.emacs.d/cache/geiser-history")
@@ -3105,6 +3104,12 @@
(jao-load-path "geiser/mit")
(use-package geiser-mit)
+ ;; (jao-load-path "geiser/chicken")
+ ;; (use-package geiser-chicken)
+
+ ;; (jao-load-path "geiser/chibi")
+ ;; (use-package geiser-chibi)
+
(jao-load-path "geiser/chez")
(use-package geiser-chez
:init (setq geiser-chez-binary "scheme"))
diff --git a/lib/doc/jao-doc-view.el b/lib/doc/jao-doc-view.el
index 5c6cbbc..713caf9 100644
--- a/lib/doc/jao-doc-view.el
+++ b/lib/doc/jao-doc-view.el
@@ -87,10 +87,6 @@
(defun jao-doc-view-is-pdf (file) (string-match-p ".*\\.pdf$" file))
-(defun jao-doc-view-title (&optional fname)
- (let ((base (file-name-base (or fname (buffer-file-name)))))
- (capitalize (replace-regexp-in-string "-" " " base))))
-
(defun jao-doc-view-title->file (title)
(concat (mapconcat 'downcase (split-string title nil t) "-") ".pdf"))
@@ -133,6 +129,12 @@
(setq outline (cdr outline)))
(replace-regexp-in-string "[[:blank:]]+" " " cur-title)))
+(defun jao-doc-view-title (&optional fname)
+ (if (or fname (not (derived-mode-p 'doc-view-mode 'pdf-view-mode)))
+ (let ((base (file-name-base (or fname (buffer-file-name)))))
+ (capitalize (replace-regexp-in-string "-" " " base)))
+ (or (jao-doc-view-section-title) (jao-doc-view-title buffer-file-name))))
+
;;; imenu
(defun jao-doc-view--enable-imenu ()
@@ -187,7 +189,8 @@
(if doc-view--current-converter-processes
(message "DocView: please wait till conversion finished.")
(let ((txt (expand-file-name "doc.txt" (doc-view--current-cache-dir)))
- (page (doc-view-current-page)))
+ (page (doc-view-current-page))
+ (urls))
(if (file-readable-p txt)
(with-current-buffer (find-file-noselect txt)
(goto-char (point-min))
@@ -195,8 +198,7 @@
(let ((end (save-excursion
(if (re-search-forward page-delimiter nil t)
(point)
- (point-max))))
- (urls))
+ (point-max)))))
(while (re-search-forward "https?://" end t)
(push (thing-at-point-url-at-point) urls))
urls))
@@ -206,7 +208,7 @@
"Visit URL displayed in this page."
(interactive nil doc-view-mode)
(let ((urls (jao-doc-view--page-urls)))
- (if (null urls)
+ (if (zerop (length urls))
(message "No URLs in this page")
(when-let (url (completing-read "URL: " urls nil nil
(when (null (cdr urls)) (car urls))))
diff --git a/lib/themes/jao-themes.el b/lib/themes/jao-themes.el
index a7e59b1..5d2ee79 100644
--- a/lib/themes/jao-themes.el
+++ b/lib/themes/jao-themes.el
@@ -533,7 +533,7 @@
(eww-valid-certificate (~ success))
(eww-form-select bx)
(eww-form-text bx (p f11))
- (eww-form-textarea bx (c nil "grey90"))
+ (eww-form-textarea bx)
(eww-form-submit (~ button)))
`((factor-font-lock-comment (~ font-lock-comment-face))
(factor-font-lock-constructor (~ font-lock-function-name-face))