hahahasan
hahahasan

Reputation: 3

Remove fringe arrows in the Emacs minimap

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.

Upvotes: 0

Views: 359

Answers (1)

phils
phils

Reputation: 73334

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)))

Upvotes: 0

Related Questions