How to set single click to enter directory in emacs speedbar?

392 views Asked by At

I've got speedbar set up and working, but I want to change it so a single click (Mouse-1) will allow me to go inside a directory. I've already googled around and looked at the relevant docs:

The mouse bindings are:

Mouse-1
    Move cursor to that location.
Mouse-2
Double-Mouse-1
    Activate the current button. Double-Mouse-1 is called a double click on
    other platforms, and is useful for windows users with two button mice.

So, basically I've been trying to find how to map Mouse-1 to the function currently bound to Mouse-2, but only inside the speedbar frame. The closest I've found to something to do that is an ecb setting:

(setq ecb-primary-secondary-mouse-buttons 'mouse-1--C-mouse-1)

but I'm not using ecb, I'm just using speedbar. Maybe there's some other way to do it?

1

There are 1 answers

0
damd On

Adding this line to `speedbar-file-key-map' should do the trick:

(define-key map (kbd "<down-mouse-1>") 'dframe-click)

If you don't want to edit speedbar.el directly, you can use e.g. a hook.