-
-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
possibly redundant :type in defcustom #51
Comments
Hey @tvraman, |
apologies for the broken link, I meant this one:
(defcustom empv-display-current-format
"[#{state}#{item-loop-indicator}, #{time-pos} of #{duration} (#{percent-pos}%), #{playlist-pos}/#{playlist-count}#{playlist-loop-indicator}#{radio}#{volume}#{speed}] #{title} #{chapter}"
"Format of the message displayed when `empv-display-current' is called.
This is a string representing the format or this can be an alist
from file format to format string, like:
\\='((\"hls\" . \"#{state} #{title} ...\")
(\"mp3\" . \"#{state} #{title} ...\")
;; Multiple formats can be defined like this:
(\"mkv,mp4\" . \"#{state} #{title} ...\")
;; Catch-all case:
(t . \"#{state} #{title} ...\"))
So that you can use different formats for different file types.
Here are the template strings that you can utilize in the format
string:
- #{title} - Shows the title of the current media.
- #{chapter} - Shows the current chapter of the media file being
played.
- #{state} - Shows one one of the following: Playing, Paused,
Buffered...
- #{time-pos} - Shows the current time of the media being played
in MM:SS format.
- #{duration} - Shows the total duration of the current media in
MM:SS format.
- #{percent-pos} - Shows the total completed percentage of the
current media.
- #{playlist-pos} - Shows the current media's position in the
playlist.
- #{playlist-count} - Shows the total item count in the current
playlist.
- #{item-loop-indicator} - Shows ↻ if the current file is on
loop.
- #{playlist-loop-indicator} - Shows ↻ if the current playlist is
on loop.
- #{radio} - Shows the current radio channel being played, if
there is any.
- #{volume} - Shows the current volume level in percentage, if
it's different from 100%.
- #{speed} - Shows the current volume level in percentage, if
it's different from 100%."
:type 'string
:type '(choice (string :tag "Template format for all file types")
(alist :key-type (string :tag "File format (like hls, mp3, mpv etc.)")
:value-type (string :tag "Template format")))
:group 'empv)
--
|
No problem! |
I think you can just drop the :type 'string.
Here is what I was thinking; agreed defcustom is a somewhat hairy mess.
I'll comment out the line I think you can delete with the prefix
;;;tvr:.
Reason: The type is a choice, one of the choices is already 'string.
(defcustom empv-display-current-format
"[#{state}#{item-loop-indicator}, #{time-pos} of #{duration} (#{percent-pos}%), #{playlist-pos}/#{playlist-count}#{playlist-loop-indicator}#{radio}#{volume}#{speed}] #{title} #{chapter}"
"Format of the message displayed when `empv-display-current' is called.
This is a string representing the format or this can be an alist
from file format to format string, like:
\\='((\"hls\" . \"#{state} #{title} ...\")
(\"mp3\" . \"#{state} #{title} ...\")
;; Multiple formats can be defined like this:
(\"mkv,mp4\" . \"#{state} #{title} ...\")
;; Catch-all case:
(t . \"#{state} #{title} ...\"))
So that you can use different formats for different file types.
Here are the template strings that you can utilize in the format
string:
- #{title} - Shows the title of the current media.
- #{chapter} - Shows the current chapter of the media file being
played.
- #{state} - Shows one one of the following: Playing, Paused,
Buffered...
- #{time-pos} - Shows the current time of the media being played
in MM:SS format.
- #{duration} - Shows the total duration of the current media in
MM:SS format.
- #{percent-pos} - Shows the total completed percentage of the
current media.
- #{playlist-pos} - Shows the current media's position in the
playlist.
- #{playlist-count} - Shows the total item count in the current
playlist.
- #{item-loop-indicator} - Shows ↻ if the current file is on
loop.
- #{playlist-loop-indicator} - Shows ↻ if the current playlist is
on loop.
- #{radio} - Shows the current radio channel being played, if
there is any.
- #{volume} - Shows the current volume level in percentage, if
it's different from 100%.
- #{speed} - Shows the current volume level in percentage, if
it's different from 100%."
;;; tvr: :type 'string
:type '(choice (string :tag "Template format for all file types")
(alist :key-type (string :tag "File format (like hls, mp3, mpv etc.)")
:value-type (string :tag "Template format")))
:group 'empv)
--
|
Oh, got it (took a while to see that line, I was skipping it unconsciously). That shouldn't be there. Thanks! |
s ee https://github.com/isamert/empv.el/blob/main/empv.el#start-of-content :type may be repeated
The text was updated successfully, but these errors were encountered: