summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCase Duckworth2021-09-01 17:58:08 -0500
committerCase Duckworth2021-09-01 17:58:08 -0500
commit585b95ea00c319fc5f19238362dc4c757506ba76 (patch)
treedd6151960da5f06d32cb45849c6231872e1e6878
parentRemove initial-scratch-message (diff)
downloademacs-585b95ea00c319fc5f19238362dc4c757506ba76.tar.gz
emacs-585b95ea00c319fc5f19238362dc4c757506ba76.zip
Replace ace-link with link-hint
-rw-r--r--init.el55
1 files changed, 28 insertions, 27 deletions
diff --git a/init.el b/init.el index 59506be..06a2450 100644 --- a/init.el +++ b/init.el
@@ -1060,33 +1060,6 @@ like a dumbass."
1060 (autoload 'dired-async-mode "dired-async.el" nil t) 1060 (autoload 'dired-async-mode "dired-async.el" nil t)
1061 (dired-async-mode +1)) 1061 (dired-async-mode +1))
1062 1062
1063(setup (:straight ace-link)
1064 (ace-link-setup-default)
1065
1066 ;; I use C-o here, even though it's usually `open-line', because it still
1067 ;; matches the 'o' logic given by abo-abo (it's got the Open mnemonic and
1068 ;; it's close to 'l'), and because I've given `open-line' to M-l --- I don't
1069 ;; need `downcase-word' much, and when I do, I can use `downcase-dwim', bound
1070 ;; to C-c l.
1071 (let ((key (kbd "C-o")))
1072 (with-eval-after-load 'erc
1073 (autoload 'org-element-lineage "org-element")
1074 (define-key erc-mode-map key #'ace-link))
1075 (with-eval-after-load 'org
1076 (define-key org-mode-map key #'ace-link-org))
1077 (with-eval-after-load 'gnus
1078 (define-key gnus-summary-mode-map key #'ace-link-gnus)
1079 (define-key gnus-article-mode-map key #'ace-link-gnus))
1080 (with-eval-after-load 'ert
1081 (define-key ert-results-mode-map "o" #'ace-link-help))
1082 (with-eval-after-load 'mastodon
1083 (define-key mastodon-mode-map "o" #'ace-link-addr))
1084 (with-eval-after-load 'circe
1085 (define-key circe-channel-mode-map (kbd "C-o") #'ace-link-addr))
1086 ;; And still everything else
1087 (setq ace-link-fallback-function #'ace-link-addr)
1088 (global-set-key key #'ace-link)))
1089
1090(setup (:straight alert) 1063(setup (:straight alert)
1091 (:option alert-default-style (acdw/system 1064 (:option alert-default-style (acdw/system
1092 (:home 'libnotify) 1065 (:home 'libnotify)
@@ -1539,6 +1512,34 @@ successive invocations."
1539(setup (:straight-if ledger-mode 1512(setup (:straight-if ledger-mode
1540 (executable-find "ledger"))) 1513 (executable-find "ledger")))
1541 1514
1515(setup (:straight link-hint)
1516 ;; Browse web URLs with a browser with a prefix argument.
1517 (dolist (type '(gnus-w3m-image-url
1518 gnus-w3m-url
1519 markdown-link
1520 mu4e-attachment
1521 mu4e-url
1522 notmuch-hello
1523 nov-link
1524 org-link
1525 shr-url
1526 text-url
1527 w3m-link
1528 w3m-message-link))
1529 (link-hint-define-type type
1530 :open-secondary browse-url-secondary-browser-function))
1531
1532 (defun acdw/link-hint-open-link (arg)
1533 "Open a link using `link-hint-open-link', but like `browse-url-at-point'.
1534That is, a prefix argument (\\[universal-argument]) will open the
1535browser defined in `browse-url-secondary-browser-function'."
1536 (interactive "P")
1537 (avy-with link-hint-open-link
1538 (link-hint--one (if arg :open-secondary :open))))
1539
1540 (:global "C-c C-o" acdw/link-hint-open-link
1541 "C-c o" acdw/link-hint-open-link))
1542
1542(setup (:straight lua-mode) 1543(setup (:straight lua-mode)
1543 (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-mode))) 1544 (add-to-list 'auto-mode-alist '("\\.lua\\'" . lua-mode)))
1544 1545