From 065ef960b3fcf80ea68dbcbbcca8c276a2d09b07 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 5 Jan 2015 00:53:01 -0200 Subject: Move sx--multiple-read to sx-tag-multiple-read --- sx.el | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 3271755..9924308 100644 --- a/sx.el +++ b/sx.el @@ -176,24 +176,6 @@ All ARGS are passed to `completing-read' or `ido-completing-read'." (apply (if ido-mode #'ido-completing-read #'completing-read) args)) -(defun sx--multiple-read (prompt hist-var) - "Interactively query the user for a list of strings. -Call `read-string' multiple times, until the input is empty. - -PROMPT is a string displayed to the user and should not end with -a space nor a colon. HIST-VAR is a quoted symbol, indicating a -list in which to store input history." - (let (list input) - (while (not (string= - "" - (setq input (read-string - (concat prompt " [" - (mapconcat #'identity list ",") - "]: ") - "" hist-var)))) - (push input list)) - list)) - (defmacro sx-sorted-insert-skip-first (newelt list &optional predicate) "Inserted NEWELT into LIST sorted by PREDICATE. This is designed for the (site id id ...) lists. So the first car -- cgit v1.2.3 From e061fb947a02290314be7247d81963e7bfd0987b Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 5 Jan 2015 16:31:10 -0200 Subject: Move define-conditional-key to sx.el --- sx-switchto.el | 12 ------------ sx.el | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'sx.el') 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)) diff --git a/sx.el b/sx.el index 9924308..bfc647d 100644 --- a/sx.el +++ b/sx.el @@ -247,6 +247,18 @@ Anything before the (sub)domain is removed." (rx string-start (or (and (0+ word) (optional ":") "//"))) "" url))) +(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))))) + ;;; Printing request data (defvar sx--overlays nil -- cgit v1.2.3 From 5b66d7865fb9f160586c7d579f8df7195804e927 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 6 Jan 2015 19:29:46 -0200 Subject: Typo --- sx.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index bfc647d..8680fc3 100644 --- a/sx.el +++ b/sx.el @@ -249,7 +249,7 @@ Anything before the (sub)domain is removed." (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\" +This is like `define-key', except the definition \"disappears\" whenever BODY evaluates to nil." (declare (indent 3) (debug (form form form &rest sexp))) -- cgit v1.2.3 From 9c55ae8efcd7a9b9f940d00f9a14dc439a7c225b Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Tue, 6 Jan 2015 19:57:22 -0200 Subject: Use site_par instead of site --- sx.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 3271755..5aec9e5 100644 --- a/sx.el +++ b/sx.el @@ -90,7 +90,7 @@ with a `link' property)." (defun sx--link-to-data (link) "Convert string LINK into data that can be displayed." - (let ((result (list (cons 'site (sx--site link))))) + (let ((result (list (cons 'site_par (sx--site link))))) ;; Try to strip a question or answer ID (when (or ;; Answer -- cgit v1.2.3