Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread Isaac Dupree
On 04/02/10 01:31, David Frascone wrote:
 Found and fixed.  There were several issues.  First, most people who type
 seq are really running seq on their host.  Fish will only use the builtin if
 it doesn't find it locally.  Use 'seq --version' to see what I mean.

of course seq is /usr/bin/seq ! (or wherever it is on your path.) What 
does it have to do with Fish? How can Fish have a possibly-a-builtin, 
possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/seq' ...) 
Isn't it against Fish's philosophy to duplicate external tools that 
don't need to be built into a shell?

Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I would be 
unsurprised.  In 10.3 (the last version I used regularly), I know they 
shipped a version of 'find' that enjoyed segfaulting (or some weird 
error, I forget exactly) when you forgot that their version of the 
'find' command didn't support omitting the path bit (you had to pass 
'.'). Admittedly, I think they just copied the tools from BSD, but that 
doesn't mean they were good tools...

-Isaac

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread Michael Lachmann

On 2 Apr 2010, at 10:52, Michael Lachmann wrote:

 I think when fish is invoked for a script, it shouldn't parse the
 arguments that are meant for the script...


I think one solution is to add a '+' to the beginning of the options  
string in fish.c:
#define GETOPT_STRING +hilnvc:p:d:

That will stop options processing once the script name is hit.

Michael


 On 2 Apr 2010, at 8:09, Isaac Dupree wrote:

 On 04/02/10 01:31, David Frascone wrote:
 Found and fixed.  There were several issues.  First, most people
 who type
 seq are really running seq on their host.  Fish will only use the
 builtin if
 it doesn't find it locally.  Use 'seq --version' to see what I mean.

 of course seq is /usr/bin/seq ! (or wherever it is on your path.)  
 What
 does it have to do with Fish? How can Fish have a possibly-a-builtin,
 possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/seq' ...)
 Isn't it against Fish's philosophy to duplicate external tools that
 don't need to be built into a shell?

 Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I
 would be
 unsurprised.  In 10.3 (the last version I used regularly), I know  
 they
 shipped a version of 'find' that enjoyed segfaulting (or some weird
 error, I forget exactly) when you forgot that their version of the
 'find' command didn't support omitting the path bit (you had to pass
 '.'). Admittedly, I think they just copied the tools from BSD, but
 that
 doesn't mean they were good tools...

 -Isaac

 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users



--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread David Frascone
Right. I was in the same boat. Use my patch and the fish installed seq  
will work for you.

-Dave

Sent from my iPhone

On Apr 2, 2010, at 4:52 AM, Michael Lachmann lachm...@eva.mpg.de  
wrote:

 The seq that I use is /sw/bin/seq, which seems to have been installed
 by fish:
 ---
 #!/usr/bin/env fish
 #
 # Fallback implementation of the seq command
 #
 # seq.  Generated from seq.in by configure.

 set -l from 1
 .
 .
 .
 ---

 The error (fish: invalid option -- 1) seems  to be generated before
 the script is ever called, by fish itself.
 So, when the script is invoked, fish is called, with the arguments (10
 -1 5), and it generates the error.

 I think when fish is invoked for a script, it shouldn't parse the
 arguments that are meant for the script...

 Michael


 On 2 Apr 2010, at 8:09, Isaac Dupree wrote:

 On 04/02/10 01:31, David Frascone wrote:
 Found and fixed.  There were several issues.  First, most people
 who type
 seq are really running seq on their host.  Fish will only use the
 builtin if
 it doesn't find it locally.  Use 'seq --version' to see what I mean.

 of course seq is /usr/bin/seq ! (or wherever it is on your path.)  
 What
 does it have to do with Fish? How can Fish have a possibly-a-builtin,
 possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/seq' ...)
 Isn't it against Fish's philosophy to duplicate external tools that
 don't need to be built into a shell?

 Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I
 would be
 unsurprised.  In 10.3 (the last version I used regularly), I know  
 they
 shipped a version of 'find' that enjoyed segfaulting (or some weird
 error, I forget exactly) when you forgot that their version of the
 'find' command didn't support omitting the path bit (you had to pass
 '.'). Admittedly, I think they just copied the tools from BSD, but
 that
 doesn't mean they were good tools...

 -Isaac

 --- 
 --- 
 --- 
 -
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users



 --- 
 --- 
 --- 
 -
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread David Frascone
Seq does not exist on OS X, it seems. Personally I've never used it.  
The patch only fixes the version installed by fish, so, should have no  
side effects at all!

-Dave

Sent from my iPhone

On Apr 2, 2010, at 2:09 AM, Isaac Dupree  
m...@isaac.cedarswampstudios.org wrote:

 On 04/02/10 01:31, David Frascone wrote:
 Found and fixed.  There were several issues.  First, most people  
 who type
 seq are really running seq on their host.  Fish will only use the  
 builtin if
 it doesn't find it locally.  Use 'seq --version' to see what I mean.

 of course seq is /usr/bin/seq ! (or wherever it is on your path.) What
 does it have to do with Fish? How can Fish have a possibly-a-builtin,
 possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/seq' ...)
 Isn't it against Fish's philosophy to duplicate external tools that
 don't need to be built into a shell?

 Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I  
 would be
 unsurprised.  In 10.3 (the last version I used regularly), I know they
 shipped a version of 'find' that enjoyed segfaulting (or some weird
 error, I forget exactly) when you forgot that their version of the
 'find' command didn't support omitting the path bit (you had to pass
 '.'). Admittedly, I think they just copied the tools from BSD, but  
 that
 doesn't mean they were good tools...

 -Isaac

 --- 
 --- 
 --- 
 -
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread David Frascone
What OS are you using?  Also, Ben has not pulled my changes yet, so, you can
either apply my patches by hand, or pull from my tree:

git clone git://github.com/CodeMonk/fish.git

-Dave

On Fri, Apr 2, 2010 at 7:07 AM, Michael Lachmann lachm...@eva.mpg.dewrote:

 I tried to download using git, but I'm getting an error, and I'm not
 sure what I did wrong.

 I did this:
 git clone git://github.com/benhoskings/fish
 cd fish
 ./configure
 make
 sudo make install

 but, calling fish gives me an error:
 ~/D/f/fish /usr/local/bin/fish
 fish: Job 1, '/usr/local/bin/fish' terminated by signal SIGBUS
 (Misaligned address error)

 ?

 On 2 Apr 2010, at 13:03, David Frascone wrote:

  Right. I was in the same boat. Use my patch and the fish installed
  seq will work for you.
 
  -Dave
 
  Sent from my iPhone
 
  On Apr 2, 2010, at 4:52 AM, Michael Lachmann lachm...@eva.mpg.de
  wrote:
 
  The seq that I use is /sw/bin/seq, which seems to have been installed
  by fish:
  ---
  #!/usr/bin/env fish
  #
  # Fallback implementation of the seq command
  #
  # seq.  Generated from seq.in by configure.
 
  set -l from 1
  .
  .
  .
  ---
 
  The error (fish: invalid option -- 1) seems  to be generated before
  the script is ever called, by fish itself.
  So, when the script is invoked, fish is called, with the arguments
  (10
  -1 5), and it generates the error.
 
  I think when fish is invoked for a script, it shouldn't parse the
  arguments that are meant for the script...
 
  Michael
 
 
  On 2 Apr 2010, at 8:09, Isaac Dupree wrote:
 
  On 04/02/10 01:31, David Frascone wrote:
  Found and fixed.  There were several issues.  First, most people
  who type
  seq are really running seq on their host.  Fish will only use the
  builtin if
  it doesn't find it locally.  Use 'seq --version' to see what I
  mean.
 
  of course seq is /usr/bin/seq ! (or wherever it is on your path.)
  What
  does it have to do with Fish? How can Fish have a possibly-a-
  builtin,
  possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/
  seq' ...)
  Isn't it against Fish's philosophy to duplicate external tools that
  don't need to be built into a shell?
 
  Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I
  would be
  unsurprised.  In 10.3 (the last version I used regularly), I know
  they
  shipped a version of 'find' that enjoyed segfaulting (or some weird
  error, I forget exactly) when you forgot that their version of the
  'find' command didn't support omitting the path bit (you had to pass
  '.'). Admittedly, I think they just copied the tools from BSD, but
  that
  doesn't mean they were good tools...
 
  -Isaac
 
 
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 
 
 
 
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/fish-users

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread Michael Lachmann
Thanks! I got your version now. git seems pretty nice.

Anyway, the problem was in config.h - I have to comment out the  
HAVE_REALPATH_NULL:
include/config.h:/*#define HAVE_REALPATH_NULL 1*/

I'm using OSX 10.5.8, I don't know why my realpath can't handle NULL.

I think two additional fixes are needed:
1. in kill.c, add the option '-n' to echo, so that fish doesn't add an  
extra newline to what's copied to the buffers.
2. in fish.c add + to the getopt:
#define GETOPT_STRING +hilnvc:p:d:
That tells fish to stop reading arguments when it encounters a non- 
option. That caused a bug in seq, but it'll cause a bug in any fish  
script that has to accept options or negative numbers.


Michael

On 2 Apr 2010, at 15:53, David Frascone wrote:

 What OS are you using?  Also, Ben has not pulled my changes yet, so,  
 you can either apply my patches by hand, or pull from my tree:

 git clone git://github.com/CodeMonk/fish.git

 -Dave

 On Fri, Apr 2, 2010 at 7:07 AM, Michael Lachmann  
 lachm...@eva.mpg.de wrote:
 I tried to download using git, but I'm getting an error, and I'm not
 sure what I did wrong.

 I did this:
 git clone git://github.com/benhoskings/fish
 cd fish
 ./configure
 make
 sudo make install

 but, calling fish gives me an error:
 ~/D/f/fish /usr/local/bin/fish
 fish: Job 1, '/usr/local/bin/fish' terminated by signal SIGBUS
 (Misaligned address error)

 ?

 On 2 Apr 2010, at 13:03, David Frascone wrote:

  Right. I was in the same boat. Use my patch and the fish installed
  seq will work for you.
 
  -Dave
 
  Sent from my iPhone
 
  On Apr 2, 2010, at 4:52 AM, Michael Lachmann lachm...@eva.mpg.de
  wrote:
 
  The seq that I use is /sw/bin/seq, which seems to have been  
 installed
  by fish:
  ---
  #!/usr/bin/env fish
  #
  # Fallback implementation of the seq command
  #
  # seq.  Generated from seq.in by configure.
 
  set -l from 1
  .
  .
  .
  ---
 
  The error (fish: invalid option -- 1) seems  to be generated before
  the script is ever called, by fish itself.
  So, when the script is invoked, fish is called, with the arguments
  (10
  -1 5), and it generates the error.
 
  I think when fish is invoked for a script, it shouldn't parse the
  arguments that are meant for the script...
 
  Michael
 
 
  On 2 Apr 2010, at 8:09, Isaac Dupree wrote:
 
  On 04/02/10 01:31, David Frascone wrote:
  Found and fixed.  There were several issues.  First, most people
  who type
  seq are really running seq on their host.  Fish will only use the
  builtin if
  it doesn't find it locally.  Use 'seq --version' to see what I
  mean.
 
  of course seq is /usr/bin/seq ! (or wherever it is on your path.)
  What
  does it have to do with Fish? How can Fish have a possibly-a-
  builtin,
  possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/
  seq' ...)
  Isn't it against Fish's philosophy to duplicate external tools  
 that
  don't need to be built into a shell?
 
  Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I
  would be
  unsurprised.  In 10.3 (the last version I used regularly), I know
  they
  shipped a version of 'find' that enjoyed segfaulting (or some  
 weird
  error, I forget exactly) when you forgot that their version of the
  'find' command didn't support omitting the path bit (you had to  
 pass
  '.'). Admittedly, I think they just copied the tools from BSD, but
  that
  doesn't mean they were good tools...
 
  -Isaac
 
   
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find  
 bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 
 
 
   
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 


 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got high marks during beta.
 http://p.sf.net/sfu/intel-sw-dev
 ___
 Fish-users mailing list
 Fish-users@lists.sourceforge.net
 

Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread David Frascone
On Fri, Apr 2, 2010 at 10:06 AM, Michael Lachmann lachm...@eva.mpg.dewrote:

 Thanks! I got your version now. git seems pretty nice.

 Anyway, the problem was in config.h - I have to comment out the
 HAVE_REALPATH_NULL:
 include/config.h:/*#define HAVE_REALPATH_NULL 1*/

 I'm using OSX 10.5.8, I don't know why my realpath can't handle NULL.

 I think two additional fixes are needed:
 1. in kill.c, add the option '-n' to echo, so that fish doesn't add an
 extra newline to what's copied to the buffers.

Doh!  I wondered what was causing that -- my bad.  I'll fix  push it.


 2. in fish.c add + to the getopt:

 #define GETOPT_STRING +hilnvc:p:d:
 That tells fish to stop reading arguments when it encounters a non-option.
 That caused a bug in seq, but it'll cause a bug in any fish script that has
 to accept options or negative numbers.


Will fix that too.  (fixing now) -- done.  You can do a git pull now.

-Dave




 Michael


 On 2 Apr 2010, at 15:53, David Frascone wrote:

  What OS are you using?  Also, Ben has not pulled my changes yet, so, you
 can either apply my patches by hand, or pull from my tree:

 git clone git://github.com/CodeMonk/fish.git

 -Dave

 On Fri, Apr 2, 2010 at 7:07 AM, Michael Lachmann lachm...@eva.mpg.de
 wrote:
 I tried to download using git, but I'm getting an error, and I'm not
 sure what I did wrong.

 I did this:
 git clone git://github.com/benhoskings/fish
 cd fish
 ./configure
 make
 sudo make install

 but, calling fish gives me an error:
 ~/D/f/fish /usr/local/bin/fish
 fish: Job 1, '/usr/local/bin/fish' terminated by signal SIGBUS
 (Misaligned address error)

 ?

 On 2 Apr 2010, at 13:03, David Frascone wrote:

  Right. I was in the same boat. Use my patch and the fish installed
  seq will work for you.
 
  -Dave
 
  Sent from my iPhone
 
  On Apr 2, 2010, at 4:52 AM, Michael Lachmann lachm...@eva.mpg.de
  wrote:
 
  The seq that I use is /sw/bin/seq, which seems to have been installed
  by fish:
  ---
  #!/usr/bin/env fish
  #
  # Fallback implementation of the seq command
  #
  # seq.  Generated from seq.in by configure.
 
  set -l from 1
  .
  .
  .
  ---
 
  The error (fish: invalid option -- 1) seems  to be generated before
  the script is ever called, by fish itself.
  So, when the script is invoked, fish is called, with the arguments
  (10
  -1 5), and it generates the error.
 
  I think when fish is invoked for a script, it shouldn't parse the
  arguments that are meant for the script...
 
  Michael
 
 
  On 2 Apr 2010, at 8:09, Isaac Dupree wrote:
 
  On 04/02/10 01:31, David Frascone wrote:
  Found and fixed.  There were several issues.  First, most people
  who type
  seq are really running seq on their host.  Fish will only use the
  builtin if
  it doesn't find it locally.  Use 'seq --version' to see what I
  mean.
 
  of course seq is /usr/bin/seq ! (or wherever it is on your path.)
  What
  does it have to do with Fish? How can Fish have a possibly-a-
  builtin,
  possibly-not?(for me, 'type seq' just says 'seq is /usr/bin/
  seq' ...)
  Isn't it against Fish's philosophy to duplicate external tools that
  don't need to be built into a shell?
 
  Is Mac OS X 'seq' broken, under-featured, (or nonexistent?)?  I
  would be
  unsurprised.  In 10.3 (the last version I used regularly), I know
  they
  shipped a version of 'find' that enjoyed segfaulting (or some weird
  error, I forget exactly) when you forgot that their version of the
  'find' command didn't support omitting the path bit (you had to pass
  '.'). Admittedly, I think they just copied the tools from BSD, but
  that
  doesn't mean they were good tools...
 
  -Isaac
 
 
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 
 
 
 
 --
  Download Intel#174; Parallel Studio Eval
  Try the new software tools for yourself. Speed compiling, find bugs
  proactively, and fine-tune applications for parallel performance.
  See why Intel Parallel Studio got high marks during beta.
  http://p.sf.net/sfu/intel-sw-dev
  ___
  Fish-users mailing list
  Fish-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/fish-users
 



 --
 Download Intel#174; Parallel Studio Eval
 Try the new software tools for yourself. Speed compiling, find bugs
 proactively, and fine-tune applications for parallel performance.
 See why Intel Parallel Studio got 

Re: [Fish-users] Fixing title setting in OS X

2010-04-02 Thread Isaac Dupree
On 04/02/10 10:26, David Frascone wrote:
 So, how do you think this should be generically fixed?

 In my tree, I simply commented out the /dev/tty setting.  But, I don't want
 to break things for linux.  And, I don't want to have conditional
 compilations, if they can be avoided.

as you wish... I think conditional compilation for accessing Linux vs. 
Darwin /dev/ filenames makes a ton of sense. (Or use a C if() and a 
system-call that tells you which system it is, if you wish, if such a 
thing exists... it's conventional to use conditional-compilation!)  But 
you'll have to tell me, what is the exact naming convention that 
Darwin/OSX uses? (for example, is /dev/tty1 a device-name on Darwin, 
or not? If not, then we can tell the difference just based on the names, 
with just a small bit of coding.)

 Should I abuse another environment variable?  Even still, how should it
 look?

 #linux
 set FISH_TERMINALS_WITH_TITLES /dev/pts whatever screen uses

 #osx
 set FISH_TERMINALS_WITH_TITLES /dev/tty whatever screen uses

 Then the code can go through that and do the strnstr?  I don't particularly
 like adding more special environment variables either, but I like it
 better than conditional compilation.

I suppose special fish environment variables could be used... make sure 
that they're initialized correctly for each system though, even if you 
share ~/.config/fish/ between a Mac and a Linux system and go back and 
forth... and it would clearly be just as much conditional as compiling 
it into the C code.  And I can tell that you're not engineering with 
weird hackers on weird embedded Linux setups in mind, so this 
configurability would probably not be useful even for dealing with that.

-Isaac

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fixing title setting in OS X

2010-04-02 Thread David Frascone
On Fri, Apr 2, 2010 at 1:23 PM, Isaac Dupree m...@isaac.cedarswampstudios.org
 wrote:


 as you wish... I think conditional compilation for accessing Linux vs.
 Darwin /dev/ filenames makes a ton of sense. (Or use a C if() and a
 system-call that tells you which system it is, if you wish, if such a thing
 exists... it's conventional to use conditional-compilation!)  But you'll
 have to tell me, what is the exact naming convention that Darwin/OSX uses?
 (for example, is /dev/tty1 a device-name on Darwin, or not? If not, then
 we can tell the difference just based on the names, with just a small bit of
 coding.)


Good point:  Darwin is using:

codemon...@daves-mbp ~/dotfiles tty
/dev/ttys015

I think ttys may be safe to use!



 I suppose special fish environment variables could be used... make sure
 that they're initialized correctly for each system though, even if you share
 ~/.config/fish/ between a Mac and a Linux system and go back and forth...
 and it would clearly be just as much conditional as compiling it into the C
 code.  And I can tell that you're not engineering with weird hackers on
 weird embedded Linux setups in mind, so this configurability would probably
 not be useful even for dealing with that.



So, given the ttys difference -- think we should go with an env setting, or
a quick fix that works for Darwin?

 I need to get some virtual machines set up anyway, I'll try to set up a BSD
one too, to see if that breaks. . .

-Dave
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fixing title setting in OS X

2010-04-02 Thread Isaac Dupree
On 04/02/10 13:34, David Frascone wrote:
 So, given the ttys difference -- think we should go with an env setting, or
 a quick fix that works for Darwin?

just use the appropriate check for ttys in the code. And make sure 
that you add a comment for what each string-check is checking for (e.g. 
Darwin terminals, Linux ptys, Linux console terminals... it's a 
dark area of Unix, so just be clear enough that people can go search the 
internet to learn more if they need to fix it or something).

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Fixing title setting in OS X

2010-04-02 Thread David Frascone
On Fri, Apr 2, 2010 at 2:17 PM, Isaac Dupree m...@isaac.cedarswampstudios.org
 wrote:

 On 04/02/10 13:34, David Frascone wrote:

 So, given the ttys difference -- think we should go with an env setting,
 or
 a quick fix that works for Darwin?


 just use the appropriate check for ttys in the code. And make sure that
 you add a comment for what each string-check is checking for (e.g. Darwin
 terminals, Linux ptys, Linux console terminals... it's a dark area of
 Unix, so just be clear enough that people can go search the internet to
 learn more if they need to fix it or something).


Ok -- code done.  Seems to work well on OS X.

http://github.com/CodeMonk/fish/commit/e11e78dfd762b80ccd4172a740e38fee0dc2c1e0

I need to check out a linux tree from darcs and apply these changes to make
sure I'm not breaking anything . . . looks much cleaner though.  Since tty
is a substring of ttys, there had to be a nested check, but, seems pretty
obvious by the comments.  (If not, let me know, and I'll be even more
verbose)

-Dave
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Temporary functions?

2010-04-02 Thread David Frascone
On Fri, Apr 2, 2010 at 6:07 PM, Philip Ganchev phil.ganc...@gmail.comwrote:

 On Thu, Apr 1, 2010 at 10:08 AM, David Frascone d...@frascone.com wrote:
 
  I'd like to add a function to my config.fish to do some things over and
 over
 [...]
  But, I don't want this function to exist after config.fish is done.
 Should
  I just erase it before the end of my config.fish:
 
  functions -e add_to_path
 
  Or is there an easier way to make a function that is non-global in scope?

 I think you should just erase it. There is no way to define a
 non-global function, as far as I  know.


Is there a better way than a function to do what I want?  (Uniquely add
directories to my path)?
--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Uniquely add to path?

2010-04-02 Thread Philip Ganchev
On Thu, Apr 1, 2010 at 9:46 AM, David Frascone d...@frascone.com wrote:

 There's a really cool feature in zsh that allows you to uniquely add a
 string to the path, if it did not exist before:

 typeset -U path

 This makes all items in path have to be unique, so then, if you do:

 path=(/foo/bin $path)
 path=(/foot/bin $path)

 You will NOT have two /foo/bin(s) in your path.

 Is there an equivalent way to do this in fish?

Not that I know of. Fish is designed to have a minimal set of builtins
that are as orthogonal as possible. But it might be useful to define a
function like:

function varuniq --description Return the unique arguments, merging
to the first occurrence of a word.
for x in $argv;
if not contains $x $ret
set ret $ret $y
end
end
end

Then use it like this:

set PATH (varuniq $PATH /home/joe/bin home/joe/src)


Or define:

function typeset
set rest argv[(seq 2 (count $argv))]
set $argv[1] (varuniq $argv[1] $rest)
end


Or even:

function path
for x in argv
if test -f $x and not contains $PATH $x
set PATH $PATH $x
end
end
end

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] Uniquely add to path?

2010-04-02 Thread David Frascone
I like the third function . . .. but I'd do a -d $x, since it should be a
directory :)

-Dave

On Fri, Apr 2, 2010 at 7:15 PM, Philip Ganchev phil.ganc...@gmail.comwrote:

 On Thu, Apr 1, 2010 at 9:46 AM, David Frascone d...@frascone.com wrote:
 
  There's a really cool feature in zsh that allows you to uniquely add a
  string to the path, if it did not exist before:
 
  typeset -U path
 
  This makes all items in path have to be unique, so then, if you do:
 
  path=(/foo/bin $path)
  path=(/foot/bin $path)
 
  You will NOT have two /foo/bin(s) in your path.
 
  Is there an equivalent way to do this in fish?

 Not that I know of. Fish is designed to have a minimal set of builtins
 that are as orthogonal as possible. But it might be useful to define a
 function like:

 function varuniq --description Return the unique arguments, merging
 to the first occurrence of a word.
for x in $argv;
if not contains $x $ret
set ret $ret $y
end
end
 end

 Then use it like this:

 set PATH (varuniq $PATH /home/joe/bin home/joe/src)


 Or define:

 function typeset
set rest argv[(seq 2 (count $argv))]
set $argv[1] (varuniq $argv[1] $rest)
 end


 Or even:

 function path
for x in argv
if test -f $x and not contains $PATH $x
set PATH $PATH $x
end
end
 end

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users


Re: [Fish-users] seq cannot count backwards

2010-04-02 Thread Isaac Dupree
On 04/02/10 04:52, Michael Lachmann wrote:
 The seq that I use is /sw/bin/seq, which seems to have been installed
 by fish:
 ---
 #!/usr/bin/env fish
 #
 # Fallback implementation of the seq command

gee.

Are there, I wonder, any systems with Fish installed but not Bash (or at 
least some bourne-compatible/posix shell as /bin/sh)?

Yes, I admit I do my scripting in Bash.  Not perl, not python, not zsh, 
not oh-er-there-must-be-another-scripting-language.  Bash is everywhere, 
bash is reliable ('cause everyone uses it, so everyone notices its 
bugs), and you basically have to know bash if you're to accurately read 
the advice and scripts that people give on the Internet*, let alone to 
give advice. (*maybe you don't need to know the looping constructs, 
history substitution, keyboard shortcuts.. -- but then again, maybe...)

 The error (fish: invalid option -- 1) seems  to be generated before
 the script is ever called, by fish itself.
 So, when the script is invoked, fish is called, with the arguments (10
 -1 5), and it generates the error.

 I think when fish is invoked for a script, it shouldn't parse the
 arguments that are meant for the script...

Yes, that would be a Fish bug, providing that Fish wishes to support the 
existence of Fish-scripts at all.  (I guess we would be silly not to 
technologically support it.. regardless of whether/which people say it's 
a good idea for common use, it shouldn't be broken!)

-Isaac

--
Download Intel#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users