emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/racket-mode 296de3c155: racket-describe: truncate-lines, d


From: ELPA Syncer
Subject: [nongnu] elpa/racket-mode 296de3c155: racket-describe: truncate-lines, disable line numbers; fixes #678
Date: Wed, 15 Nov 2023 16:00:33 -0500 (EST)

branch: elpa/racket-mode
commit 296de3c15580805f2d84dd30e01eb9b12f18bc3f
Author: Greg Hendershott <git@greghendershott.com>
Commit: Greg Hendershott <git@greghendershott.com>

    racket-describe: truncate-lines, disable line numbers; fixes #678
---
 racket-describe.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/racket-describe.el b/racket-describe.el
index 43cc6ebcbf..6c95763c57 100644
--- a/racket-describe.el
+++ b/racket-describe.el
@@ -128,9 +128,13 @@ anchor. If numberp, move to that position."
          (concat path (cond ((stringp goto) (concat " " goto))
                             ((numberp goto) (format " %s" goto))))
          'face '(:height 0.75)))
-  (cl-macrolet ((disable (id) `(and (boundp ',id) ,id (fboundp ',id) (,id 
-1))))
-    (disable linum-mode)
-    (disable display-line-numbers-mode))
+  ;; Although `shr' carefully fills to fit window width, if user
+  ;; resizes window or changes text scaling, we don't want it to wrap.
+  (setq truncate-lines t)
+  ;; Modes that show line numbers in the buffer just eat up valuable
+  ;; space; disable. (Also we'll set a text prop below.)
+  (when (fboundp 'linum-mode)                (linum-mode -1))
+  (when (fboundp 'display-line-numbers-mode) (display-line-numbers-mode -1))
   (let ((buffer-read-only nil))
     (erase-buffer)
     (let ((shr-use-fonts nil)
@@ -152,6 +156,10 @@ anchor. If numberp, move to that position."
     (goto-char (point-min))
     (while (re-search-forward (string racket--scribble-temp-nbsp) nil t)
       (replace-match " " t t))
+    ;; Just in case disabling `display-line-numbers-mode' doesn't
+    ;; suffice (#678), as well as to cover e.g. user enabling
+    ;; `global-display-line-numbers-mode' later:
+    (put-text-property (point-min) (point-max) 'display-line-numbers-disable t)
     (racket--describe-goto goto)))
 
 (defun racket--describe-goto (goto)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]