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.

For the most part I prefer to disable Emacs' fringe with fringe-mode no-fringes. But I like to have the left fringe active when debugging elisp code (for the little fringe arrow pointing to the active line).

I found edebug-setup-hook for setting fringe-mode to left-only when entering edebug, but I'm fairly certain that's not what that hook is for. (Basing that on the fact that Emacs resets edebug-setup-hook to nil all the time.)

Is there a way to set fringe-mode back to no-fringes upon exiting the debugger? Is there a better way to set it to left-only upon entering?

share|improve this question

1 Answer 1

I think this does what you are asking for:

(add-hook 'edebug-mode-hook
          (lambda ()
            (set-fringe-mode
             (set (make-local-variable 'fringe-mode)
                  (if edebug-mode '(nil . 0) 0)))))
share|improve this answer
    
Which version of Emacs are you using? I've got 24.3.1, and mine doesn't have edebug-mode or an edebug-mode-hook. –  purple_arrows Sep 17 '13 at 15:05
    
Emacs 24.3 does have edebug-mode, but you have to first load library edebug.el to then see it using C-h f. Each mode is defined to use a mode hook variable, if one is referenced (e.g., by add-hook). IOW, the variable does not need to preexist --- this is true of modes in general. –  Drew Sep 17 '13 at 17:16
    
Coming back to this question more than a year too late, my apologies. The code as given did not work, I think because edebug is implemented as a recursive edit, not a true minor mode. Mind if I move to the new emacs.SE? –  purple_arrows Oct 5 '14 at 19:00
    
I certainly don't mind. Hope you find what you are looking for. Wrt the code above, you might want to say what "did not work" amounts to. –  Drew Oct 6 '14 at 3:36

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.