[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct 20aa296 52/70: Heuristic attempt to handle differen
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct 20aa296 52/70: Heuristic attempt to handle different CRM separator |
Date: |
Thu, 11 Nov 2021 03:57:50 -0500 (EST) |
branch: externals/mct
commit 20aa296f0b2d871b740115aaed42decf0270a866
Author: James N. V. Cash <james.nvc@gmail.com>
Commit: James N. V. Cash <james.nvc@gmail.com>
Heuristic attempt to handle different CRM separator
---
mct.el | 20 +++++++++++++++++---
1 file changed, 17 insertions(+), 3 deletions(-)
diff --git a/mct.el b/mct.el
index 2ff86b3..3f848a1 100644
--- a/mct.el
+++ b/mct.el
@@ -661,6 +661,20 @@ Completions' buffer."
(defvar crm-completion-table)
+(defun mct--regex-to-separator (regex)
+ (save-match-data
+ (cond
+ ;; whitespace-delimited, like default & org-set-tag-command
+ ((string-match (rx
+ bos "[" (1+ blank) "]*"
+ (group (1+ any))
+ "[" (1+ blank) "]*" eos)
+ regex)
+ (match-string 1 regex))
+ ;; literal character
+ ((string= regex (regexp-quote regex))
+ regex))))
+
(defun mct-choose-completion-dwim ()
"Append to minibuffer when at `completing-read-multiple' prompt.
In any other prompt use `mct-choose-completion-no-exit'."
@@ -671,9 +685,9 @@ In any other prompt use `mct-choose-completion-no-exit'."
(mct-choose-completion-no-exit)
(with-current-buffer (window-buffer mini)
(when crm-completion-table
- ;; FIXME 2021-10-22: How to deal with commands that let-bind the
- ;; crm-separator? For example: `org-set-tags-command'.
- (insert ",")
+ (let ((separator (or (mct--regex-to-separator crm-separator)
+ ",")))
+ (insert separator))
(let ((inhibit-message t))
(switch-to-completions))))))
- [elpa] externals/mct d333057 59/70: Update keys for group navigation, (continued)
- [elpa] externals/mct d333057 59/70: Update keys for group navigation, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 981dba1 68/70: Fix typo, ELPA Syncer, 2021/11/11
- [elpa] externals/mct e459304 64/70: Add missing reference to mct-backward-updir, ELPA Syncer, 2021/11/11
- [elpa] externals/mct b5f4222 70/70: Update Acknowledgements in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 57cd47d 69/70: Expand mct-live-update; update documentation, ELPA Syncer, 2021/11/11
- [elpa] externals/mct ea0847d 50/70: Update "Alternatives" section; add Elmo, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 5972191 51/70: Update docs on Alternatives; improve vertico part, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 01edefb 14/70: Use memq instead of member where applicable, ELPA Syncer, 2021/11/11
- [elpa] externals/mct c096fab 48/70: Mention completion-cycle-threshold in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 6eefd80 49/70: Expand the "extensions" section in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 20aa296 52/70: Heuristic attempt to handle different CRM separator,
ELPA Syncer <=
- [elpa] externals/mct 8f8a83a 39/70: Make mct-edit-completion behave consistently, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 9586c51 41/70: Refine mct-choose-completion{, -no}-exit, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 4d61a41 46/70: Minor tweaks to code sample in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 2dd1308 53/70: Add functions to jump through completion groups in completions, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 47b26e4 61/70: Document group motions and backward-dir motion, ELPA Syncer, 2021/11/11
- [elpa] externals/mct f1ddc1e 65/70: Add reference to Icomplete and Fido-mode, ELPA Syncer, 2021/11/11
- [elpa] externals/mct e25fdd5 55/70: Merge branch 'completion-group-navigation' into 'main', ELPA Syncer, 2021/11/11
- [elpa] externals/mct 0e2d0ae 62/70: Remove note about crm-separator (see 20aa296), ELPA Syncer, 2021/11/11
- [elpa] externals/mct 2352f14 63/70: Rectify paths to git repo, ELPA Syncer, 2021/11/11
- [elpa] externals/mct cf439ea 35/70: Clarify mct-choose-completion-number doc string, ELPA Syncer, 2021/11/11