aboutsummaryrefslogtreecommitdiff
path: root/sx-switchto.el
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-01-16 13:07:20 -0200
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-01-16 13:07:20 -0200
commit574944fa6ca61ce07e0eb059711ead2b74891e44 (patch)
treefacfe1ef83d2eace51dc170a19e8a1e11e70c90f /sx-switchto.el
parent7a75cd61e822a4895b85bc17780b163bd6876ca7 (diff)
parent389e433953bba4003b102748dbbf5f8a9b421a51 (diff)
Merge branch 'master' into more-tests
Diffstat (limited to 'sx-switchto.el')
-rw-r--r--sx-switchto.el16
1 files changed, 2 insertions, 14 deletions
diff --git a/sx-switchto.el b/sx-switchto.el
index 76804e4..6a195e0 100644
--- a/sx-switchto.el
+++ b/sx-switchto.el
@@ -1,4 +1,4 @@
-;;; sx-switchto.el --- Keymap for navigating between pages. -*- lexical-binding: t; -*-
+;;; sx-switchto.el --- keymap for navigating between pages -*- lexical-binding: t; -*-
;; Copyright (C) 2014 Artur Malabarba
@@ -33,7 +33,7 @@
(mapc (lambda (x) (define-key sx-switchto-map (car x) (cadr x)))
'(
- ;; These immitate the site's G hotkey.
+ ;; These imitate the site's G hotkey.
("a" sx-ask)
("h" sx-tab-frontpage)
("m" sx-tab-meta-or-main)
@@ -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))