File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -1408,8 +1408,11 @@ under point, prompts for a var."
1408
1408
(interactive " P" )
1409
1409
(cider-read-symbol-name " Symbol: " 'cider-doc-lookup query))
1410
1410
1411
- (defun cider-grimoire-replace-dashes (name )
1411
+ (defun cider-grimoire-replace-special (name )
1412
1412
" Convert the dashes in NAME to a grimoire friendly format."
1413
+ (setq name (if (string-match " \\ ?\\ '" name)
1414
+ (replace-match " _QMARK" t t name)
1415
+ name))
1413
1416
(setq name (if (string-match " \\ `-" name)
1414
1417
(replace-match " DASH_" t t name)
1415
1418
name))
@@ -1423,7 +1426,7 @@ under point, prompts for a var."
1423
1426
(let ((clojure-version (concat (substring clojure-version 0 4 ) " 0" ))
1424
1427
(base-url " http://grimoire.arrdem.com/" ))
1425
1428
(if name
1426
- (concat base-url clojure-version " /" ns " /" (cider-grimoire-replace-dashes name) " /" )
1429
+ (concat base-url clojure-version " /" ns " /" (cider-grimoire-replace-special name) " /" )
1427
1430
(concat base-url clojure-version " /" ns " /" ))))
1428
1431
1429
1432
(defun cider-grimoire-lookup (symbol )
Original file line number Diff line number Diff line change 544
544
(should (equal " C:/space test" (cider--url-to-file " file:/C:/space%20test" ))))
545
545
546
546
; ;; grimoire tests
547
- (ert-deftest cider-grimoire-replace-dashes ()
548
- (should (equal (cider-grimoire-replace-dashes " defn-" ) " defn_DASH" ))
549
- (should (equal (cider-grimoire-replace-dashes " -map-indexed" ) " DASH_map_DASH_indexed" ))
550
- (should (equal (cider-grimoire-replace-dashes " -foo-bar-baz-" ) " DASH_foo_DASH_bar_DASH_baz_DASH" )))
547
+ (ert-deftest cider-grimoire-replace-special ()
548
+ (should (equal (cider-grimoire-replace-special " isa?" ) " isa_QMARK" ))
549
+ (should (equal (cider-grimoire-replace-special " really-isa?" ) " really_DASH_isa_QMARK" ))
550
+ (should (equal (cider-grimoire-replace-special " defn-" ) " defn_DASH" ))
551
+ (should (equal (cider-grimoire-replace-special " -map-indexed" ) " DASH_map_DASH_indexed" ))
552
+ (should (equal (cider-grimoire-replace-special " -foo-bar-baz-" ) " DASH_foo_DASH_bar_DASH_baz_DASH" )))
551
553
552
554
(ert-deftest cider-grimoire-url ()
553
555
(should (equal " http://grimoire.arrdem.com/1.5.0/clojure.core/defn_DASH/"
You can’t perform that action at this time.
0 commit comments