[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/filechooser 192aec343f 21/23: Remove the crm based choo
From: |
ELPA Syncer |
Subject: |
[elpa] externals/filechooser 192aec343f 21/23: Remove the crm based chooser |
Date: |
Sun, 4 Feb 2024 12:58:36 -0500 (EST) |
branch: externals/filechooser
commit 192aec343f6bdd724a0653c490e43f035adafc66
Author: Rahguzar <rahguzar@zohomail.eu>
Commit: Rahguzar <rahguzar@zohomail.eu>
Remove the crm based chooser
Because completing read in a loop is more user friendly.
---
filechooser.el | 51 ++++++---------------------------------------------
1 file changed, 6 insertions(+), 45 deletions(-)
diff --git a/filechooser.el b/filechooser.el
index 4759057eec..feb62152a2 100644
--- a/filechooser.el
+++ b/filechooser.el
@@ -45,7 +45,6 @@
(defvar filechooser-mininuffer-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-f") #'filechooser-toggle-filter)
- (define-key map (kbd "C-l") #'filechooser-insert-crm-separator)
(define-key map [remap abort-recursive-edit] #'filechooser-abort)
map))
@@ -110,11 +109,6 @@ It should have the same calling convention as
`filechooser-save-files' which see for expected behavior."
:type 'function)
-(defcustom filechooser-crm-separator ""
- "`crm-separator' for choosing multiple files.
-It should be a literal string and can be inserted using `C-l' from minibuffer."
- :type 'string)
-
(defcustom filechooser-multiple-selection-key "RET"
"The key that is used to exit minibuffer to do completion.
I.e. the key that binds the equivalent of `exit-minibuffer' for the completion
@@ -232,18 +226,6 @@ MINIBUFFER is the value of minibuffer frame paramter."
`(:array :signature "{sv}"))))
;;; Minibuffer based selection
-(defun filechooser-insert-crm-separator ()
- "Insert the `filechooser-crm-separator'."
- (interactive)
- (insert filechooser-crm-separator))
-
-(defun filechooser--multiple-completion-table (str pred action)
- "Completion table for reading file names.
-See Info node `(elisp) Programmed Completion' for STR, PRED and ACTION."
- (if (eq action 'metadata)
- '(metadata (category . file))
- (completion-file-name-table str pred action)))
-
(defun filechooser--multiple-group-function (completion transform)
"Group function for `filechooser--multiple-loop-table'.
See Info node `(elisp) Programmed Completion' for COMPLETION and TRANSFORM."
@@ -268,7 +250,7 @@ See Info node `(elisp) Programmed Completion' for STR, PRED
and ACTION."
(group-function . filechooser--multiple-group-function)))
(_ (completion-file-name-table str pred action))))
-(defun filechooser--read-file-name-1 (prompt &optional mustmatch filters dir
default multiple)
+(defun filechooser--read-file-name-1 (prompt &optional mustmatch filters dir
default)
"Read a filename with PROMPT and predicate made from FILTERS.
MUSTMATCH and DIR are as in `read-file-name'. DEFAULT is the default filename.
If MULTIPLE is non-nil `completing-read-multiple' is used."
@@ -277,15 +259,9 @@ If MULTIPLE is non-nil `completing-read-multiple' is used."
(lambda () (use-local-map (make-composed-keymap
filechooser-mininuffer-map
(current-local-map)))
(when dir (setq default-directory dir)))
- (if multiple
- (let ((crm-separator filechooser-crm-separator))
- (completing-read-multiple
- prompt #'filechooser--multiple-completion-table
- (filechooser--filters-predicate filters)
- mustmatch))
- (read-file-name
- prompt dir default mustmatch nil
- (when filters (filechooser--filters-predicate filters)))))))
+ (read-file-name
+ prompt dir default mustmatch nil
+ (when filters (filechooser--filters-predicate filters))))))
(defun filechooser--handle-exisiting-file (filename &optional dir filters)
"Handle an existing FILENAME according to `filechooser-save-existing-files'.
@@ -308,7 +284,7 @@ are the filters to use in that case."
(file-relative-name filename dir))))
(_ (funcall filechooser-save-existing-files filename))))
-(defun filechooser--read-file-name (prompt &optional mustmatch filters dir
default multiple)
+(defun filechooser--read-file-name (prompt &optional mustmatch filters dir
default)
"Read a filename with PROMPT and predicate made from FILTERS.
MUSTMATCH and DIR are as in `read-file-name'. DEFAULT is the default filename.
If MULTIPLE is non-nil `completing-read-multiple' is used."
@@ -323,7 +299,7 @@ If MULTIPLE is non-nil `completing-read-multiple' is used."
prompt mustmatch
(delq nil (mapcar (lambda (flt) (if (cddr flt) (cadr flt)))
filechooser--filters))
- dir default multiple)))
+ dir default)))
(if (or mustmatch (not (file-exists-p result)))
result
(filechooser--handle-exisiting-file result dir filters))))
@@ -405,21 +381,6 @@ files which satisfy one of the active filters from FILTERS
or
(setq continue (eq this-command 'filechooser-multiple-continue))))
(nreverse (mapcar #'car filechooser--multiple-selection)))))
-(defun filechooser-read-file-names-crm (prompt &optional dir filters)
- "Read multiple file names using `completing-read-multiple'.
-`filechooser-crm-separator' is used as `crm-separator' and can be inserted
-using `C-l'.
-If `filechooser-use-popup-frame' is non-nil a new minibuffer only popup frame
-is used, othewise the selected frame is used.
-PROMPT is the minibuffer prompt. DIR is the directory where selection starts.
-FILTERS take the same form as elements of `filechooser-filters'. Only those
-files which satisfy one of the active filters from FILTERS or
-`filechooser-filters' are presented for completions."
- (setq dir (file-name-as-directory
- (expand-file-name (or dir default-directory))))
- (filechooser--maybe-with-new-frame only
- (filechooser--read-file-name prompt t filters dir nil 'multiple)))
-
(defun filechooser-save-files (prompt &optional dir files)
"Read a directory name to save FILES in it.
If `filechooser-use-popup-frame' is non-nil a new minibuffer only popup frame
- [elpa] externals/filechooser e428b5f2d4 23/23: Documentation fixes, (continued)
- [elpa] externals/filechooser e428b5f2d4 23/23: Documentation fixes, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 8c2c93a8b0 05/23: Add readme, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 83010806c3 07/23: Peek a little into the invisible region to nudge jit-lock, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 3669426f04 08/23: Move provide to the end, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser d98a85f9d6 02/23: Add portal and service files, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 651ce0c440 06/23: Make directories filter work in dired, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 676043fd0d 12/23: Make new frames optional, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 9c1c61170f 11/23: Select the selection window only if it exists, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 20211f48b5 13/23: Variables to change how files are chosen, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 2d4dc14a09 16/23: Put the filechooser command in a variable, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 192aec343f 21/23: Remove the crm based chooser,
ELPA Syncer <=
- [elpa] externals/filechooser 282bb2da3c 22/23: Command to select all of current candidates, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 8895cb4ccc 18/23: Bind minibuffer-completing-file-name, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 2582aef0db 17/23: Add a keymap for multiple selection, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 21a567dd32 19/23: Update documentation, ELPA Syncer, 2024/02/04
- [elpa] externals/filechooser 30150e9445 20/23: Use defcustom for customizable variables, ELPA Syncer, 2024/02/04