From d479dfd67de910d2a8abf876cd2d99cc2e62c2ea Mon Sep 17 00:00:00 2001 From: Guido Cella Date: Fri, 27 Nov 2020 10:48:57 +0100 Subject: manpage: clarify profile-cond requires underscores While this says that _ is replaced with -, it doesn't say that you HAVE to use _. This isn't obvious and I didn't understand why my profile conditions with - weren't working at first. Seeing as the person who reproted #8324 ran into this as well, this may be worth clarifying. --- DOCS/man/mpv.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'DOCS/man') diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst index be29a977d5..d00c8a77f4 100644 --- a/DOCS/man/mpv.rst +++ b/DOCS/man/mpv.rst @@ -781,9 +781,11 @@ ignored. This Lua code execution is not sandboxed. Any variables in condition expressions can reference properties. If an identifier is not already defined by Lua or mpv, it is interpreted as property. -For example, ``pause`` would return the current pause status. If the variable -name contains any ``_`` characters, they are turned into ``-``. For example, -``playback_time`` would return the property ``playback-time``. +For example, ``pause`` would return the current pause status. You cannot +reference properties with ``-`` this way since that would denote a subtraction, +but if the variable name contains any ``_`` characters, they are turned into +``-``. For example, ``playback_time`` would return the property +``playback-time``. A more robust way to access properties is using ``p.property_name`` or ``get("property-name", default_value)``. The automatic variable to property -- cgit v1.2.3