emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/mpv a43b1813fc 05/12: Makes listing functions use built-in


From: ELPA Syncer
Subject: [nongnu] elpa/mpv a43b1813fc 05/12: Makes listing functions use built-in Emacs completion APIs
Date: Mon, 1 Aug 2022 09:58:52 -0400 (EDT)

branch: elpa/mpv
commit a43b1813fc4905d89711589a3098a1ade1d42372
Author: efimerspan <96617722+efimerspan@users.noreply.github.com>
Commit: efimerspan <96617722+efimerspan@users.noreply.github.com>

    Makes listing functions use built-in Emacs completion APIs
---
 mpv.el | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/mpv.el b/mpv.el
index e47c6c2c59..88387d0e57 100644
--- a/mpv.el
+++ b/mpv.el
@@ -41,7 +41,6 @@
 (require 'json)
 (require 'org)
 (require 'org-timer)
-(require 'consult)
 (require 'tq)
 
 (defgroup mpv nil
@@ -270,19 +269,25 @@ or PLAYLIST if provided."
 (defun mpv-show-playlist ()
   "Shows an interactive completion prompt drawn from the current playlist 
entries."
   (interactive)
-  (consult--read (mpv--get-formatted-playlist)
-                 :prompt "Playlist entries: "
-                 :category 'mpv-file
-                 :sort nil))
+  (completing-read "Playlist entries: "
+                   (lambda (string pred action)
+                     (if (eq action 'metadata)
+                         `(metadata
+                           (category . mpv-file)
+                           (display-sort-function . ,#'identity))
+                       (complete-with-action action 
(mpv--get-formatted-playlist) string pred)))))
 
 (defun mpv-show-chapters ()
   "Presents an interactive completion list drawn from the available chapters
 in the current mpv playback."
   (interactive)
-  (consult--read (mpv--get-formatted-chapters)
-                 :prompt "Chapters: "
-                 :category 'mpv-chapter
-                 :sort nil))
+  (completing-read "Chapters: "
+                   (lambda (string pred action)
+                     (if (eq action 'metadata)
+                         `(metadata
+                           (category . mpv-chapter)
+                           (display-sort-function . ,#'identity))
+                       (complete-with-action action 
(mpv--get-formatted-chapters) string pred)))))
 
 (defun mpv-jump-to-chapter (chapter)
   "Selects CHAPTER to jump to from list of currently available chapters."



reply via email to

[Prev in Thread] Current Thread [Next in Thread]