[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/orderless 9218343171 043/204: Add command to temporaril
From: |
ELPA Syncer |
Subject: |
[elpa] externals/orderless 9218343171 043/204: Add command to temporarily change separator |
Date: |
Tue, 11 Jan 2022 12:58:16 -0500 (EST) |
branch: externals/orderless
commit 92183431712f94b042c6b6caba2b6c2415db3c66
Author: Omar Antolín <omar.antolin@gmail.com>
Commit: Omar Antolín <omar.antolin@gmail.com>
Add command to temporarily change separator
---
README.org | 10 ++++++++++
orderless.el | 20 ++++++++++++++++++++
2 files changed, 30 insertions(+)
diff --git a/README.org b/README.org
index f60df15765..758a3a62fb 100644
--- a/README.org
+++ b/README.org
@@ -33,6 +33,16 @@ If you are implementing a command for which you know you
want a
different separator for the components, bind
=orderless-regexp-separator= in a =let= form.
+The package also provides a command
+=orderless-temporarily-change-separator= to change it for the rest of
+the current completion session. If you want to use it, bind it to a
+key in a keymap that will be active during your completion session:
+
+- Icomplete users should bind it in =icomplete-minibuffer-map=.
+- Users of the default completion should bind it in both
+ =minibuffer-local-completion-map= and
+ =minibuffer-local-filename-completion-map=.
+
** Faces for component matches
The portions of a candidate matching each component get highlighted in
diff --git a/orderless.el b/orderless.el
index 67f71a7e16..0d5bbddd94 100644
--- a/orderless.el
+++ b/orderless.el
@@ -159,5 +159,25 @@ This function is part of the `orderless' completion style."
completion-styles-alist
:test #'equal)
+(defvar orderless-old-regexp-separator nil
+ "Stores the old value of `orderless-regexp-separator'.")
+
+(defun orderless--restore-regexp-separator ()
+ "Restore old value of `orderless-regexp-separator'."
+ (when orderless-old-regexp-separator
+ (setq orderless-regexp-separator orderless-old-regexp-separator
+ orderless-old-regexp-separator nil))
+ (remove-hook 'minibuffer-exit-hook #'orderless--restore-regexp-separator))
+
+(defun orderless-temporarily-change-separator (separator)
+ "Change `orderless-regexp-separator' for the current completion session."
+ (interactive
+ (list (let ((enable-recursive-minibuffers t))
+ (read-string "Orderless regexp separator: "))))
+ (unless orderless-old-regexp-separator
+ (setq orderless-old-regexp-separator orderless-regexp-separator))
+ (setq orderless-regexp-separator separator)
+ (add-to-list 'minibuffer-exit-hook #'orderless--restore-regexp-separator))
+
(provide 'orderless)
;;; orderless.el ends here
- [elpa] externals/orderless 871eb1d0f0 178/204: Use add-face-text-property, (continued)
- [elpa] externals/orderless 871eb1d0f0 178/204: Use add-face-text-property, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless df4f29a4f4 183/204: Use minibuffer customization group, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 62f71c34ba 191/204: Extend prefix optimization to anchored quoted regexps (fix #81), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 75d3398056 192/204: Have orderless-try-completion return t for exact match (fix #95), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c8731aacfa 197/204: Merge pull request #98 from minad/fix-try, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless f22789f358 202/204: Merge pull request #94 from minad/strict-initialism, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 855255eb01 198/204: Mention Corfu and consult-completion-in-region (fix #99), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 269d7388ab 034/204: Merge pull request #6 from raxod502/patch-1, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless ae466bc4f4 054/204: Rename orderless-regexp-separator to orderless-component-separator, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless aad0aa8a8d 017/204: Copy candidates to avoid permanently changing their face, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 9218343171 043/204: Add command to temporarily change separator,
ELPA Syncer <=
- [elpa] externals/orderless 2750e15c74 065/204: Add ivy integration, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless fb6ad592b7 067/204: List more helpful functions for integration, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 50c83f2752 074/204: Avoid using cl-lib in autoloads, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 274c8cbadc 078/204: Declare other ivy variable used, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless b63019aea3 090/204: Add missing (oops!) "forgiving funcall" function, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 74947d0862 092/204: Update dispatchers documentation, and documents pattern compiler, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c245cb6e9d 091/204: Make dispatchers always take 3 args (to avoid depending on 26.1), ELPA Syncer, 2022/01/11
- [elpa] externals/orderless c1be870f02 101/204: Undocument orderless-temporarily-change-separator in README, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless d0b217512f 104/204: Switch to single variable config, add transient vars, ELPA Syncer, 2022/01/11
- [elpa] externals/orderless 5618c349a6 107/204: Remove global dispatchers, ELPA Syncer, 2022/01/11