Paraphrasing a question I previously asked on SuperUser because, IMO, the answer found there does not resolve the issue.


For the most part I prefer to disable Emacs' fringe. (I customize fringe-mode to 0 a/k/a 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).

How can I configure Emacs to switch to fringe-mode of (nil . 0) a/k/a left-only when entering edebug and restore the previous fringe-mode when exiting?


Since Emacs 24.3 is the latest stable release as of this writing, I have a preference for solutions that work there. Since Emacs 24.4 is available, in feature-freeze, and actively in use by several users of this site, I'm accepting that answer.

  • 1
    I can confirm that the suggested code works perfectly for me. You might want to verify the behavior on your side with emacs -q – Sigma Oct 6 '14 at 16:08
  • Even the message code? I've tried emacs -Q + eval either one, or both, in the *scratch* buffer, call a command I'd previously instrumented with C-u C-M-x. I have yet to see any joy. – purple_arrows Oct 6 '14 at 21:22
  • Could you describe what you mean by "works perfectly"? – purple_arrows Oct 6 '14 at 21:30
  • 1
    To be clear: I'm not claiming that the code given above fails to compile, or that the functions in the lambda forms are somehow broken. I'm claiming that the call to add-hook creates a hook symbol that never existed before, and I see no reason to expect edebug to ever consult that symbol again. – purple_arrows Oct 7 '14 at 1:18
  • 1
    People the discrepancy probably comes from emacs versions. In Emacs 24.3, edebug-mode is a standard function, and edebug-mode-hook really isn’t used nor defined. In Emacs 24.4, edebug-mode is defined through define-minor-mode, so edebug-mode-hook is defined and used. – Malabarba Oct 7 '14 at 10:22

If you’re using Emacs 24.4, the code you’ve posted (which I’m repeating below) should be enough.

(add-hook 'edebug-mode-hook
          (lambda ()
             (set (make-local-variable 'fringe-mode)
                  (if edebug-mode '(nil . 0) 0)))))

I’m positing this as answer for completeness, I understand it doesn’t statisfy your needs. I tried to look a bit into edebug’s source code, to find a function I could advise and get a similar effect, but failed.

On Emacs 24.4

Emacs 24.4 has been in feature freeze for a while now and is unlikely to change very much until release. Plenty of people are using it daily, and I haven’t run into any problems whatsoever.
I won’t go into how to install it, as that’s another question entirely.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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