Skip to content

Commit

Permalink
Don't set shr-width to 76 unless company-mode buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
greghendershott committed Sep 23, 2024
1 parent 937e2bc commit 75a6e73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions racket-scribble-anchor.el
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
(kill-buffer buf)))
(with-current-buffer (get-buffer-create name)
(goto-char (point-min))
(racket--scribble-path+anchor-insert path anchor)
;; width 76 for company-quickhelp-mode
(racket--scribble-path+anchor-insert path anchor 76)
(goto-char (point-min))
(setq buffer-read-only t)
(current-buffer))))))
Expand Down Expand Up @@ -56,7 +57,7 @@ Uses `racket--path+anchor-cache'."
(ring-insert racket--path+anchor-ring item)
str))))

(defun racket--scribble-path+anchor-insert (path anchor)
(defun racket--scribble-path+anchor-insert (path anchor &optional width)
(let* ((tramp-verbose 2) ;avoid excessive tramp messages
(dom (racket--html-file->dom path))
(dom (racket--elements-for-anchor dom anchor))
Expand All @@ -67,7 +68,7 @@ Uses `racket--path+anchor-cache'."
(save-excursion
(let ((shr-use-fonts nil)
(shr-external-rendering-functions `((span . ,#'racket-render-tag-span)))
(shr-width 76)) ;for company-quickhelp-mode
(shr-width width))
(shr-insert-document dom)))
(while (re-search-forward (string racket--scribble-temp-nbsp) nil t)
(replace-match " " t t))))
Expand Down

0 comments on commit 75a6e73

Please sign in to comment.