[Sciviews-commits] r276 - in komodo: . SciViews-K SciViews-K/content/js

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri May 14 17:07:05 CEST 2010


Author: phgrosjean
Date: 2010-05-14 17:07:05 +0200 (Fri, 14 May 2010)
New Revision: 276

Modified:
   komodo/SciViews-K/content/js/commands.js
   komodo/SciViews-K/content/js/pref-R.js
   komodo/SciViews-K/install.rdf
   komodo/TODO
Log:
SciViews-K 0.9.17.
Code to temporary reenable possibility to start R.
R code submission from any document, not only .R ones. 

Modified: komodo/SciViews-K/content/js/commands.js
===================================================================
--- komodo/SciViews-K/content/js/commands.js	2010-05-11 19:53:26 UTC (rev 275)
+++ komodo/SciViews-K/content/js/commands.js	2010-05-14 15:07:05 UTC (rev 276)
@@ -145,7 +145,6 @@
 	// be more flexible, because it should allow much more than just --quiet???
 	// KB: work in progress...
 
-
 	var Quiet = sv.prefs.getString("svRQuiet")? "--quiet " : " ";
 	cmd = cmd.replace("%Path%", path).replace("%cwd%", cwd)
 		.replace("%title%", "SciViews-R").replace("%quiet%", Quiet);
@@ -167,9 +166,9 @@
 	var isWin = navigator.platform.indexOf("Win") === 0;
 	// Default preferredRApp on Windows is r-gui
 	var preferredRApp = sv.prefs.getString("svRApplicationId", isWin?
-	"r-gui" : "r-terminal");
+		"r-gui" : "r-terminal");
 	var env = ["koId=" + sv.prefs.getString("sciviews.client.id",
-	"SciViewsK"),
+		"SciViewsK"),
 		"koHost=localhost",
 		"koActivate=FALSE",
 		"Rinitdir=" + sv.prefs.getString("sciviews.session.dir", "~"),
@@ -398,7 +397,10 @@
                 'cmd_svRSourceBlock': [ 'sv.r.source("block");',XisRDoc | XRRunning ],
                 'cmd_svRSourceFunction': [ 'sv.r.source("function");',XisRDoc | XRRunning ],
                 'cmd_svRSourcePara': [ 'sv.r.source("para");',XisRDoc | XRRunning ],
-                'cmd_svRRunLineOrSelection': [ 'sv.r.send("line/sel");',XisRDoc | XRRunning ],
+                // PhG: this should really be sv.r.run(), which is supposed to be "more
+				// intelligent" and can be used to run code step by step because it
+				// moves the cursor to the next line each time...
+				'cmd_svRRunLineOrSelection': [ 'sv.r.run();',XisRDoc | XRRunning ],
                 'cmd_svRSourceLineOrSelection': [ 'sv.r.source("line/sel");',XisRDoc | XRRunning ],
                 'cmd_svRRunSelection': [ 'sv.r.send("sel");',XisRDoc | XRRunning | XHasSelection ],
                 'cmd_svRSourceSelection': [ 'sv.r.source("sel");', XisRDoc | XRRunning | XHasSelection ]
@@ -430,9 +432,18 @@
             if(!command in handlers) return false;
 
             var test = handlers[command][1];
-            return (((test & XRRunning) != XRRunning) || _isRRunning())
-            && (((test & XRStopped) != XRStopped) || !_isRRunning())
-            && (((test & XisRDoc) != XisRDoc) || _isRCurLanguage())
+            // PhG: since _isRRunning() returns always true, we are currently
+			// NOT able to start R!
+			return (((test & XRRunning) != XRRunning) || true) //_isRRunning())
+            && (((test & XRStopped) != XRStopped) || true) //!_isRRunning())
+            // PhG: it is NOT the program, but the user who decides when it possible
+			// to send a command to R... There are possibles situations where
+			// executable R code live somewhere else than in a .R document
+			// Let's think at examples in .Rd files, <code R> sections in a
+			// wiki page, etc.
+			// Thus, for the nth time, I don't want this restriction on commands
+			// running code to R: I want them available EVERYWHERE!
+			&& (((test & XisRDoc) != XisRDoc) || true) //_isRCurLanguage())
             && (((test & XHasSelection) != XHasSelection) || _hasSelection());
         }
 

Modified: komodo/SciViews-K/content/js/pref-R.js
===================================================================
--- komodo/SciViews-K/content/js/pref-R.js	2010-05-11 19:53:26 UTC (rev 275)
+++ komodo/SciViews-K/content/js/pref-R.js	2010-05-14 15:07:05 UTC (rev 276)
@@ -162,8 +162,16 @@
 }
 
 function PrefR_svRApplicationOnSelect(event) {
+	var el = document.getElementById("svRApplication");
+	var sel = el.selectedItem;
+	var app = sel.hasAttribute("app")? sel.getAttribute("app") : "R";
+	// PhG: always get a good starting value - DO NOT ELIMINATE THIS!
+	var svRDefaultInterpreter = PrefR_locateApp(app);
+	document.getElementById("svRDefaultInterpreter").value
+		= svRDefaultInterpreter;
+	
 	// Delegate to PrefR_svRApplicationUpdate()
-	return PrefR_svRApplicationUpdate(event);
+ 	return PrefR_svRApplicationUpdate(event);
 }
 
 function PrefR_svRApplicationUpdate(event) {

Modified: komodo/SciViews-K/install.rdf
===================================================================
--- komodo/SciViews-K/install.rdf	2010-05-11 19:53:26 UTC (rev 275)
+++ komodo/SciViews-K/install.rdf	2010-05-14 15:07:05 UTC (rev 276)
@@ -4,7 +4,7 @@
     <Description about="urn:mozilla:install-manifest">
         <em:id>sciviewsk at sciviews.org</em:id>
         <em:name>SciViews-K</em:name>
-        <em:version>0.9.16</em:version>
+        <em:version>0.9.17</em:version>
         <em:description>Edit R (http://www.r-project.org) code with Komodo</em:description>
         <em:creator>Philippe Grosjean</em:creator>
         <em:contributor>Romain Francois</em:contributor>

Modified: komodo/TODO
===================================================================
--- komodo/TODO	2010-05-11 19:53:26 UTC (rev 275)
+++ komodo/TODO	2010-05-14 15:07:05 UTC (rev 276)
@@ -1,5 +1,5 @@
 = SciViews-K To Do
-
+ 
 * In version 0.9.16, there is still a problem with the selection of the
 R interpreter: in Windows, switching from RGui to console do not switch
 from Rgui.exe and Rterm.exe and vice-versa.



More information about the Sciviews-commits mailing list