[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless da876320b3 146/204: Remove all orderless-tran
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless da876320b3 146/204: Remove all orderless-transient-* variables (fix #34) |
Date: |
Tue, 11 Jan 2022 12:58:25 -0500 (EST) |
branch: externals/orderless
commit da876320b3e7ac123c16eaa0f628d00724444597
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Remove all orderless-transient-* variables (fix #34)
---
README.org | 51 +++++++++++++--------------------------------------
orderless.el | 57 ++++-----------------------------------------------------
2 files changed, 17 insertions(+), 91 deletions(-)
diff --git a/README.org b/README.org
index f74c6663cd..03a569a299 100644
--- a/README.org
+++ b/README.org
@@ -254,56 +254,31 @@ lists to use instead of =orderless-matching-styles=.
** Interactively changing the configuration
You might want to change the separator or the matching style
-configuration on the fly while matching. There many possible UIs for
-this: you could toggle between two chosen configurations, cycle among
-several, have a keymap where each key sets a different configurations,
-have a set of named configurations and be prompted (with completion)
-for one of them, popup a [[https://github.com/abo-abo/hydra][hydra]] to choose
a configuration, etc.
-
-Rather than include commands for any of those on-the-fly configuration
-changes, =orderless= provides a general mechanism to make it easy to
-write such commands yourself. For each variable you might to
-temporarily change there is a corresponding /transient/ variable that
-overrides it when the transient variable is non-nil. You can write
-your own commands to set these transient variable to the desired value
-without clobbering the value of the variables they override. To reset
-the transient variables to =nil= again after each completion session,
-use the following configuration:
-
-#+begin_src emacs-lisp
- (add-hook 'minibuffer-exit-hook
- #'orderless-remove-transient-configuration)
-#+end_src
-
-The transient variables provided are:
-
-- =orderless-transient-component-separator=
-- =orderless-transient-matching-styles=
-- =orderless-transient-style-dispatchers=
+configuration on the fly while matching. There many possible user
+interfaces for this: you could toggle between two chosen
+configurations, cycle among several, have a keymap where each key sets
+a different configurations, have a set of named configurations and be
+prompted (with completion) for one of them, popup a
[[https://github.com/abo-abo/hydra][hydra]] to choose a
+configuration, etc. Since there are so many possible UIs and which to
+use is mostly a matter of taste, =orderless= does not provide any such
+commands. But it's easy to write your own!
For example, say you want to use the keybinding =C-l= to make all
-components match literally. You could use the following configuration:
+components match literally. You could use the following code:
#+begin_src emacs-lisp
(defun my/match-components-literally ()
"Components match literally for the rest of the session."
(interactive)
- (setq orderless-transient-matching-styles '(orderless-literal)
- orderless-transient-style-dispatchers '(ignore)))
-
- (add-hook 'minibuffer-exit-hook
- #'orderless-remove-transient-configuration)
+ (setq-local orderless-matching-styles '(orderless-literal)
+ orderless-style-dispatchers nil))
(define-key minibuffer-local-completion-map (kbd "C-l")
#'my/match-components-literally)
#+end_src
-Note that we also set =orderless-transient-style-dispatchers= to
-='(ignore)=, to ensure no style dispatchers are used so the literal
-matching does not get overridden. You may want to allow the
-dispatchers in =orderless-style-dispatchers= to override, in which case
-you'd set =orderless-transient-style-dispatchers= to =nil= or simply
-remove that assignment.
+Using =setq-local= to assign to the configuration variables ensures the
+values are only used for that minibuffer completion session.
* Integration with other completion UIs
diff --git a/orderless.el b/orderless.el
index ab6b0ed1de..e81134fee4 100644
--- a/orderless.el
+++ b/orderless.el
@@ -103,17 +103,6 @@ or a function of a single string argument."
(function : tag "Custom function"))
:group 'orderless)
-(defvar-local orderless-transient-component-separator nil
- "Component separator regexp override.
-This variabel, if non-nil, overrides `orderless-component-separator'.
-It is meant to be set by commands that interactively change the
-separator. No such commands are provided with this package, but
-this variable is meant to make writing them simple. If you do
-use this variable you are likely to want to reset it to nil after
-every completion session, which can be achieved by adding the
-function `orderless-remove-transient-configuration' to the
-`minibuffer-exit-hook'.")
-
(defcustom orderless-match-faces
[orderless-match-face-0
orderless-match-face-1
@@ -167,30 +156,6 @@ information on how this variable is used, see
:type 'hook
:group 'orderless)
-(defvar-local orderless-transient-matching-styles nil
- "Component matching styles override.
-This variable, if non-nil, overrides `orderless-matching-styles'.
-It is meant to be set by commands that interactively change the
-matching style configuration. No such commands are provided with
-this package, but this variable is meant to make writing them
-simple. If you do use this variable you are likely to want to
-reset it to nil after every completion session, which can be
-achieved by adding the function
-`orderless-remove-transient-configuration' to the
-`minibuffer-exit-hook'.")
-
-(defvar-local orderless-transient-style-dispatchers nil
- "Component style dispatchers override.
-This variable, if non-nil, overrides `orderless-style-dispatchers'.
-It is meant to be set by commands that interactively change the
-matching style configuration. No such commands are provided with
-this package, but this variable is meant to make writing them
-simple. If you do use this variable you are likely to want to
-reset it to nil after every completion session, which can be
-achieved by adding the function
-`orderless-remove-transient-configuration' to the
-`minibuffer-exit-hook'.")
-
(defcustom orderless-pattern-compiler #'orderless-default-pattern-compiler
"The `orderless' pattern compiler.
This should be a function that takes an input pattern and returns
@@ -355,12 +320,6 @@ converted to a list of regexps according to the value of
(lambda (piece) (replace-regexp-in-string (string 0) " " piece))
(split-string (replace-regexp-in-string "\\\\ " (string 0) string) " ")))
-(defun orderless-remove-transient-configuration ()
- "Remove all transient orderless configuration.
-Meant to be added to `exit-minibuffer-hook'."
- (setq orderless-transient-matching-styles nil
- orderless-transient-component-separator nil))
-
(defun orderless-dispatch (dispatchers default string &rest args)
"Run DISPATCHERS to compute matching styles for STRING.
@@ -420,23 +379,15 @@ DISPATCHERS default to `orderless-dipatchers'. Since nil
gets you
the default, if want to no dispatchers to be run, use '(ignore)
as the value of DISPATCHERS.
-The `orderless-transient-*' variables, when non-nil, override the
-corresponding value among `orderless-component-separator', STYLES
-and DISPATCHERS.
-
This function is the default for `orderless-pattern-compiler' and
might come in handy as a subroutine to implement other pattern
compilers."
(unless styles (setq styles orderless-matching-styles))
- (setq styles (or orderless-transient-matching-styles styles))
(unless dispatchers (setq dispatchers orderless-style-dispatchers))
- (setq dispatchers (or orderless-transient-style-dispatchers dispatchers))
(cl-loop
- with splitter = (or orderless-transient-component-separator
- orderless-component-separator)
- with components = (if (functionp splitter)
- (funcall splitter pattern)
- (split-string pattern splitter))
+ with components = (if (functionp orderless-component-separator)
+ (funcall orderless-component-separator pattern)
+ (split-string pattern orderless-component-separator))
with total = (length components)
for component in components and index from 0
for (newstyles . newcomp) = (orderless-dispatch
@@ -537,7 +488,7 @@ string for the completion style."
(try-completion (funcall fn-name "-try-completion"))
(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
+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
- [elpa] externals/orderless dc1a31b5fc 098/204: Merge remote-tracking branch 'github/master', (continued)
- [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, 2022/01/11
- [elpa] externals/orderless da876320b3 146/204: Remove all orderless-transient-* variables (fix #34),
ELPA Syncer <=
- [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
- [elpa] externals/orderless d97a91f6e1 172/204: Merge pull request #51 from minad/disable-initialism, ELPA Syncer, 2022/01/11