Skip to content

Commit a8d93d7

Browse files
author
Antoine Brand
committed
* Changed to make it not depend on helm, and use the racket- convention
1 parent 61cec32 commit a8d93d7

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

racket-mode.el

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -144,31 +144,32 @@ http://www.gnu.org/licenses/ for details.")
144144
(set (make-local-variable 'imenu-syntax-alist)
145145
'(("+-*/.<>=?!$%_&~^:" . "w"))))
146146

147-
(require 'helm)
148-
149-
(defun helm-racket-apropos-init ()
150-
(with-current-buffer (helm-candidate-buffer 'global)
151-
(dolist (elem (racket--eval/sexpr ",apropos"))
152-
(insert (car elem) "\n"))))
153-
154-
(defun helm-racket-apropos-match-part (candidate)
155-
candidate)
156-
157-
(defun helm-racket-apropos-action (candidate)
158-
(racket--do-describe candidate t))
159-
160-
(defvar helm-source-racket-apropos
161-
'((name . "Search throught racket defining symbol")
162-
(init . helm-racket-apropos-init)
163-
(candidates-in-buffer)
164-
(get-line . buffer-substring)
165-
(match-part . helm-racket-apropos-match-part)
166-
(action . helm-racket-apropos-action)))
167-
168-
(defun helm-racket-apropos ()
169-
"Equivalent of helm-apropos but for the racket installed documentation"
170-
(interactive)
171-
(helm :sources 'helm-source-racket-apropos :buffer "*helm racket apropos*"))
147+
(when (fboundp 'helm)
148+
(require 'helm)
149+
150+
(defun racket-helm-apropos-init ()
151+
(with-current-buffer (helm-candidate-buffer 'global)
152+
(dolist (elem (racket--eval/sexpr ",apropos"))
153+
(insert (car elem) "\n"))))
154+
155+
(defun racket-helm-apropos-match-part (candidate)
156+
candidate)
157+
158+
(defun racket-helm-apropos-action (candidate)
159+
(racket--do-describe candidate t))
160+
161+
(defvar helm-source-racket-apropos
162+
'((name . "Search throught racket defining symbol")
163+
(init . racket-helm-apropos-init)
164+
(candidates-in-buffer)
165+
(get-line . buffer-substring)
166+
(match-part . racket-helm-apropos-match-part)
167+
(action . racket-helm-apropos-action)))
168+
169+
(defun racket-helm-apropos ()
170+
"Equivalent of helm-apropos but for the racket installed documentation"
171+
(interactive)
172+
(helm :sources 'helm-source-racket-apropos :buffer "*helm racket apropos*")))
172173

173174
;;;###autoload
174175
(define-derived-mode racket-mode prog-mode

0 commit comments

Comments
 (0)