@@ -473,6 +473,26 @@ the buffer."
473
473
(declare-function cider-doc-lookup " cider-doc" )
474
474
(declare-function cider--eldoc-remove-dot " cider-eldoc" )
475
475
476
+ ; ; Taken from: https://github.com/emacs-mirror/emacs/blob/65c8c7cb96c14f9c6accd03cc8851b5a3459049e/lisp/help-mode.el#L551-L565
477
+ (defun cider--make-back-forward-xrefs (&optional buffer )
478
+ " Insert special references `back' and `forward' , as in `help-make-xrefs' "
479
+ (with-current-buffer (or buffer (current-buffer ))
480
+ (insert " \n " )
481
+ (when (or help-xref-stack help-xref-forward-stack)
482
+ (insert " \n " ))
483
+ ; ; Make a back-reference in this buffer if appropriate.
484
+ (when help-xref-stack
485
+ (help-insert-xref-button help-back-label 'help-back
486
+ (current-buffer )))
487
+ ; ; Make a forward-reference in this buffer if appropriate.
488
+ (when help-xref-forward-stack
489
+ (when help-xref-stack
490
+ (insert " \t " ))
491
+ (help-insert-xref-button help-forward-label 'help-forward
492
+ (current-buffer )))
493
+ (when (or help-xref-stack help-xref-forward-stack)
494
+ (insert " \n " ))))
495
+
476
496
; ; Similar to https://github.com/emacs-mirror/emacs/blob/65c8c7cb96c14f9c6accd03cc8851b5a3459049e/lisp/help-mode.el#L404
477
497
(defun cider--doc-make-xrefs ()
478
498
" Parse and hyperlink documentation cross-references in current buffer.
@@ -495,23 +515,7 @@ through a stack of help buffers. Variables `help-back-label' and
495
515
'type 'help-xref
496
516
'help-function (apply-partially #'cider-doc-lookup
497
517
(cider--eldoc-remove-dot symbol))))))
498
-
499
- ; ; create back and forward buttons if appropiate
500
- (insert " \n " )
501
- (when (or help-xref-stack help-xref-forward-stack)
502
- (insert " \n " ))
503
- ; ; Make a back-reference in this buffer if appropriate.
504
- (when help-xref-stack
505
- (help-insert-xref-button help-back-label 'help-back
506
- (current-buffer )))
507
- ; ; Make a forward-reference in this buffer if appropriate.
508
- (when help-xref-forward-stack
509
- (when help-xref-stack
510
- (insert " \t " ))
511
- (help-insert-xref-button help-forward-label 'help-forward
512
- (current-buffer )))
513
- (when (or help-xref-stack help-xref-forward-stack)
514
- (insert " \n " )))
518
+ (cider--make-back-forward-xrefs))
515
519
516
520
517
521
; ;; Words of inspiration
0 commit comments