etu/webpaste.el

sending bash script to dpaste.org to dpaste.org gives a "python" type

braoult opened this issue · 2 comments

When sending a bash file to dpaste.org, bash scripts are seen as "python".

#!/bin/bash
shopt -s extglob

case $1 in
    [a-z])
        echo indent OK. Case '[a-z]'
        ;;
    +([1-9]))
        echo indent NOK. Case '+([1-9])', extended pattern.
        ;;
    *)
        echo indent still NOK. Case '*', after extended pattern
        ;;
esac # indent still NOK

The buffer is correct (sh-mode), and shebang is correct. I did not test this behavior for other providers.

etu commented

I can confirm this by executing the following piece of lisp in a buffer in sh-mode and a correct shebang.

(webpaste--get-buffer-language "https://dpaste.org/api/")

Not sure why I get nil back though, it doesn't really make sense to me at the moment. Don't have time to dig in further.

following my question, someone on #emacsfr made a couple of tests:

  • if shebang is "#!/bin/sh" instead of "#!/bin/bash", it is seen correctly as bash.
    I double checked, this is right.
  • on paste.mozilla.org, "#!/bin/bash" is javascript, "#!/bin/sh" is bash.
    I checked too, this is correct.

likely a bug on dpaste side, I will fill a bug report.