diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/doc/jao-mac.el | 21 | ||||
| -rw-r--r-- | lib/doc/jao-org-links.el | 3 | ||||
| -rw-r--r-- | lib/eos/jao-afio.el | 2 | ||||
| -rw-r--r-- | lib/net/jao-notmuch.el | 6 |
4 files changed, 30 insertions, 2 deletions
diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el index 1f325c7..ad11ea2 100644 --- a/lib/doc/jao-mac.el +++ b/lib/doc/jao-mac.el @@ -107,6 +107,27 @@ (when-let* ((ps (jao-skim-current-doc))) (apply 'jao-open-doc ps))) +(defvar jao-skim--current-page-text + (jao-mac-applescript-prepare + "tell application \"Skim\"" + "return the text of the current page of the front document" + "end tell")) + +(defun jao-skim-page-text () + (jao-mac-run-applescript jao-skim--current-page-text)) + +(defun jao-skim-view-page-text () + (interactive) + (when-let* ((ps (jao-skim-current-doc)) + (p (car ps)) + (n (cadr ps)) + (txt (jao-skim-page-text)) + (bn (format "*%s - %s - txt*" p n))) + (with-current-buffer (get-buffer-create bn) + (delete-region (point-min) (point-max)) + (insert txt) + (pop-to-buffer (current-buffer))))) + ;;; NetNewsWire (defvar jao-nnw--current-article-script diff --git a/lib/doc/jao-org-links.el b/lib/doc/jao-org-links.el index 5547c9b..95f2d67 100644 --- a/lib/doc/jao-org-links.el +++ b/lib/doc/jao-org-links.el @@ -18,7 +18,8 @@ (defun jao-org-links--open-pdf (link) "Open LINK using `jaor-org-open-pdf-fn'." - (cond ((string-match "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)" link) + (cond ((string-match "\\(.*\\)::\\([0-9]*\\)\\+\\+\\([[0-9]\\.*[0-9]*\\)" + link) (let* ((path (match-string 1 link)) (page (string-to-number (match-string 2 link))) (height (string-to-number (match-string 3 link)))) diff --git a/lib/eos/jao-afio.el b/lib/eos/jao-afio.el index 235aa54..99152b0 100644 --- a/lib/eos/jao-afio.el +++ b/lib/eos/jao-afio.el @@ -72,7 +72,7 @@ (defun jao-afio-open-pdf-session (&optional docs) (interactive) (dolist (doc (or docs (jao-doc-session))) - (when (and doc (file-exists-p doc)) + (when (and (stringp doc) (file-exists-p doc)) (if (jao-pdf-is-pdf-file doc) (jao-open-doc doc) (find-file doc)) (other-window 1))) (other-window 1)) diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 7ae9a4f..73f6420 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -316,6 +316,12 @@ (let ((undo (jao-notmuch--has-tag "deleted"))) (jao-notmuch-tree-tag-thread '("+deleted" "-new" "-unread") undo full))) +(defun jao-notmuch-tree-mark-all-read () + (interactive) + (when-let* ((q notmuch-tree-basic-query)) + (when (yes-or-no-p "Mark all messages as read? ") + (notmuch-tag q '("-new" "-unread"))))) + (defun jao-notmuch-tree-read-thread (full) (interactive "P") (jao-notmuch-tree-tag-thread '("-unread" "-new") nil full)) |
