Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I am trying to use both minimap and fill-column-indicator modes in emacs, with fci-mode enabled for all buffers but the minimap.

I've adapted code from this similar answer, and made this for my .emacs file :

(require 'fill-column-indicator)
(require 'minimap)                   
(define-global-minor-mode my-global-fci-mode fci-mode
  (lambda ()
    (unless minimap-mode
      (fci-mode))))
(my-global-fci-mode 1)

With this code, fci-mode gets enabled in all buffers, including the minimap one. Why?

share|improve this question
    
For readers who are interested in knowing more about fci-mode, here is the link to the Github site for Al Parker: github.com/alpaker/Fill-Column-Indicator –  lawlist Feb 18 at 19:20
1  
My best guess is that fci-mode activates as soon as the minimap buffer is created, and before the function minimap-create has a chance to finish. The function minimap-create calls a helper function minimap-new-minimap, which contains (minimap-mode 1). Therefore, fci-mode is active in the minimap buffer because your lambda function has already been run once when the minimap buffer was first created. My suggestion would be to create a new function for minimap-create and put (fci-mode 0) at the bottom of it. –  lawlist Feb 18 at 22:45
    
What @lawlist says sounds like it might well explain the behavior. But before trying to work around the problem, I'd suggest adding some debug info (via message or even debug), to confirm the problem or understand it better. Once you know just what is happening you can think about how to fix it, based on that knowledge. –  Drew Feb 19 at 3:30
    
Thanks for your replies. I added a message command as @Drew suggested and saw that minimap-mode = nil when the lambda function is called. @lawlist, would I create the new minimap-create function in my .emacs file? Thanks. –  Romain Deterre Feb 19 at 22:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.