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

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


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
> ( = require(''))
> 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
     -- 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" :)


You are subscribed to
To change subscription settings, send an e-mail to
To unsubscribe, send an e-mail to
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