There is more than one way to skin a cat
- Posted by K_D_R
Nov 22, 2012
--note that this prefix macro code:
elsif equal(macro, "il") then
shell("eushroud " & file_name)
normal_video()
goto_line(0, b_col) -- refresh screen
-- does the same thing as this code:
elsif equal(macrol, "il") then
add_queue(ESCAPE & "d" & " eushroud " & file_name & CR)
-- and this code:
elsif equal(macro,"il") then -- shroud the current file
shell("eushroud " & file_name)
add_queue(CONTROL_B & CONTROL_T)
-------------------------------------------------------------
-- if you choose to add a hot-key shell command
-- to the get-escape elsif clauses, to execute a shell command
-- you can avoid adding the calling command letter to the list
-- of hot-keys by choosing the second method above:
elsif command[1] = 'S' then
add_queue(ESCAPE & "d" & " eushroud " & file_name & CR) -- note the final CR
-- one advantage of using a prefix-macro instead of ESCAPE + hotkey
-- is that the prefix macro calling command or label can be multiple letters
-- allowing for a more "readable" or easy to remember mnemonic code:
-- ;il may be easier to associate with shroud than the "S".
-- perhaps a better example - in my original post for multi-line quotes
-- I chose the prefix macro latel "bt" for back- tick, but "mlq" might be easier to remember:
elsif equal(macro, "mlq") then -- called by entering ";mlq ", 5 keystrokes
add_queue("` `" & repeat(ARROW_LEFT,2))
-- on the other hand, you can assign a symbol as an ESCAPE hot-key
-- such as:
elsif command [1] = '^' then -- '^' will not have to be added to the list of hot-keys
add_queue(ESCAPE & "d" & " eushroud " & file_name & CR) -- because of the final CR.
------------------------------------------------
-- Prefix macro's allow you to use multiple mnemoinic calling characters.
-- ESCAPE hot-keys are limited to one character or symbol.
-- In addition to being easier to remember, prefix macros
-- allow you to keep your fingers closer to the home-keys.
-- ESCAPE hot-keys are somewhat constrained to a fix number of single letters or symbols.
-- However, you can add additional menu's which would allow you to re-use letter or symbols,
-- but that would involve more key-strokes.
-- Prefix macros are very good to use to save key strokes
-- when entering longer commands which are used frequently:
elsif equal(macro,"ri") then
add_queue("routine_id(\"\")" & repeat(ARROW_LEFT,2))
elsif equal(macro,"pf") then
add_queue("printf(STDOUT,\"\", )" & repeat(ARROW_LEFT,4))
----------------------------------------------------------------
-- this little prefix macro might be useful if you have a
-- long string of code which extends beyond the width of your screen.
-- It basically executes a CR at the beginning of the last word within
-- the width of the screen:
elsif equal(macro,"rm") then
-- cuts right margin to format long lines
add_queue(HOME & repeat(ARROW_RIGHT, screen_width) & CONTROL_L & CR)
Not Categorized, Please Help
|
|