ed.ex :: simple mods for online context sensitive help

new topic     » topic index » view thread      » older message » newer message

If your platform is Linux, you may want to add a constant defining your browser of choice. I inserted the following lines immediately following the code for CUSTOM_KEYSTROKES_F11:

-- change to the browser of your choice:                                                                       
constant BROWSER = "google-chrome "   
boolean online = TRUE  -- if you have constant internet access 
 
 
-- insert/substitute the following if then clause after the line in ed.ex's help routine  
-- search for 'h', then after 
if answer[1] = 'y' then  -- this line insert the following if then clause 
 
   -- insert code    
   if online then 
	search_word = lower(search_word) -- search_word will be defined in syncolor.e 
	system(BROWSER & "openeuphoria.org/search/results.wc?manual=1\\&s="&search_word,0) 
   else 
        -- use the local files installed on your computer: 
        system(BROWSER & self_command & SLASH & "html" & SLASH & "index.html") -- Linux 
        -- system(self_command & SLASH & "html" & SLASH & "index.html") -- Windows 
   end if 
   -- end code insertion 
	 
   -- this is the original ed.ex help command: 
   -- system(self_command & SLASH & "html" & SLASH & "index.html") 
else 
     normal_video() 
end if 
 
-- you can toggle the online status by inserting the following escape command clause:  
elsif command[1] = 'i' then                                                                                
        -- toggles "online": when "FALSE", local help files will be used,                                      
        -- instead of internet resources.                                                                      
        if online then                                                                                         
            online = FALSE                                                                                     
            set_top_line("online = FALSE")                                                                     
        else                                                                                                   
            online = TRUE                                                                                      
            set_top_line("online = TRUE")                                                                      
        end if                              
 
-- 
-- now in syncolor.e  
 
-- insert the following line after the last include statement: 
export sequence search_word = " " 
 
-- finally insert the following line immediately before the line "seg_end = last" 
search_word = word --<---------- insert  
seg_end = last 

Now, if you are online, you can search any current "word" in euphoria.orgs online manual, with ESCAPE + 'h'. If you are not online, or if your online status has been toggled to FALSE, then the local html help files will be loaded into your browser and you will have to type the word into the search box.

new topic     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu