Peter White
Peter White
The cases `%f/%F` and `%{filename[/no-ext]}` are semantically identical but take two very different code paths which led to inconsistencies. I reckon this could all be outsourced to a Lua function...
And in said Lua version there will be one helper function that gets called in all the cases. Or maybe Lua can express cases better? Not sure, needs exploration. In...
> There is nothing to outsource. Getting the filename is trivial. OK, but I was looking at that whole long `switch` `case` and especially `%{` which reinvents `mp.get`. > And...
> > OK, but I was looking at that whole long `switch` `case` and especially `%{` which reinvents `mp.get`. > > No. Retrieving a single property is different from expanding...
> > Yes, I know that. But why use the C functions with all that memory management overhead, i.e. dragging the talloc context along, and all that makes C difficult...
Just to be clear. I am not talking about getting rid of `screenshot` (the command). I am suggesting something like, say `screenshot.lua` to build the correct `screenshot-to-file` command, so it...
Message received.
One last thing I just have to say to this because it does demonstrate, that 99.9% can be achieved with plain `screenshot-to-file` and a key binding with **Lua disabled**. Adding...
This does alter the semantics of `mp_basename`, though. Maybe this warrants renaming to `mp_basename_or_url`, or something similar? Or wrap `mp_basename` in said new function, and encourage use of the new...
Fair enough. I was just musing about people not intimately familiar with the code base. Seeing something that says basename and *not* looking at its implementation may yield unexpected results....