1. Context Sensitive Help for Shian Lee's Unicode/Utf8 editor, "edu.ex"

Download Juergen Leuthje's "EuHTHelp.ex" from the RDS Archives: EuHTHelp.ex

-- add this function just before the procedure get_escape(boolean help) 
-- this code is taken from the "try_auto_complete" routine: 
function context_help(char key = 'h') 
 
    sequence this_line, white_space, current_word 
		natural first_non_blank 
		 
    this_line = buffer[b_line] 
    white_space = this_line = ' ' or this_line = '\t' 
    first_non_blank = find(0, white_space) -- there's always '\n' at end                   
    current_word = this_line[first_non_blank..b_col -1 - (key= ' ')] 
     
return current_word 
end function 
 
procedure get_escape(boolean help) 
 
-- comment out all the existing code  
-- of the elsif command[1] = 'h' clause: 
elsif command[1] = 'h' then 
 
        -- insert the following line:     
	shell("exu EuHTHelp.ex " & context_help()) 
         

Now, immediately upon completing the entry of a command press ESCAPE + 'h' and a context specific article or the reference manual will be opened in a browser window or tab.

Works like a charm.

Regards, Ken Rhodes

new topic     » topic index » view message » categorize

2. Re: Context Sensitive Help for Shian Lee's Unicode/Utf8 editor, "edu.ex"

The following modification to Shian Lee's Unicode/Utf8 editor, "edu.ex" will provide context sensitive help via help from the RDS text documentation if the library.doc option is selected from the top line help menu in Euphoria 3.1 or earlier. Also works in "ed.ex".

I thought this might be useful for minimalistic installations.

 
-- Searches text documentation in early versions of euphoria 
-- prior to 3.1 or earlier for word specific article 
-- Insert the following procedure before the routine  
-- "get_escape(boolean help): 
procedure text_context_help(char key, object self_command) 
sequence this_line, white_space, search_path, search_word 
		natural first_non_blank 
this_line = buffer[b_line] 
white_space = this_line = ' ' or this_line = '\t' 
first_non_blank = find(0, white_space) -- there's always '\n' at end                   
search_word = this_line[first_non_blank..b_col -1 - (key= ' ')] 
search_word = "<" & search_word & ">" 
add_queue(self_command & SLASH & "library.doc" & CR &  
          ESCAPE & "f" & search_word & CR & ESCAPE & "y" & CR) 
end procedure 
 
-- Within the routine get_escape(boolean help) 
-- context sensitive text help -- Euphoria 3.1 or earlier 
-- if library.doc is selected, the specific article for the current 
-- word will be displayed. 
  elsif answer[1] = 'l' then 
--add_queue(self_command & SLASH & "ed.doc" & CR) 
  text_context_help('l', self_command) 
 
new topic     » goto parent     » topic index » view message » categorize

3. Re: Context Sensitive Help for Shian Lee's Unicode/Utf8 editor, "edu.ex"

Since my previous post Shian Lee has upgraded "edu.ex" several times and included several help menus for the various lib2 libraries which allow a user to select a library.doc to browse. There is no word/command specific context sensitive help. This is my latest suggestion:

The help routine can be streamlined and made very efficient by cycling through all the text libraries in the documentation directory searching for the "<current_word>" if a match for the current word search string is found then editor can load that document and place the cursor on the context specific article. If there is no current word, or if a context specific article is not found then then the user can be given the option of selecting one of the available help document to browse using the new_file_from_list() routine.

-- a routine like this might be helpful 
function get_current_word(char key) 
    sequence this_line, white_space, word  
    natural first_non_blank  
     
    this_line = buffer[b_line]  
    white_space = this_line = ' ' or this_line = '\t'  
    first_non_blank = find(0, white_space) -- there's always '\n' at end                    
    word = this_line[first_non_blank..b_col -1 - (key= ' ')]  
    word = "<" & word & ">"  
    return word 
end function 
new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu