diff options
author | jao <jao@gnu.org> | 2025-09-30 01:46:39 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2025-09-30 01:46:39 +0100 |
commit | 1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669 (patch) | |
tree | 7c9089f50fff716897645834b6cc4c16b2cdc77d | |
parent | baea1398986f71054566b1a5a05163d728c580a8 (diff) | |
download | elibs-1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669.tar.gz elibs-1a54f3532dcd812b5b4c1c1ecfcf366d9aa10669.tar.bz2 |
tiny safari integration
-rw-r--r-- | init.el | 6 | ||||
-rw-r--r-- | lib/doc/jao-mac.el | 11 |
2 files changed, 14 insertions, 3 deletions
@@ -1807,13 +1807,15 @@ ("o" "open doc" jao-open-doc) ("s" "open skim doc" jao-skim-open-current-doc) ("c" "view cache" doc-view-dired-cache)] + ["Browse" + ("bn" "browse NNW article" jao-nnw-browse-current-article) + ("bs" "browse safary article" jao-safari-browse-current)] ["Network" ("S" "ssh" jao-ssh) ("r" "r2e" jao-r2e)] ["Utilities" ("l" "packages" jao-list-packages) - ("f" "copy buffer file name" copy-buffer-file-name-as-kill) - ("N" "browse NNW article" jao-nnw-browse-current-article)]]) + ("f" "copy buffer file name" copy-buffer-file-name-as-kill)]]) (transient-define-prefix jao-transient-utils () "Global operations." diff --git a/lib/doc/jao-mac.el b/lib/doc/jao-mac.el index c828507..b9da4ab 100644 --- a/lib/doc/jao-mac.el +++ b/lib/doc/jao-mac.el @@ -116,13 +116,22 @@ (jao-mac-run-applescript jao-nnw--current-article-script)) (defun jao-nnw-browse-current-article () - (interactive) "Browse the URL of the current NNW article." + (interactive) (if-let* ((url (jao-nnw-current-article))) (unless (string-empty-p url) (browse-url url)) (message "No article selected in NetNewsWire"))) +;;; Safari +(defun jao-safari-current-url () + (jao-mac-tell-app "Safari" "return URL of current tab of window 1")) + +(defun jao-safari-browse-current () + "Browse the URL of the current Safari topmost document." + (interactive) + (browse-url (jao-safari-current-url))) + ;;; Firefox (defvar jao-ffox--current-url-script (jao-mac-applescript-prepare |