commit fc7e48872cd07b73353f4dec141591e65765f490 parent 6db39e4ac1fccfd2972bb62da8fe1d7cc5bcf540 Author: Alex Balgavy <alex@balgavy.eu> Date: Thu, 15 Jul 2021 20:12:20 +0200 emacs: fix speedbar bindings Diffstat:
M | emacs/config.org | | | 10 | ++++++++-- |
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/emacs/config.org b/emacs/config.org @@ -208,16 +208,22 @@ Make speed bar show in the current frame. (use-package sr-speedbar :config (setq sr-speedbar-right-side nil) + (define-key speedbar-mode-map (kbd "q") 'sr-speedbar-close) :bind (("C-c F" . sr-speedbar-toggle))) #+end_src +Jump to speedbar. sr-speedbar-exist-p can be void, so I check if it's bound first. +If it's not bound, or if it's false, first open the speedbar. +Then, select it. + #+begin_src emacs-lisp (global-set-key (kbd "C-c f") (lambda () (interactive) - (unless (sr-speedbar-exist-p) + (if (or (not (boundp 'sr-speedbar-exist-p)) + (not (sr-speedbar-exist-p))) (sr-speedbar-open)) - (sr-speedbar-select-window))) + (sr-speedbar-select-window))) #+end_src * Interface