Skip to content

quoting around complex noweb template use is unclear #15

Description

@gvoysey

Consider the following defun:

    (defun dwim-shell-command-thumbnail-with-ffmpeg ()
      "Generate a thumbnail with ffmpeg."
      (interactive)
      (dwim-shell-command-on-marked-files
       "Thumbnail with ffmpeg"
       " ffmpeg -i '<<f>>' -vf  \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<fne>>.png'"
       :utils "ffmpeg"
       :silent-success t))

This fails with dwim-shell-command--escaped-quote-around: Couldn’t figure out how to quote for " ffmpeg -i '<<f>>' -vf "thumbnail,scale=640:360" -frames:v 1 '<<td>>/<<fne>>.png'" using / and .

If instead the command is " ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<fne>>.png'", (ie, omitting the temporary directory), this succeeds.

how does <> work? omitting the explicit / path separator doesn't seem to matter, nor does hardcoding a /tmp/ instead of using <<td>>.

(my actual goal here is to generate temporary thumbnails for videos, so what i really want is something like " ffmpeg -i '<<f>>' -vf \"thumbnail,scale=640:360\" -frames:v 1 '<<td>>/<<fne>>.png' && feh <<td>>/<<fne>>.png", but omitting the && ... clause doesn't affect the error here. I'm also a little curious about how to use <>; maybe i can just pipe the png into feh and avoid the file entirely, but i don't know how.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions