gst version: 3.0.3
Linux dist: Debian/testing I have a few questions about suing gst for scripting: 1. Can gst be used in #! type scripts ? Based on what I recall from a 3-4 years ago, it was possible to do so, but I am unable to find the syntax that is correct for it. 2. Presuming the syntax is #!/usr/bin/gst, using smalltalk-mode.el to work on a script, I run into the problem that after I type the "#", pressing the "!" key will not print anything on the screen. Is there something I am doing wrong ? Probably the assumption in #1 is incorrect ? cheers, mehul _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
> 1. Can gst be used in #! type scripts ? Based on what I recall from a > 3-4 years ago, it was possible to do so, but I am unable to find the > syntax that is correct for it. Yes, the suggested one is this: #! /bin/sh "exec" "gst" "-f" "$0" "$@" which finds gst in the path. The quotes make the shell command look like a comment to gst. > 2. Presuming the syntax is #!/usr/bin/gst, using smalltalk-mode.el to > work on a script, I run into the problem that after I type the "#", > pressing the "!" key will not print anything on the screen. Is there > something I am doing wrong ? Probably the assumption in #1 is incorrect ? It's a bug in smalltalk mode. Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Paolo Bonzini said the following on 12/08/2008 12:58 PM:
>> 1. Can gst be used in #! type scripts ? Based on what I recall from a >> 3-4 years ago, it was possible to do so, but I am unable to find the >> syntax that is correct for it. > > Yes, the suggested one is this: > > #! /bin/sh > "exec" "gst" "-f" "$0" "$@" > > which finds gst in the path. The quotes make the shell command look > like a comment to gst. > This seems to work, though still need the ability to add "!". >> 2. Presuming the syntax is #!/usr/bin/gst, using smalltalk-mode.el to >> work on a script, I run into the problem that after I type the "#", >> pressing the "!" key will not print anything on the screen. Is there >> something I am doing wrong ? Probably the assumption in #1 is incorrect ? > > It's a bug in smalltalk mode. > Any known work arounds ? _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
> Any known work arounds ? I think if you write '#! and then delete the quote it works, but I have not tried. I'll work on a fix soon. BTW, the bug is there because ! is associated to "move past the end of this method" for analogy with the old syntax. If you are in the following situation a: n [ blah blah "Point at the end of this line" ] b: m [ ] Then ! will move just before "b: m". Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
In reply to this post by Mehul Sanghvi-2
For emacs smalltalk mode,
creating new/another mode for new syntax could be bad choice? Just curious, for I think it's easier than maintaining two syntax in single mode. ----- Original Message ----- From: Paolo Bonzini <[hidden email]> To: [hidden email], gnu smalltalk <[hidden email]> Sent: 08-12-09 19:59:39 Subject: Re: [Help-smalltalk] gst & scripting > Any known work arounds ? I think if you write '#! and then delete the quote it works, but I have not tried. I'll work on a fix soon. BTW, the bug is there because ! is associated to "move past the end of this method" for analogy with the old syntax. If you are in the following situation a: n [ blah blah "Point at the end of this line" ] b: m [ ] Then ! will move just before "b: m". Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
In reply to this post by Paolo Bonzini-2
I just tested with #!/usr/bin/env gst and #!/opt/local/bin/gst
It works fine with both, except the latter is specific to my installation (macports). On Mon, Dec 8, 2008 at 18:58, Paolo Bonzini <[hidden email]> wrote: > >> 1. Can gst be used in #! type scripts ? Based on what I recall from a >> 3-4 years ago, it was possible to do so, but I am unable to find the >> syntax that is correct for it. > > Yes, the suggested one is this: > > #! /bin/sh > "exec" "gst" "-f" "$0" "$@" > > which finds gst in the path. The quotes make the shell command look > like a comment to gst. > >> 2. Presuming the syntax is #!/usr/bin/gst, using smalltalk-mode.el to >> work on a script, I run into the problem that after I type the "#", >> pressing the "!" key will not print anything on the screen. Is there >> something I am doing wrong ? Probably the assumption in #1 is incorrect ? > > It's a bug in smalltalk mode. > > Paolo -- Damien Pollet type less, do more [ | ] http://people.untyped.org/damien.pollet _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
In reply to this post by Paolo Bonzini-2
Damien Pollet wrote:
> I just tested with #!/usr/bin/env gst and #!/opt/local/bin/gst > > It works fine with both, except the latter is specific to my > installation (macports). It should be #! /usr/bin/env gst -f to pass command-line arguments and shut up the garbage collection message. However, passing more than one argument on the #! lines is not portable. It would work instead to use #! /path/to/gst -f but as you said it is not portable. So that's why someone (not me, I don't remember who it was) concocted... >> #! /bin/sh >> "exec" "gst" "-f" "$0" "$@" ... this one, which is actually quite elegant. It is similar to how Tcl scripts are invoked with #! /bin/sh # Tcl sees the next line as a continuation of the comment \ exec wish "$0" "$@" Paolo _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Paolo Bonzini wrote:
> So that's why someone (not me, I don't remember who it was) concocted... > >>> #! /bin/sh >>> "exec" "gst" "-f" "$0" "$@" > > ... this one, which is actually quite elegant. It is similar to how Tcl > scripts are invoked with > > #! /bin/sh > # Tcl sees the next line as a continuation of the comment \ > exec wish "$0" "$@" It's also similar to where we ended up for Scheme scripts (using, in this instance, mzscheme): "true" ;exec env mzscheme -mv -f "$0" -e "(apply script-main \"`dirname $0`\" (vector->list argv))" -- "$@" Cheers, Tony _______________________________________________ help-smalltalk mailing list [hidden email] http://lists.gnu.org/mailman/listinfo/help-smalltalk |
Free forum by Nabble | Edit this page |