public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in dev-util/visual-regexp/files: visual-regexp-3.0-help-font-fix.patch visual-regexp-3.0-home-conf-fix.patch visual-regexp-3.0-wish-fix.patch visual-regexp-3.0-pattern-load-fix.patch
@ 2013-12-15 18:56 Tom Wijsman (tomwij)
  0 siblings, 0 replies; only message in thread
From: Tom Wijsman (tomwij) @ 2013-12-15 18:56 UTC (permalink / raw
  To: gentoo-commits

tomwij      13/12/15 18:56:26

  Added:                visual-regexp-3.0-help-font-fix.patch
                        visual-regexp-3.0-home-conf-fix.patch
                        visual-regexp-3.0-wish-fix.patch
                        visual-regexp-3.0-pattern-load-fix.patch
  Log:
  Revision bump, several fixes from bug #492700; proxied commit for Quentin Minster (laomaiweng).
  
  (Portage version: HEAD/cvs/Linux x86_64, signed Manifest commit with key 6D34E57D)

Revision  Changes    Path
1.1                  dev-util/visual-regexp/files/visual-regexp-3.0-help-font-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-help-font-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-help-font-fix.patch?rev=1.1&content-type=text/plain

Index: visual-regexp-3.0-help-font-fix.patch
===================================================================
diff -ur a/visual_regexp.tcl b/visual_regexp.tcl
--- a/visual_regexp.tcl	2013-11-10 01:35:49.959609478 +0100
+++ b/visual_regexp.tcl	2013-11-10 01:34:10.491151352 +0100
@@ -494,15 +494,18 @@
 	pack .help.l -side top -padx 10 -pady 10
 	# help text
 	if {$tcl_platform(platform) == "windows"} {
-		text .help.t -bd 2 -relief groove -font {Courier 10}
+        set hfont {Courier 10}
+        set hbfont {Courier 10 bold}
 	} else {
-		text .help.t -bd 2 -relief groove
+        set hfont {9x15}
+        set hbfont {9x15bold}
 	}
+    text .help.t -bd 2 -relief groove -font $hfont
 	pack .help.t -side top -padx 20
-	.help.t tag configure bold -font "[.help.t cget -font] bold"
+	.help.t tag configure bold -font $hbfont
 	.help.t insert 1.0 "Version:" bold " $::version
 
-" normal "Usage:" bold " tkregexp <sampleFile>
+" normal "Usage:" bold " [file tail $::argv0] <sampleFile>
 
 " normal "Key bindings:" bold " Alt-q               exit
               Alt-a               toggle 'all' flag



1.1                  dev-util/visual-regexp/files/visual-regexp-3.0-home-conf-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-home-conf-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-home-conf-fix.patch?rev=1.1&content-type=text/plain

Index: visual-regexp-3.0-home-conf-fix.patch
===================================================================
diff -ur a/visual_regexp.tcl b/visual_regexp.tcl
--- a/visual_regexp.tcl	2013-11-12 23:23:59.730171882 +0100
+++ b/visual_regexp.tcl	2013-11-12 23:24:42.134085257 +0100
@@ -1062,27 +1060,38 @@
 #==============================================================================================
 
 # try to get customization from 'visual_regexp.ini'
-puts "[file exists visual_regexp.ini]"
-set filename [file dirname [info nameofexecutable]]/visual_regexp.ini
-if {[file exists $filename]} {
-	source $filename
-} elseif {[file exists visual_regexp.ini]} {
-	source visual_regexp.ini
+set localfilename visual_regexp.ini
+set homefilename ""
+if {[info exists ::env(HOME)]} {
+	set homefilename [file join $::env(HOME) .visual_regexp visual_regexp.ini]
 }
-
-# try to auto user patterns
-set filename [file dirname [info nameofexecutable]]/regexp.txt
-if {[file exists $filename]} {
-	regexp::pattern:load $filename
-} elseif {[file exists regexp.txt]} {
-	regexp::pattern:load regexp.txt
+set binfilename [file join [file dirname [info nameofexecutable]] visual_regexp.ini]
+foreach filename [list $localfilename $homefilename $binfilename] {
+	if {[file exists $filename]} {
+		source $filename
+		break
+	}
 }
 
-# buld the GUI
+# build the GUI
 regexp::history:init
 regexp::gui
 regexp::go
 
+# try to auto user patterns
+set localfilename regexp.txt
+set homefilename ""
+if {[info exists ::env(HOME)]} {
+	set homefilename [file join $::env(HOME) .visual_regexp regexp.txt]
+}
+set binfilename [file join [file dirname [info nameofexecutable]] regexp.txt]
+foreach filename [list $localfilename $homefilename $binfilename] {
+	if {[file exists $filename]} {
+		regexp::pattern:load $filename
+		break
+	}
+}
+
 if {$argc > 1} {
 	puts "Usage: $argv0 <sampleFile>"
 } elseif {$argc == 1} {



1.1                  dev-util/visual-regexp/files/visual-regexp-3.0-wish-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-wish-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-wish-fix.patch?rev=1.1&content-type=text/plain

Index: visual-regexp-3.0-wish-fix.patch
===================================================================
diff -ur visual_regexp-3.0/visual_regexp.tcl visual_regexp-current/visual_regexp.tcl
--- visual_regexp-3.0/visual_regexp.tcl	2002-09-01 08:24:56.000000000 -0500
+++ visual_regexp-current/visual_regexp.tcl	2004-03-29 23:20:43.000000000 -0500
@@ -1,7 +1,7 @@
 #!/bin/sh  
 #-*-tcl-*-  
 # the next line restarts using wish \
-exec wish8.3 "$0" -- ${1+"$@"}
+exec wish "$0" -- ${1+"$@"}
 
 
 set version 3.0



1.1                  dev-util/visual-regexp/files/visual-regexp-3.0-pattern-load-fix.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-pattern-load-fix.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-util/visual-regexp/files/visual-regexp-3.0-pattern-load-fix.patch?rev=1.1&content-type=text/plain

Index: visual-regexp-3.0-pattern-load-fix.patch
===================================================================
diff -ur a/visual_regexp.tcl b/visual_regexp.tcl
--- a/visual_regexp.tcl	2013-11-12 23:23:59.730171882 +0100
+++ b/visual_regexp.tcl	2013-11-12 23:24:42.134085257 +0100
@@ -380,19 +380,17 @@
 	}
 	# do it
 	set in [open $file "r"]
-	$data(w:menu) delete [expr 4+[llength $::regexp_db]/2] end
-	while {![eof $in]} {
-		set name [gets $in]
-		while {$name == ""} {
-			set name [gets $in]
-		}
-		set pattern [gets $in]
-		while {$pattern == ""} {
-			set pattern [gets $in]
+	set contents {}
+	foreach line [split [read $in] \n] {
+		if {$line != ""} {
+			lappend contents $line
 		}
-		$data(w:menu) add command -label $name -command "regexp::regexp:insert [list $pattern]"
 	}
 	close $in
+	$data(w:menu) delete [expr 4+[llength $::regexp_db]/2] end
+	foreach {name pattern} $contents {
+		$data(w:menu) add command -label $name -command "regexp::regexp:insert [list $pattern]"
+	}
 }
 
 





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

only message in thread, other threads:[~2013-12-15 18:56 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-15 18:56 [gentoo-commits] gentoo-x86 commit in dev-util/visual-regexp/files: visual-regexp-3.0-help-font-fix.patch visual-regexp-3.0-home-conf-fix.patch visual-regexp-3.0-wish-fix.patch visual-regexp-3.0-pattern-load-fix.patch Tom Wijsman (tomwij)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox