zsh-users
 help / color / mirror / code / Atom feed
* _mac_applications patch for Mac OS X 10.4
@ 2005-05-11 14:49 lists
  2005-05-11 15:42 ` lists
  0 siblings, 1 reply; 9+ messages in thread
From: lists @ 2005-05-11 14:49 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 746 bytes --]

I've done some tweaking based on the submission in <http:// 
www.zsh.org/mla/users/2005/msg00479.html> (thanks Scott and Wataru)  
and have put together a patch for _mac_applications which uses the  
_tiger_mac_applications function from the aforementioned submission  
(which I've renamed to _spotlight_mac_apps since Spotlight will  
probably be around after Tiger).  _mac_applications will now use  
Spotlight (via _spotlight_mac_apps) if you're running Mac OS X 10.4,  
and will fall back to the old way if you're not.  I'm also including  
the modified _spotlight_mac_apps function (which will now check for  
an Applications folder in your home directory as well).  Please let  
me know if there are any problems/objections.

Thanks,
Ryan


[-- Attachment #2: _mac_applications.diff.gz --]
[-- Type: application/x-gzip, Size: 274 bytes --]

[-- Attachment #3: _spotlight_mac_apps.gz --]
[-- Type: application/x-gzip, Size: 227 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 14:49 _mac_applications patch for Mac OS X 10.4 lists
@ 2005-05-11 15:42 ` lists
  2005-05-11 16:27   ` Motoi Washida
  2005-05-11 18:32   ` William Scott
  0 siblings, 2 replies; 9+ messages in thread
From: lists @ 2005-05-11 15:42 UTC (permalink / raw)
  To: zsh-users; +Cc: Motoi Washida

After poking around some more, I think the best thing to do would be  
to modify _retrieve_mac_apps() so that it uses Spotlight to find the  
apps if you're running Tiger, and the old way if you're not running  
Tiger.  This way the apps would be found using Spotlight the first  
time, then added to the cache so you don't have to keep using mdfind  
every time you try to tab complete an app's name.  Motoi, since you  
are the expert on _retrieve_mac_apps() what do you think?

-Ryan


On May 11, 2005, at 9:49 AM, lists wrote:

> I've done some tweaking based on the submission in <http:// 
> www.zsh.org/mla/users/2005/msg00479.html> (thanks Scott and Wataru)  
> and have put together a patch for _mac_applications which uses the  
> _tiger_mac_applications function from the aforementioned submission  
> (which I've renamed to _spotlight_mac_apps since Spotlight will  
> probably be around after Tiger).  _mac_applications will now use  
> Spotlight (via _spotlight_mac_apps) if you're running Mac OS X  
> 10.4, and will fall back to the old way if you're not.  I'm also  
> including the modified _spotlight_mac_apps function (which will now  
> check for an Applications folder in your home directory as well).   
> Please let me know if there are any problems/objections.
>
> Thanks,
> Ryan
>
>
> <_mac_applications.diff.gz>
> <_spotlight_mac_apps.gz>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 15:42 ` lists
@ 2005-05-11 16:27   ` Motoi Washida
  2005-05-12  2:16     ` lists
  2005-05-13 17:04     ` Motoi Washida
  2005-05-11 18:32   ` William Scott
  1 sibling, 2 replies; 9+ messages in thread
From: Motoi Washida @ 2005-05-11 16:27 UTC (permalink / raw)
  To: zsh-users

Hi Ryan,

I want to try your great patch, but I have one remote Tiger machine, 
which has not finished indexing. :(

On 2005/05/12, at 0:42, lists wrote:

> After poking around some more, I think the best thing to do would be 
> to modify _retrieve_mac_apps() so that it uses Spotlight to find the 
> apps if you're running Tiger, and the old way if you're not running 
> Tiger.  This way the apps would be found using Spotlight the first 
> time, then added to the cache so you don't have to keep using mdfind 
> every time you try to tab complete an app's name.  Motoi, since you 
> are the expert on _retrieve_mac_apps() what do you think?
I was just thinking about modifying _retrieve_mac_apps() to use Bill 
and Wataru's idea. If you don't mind, I'll modify and commit it.

>
> -Ryan
>
>
> On May 11, 2005, at 9:49 AM, lists wrote:
>
>> I've done some tweaking based on the submission in 
>> <http://www.zsh.org/mla/users/2005/msg00479.html> (thanks Scott and 
>> Wataru) and have put together a patch for _mac_applications which 
>> uses the _tiger_mac_applications function from the aforementioned 
>> submission (which I've renamed to _spotlight_mac_apps since Spotlight 
>> will probably be around after Tiger).  _mac_applications will now use 
>> Spotlight (via _spotlight_mac_apps) if you're running Mac OS X 10.4, 
>> and will fall back to the old way if you're not.  I'm also including 
>> the modified _spotlight_mac_apps function (which will now check for 
>> an Applications folder in your home directory as well).  Please let 
>> me know if there are any problems/objections.
>>
>> Thanks,
>> Ryan
>>
>>
>> <_mac_applications.diff.gz>
>> <_spotlight_mac_apps.gz>
>>
>
>
--
Motoi Washida


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 15:42 ` lists
  2005-05-11 16:27   ` Motoi Washida
@ 2005-05-11 18:32   ` William Scott
  2005-05-13 17:42     ` Motoi Washida
  1 sibling, 1 reply; 9+ messages in thread
From: William Scott @ 2005-05-11 18:32 UTC (permalink / raw)
  To: zsh-users; +Cc: Motoi Washida

In   _open I just have this:

   case "$state" in
     open_mac_applications)
       if [[ $OSTYPE[7] -ge '8' ]]; then
         _init_open_tiger
       else
         _init_open
         _alternative \
             "commands: :_mac_applications" \
             "files:: _open_absolute_application_path"
       fi
       ;;


I wrote an augmented open function and hacked an _open completion for 
it based on Motoi's version.  The open function and its dependencies 
are here:

http://www.chemistry.ucsc.edu/%7Ewgscott/mystuff/zsh_tree.html

This gives open a few extra (non-apple) arguments, like open -p to open 
preference panes, open -w to open widgets, open -x to open x11 apps, 
and so forth.


Also I hacked the _fink completion function and made a function fink 
(same page) that updates the cache after an installation, update, and 
so on.

Please feel free to incorporate and/or improve any of these.  I wrote 
them to learn shell scripting so they are unlikely to be works of art.



William G. Scott

Associate Professor
Department of Chemistry and Biochemistry
and The Center for the Molecular Biology of RNA
Sinsheimer Laboratories
University of California at Santa Cruz
Santa Cruz, California 95064
USA

On May 11, 2005, at 8:42 AM, lists wrote:

> After poking around some more, I think the best thing to do would be 
> to modify _retrieve_mac_apps() so that it uses Spotlight to find the 
> apps if you're running Tiger, and the old way if you're not running 
> Tiger.  This way the apps would be found using Spotlight the first 
> time, then added to the cache so you don't have to keep using mdfind 
> every time you try to tab complete an app's name.  Motoi, since you 
> are the expert on _retrieve_mac_apps() what do you think?
>
> -Ryan
>
>
> On May 11, 2005, at 9:49 AM, lists wrote:
>
>> I've done some tweaking based on the submission in 
>> <http://www.zsh.org/mla/users/2005/msg00479.html> (thanks Scott and 
>> Wataru) and have put together a patch for _mac_applications which 
>> uses the _tiger_mac_applications function from the aforementioned 
>> submission (which I've renamed to _spotlight_mac_apps since Spotlight 
>> will probably be around after Tiger).  _mac_applications will now use 
>> Spotlight (via _spotlight_mac_apps) if you're running Mac OS X 10.4, 
>> and will fall back to the old way if you're not.  I'm also including 
>> the modified _spotlight_mac_apps function (which will now check for 
>> an Applications folder in your home directory as well).  Please let 
>> me know if there are any problems/objections.
>>
>> Thanks,
>> Ryan
>>
>>
>> <_mac_applications.diff.gz>
>> <_spotlight_mac_apps.gz>
>>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 16:27   ` Motoi Washida
@ 2005-05-12  2:16     ` lists
  2005-05-13 17:04     ` Motoi Washida
  1 sibling, 0 replies; 9+ messages in thread
From: lists @ 2005-05-12  2:16 UTC (permalink / raw)
  To: zsh-users


On May 11, 2005, at 11:27 AM, Motoi Washida wrote:

> I was just thinking about modifying _retrieve_mac_apps() to use  
> Bill and Wataru's idea. If you don't mind, I'll modify and commit it.

Yes please, thanks!

On May 11, 2005, at 1:32 PM, William Scott wrote:
> I wrote an augmented open function and hacked an _open completion  
> for it based on Motoi's version.  The open function and its  
> dependencies are here:


Thanks for sharing!

-Ryan


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 16:27   ` Motoi Washida
  2005-05-12  2:16     ` lists
@ 2005-05-13 17:04     ` Motoi Washida
  2005-05-19 12:40       ` lists
  1 sibling, 1 reply; 9+ messages in thread
From: Motoi Washida @ 2005-05-13 17:04 UTC (permalink / raw)
  To: zsh-users

[-- Attachment #1: Type: text/plain, Size: 1865 bytes --]

Here is a patch to _retreive_mac_apps.

On 2005/05/12, at 1:27, Motoi Washida wrote:

> Hi Ryan,
>
> I want to try your great patch, but I have one remote Tiger machine, 
> which has not finished indexing. :(
>
> On 2005/05/12, at 0:42, lists wrote:
>
>> After poking around some more, I think the best thing to do would be 
>> to modify _retrieve_mac_apps() so that it uses Spotlight to find the 
>> apps if you're running Tiger, and the old way if you're not running 
>> Tiger.  This way the apps would be found using Spotlight the first 
>> time, then added to the cache so you don't have to keep using mdfind 
>> every time you try to tab complete an app's name.  Motoi, since you 
>> are the expert on _retrieve_mac_apps() what do you think?
> I was just thinking about modifying _retrieve_mac_apps() to use Bill 
> and Wataru's idea. If you don't mind, I'll modify and commit it.
>
>>
>> -Ryan
>>
>>
>> On May 11, 2005, at 9:49 AM, lists wrote:
>>
>>> I've done some tweaking based on the submission in 
>>> <http://www.zsh.org/mla/users/2005/msg00479.html> (thanks Scott and 
>>> Wataru) and have put together a patch for _mac_applications which 
>>> uses the _tiger_mac_applications function from the aforementioned 
>>> submission (which I've renamed to _spotlight_mac_apps since 
>>> Spotlight will probably be around after Tiger).  _mac_applications 
>>> will now use Spotlight (via _spotlight_mac_apps) if you're running 
>>> Mac OS X 10.4, and will fall back to the old way if you're not.  I'm 
>>> also including the modified _spotlight_mac_apps function (which will 
>>> now check for an Applications folder in your home directory as 
>>> well).  Please let me know if there are any problems/objections.
>>>
>>> Thanks,
>>> Ryan
>>>
>>>
>>> <_mac_applications.diff.gz>
>>> <_spotlight_mac_apps.gz>
>>>
>>
>>
> --
> Motoi Washida
>
>
--
Motoi Washida

[-- Attachment #2: _retrieve_mac_apps.patch.gz --]
[-- Type: application/x-gzip, Size: 1520 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-11 18:32   ` William Scott
@ 2005-05-13 17:42     ` Motoi Washida
  2005-05-14  6:09       ` William Scott
  0 siblings, 1 reply; 9+ messages in thread
From: Motoi Washida @ 2005-05-13 17:42 UTC (permalink / raw)
  To: William Scott; +Cc: zsh-users

Hi Bill,

On 2005/05/12, at 3:32, William Scott wrote:

> I wrote an augmented open function and hacked an _open completion for 
> it based on Motoi's version.  The open function and its dependencies 
> are here:
>
> http://www.chemistry.ucsc.edu/%7Ewgscott/mystuff/zsh_tree.html
>
> This gives open a few extra (non-apple) arguments, like open -p to 
> open preference panes, open -w to open widgets, open -x to open x11 
> apps, and so forth.
I checked your zsh-templates Fink package some time ago. I think your 
extensions are very useful, but some scripts seem to be written by 
copying and modifying files from original zsh distribution. It is not 
efficient and I hope you can write your scripts by just calling 
original functions, although I've not looked at your code well and have 
no idea about that for now. :(

> Also I hacked the _fink completion function and made a function fink 
> (same page) that updates the cache after an installation, update, and 
> so on.
>
> Please feel free to incorporate and/or improve any of these.  I wrote 
> them to learn shell scripting so they are unlikely to be works of art.


--
Motoi Washida


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-13 17:42     ` Motoi Washida
@ 2005-05-14  6:09       ` William Scott
  0 siblings, 0 replies; 9+ messages in thread
From: William Scott @ 2005-05-14  6:09 UTC (permalink / raw)
  To: Motoi Washida; +Cc: zsh-users


Dear Motoi:

As I said, they are not works of art.

In the case of the open and fink completions, I had written my own
functions but when yours were made available I saw that they were much
superior in almost every respect, but being highly impatient I hacked out
what I used for faster completions and grafted or tricked your completions
into using my hacks.

As you say, it is unlikely the best or most efficient way to do this, but
at least it is a proof of principle.

With OS X 10.4, the problem at least for _open is now much easier, and if
some clever person comes up with an instantaneous replacement for making a
call to "fink index" after every update or install command, that obviously
would be of tremendous benefit too.

For the record, I put comments like this at the top of the files that I
altered:

# Author:  Motoi Washida
# modified by W G Scott
# Nov 28, 2004 from the
# November 12 2004 CVS version

All the best,

Bill





On Sat, 14 May 2005, Motoi Washida wrote:

> Hi Bill,
>
> On 2005/05/12, at 3:32, William Scott wrote:
>
> > I wrote an augmented open function and hacked an _open completion for
> > it based on Motoi's version.  The open function and its dependencies
> > are here:
> >
> > http://www.chemistry.ucsc.edu/%7Ewgscott/mystuff/zsh_tree.html
> >
> > This gives open a few extra (non-apple) arguments, like open -p to
> > open preference panes, open -w to open widgets, open -x to open x11
> > apps, and so forth.
> I checked your zsh-templates Fink package some time ago. I think your
> extensions are very useful, but some scripts seem to be written by
> copying and modifying files from original zsh distribution. It is not
> efficient and I hope you can write your scripts by just calling
> original functions, although I've not looked at your code well and have
> no idea about that for now. :(
>
> > Also I hacked the _fink completion function and made a function fink
> > (same page) that updates the cache after an installation, update, and
> > so on.
> >
> > Please feel free to incorporate and/or improve any of these.  I wrote
> > them to learn shell scripting so they are unlikely to be works of art.
>
>
> --
> Motoi Washida
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: _mac_applications patch for Mac OS X 10.4
  2005-05-13 17:04     ` Motoi Washida
@ 2005-05-19 12:40       ` lists
  0 siblings, 0 replies; 9+ messages in thread
From: lists @ 2005-05-19 12:40 UTC (permalink / raw)
  To: zsh-users

Motoi, that seems to work well.  Thanks!

-Ryan


On May 13, 2005, at 12:04 PM, Motoi Washida wrote:

> Here is a patch to _retreive_mac_apps.
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2005-05-19 12:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-11 14:49 _mac_applications patch for Mac OS X 10.4 lists
2005-05-11 15:42 ` lists
2005-05-11 16:27   ` Motoi Washida
2005-05-12  2:16     ` lists
2005-05-13 17:04     ` Motoi Washida
2005-05-19 12:40       ` lists
2005-05-11 18:32   ` William Scott
2005-05-13 17:42     ` Motoi Washida
2005-05-14  6:09       ` William Scott

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).