From ef1d321a157e300d29c48e461257897fca1c9aa4 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sat, 20 Dec 2014 02:01:52 -0500 Subject: Expand `let-alist' upon `sx-assoc-let' expansion --- sx.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 6f4e7c7..97a6d61 100644 --- a/sx.el +++ b/sx.el @@ -313,10 +313,11 @@ with a `link' property)." If ALIST doesn't have a `site' property, one is created using the `link' property." (declare (indent 1) (debug t)) + (require 'let-alist) `(progn - (require 'let-alist) (sx--ensure-site ,alist) - (let-alist ,alist ,@body))) + ,(macroexpand + `(let-alist ,alist ,@body)))) (defcustom sx-init-hook nil "Hook run when SX initializes. -- cgit v1.2.3 From e3aa448f7d456d857879e53ae7b2268d8b5d97c2 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Sat, 20 Dec 2014 02:00:24 -0500 Subject: Hotfix undefined variable --- sx.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 7d67835..cda1acd 100644 --- a/sx.el +++ b/sx.el @@ -107,7 +107,8 @@ is intentionally skipped." (defun sx-user-error (format-string &rest args) "Like `user-error', but prepend FORMAT-STRING with \"[sx]\". See `format'." - (signal 'user-error (list (apply #'format (concat "[sx] " format) args)))) + (signal 'user-error + (list (apply #'format (concat "[sx] " format-string) args)))) (defun sx-message (format-string &rest args) "Display FORMAT-STRING as a message with ARGS. -- cgit v1.2.3 From d51791fb6ae69e3b426f7d598920b4349858908f Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 22 Dec 2014 11:37:35 -0200 Subject: Refactor .site to .site_par It turns out some api objects do have a site property, except its value is not a string, it is another object. The actual string we've been referring to as .site is the .site.api_site_parameter To avoid conflicts, I've renamed all our uses of .site to .site_par, and sx-assoc-let now makes sure the object has a .site_par value, instead of a .site value (which it may or may not have now, and is the same object that the api refers to as site). --- sx-interaction.el | 18 +++++++++--------- sx-question-list.el | 2 +- sx-question-mode.el | 2 +- sx-question.el | 18 +++++++++--------- sx.el | 9 ++++++--- 5 files changed, 26 insertions(+), 23 deletions(-) (limited to 'sx.el') diff --git a/sx-interaction.el b/sx-interaction.el index 2768c8d..342ae1c 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -142,10 +142,10 @@ Element can be a question, answer, or comment." (cl-case .type (answer (sx-display-question - (sx-question-get-from-answer .site .id) 'focus)) + (sx-question-get-from-answer .site_par .id) 'focus)) (question (sx-display-question - (sx-question-get-question .site .id) 'focus)))))) + (sx-question-get-question .site_par .id) 'focus)))))) ;;; Displaying @@ -206,7 +206,7 @@ changes." :auth 'warn :url-method "POST" :filter sx-browse-filter - :site .site)))) + :site .site_par)))) ;; The api returns the new DATA. (when (> (length result) 0) (sx--copy-data (elt result 0) data) @@ -247,14 +247,14 @@ TEXT is a string. Interactively, it is read from the minibufer." :auth 'warn :url-method "POST" :filter sx-browse-filter - :site .site + :site .site_par :keywords `((body . ,text))))) ;; The api returns the new DATA. (when (> (length result) 0) (sx--add-comment-to-object (elt result 0) (if .post_id - (sx--get-post .post_type .site .post_id) + (sx--get-post .post_type .site_par .post_id) data)) ;; Display the changes in `data'. (sx--maybe-update-display))))) @@ -287,7 +287,7 @@ ID is an integer." (car (cl-member-if (lambda (x) (sx-assoc-let x (and (equal (or .answer_id .question_id) id) - (equal .site site)))) + (equal .site_par site)))) db)))) (defun sx--add-comment-to-object (comment object) @@ -320,7 +320,7 @@ from context at point." (let ((buffer (current-buffer))) (pop-to-buffer (sx-compose-create - .site data + .site_par data ;; Before send hook (when .comment_id (list #'sx--comment-valid-p)) ;; After send functions @@ -338,7 +338,7 @@ from context at point." (defun sx--interactive-site-prompt () "Query the user for a site." (let ((default (or sx-question-list--site - (sx-assoc-let sx-question-mode--data .site) + (sx-assoc-let sx-question-mode--data .site_par) sx-default-site))) (funcall (if ido-mode #'ido-completing-read #'completing-read) (format "Site (%s): " default) @@ -372,7 +372,7 @@ context at point. " (sx-assoc-let data (pop-to-buffer (sx-compose-create - .site .question_id nil + .site_par .question_id nil ;; After send functions (list (lambda (_ res) (sx--add-answer-to-question-object diff --git a/sx-question-list.el b/sx-question-list.el index 62ce032..4b6c4ef 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -127,7 +127,7 @@ elements: Also see `sx-question-list-refresh'." (sx-assoc-let question-data (let ((favorite (if (member .question_id - (assoc .site + (assoc .site_par sx-favorites--user-favorite-list)) (if (char-displayable-p ?\x2b26) "\x2b26" "*") " "))) (list diff --git a/sx-question-mode.el b/sx-question-mode.el index a60cf3a..7d61167 100644 --- a/sx-question-mode.el +++ b/sx-question-mode.el @@ -254,7 +254,7 @@ query the api." (if no-update sx-question-mode--data (sx-assoc-let sx-question-mode--data - (sx-question-get-question .site .question_id)))) + (sx-question-get-question .site_par .question_id)))) (goto-char point) (when (equal (selected-window) (get-buffer-window (current-buffer))) diff --git a/sx-question.el b/sx-question.el index 801384a..3fcc438 100644 --- a/sx-question.el +++ b/sx-question.el @@ -94,8 +94,8 @@ If no cache exists for it, initialize one with SITE." "Non-nil if QUESTION has been read since last updated. See `sx-question--user-read-list'." (sx-assoc-let question - (sx-question--ensure-read-list .site) - (let ((ql (cdr (assoc .site sx-question--user-read-list)))) + (sx-question--ensure-read-list .site_par) + (let ((ql (cdr (assoc .site_par sx-question--user-read-list)))) (and ql (>= (or (cdr (assoc .question_id ql)) 0) .last_activity_date))))) @@ -107,14 +107,14 @@ read, i.e., if it was `sx-question--read-p'. See `sx-question--user-read-list'." (prog1 (sx-assoc-let question - (sx-question--ensure-read-list .site) - (let ((site-cell (assoc .site sx-question--user-read-list)) + (sx-question--ensure-read-list .site_par) + (let ((site-cell (assoc .site_par sx-question--user-read-list)) (q-cell (cons .question_id .last_activity_date)) cell) (cond ;; First question from this site. ((null site-cell) - (push (list .site q-cell) sx-question--user-read-list)) + (push (list .site_par q-cell) sx-question--user-read-list)) ;; Question already present. ((setq cell (assoc .question_id site-cell)) ;; Current version is newer than cached version. @@ -149,18 +149,18 @@ If no cache exists for it, initialize one with SITE." (defun sx-question--hidden-p (question) "Non-nil if QUESTION has been hidden." (sx-assoc-let question - (sx-question--ensure-hidden-list .site) - (let ((ql (cdr (assoc .site sx-question--user-hidden-list)))) + (sx-question--ensure-hidden-list .site_par) + (let ((ql (cdr (assoc .site_par sx-question--user-hidden-list)))) (and ql (memq .question_id ql))))) (defun sx-question--mark-hidden (question) "Mark QUESTION as being hidden." (sx-assoc-let question - (let ((site-cell (assoc .site sx-question--user-hidden-list))) + (let ((site-cell (assoc .site_par sx-question--user-hidden-list))) ;; If question already hidden, do nothing. (unless (memq .question_id site-cell) ;; First question from this site. - (push (list .site .question_id) sx-question--user-hidden-list) + (push (list .site_par .question_id) sx-question--user-hidden-list) ;; Question wasn't present. ;; Add it in, but make sure it's sorted (just in case we need ;; it later). diff --git a/sx.el b/sx.el index cda1acd..78995a8 100644 --- a/sx.el +++ b/sx.el @@ -303,9 +303,12 @@ DATA can also be the link itself." DATA can be a question, answer, comment, or user (or any object with a `link' property)." (when data - (unless (assq 'site data) - (setcdr data (cons (cons 'site (sx--site data)) - (cdr data)))) + (let-alist data + (unless .site_par + (setcdr data (cons (cons 'site_par + (or .site.api_site_parameter + (sx--site data))) + (cdr data))))) data)) (defmacro sx-assoc-let (alist &rest body) -- cgit v1.2.3 From aa9002f4dbf29d6c4e9acb551d4340410bc22e50 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Mon, 22 Dec 2014 14:03:22 -0200 Subject: Link-to-data creates site_par --- sx.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 78995a8..1b15ad3 100644 --- a/sx.el +++ b/sx.el @@ -323,7 +323,7 @@ If ALIST doesn't have a `site' property, one is created using the (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))))) (when (or ;; Answer (and (or (string-match "/a/\\([0-9]+\\)/[0-9]+\\(#.*\\|\\)\\'" link) -- cgit v1.2.3 From 5225bd4ae6e26177a4daf62ddc5e807784e7c46e Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 25 Dec 2014 12:47:28 -0200 Subject: Fix merge --- sx.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index a31c0a0..79d51f7 100644 --- a/sx.el +++ b/sx.el @@ -69,9 +69,12 @@ DATA can also be the link itself." DATA can be a question, answer, comment, or user (or any object with a `link' property)." (when data - (unless (assq 'site data) - (setcdr data (cons (cons 'site (sx--site data)) - (cdr data)))) + (let-alist data + (unless .site_par + (setcdr data (cons (cons 'site_par + (or .site.api_site_parameter + (sx--site data))) + (cdr data))))) data)) (defmacro sx-assoc-let (alist &rest body) -- cgit v1.2.3 From 93573c854da4c502ccca676c1dd70bf680ab1036 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 26 Dec 2014 16:32:03 -0500 Subject: Bump let-alist required version to 1.0.3 Syntax introduced in commits: * d51791fb6ae69e3b426f7d598920b4349858908f * 5225bd4ae6e26177a4daf62ddc5e807784e7c46e --- sx.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 79d51f7..9a5a6a0 100644 --- a/sx.el +++ b/sx.el @@ -6,7 +6,7 @@ ;; URL: https://github.com/vermiculus/sx.el/ ;; Version: 0.1 ;; Keywords: help, hypermedia, tools -;; Package-Requires: ((emacs "24.1") (cl-lib "0.5") (json "1.3") (markdown-mode "2.0") (let-alist "1.0.1")) +;; Package-Requires: ((emacs "24.1") (cl-lib "0.5") (json "1.3") (markdown-mode "2.0") (let-alist "1.0.3")) ;; This program is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -- cgit v1.2.3 From 6c20202ad50aeba70290de860bd1f5feb944c955 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 27 Dec 2014 15:31:22 -0200 Subject: Don't rely on the new feature. This is to avoid a bug in package.el which only gets fixed in Emacs 25 Unfortunately, there's no safe way to use a new feature offered by a previously defined macro, because files were not reloaded on upgrade. After a couple of weeks, once we can expect most of our users to have restarted Emacs at least once since the last upgrade, we can start relying on this new feature. --- sx.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 9a5a6a0..be37766 100644 --- a/sx.el +++ b/sx.el @@ -72,7 +72,7 @@ with a `link' property)." (let-alist data (unless .site_par (setcdr data (cons (cons 'site_par - (or .site.api_site_parameter + (or (cdr (assq 'api_site_parameter .site)) (sx--site data))) (cdr data))))) data)) -- cgit v1.2.3 From 2012346d11a04f7cd9871fced0df2417b5503336 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 27 Dec 2014 22:54:42 -0200 Subject: Explicitly request last_activity_date --- sx.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 508de46..a63c155 100644 --- a/sx.el +++ b/sx.el @@ -148,6 +148,7 @@ If ALIST doesn't have a `site' property, one is created using the question.comments question.answers question.last_editor + question.last_activity_date question.accepted_answer_id question.link question.upvoted @@ -168,6 +169,7 @@ If ALIST doesn't have a `site' property, one is created using the comment.comment_id answer.answer_id answer.last_editor + answer.last_activity_date answer.link answer.share_link answer.owner -- cgit v1.2.3 From c37022ffbc52b900d81eee05f3c2c3d5fe6fee01 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 27 Dec 2014 23:06:00 -0200 Subject: Initial implementation of sx-completing-read --- sx-interaction.el | 8 ++++---- sx-question-list.el | 3 +-- sx-tab.el | 8 ++++---- sx.el | 5 +++++ 4 files changed, 14 insertions(+), 10 deletions(-) (limited to 'sx.el') diff --git a/sx-interaction.el b/sx-interaction.el index 372a5b1..9ced1ab 100644 --- a/sx-interaction.el +++ b/sx-interaction.el @@ -340,10 +340,10 @@ from context at point." (let ((default (or sx-question-list--site (sx-assoc-let sx-question-mode--data .site) sx-default-site))) - (funcall (if ido-mode #'ido-completing-read #'completing-read) - (format "Site (%s): " default) - (sx-site-get-api-tokens) nil t nil nil - default))) + (sx-completing-read + (format "Site (%s): " default) + (sx-site-get-api-tokens) nil t nil nil + default))) ;;;###autoload (defun sx-ask (site) diff --git a/sx-question-list.el b/sx-question-list.el index 4bd6478..d84d1ea 100644 --- a/sx-question-list.el +++ b/sx-question-list.el @@ -559,12 +559,11 @@ This does not update `sx-question-mode--window'." (defun sx-question-list-switch-site (site) "Switch the current site to SITE and display its questions. -Use `ido-completing-read' if variable `ido-mode' is active. Retrieve completions from `sx-site-get-api-tokens'. Sets `sx-question-list--site' and then call `sx-question-list-refresh' with `redisplay'." (interactive - (list (funcall (if ido-mode #'ido-completing-read #'completing-read) + (list (sx-completing-read "Switch to site: " (sx-site-get-api-tokens) (lambda (site) (not (equal site sx-question-list--site))) t))) diff --git a/sx-tab.el b/sx-tab.el index 6c5e21e..32a7784 100644 --- a/sx-tab.el +++ b/sx-tab.el @@ -34,10 +34,10 @@ (defun sx-tab-switch (tab) "Switch to another question-list tab." (interactive - (list (funcall (if ido-mode #'ido-completing-read #'completing-read) - "Switch to tab: " sx-tab--list - (lambda (tab) (not (equal tab sx-question-list--current-tab))) - t))) + (list (sx-completing-read + "Switch to tab: " sx-tab--list + (lambda (tab) (not (equal tab sx-question-list--current-tab))) + t))) (funcall (intern (format "sx-tab-%s" (downcase tab))))) diff --git a/sx.el b/sx.el index a63c155..c2d1164 100644 --- a/sx.el +++ b/sx.el @@ -183,6 +183,11 @@ See `sx-question-get-questions' and `sx-question-get-question'.") ;;; Utility Functions +(defun sx-completing-read (&rest args) + "Like `completing-read', but possibly use ido. +All ARGS are passed to `completing-read' or `ido-completing-read'." + (apply (if ido-mode #'ido-completing-read #'completing-read) + args)) (defmacro sx-sorted-insert-skip-first (newelt list &optional predicate) "Inserted NEWELT into LIST sorted by PREDICATE. -- cgit v1.2.3 From 8c2b378b439d24ec7d3f4417c602a1b22e693709 Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Sat, 27 Dec 2014 23:37:55 -0200 Subject: Implement sx--multiple-read for reading multiple strings --- sx.el | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'sx.el') diff --git a/sx.el b/sx.el index c2d1164..2824b4d 100644 --- a/sx.el +++ b/sx.el @@ -189,6 +189,25 @@ 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 gthe 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 35b0883d3e551c5cbc4f416082957e977d6e03eb Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Tue, 30 Dec 2014 18:10:39 -0500 Subject: Reapply ef1d321a157e300d29c48e461257897fca1c9aa4 It was somehow lost in the merging. --- sx.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 508de46..8fe31ac 100644 --- a/sx.el +++ b/sx.el @@ -136,10 +136,11 @@ with a `link' property)." If ALIST doesn't have a `site' property, one is created using the `link' property." (declare (indent 1) (debug t)) + (require 'let-alist) `(progn - (require 'let-alist) (sx--ensure-site ,alist) - (let-alist ,alist ,@body))) + ,(macroexpand + `(let-alist ,alist ,@body)))) ;;; Browsing filter -- cgit v1.2.3 From 7d73bc8b9da4a093b0a3b477da81252d5b805ca5 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 1 Jan 2015 14:19:58 -0500 Subject: Prune sx--filter-data --- sx.el | 44 -------------------------------------------- test/test-util.el | 35 ----------------------------------- 2 files changed, 79 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 8fe31ac..73d1a40 100644 --- a/sx.el +++ b/sx.el @@ -239,50 +239,6 @@ and sequences of strings." (funcall first-f sequence-sep) ";")))))) -(defun sx--filter-data (data desired-tree) - "Filter DATA and return the DESIRED-TREE. - -For example: - - (sx--filter-data - '((prop1 . value1) - (prop2 . value2) - (prop3 - (test1 . 1) - (test2 . 2)) - (prop4 . t)) - '(prop1 (prop3 test2))) - -would yield - - ((prop1 . value1) - (prop3 - (test2 . 2)))" - (if (vectorp data) - (apply #'vector - (mapcar (lambda (entry) - (sx--filter-data - entry desired-tree)) - data)) - (delq - nil - (mapcar (lambda (cons-cell) - ;; @TODO the resolution of `f' is O(2n) in the worst - ;; case. It may be faster to implement the same - ;; functionality as a `while' loop to stop looking the - ;; list once it has found a match. Do speed tests. - ;; See edfab4443ec3d376c31a38bef12d305838d3fa2e. - (let ((f (or (memq (car cons-cell) desired-tree) - (assoc (car cons-cell) desired-tree)))) - (when f - (if (and (sequencep (cdr cons-cell)) - (sequencep (elt (cdr cons-cell) 0))) - (cons (car cons-cell) - (sx--filter-data - (cdr cons-cell) (cdr f))) - cons-cell)))) - data)))) - (defun sx--shorten-url (url) "Shorten URL hiding anything other than the domain. Paths after the domain are replaced with \"...\". diff --git a/test/test-util.el b/test/test-util.el index 49df274..5db1691 100644 --- a/test/test-util.el +++ b/test/test-util.el @@ -1,38 +1,3 @@ -(ert-deftest test-tree-filter () - "Test `sx-core-filter-data'" - ;; flat - (should - (equal - '((1 . t) (2 . [1 2]) (3)) - (sx--filter-data '((0 . 3) (1 . t) (a . five) (2 . [1 2]) - ("5" . bop) (3) (p . 4)) - '(1 2 3)))) - ;; complex - (should - (equal - '((1 . [a b c]) - (2 . [((a . 1) (c . 3)) - ((a . 4) (c . 6))]) - (3 . peach)) - (sx--filter-data '((1 . [a b c]) - (2 . [((a . 1) (b . 2) (c . 3)) - ((a . 4) (b . 5) (c . 6))]) - (3 . peach) - (4 . banana)) - '(1 (2 a c) 3)))) - - ;; vector - (should - (equal - [((1 . 2) (2 . 3) (3 . 4)) - ((1 . a) (2 . b) (3 . c)) - nil ((1 . alpha) (2 . beta))] - (sx--filter-data [((1 . 2) (2 . 3) (3 . 4)) - ((1 . a) (2 . b) (3 . c) (5 . seven)) - ((should-not-go)) - ((1 . alpha) (2 . beta))] - '(1 2 3))))) - (ert-deftest thing-as-string () "Test `sx--thing-as-string'" (should -- cgit v1.2.3 From cad44329de7679158dee78e25aeb068c0724770b Mon Sep 17 00:00:00 2001 From: Artur Malabarba Date: Thu, 1 Jan 2015 22:26:22 -0200 Subject: Add TODO reminder --- sx.el | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 151255e..e2ea914 100644 --- a/sx.el +++ b/sx.el @@ -80,6 +80,8 @@ with a `link' property)." (when data (let-alist data (unless .site_par + ;; @TODO: Change this to .site.api_site_parameter sometime + ;; after February. (setcdr data (cons (cons 'site_par (or (cdr (assq 'api_site_parameter .site)) (sx--site data))) -- cgit v1.2.3 From 80541f53ab81695f5878055ac4404ee212766b11 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Thu, 1 Jan 2015 23:20:34 -0500 Subject: Checkdoc --- sx.el | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index b31b22f..e6215b4 100644 --- a/sx.el +++ b/sx.el @@ -74,7 +74,7 @@ DATA can also be the link itself." "\\1\\2" link)))) (defun sx--ensure-site (data) - "Add a `site' property to DATA if it doesn't have one. Return DATA. + "Add a `site' property to DATA if it doesn't have one. Return DATA. DATA can be a question, answer, comment, or user (or any object with a `link' property)." (when data @@ -132,8 +132,9 @@ with a `link' property)." result)) (defmacro sx-assoc-let (alist &rest body) - "Identical to `let-alist', except `.site' has a special meaning. -If ALIST doesn't have a `site' property, one is created using the + "Use ALIST with `let-alist' to execute BODY. +`.site' has a special meaning, thanks to `sx--ensure-site'. If +ALIST doesn't have a `site' property, one is created using the `link' property." (declare (indent 1) (debug t)) (require 'let-alist) @@ -191,13 +192,12 @@ All ARGS are passed to `completing-read' or `ido-completing-read'." args)) (defun sx--multiple-read (prompt hist-var) - "Interactively query gthe user for a list of strings. + "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." +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= "" @@ -336,7 +336,7 @@ Return the result of BODY." ("ĥ" . "h") ("ĵ" . "j") ("^[:ascii:]" . "")) - "List of replacements to use for non-ascii characters + "List of replacements to use for non-ascii characters. Used to convert user names into @mentions.") (defun sx--user-@name (user) -- cgit v1.2.3 From 0325369632523a81e4246533e4067ebd57f7a0e7 Mon Sep 17 00:00:00 2001 From: Sean Allred Date: Fri, 2 Jan 2015 12:09:06 -0500 Subject: Fix docstring Branch: search --- sx.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sx.el') diff --git a/sx.el b/sx.el index 2605f27..62484b7 100644 --- a/sx.el +++ b/sx.el @@ -138,8 +138,8 @@ with a `link' property)." (defmacro sx-assoc-let (alist &rest body) "Use ALIST with `let-alist' to execute BODY. -`.site' has a special meaning, thanks to `sx--ensure-site'. If -ALIST doesn't have a `site' property, one is created using the +`.site_par' has a special meaning, thanks to `sx--ensure-site'. +If ALIST doesn't have a `site' property, one is created using the `link' property." (declare (indent 1) (debug t)) (require 'let-alist) -- cgit v1.2.3