diff options
author | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-07 22:50:58 -0200 |
---|---|---|
committer | Artur Malabarba <bruce.connor.am@gmail.com> | 2015-01-07 22:50:58 -0200 |
commit | 976cf5e95dce4fd4d6f74350c8b9ea66aa13c0fd (patch) | |
tree | 683e71610f1f8e0faf736e4b5c293d70c2caa69e /sx-switchto.el | |
parent | a11d7997aa61f6e5bcb5fb6974c25b914b3bd001 (diff) | |
parent | 95e9f6069ba328249c0e8ac86efdc888437ac187 (diff) |
Merge branch 'master' into vermiculus/bot-branch
Diffstat (limited to 'sx-switchto.el')
-rw-r--r-- | sx-switchto.el | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/sx-switchto.el b/sx-switchto.el index 458586a..ed83360 100644 --- a/sx-switchto.el +++ b/sx-switchto.el @@ -54,18 +54,6 @@ ;;; These are keys which depend on context. ;;;; For instance, it makes no sense to have `switch-site' bound to a ;;;; key on a buffer with no `sx-question-list--site' variable. -(defmacro sx--define-conditional-key (keymap key def &rest body) - "In KEYMAP, define key sequence KEY as DEF conditionally. -This is like `define-key', except the definition \"disapears\" -whenever BODY evaluates to nil." - (declare (indent 3) - (debug (form form form &rest sexp))) - `(define-key ,keymap ,key - '(menu-item - ,(format "maybe-%s" (or (car (cdr-safe def)) def)) ignore - :filter (lambda (&optional _) - (when (progn ,@body) ,def))))) - (sx--define-conditional-key sx-switchto-map "s" #'sx-question-list-switch-site (and (boundp 'sx-question-list--site) sx-question-list--site)) |