Re: [code] [textadept] Textadept used as a "simple advanced viewer"

From: Mitchell <m.att.foicica.com>
Date: Tue, 27 Aug 2013 11:04:23 -0400 (Eastern Daylight Time)

Hi,

On Tue, 27 Aug 2013, Pascal wrote:

> Note that I use TA 6.6 and that this (old) version does'nt have the "
> properties.lua" facility.
>
> My idea is to create a "viewer" profile in which TA would start without menu
> (--M.menu = require('textadept.menu'))
> and open all documents (args or ctrl-o) in read-only mode.
>
> TaV (for textadeptviewer) will be a wrapper to TA called with the "viewer"
> profile (--serhome)...

In your ~/.textadept/init.lua you could put something like this:

   args.register('-vm', '--view-mode', 0, function()
     -- Make all opened buffers read-only.
     events.connect(events.FILE_OPENED, function()
       buffer.read_only = true
     end)
     -- Hide the menubar.
     gui.menubar = {}
   end, 'View-only mode')

Then call ta like this:

   textadept --view-mode foo.lua bar.lua -e [lua_code]

No need to have a "profile" :)

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Tue 27 Aug 2013 - 11:04:23 EDT

This archive was generated by hypermail 2.2.0 : Wed 28 Aug 2013 - 06:25:34 EDT