successfully edit a description

FossilOrigin-Name: 366a427e0123cc5fbc9a5b4cce368c0f985b3e657e6f082c1733527db0a9cd8a
This commit is contained in:
crc 2017-11-10 20:54:46 +00:00
parent 1c6194442f
commit ffc4c077ee

View file

@ -142,12 +142,37 @@ QUERY 'export s:eq? 'tsv TARGET s:eq? and
'EDITOR here [ unix:getenv ] sip s:temp 'EDITOR s:const 'EDITOR here [ unix:getenv ] sip s:temp 'EDITOR s:const
'FID var 'FID var
:edit:description
'/tmp/glossary.descr file:W file:open !FID
field:descr [ @FID file:write ] s:for-each @FID file:close
'/tmp/glossary.descr EDITOR '%s_%s s:with-format unix:system ;
'FOUT var
:fputs (s-) [ dup ASCII:CR eq? over ASCII:LF eq? or [ drop ] [ @FOUT file:write ] choose ] s:for-each ASCII:HT @FOUT file:write ;
:display-fields
field:name fputs
field:dstack fputs
field:astack fputs
field:fstack fputs
here '/tmp/glossary.descr file:slurp here fputs
field:itime fputs
field:ctime fputs
field:class fputs
field:ex1 fputs
field:ex2 fputs
field:namespace fputs
field:interface fputs
;
QUERY 'edit:descr s:eq? QUERY 'edit:descr s:eq?
[ 'words.tsv [ 'words.tsv
[ s:keep !SourceLine field:name TARGET s:eq? [ s:keep !SourceLine field:name TARGET s:eq? [ edit:description ] if ] file:for-each-line
[ '/tmp/glossary.descr file:W file:open !FID 'words.new file:W file:open !FOUT
field:descr [ @FID file:write ] s:for-each @FID file:close 'words.tsv
'/tmp/glossary.descr EDITOR '%s_%s s:with-format unix:system ] if ] file:for-each-line [ s:keep !SourceLine field:name TARGET s:eq? [ display-fields ] [ @SourceLine [ @FOUT file:write ] s:for-each ASCII:LF @FOUT file:write ] choose ] file:for-each-line
@FOUT file:close
] if ] if
~~~ ~~~