Skip to content

Commit c7dc44c

Browse files
committed
Revert to the explicit completing-read-multiple calls
This function abstracted almost nothing, no use to pretend it's anything but a completing-read-multiple call with two arguments hardcoded and the others reordered.
1 parent 00c0fd8 commit c7dc44c

File tree

2 files changed

+11
-22
lines changed

2 files changed

+11
-22
lines changed

tmsu-dired.el

+8-5
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ If no files are marked, uses the file at point."
7979
(interactive nil dired-mode)
8080
(unless (tmsu-database-p)
8181
(error "No TMSU database"))
82-
(let ((tags-to-add (tmsu-read-tags
82+
(let ((tags-to-add (completing-read-multiple
8383
"Tags to add: "
84-
nil 'tmsu-dired-tags-history)))
84+
(tmsu-completion-table-assignment)
85+
nil nil nil
86+
'tmsu-dired-tags-history)))
8587
(dolist (file (dired-get-marked-files))
8688
(apply #'tmsu-tags-add file tags-to-add))))
8789

@@ -97,10 +99,11 @@ The completing read offers the sum of tags of all the marked files."
9799
(error "No TMSU database"))
98100
(let* ((files (dired-get-marked-files))
99101
(tags-in-files (mapcan #'cdr (tmsu-get-tags-for-files files)))
100-
(tags-to-remove (tmsu-read-tags
102+
(tags-to-remove (completing-read-multiple
101103
"Tags to remove: "
102-
nil 'tmsu-dired-tags-history nil t
103-
tags-in-files)))
104+
tags-in-files
105+
nil t nil
106+
'tmsu-dired-tags-history)))
104107
(dolist (file files)
105108
(apply #'tmsu-tags-remove file tags-to-remove))))
106109

tmsu.el

+3-17
Original file line numberDiff line numberDiff line change
@@ -272,22 +272,6 @@ TMSU commands."
272272
"untag" "--" (file-local-name file)
273273
tags))
274274

275-
(defun tmsu-read-tags
276-
(prompt &optional initial-input hist def require-match table)
277-
"Read multiple tags with completion.
278-
279-
PROMPT, INITIAL-INPUT, HIST, DEF, REQUIRE-MATCH and TABLE are
280-
passed to `completing-read-multiple', see its documentation for
281-
the details.
282-
283-
TABLE can be passed to use instead of a call to
284-
`tmsu-completion-table-assignment'."
285-
(completing-read-multiple
286-
prompt
287-
(or table (tmsu-completion-table-assignment))
288-
nil
289-
require-match initial-input hist def))
290-
291275
;;;###autoload
292276
(defun tmsu-edit (file)
293277
"Interactively edit the TMSU tags of FILE."
@@ -299,8 +283,10 @@ TABLE can be passed to use instead of a call to
299283
(tags-old (let ((tags (tmsu-get-tags file)))
300284
(dolist (func tmsu-tag-list-preprocess-functions tags)
301285
(setq tags (funcall func tags)))))
302-
(tags-new (tmsu-read-tags
286+
(tags-new (completing-read-multiple
303287
(format-message "Tag `%s': " file-name)
288+
(tmsu-completion-table-assignment)
289+
nil nil
304290
(string-join tags-old ",")
305291
'tmsu-edit-history
306292
(string-join (append tags-old

0 commit comments

Comments
 (0)