home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
epmsmp.zip
/
MARKQUOT.E
< prev
next >
Wrap
Text File
|
1996-01-18
|
1KB
|
41 lines
; Here's a command to mark a quoted string. I've defined the Ctrl+quote key
; to execute the command, so you can simply place the cursor anywhere inside
; the quotes and press Ctrl+' to have the contents of the string (without the
; surrounding quotes) marked. by Larry Margolis
;
; Best way to install is to add to your MYSTUFF.E:
; include 'markquot.e'
; (without the ';' in col. 1) and then recompile the macros (ETPM EPM).
compile if not defined(AF_CHAR)
include 'stdconst.e'
compile endif
definit
universal activeaccel
buildacceltable activeaccel, 'markquote', AF_CHAR+AF_CONTROL, 39, 61000 -- c+'
activateacceltable activeaccel
defc markquote =
getline line
q1 = lastpos("'", line, .col)
q2 = lastpos('"', line, .col)
if not (q1 + q2) then
sayerror 'No quotes!'
return
endif
if not q1 then
q1 = q2
elseif q2 then
q1 = min(q1, q2)
endif
q = substr(line, q1, 1)
q2 = pos(q, line, q1+1)
if not q2 then
sayerror 'Unmatched quotes!'
return
endif
getfileid fid
call pset_mark(.line, .line, q1+1, q2-1, 'BLOCK', fid)