(when (funcall testfn symbol)
;; Don't record the current entry in the stack.
(setq help-xref-stack-item nil)
- (cons name
- (funcall descfn symbol buffer frame))))
+ (let ((help-xref-stack nil)
+ (help-xref-forward-stack nil))
+ (funcall descfn symbol buffer frame))
+ (cons name (buffer-string))))
describe-symbol-backends))))
(single (null (cdr docs))))
(while (cdr docs)
;; Don't record the `describe-variable' item in the stack.
(setq help-xref-stack-item nil)
(help-setup-xref (list #'describe-symbol symbol) nil))
+ (goto-char (point-max))
+ (help-xref--navigation-buttons)
(goto-char (point-min))))))
;;;###autoload
(while (and (not (bobp)) (bolp))
(delete-char -1))
(insert "\n")
- (when (or help-xref-stack help-xref-forward-stack)
- (insert "\n"))
- ;; Make a back-reference in this buffer if appropriate.
- (when help-xref-stack
- (help-insert-xref-button help-back-label 'help-back
- (current-buffer)))
- ;; Make a forward-reference in this buffer if appropriate.
- (when help-xref-forward-stack
- (when help-xref-stack
- (insert "\t"))
- (help-insert-xref-button help-forward-label 'help-forward
- (current-buffer)))
- (when (or help-xref-stack help-xref-forward-stack)
- (insert "\n")))
+ (help-xref--navigation-buttons))
(set-buffer-modified-p old-modified)))))
+(defun help-xref--navigation-buttons ()
+ (let ((inhibit-read-only t))
+ ;; Make a back-reference in this buffer if appropriate.
+ (when help-xref-stack
+ (ensure-empty-lines 1)
+ (help-insert-xref-button help-back-label 'help-back
+ (current-buffer)))
+ ;; Make a forward-reference in this buffer if appropriate.
+ (when help-xref-forward-stack
+ (when help-xref-stack
+ (insert "\t"))
+ (help-insert-xref-button help-forward-label 'help-forward
+ (current-buffer)))
+ (unless (bolp)
+ (insert "\n"))))
+
;;;###autoload
(defun help-xref-button (match-number type &rest args)
"Make a hyperlink for cross-reference text previously matched.