0

I would like to get rid of the fringes in the emacs minimap buffer. Specifically the line continuation arrows. I would still like them for my main buffers but find them pointless in the minimap.

I have tried to add the following to my ~/.emacs file:

(add-hook 'minimap-mode-hook (lambda () (setq indicate-empty-lines nil)))
(add-hook 'minimap-mode-hook (lambda () (setq overflow-newline-into-fringeh nil)))
(add-hook 'minimap-mode-hook (lambda () (setq visual-line-mode 0)))

But they don't seem to do much. I am fairly inexperienced when it comes lisp and modifying emacs to my whims so maybe I am misunderstanding how this should be done.

I have tried looking at the GNU pages but still cannot manage. I would appreciate an explanation of what I am doing wrong please.

Drew
  • 29,895
  • 7
  • 74
  • 104
hahahasan
  • 3
  • 3

1 Answers1

0

I've had a play with it, and Minimap is a little odd in not setting a major mode or otherwise running any hooks in the minimap buffer (minimap-mode itself is a global minor mode), so it looks like we need to use advice to do this.

You've said "line continuation arrows", but after trying it I think you meant "line truncation arrows", so that's what I've targeted.

This seems to do the trick:

(define-advice minimap-new-minimap (:after () hide-truncation-indicators)
  "Hide truncation fringe indicators in the minimap buffer."
  (with-current-buffer minimap-buffer-name
    (push '(truncation nil nil) ;; no truncation indicators
          ;; '(truncation nil right-arrow) ;; right indicator only
          ;; '(truncation left-arrow nil) ;; left indicator only
          ;; '(truncation left-arrow right-arrow) ;; default
          fringe-indicator-alist)))
phils
  • 71,335
  • 11
  • 153
  • 198
  • n.b. I also suggest you log a feature request for this library to suggest that it `define-derived-mode` for use when setting up that buffer, so that custom code has a better way to hook into it. – phils Apr 25 '20 at 07:37