diff options
author | jao <jao@gnu.org> | 2021-04-08 04:59:16 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-08 04:59:16 +0100 |
commit | 7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b (patch) | |
tree | d996a3cb2c91a8586405d482439883d182b62ba4 /lib | |
parent | 86f38468a5ae8d527dbd633b51f52796c882bf06 (diff) | |
download | elibs-7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b.tar.gz elibs-7250b0f436ce31f2cf75dbaf9f00972dc4ad0b4b.tar.bz2 |
nits
Diffstat (limited to 'lib')
-rw-r--r-- | lib/doc/jao-doc-view.el | 18 | ||||
-rw-r--r-- | lib/themes/jao-themes.el | 2 |
2 files changed, 11 insertions, 9 deletions
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)) |