Skip to content

Commit 950d55c

Browse files
committed
ace-link.el (ace-link-setup-default): improve
* ace-link.el (ace-link-setup-default): Use `eval-after-load'.
1 parent 65d77c9 commit 950d55c

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

ace-link.el

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,8 +136,8 @@
136136
(let ((skip (text-property-any (point) (point-max)
137137
'help-echo nil))
138138
candidates)
139-
(while (setq skip (text-property-not-all skip (point-max)
140-
'help-echo nil))
139+
(while (setq skip (text-property-not-all
140+
skip (point-max) 'help-echo nil))
141141
(goto-char skip)
142142
(push skip candidates)
143143
(setq skip (text-property-any (point) (point-max)
@@ -160,13 +160,14 @@
160160
;;;###autoload
161161
(defun ace-link-setup-default ()
162162
"Setup the defualt shortcuts."
163-
(require 'info)
164-
(define-key Info-mode-map "o" 'ace-link-info)
165-
(require 'help-mode)
166-
(define-key help-mode-map "o" 'ace-link-help)
167-
(require 'eww)
168-
(define-key eww-link-keymap "o" 'ace-link-eww)
169-
(define-key eww-mode-map "o" 'ace-link-eww))
163+
(eval-after-load "info"
164+
'(define-key Info-mode-map "o" 'ace-link-info))
165+
(eval-after-load "help-mode"
166+
'(define-key help-mode-map "o" 'ace-link-help))
167+
(eval-after-load "eww"
168+
'(progn
169+
(define-key eww-link-keymap "o" 'ace-link-eww)
170+
(define-key eww-mode-map "o" 'ace-link-eww))))
170171

171172
(provide 'ace-link)
172173

0 commit comments

Comments
 (0)