[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless 94d52640d4 145/204: Change docstring interfac
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless 94d52640d4 145/204: Change docstring interface for orderless-define-completion-style |
Date: |
Tue, 11 Jan 2022 12:58:25 -0500 (EST) |
branch: externals/orderless
commit 94d52640d4d8eed1a412907a4e4b6d4dea990b7f
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Change docstring interface for orderless-define-completion-style
---
orderless.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/orderless.el b/orderless.el
index b4ec2fc838..ab6b0ed1de 100644
--- a/orderless.el
+++ b/orderless.el
@@ -515,7 +515,7 @@ This function is part of the `orderless' completion style."
"Completion of multiple components, in any order."))
(defmacro orderless-define-completion-style
- (name docstrings &rest configuration)
+ (name &optional docstring &rest configuration)
"Define an orderless completion style with given CONFIGURATION.
The CONFIGURATION should be a list of bindings that you could use
with `let' to configure orderless. You can include bindings for
@@ -527,28 +527,30 @@ defines for you, NAME-try-completion and
NAME-all-completions.
This macro registers those in `completion-styles-alist' as
forming the completion style NAME.
-The DOCSTRINGS argument should be a list of between 0 to 3
-strings. The strings present are used as the documentation
-string for the completion style, NAME-try-completion, and
-NAME-all-completions, respectively."
- (declare (indent defun))
+The optional DOCSTRING argument is used as the documentation
+string for the completion style."
+ (declare (doc-string 2) (indent 1))
+ (unless (stringp docstring)
+ (push docstring configuration)
+ (setq docstring nil))
(let* ((fn-name (lambda (string) (intern (concat (symbol-name name)
string))))
(try-completion (funcall fn-name "-try-completion"))
- (all-completions (funcall fn-name "-all-completions")))
+ (all-completions (funcall fn-name "-all-completions"))
+ (doc-fmt "`%s' function for the %s completion style.
+This configures orderless according to the %s completion style and
+delegates to `orderless-%s'.")
+ (fn-doc (lambda (fn) (format doc-fmt fn name name fn))))
`(progn
(defun ,try-completion (string table pred point)
- ,(cadr docstrings)
+ ,(funcall fn-doc "try-completion")
(let ,configuration
(orderless-all-completions string table pred point)))
-
(defun ,all-completions (string table pred point)
- ,(caddr docstrings)
+ ,(funcall fn-doc "all-completions")
(let ,configuration
(orderless-all-completions string table pred point)))
-
(add-to-list 'completion-styles-alist
- '(,name ,try-completion ,all-completions
- ,(car docstrings))))))
+ '(,name ,try-completion ,all-completions ,docstring)))))
;;; Ivy integration
- [elpa] externals/orderless e16fc5ddb1 099/204: Ido has progressive completion too!, (continued)
- [elpa] externals/orderless e16fc5ddb1 099/204: Ido has progressive completion too!, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless dc1a31b5fc 098/204: Merge remote-tracking branch 'github/master', ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 306fb267f5 100/204: Mark orderless-temporarily-change-separator obsolete (#15), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 09f4c74280 105/204: Update dispatchers documentation, add transient vars, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless bc9e48216e 120/204: Add option for "smart case" matching, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1f1e0380e2 122/204: Test for match before highlighting it, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 6b94b9abf8 124/204: Merge pull request #21 from wyuenho/patch-1, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 0826fd4eb4 130/204: Merge pull request #27 from vifon/master, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless fc420e3d07 134/204: Minor readme tweak, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless b600f88db0 144/204: Add orderless-define-completion-style macro, a new fix for #31, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 94d52640d4 145/204: Change docstring interface for orderless-define-completion-style,
ELPA Syncer <=
- [elpa] externals/orderless da876320b3 146/204: Remove all orderless-transient-* variables (fix #34), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c023ee1cbe 150/204: Add option to skip-highlighting as requested by @clemera, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 1ed0c4aabb 153/204: Fix typo, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 0ebc884693 154/204: Update manual to not recommend icomplete anymore, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 9d5b95f402 157/204: Merge pull request #40 from minad/master, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 150155ce3c 160/204: Add literal matching to default styles and document (fix #42), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 44935d8962 166/204: Fix bug when all matching styles return nil, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless e85084e733 179/204: Merge pull request #58 from minad/add-face-text-property, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 3f76b7d1a1 185/204: Delete duplicate regexps (fix #73), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless cc15f27107 188/204: orderless-escapable-split-on-space: Fix escaping mistake, ELPA Syncer, 2022/01/11