vile
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vile] (no subject)


From: Wayne Cuddy
Subject: Re: [vile] (no subject)
Date: Wed, 2 Sep 2015 14:52:39 -0400
User-agent: Mutt/1.4.2.3i

On Mon, Aug 31, 2015 at 05:48:34PM -0400, Thomas Dickey wrote:
> On Mon, Aug 31, 2015 at 04:58:25PM -0400, Thomas Dickey wrote:
> > > ~~~~~~~~~~~~~~~~~~~~
> > > store-procedure show-register string="reg" "show the contents of a single 
> > > register"
> > >     ~local %bn
> > >     setv %bn &cat "register-" $1
> > >     find-file %bn
> > >     1 goto-line
> > >     delete-lines-til end-of-file
> > >     put $1
> > > ~endm
> > > ~~~~~~~~~~~~~~~~~~~~
> > > 
> > > I've tried:
> > > 
> > > put "$1"
> > > $1 put
> > > "$1" put
> 
> You should be able to do
> 
>       use-register $1 put
> 
> -- 
> Thomas E. Dickey <address@hidden>
> http://invisible-island.net
> ftp://invisible-island.net

Thanks, worked like a charm. Here is the complete version of
show-register in case anyone else finds it useful.

Wayne



store-procedure show-register string="register" "show the contents of a single 
register in it's own buffer"

    ~if &cmatch '^\s*$' $1
        ~return
    ~endif

    ~local %bn
    setv %bn &cat "[register-" &cat $1 "]"

    ~force select-buffer %bn
    ~if $status
        setl noreadonly noview
        ~if &greater $bchars 0
            goto-beginning-of-file
            delete-lines-til end-of-file
        ~endif
    ~else
        edit-buffer %bn
        setl noreadonly noview
    ~endif
 
    ~force use-register $1 put
    unmark-buffer
    setl readonly view
    goto-beginning-of-file

~endm



reply via email to

[Prev in Thread] Current Thread [Next in Thread]