zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] remove perl dependency in pick-web-browser
@ 2009-09-11 11:06 Baptiste Daroussin
  0 siblings, 0 replies; only message in thread
From: Baptiste Daroussin @ 2009-09-11 11:06 UTC (permalink / raw)
  To: zsh-workers

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

this patch removes the need of perl and sed in pick-web-browser, it
works but I'm sur the pattern matching could be cleaner

Anyway here is the patch
the only function that now keeps using perl is
Newuser/zsh-newuser-install but that will be for an other day :)

regards,
Bapt

[-- Attachment #2: pick-web-browser-noperl.patch --]
[-- Type: application/octet-stream, Size: 939 bytes --]

diff --git a/Functions/MIME/pick-web-browser b/Functions/MIME/pick-web-browser
index fe42c0b..aecc789 100644
--- a/Functions/MIME/pick-web-browser
+++ b/Functions/MIME/pick-web-browser
@@ -81,9 +81,10 @@ for bstyle in $bstyles; do
     #    windows=(${(f)"$(xwininfo -root -all | 
     #	sed -ne 's/.*".*": ("\(.*\)" ".*").*/\1/p' |sort | uniq)"})
 
-    windows=(${(f)"$(xwininfo -root -all | 
-         perl -ne '/.*"(.*)": \("(.*)" "(.*)"\).*/ and $w{$2} = 1;
-                   END { print join("\n", keys %w), "\n" }')"})
+    windows=(${(ou)${(M)${(f)"$(xwininfo -root -all)"}:#*\"*\"\:[[:space:]]\(\"*}/(#b)*\"*\"\:[[:space:]]\(\"(*)\"[[:space:]]\"*\"\)*/$match[1]})
+    #windows=(${(f)"$(xwininfo -root -all | 
+    #     perl -ne '/.*"(.*)": \("(.*)" "(.*)"\).*/ and $w{$2} = 1;
+    #               END { print join("\n", keys %w), "\n" }')"})
 
     # Is any browser we've heard of running?
     for browser in $xbrowsers; do

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-11 11:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-11 11:06 [PATCH] remove perl dependency in pick-web-browser Baptiste Daroussin

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).