[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/mct 532656b 54/70: Merge branch 'crm-separator-heuristi
From: |
ELPA Syncer |
Subject: |
[elpa] externals/mct 532656b 54/70: Merge branch 'crm-separator-heuristic' into 'main' |
Date: |
Thu, 11 Nov 2021 03:57:50 -0500 (EST) |
branch: externals/mct
commit 532656bf4d4a7b55e4c3584d6583322cf787d7c0
Merge: 5972191 20aa296
Author: Protesilaos Stavrou <info@protesilaos.com>
Commit: Protesilaos Stavrou <info@protesilaos.com>
Merge branch 'crm-separator-heuristic' into 'main'
Heuristic attempt to handle different CRM separator
See merge request protesilaos/mct!1
---
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 be15b4b 44/70: Re-order mct-completion-list-mode-map, (continued)
- [elpa] externals/mct be15b4b 44/70: Re-order mct-completion-list-mode-map, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 640ce43 24/70: Update code sample in mct-display-buffer-action, ELPA Syncer, 2021/11/11
- [elpa] externals/mct d21edfb 26/70: Make mct--fit-completions-window more robust, ELPA Syncer, 2021/11/11
- [elpa] externals/mct dc3c224 32/70: Update Acknowledgements in the manual, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 17abf47 33/70: Make cycling robust for all completions-format, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 613252a 27/70: Use internal function to fit Completions' window, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 6db7f29 36/70: Rewrite mct-edit-completion for greater accuracy, ELPA Syncer, 2021/11/11
- [elpa] externals/mct b16f582 37/70: Make completion metadata functions work everywhere, ELPA Syncer, 2021/11/11
- [elpa] externals/mct e7f13ee 43/70: Make TAB in the Completions never exit, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 97d7855 45/70: Use correct internals for commit 099e204, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 532656b 54/70: Merge branch 'crm-separator-heuristic' into 'main',
ELPA Syncer <=
- [elpa] externals/mct 78f3e77 57/70: Clear trailing space, ELPA Syncer, 2021/11/11
- [elpa] externals/mct 573a324 60/70: Document numeric arg for cyclic commands, ELPA Syncer, 2021/11/11
- [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