Re: listings improvement

2007-07-12 Thread Neal Becker
Bo Peng wrote:

 Make external file an option under listings insert would be more
 intuitive.
 
 Do you mean menu items
 
 insert -
program listing
program file listing
 
 or something in the listings - right click dialog? The latter is
 difficult because file listings is not an option of a normal listing
 (which contains code, caption etc) and you can not somehow convert a
 listings inset to file listing.
 
 Bo

Yes, I do mean the latter.  It's just like a printer dialog: choose print to
device or print to file.  If this is hard to implement, then in the interim
can we just put some text on this dialog that points the user to the insert
child doc?



Re: listings improvement

2007-07-12 Thread Bo Peng

Yes, I do mean the latter.  It's just like a printer dialog: choose print to
device or print to file.  If this is hard to implement, then in the interim
can we just put some text on this dialog that points the user to the insert
child doc?


File listings needs a filename + all the options
Normal listings needs code + all the options

Currently, file listings is treated like other file inclusions, and
normal listings is treated like an ERT inset. It would be difficult to
merge those two things. For example, it is unnatural to have a file
browser in the listings dialogs that if a file is given, the manually
inputted text would be ignored... If possible, I would rather have a
menu item that opens the Child Document dialog in listings mode.

Bo


Re: listings improvement

2007-07-12 Thread Neal Becker
Bo Peng wrote:

>> Make external file an option under listings insert would be more
>> intuitive.
> 
> Do you mean menu items
> 
> insert ->
>program listing
>program file listing
> 
> or something in the listings -> right click dialog? The latter is
> difficult because file listings is not an option of a normal listing
> (which contains code, caption etc) and you can not somehow convert a
> listings inset to file listing.
> 
> Bo

Yes, I do mean the latter.  It's just like a printer dialog: choose print to
device or print to file.  If this is hard to implement, then in the interim
can we just put some text on this dialog that points the user to the insert
child doc?



Re: listings improvement

2007-07-12 Thread Bo Peng

Yes, I do mean the latter.  It's just like a printer dialog: choose print to
device or print to file.  If this is hard to implement, then in the interim
can we just put some text on this dialog that points the user to the insert
child doc?


File listings needs a filename + all the options
Normal listings needs code + all the options

Currently, file listings is treated like other file inclusions, and
normal listings is treated like an ERT inset. It would be difficult to
merge those two things. For example, it is unnatural to have a file
browser in the listings dialogs that if a file is given, the manually
inputted text would be ignored... If possible, I would rather have a
menu item that opens the Child Document dialog in listings mode.

Bo


listings improvement

2007-07-11 Thread Neal Becker

I am just trying out listings and it seems pretty good.  One problem I see
is I just needed to re-indent a bunch of code (happens to be python, so
indent matters).  I thought maybe I'd just edit the lyx file in emacs, but
found out that the form of the listing in the lyx file was not very
friendly to this.

Since I doubt lyx will implement auto-indent or other emacs abilities (like
re-indent region), it would be nice if there was a more convenient way to
move back and forth between the lyx listing and an external tool.




Re: listings improvement

2007-07-11 Thread Bo Peng

I am just trying out listings and it seems pretty good.  One problem I see
is I just needed to re-indent a bunch of code (happens to be python, so
indent matters).  I thought maybe I'd just edit the lyx file in emacs, but
found out that the form of the listing in the lyx file was not very
friendly to this.


This is why I tend to use external files as listings child documents.
It is easier to modify an external file than doing so within lyx. An
advantage of this approach is that  you can use 'firstline',
'lastline' options to include part of the file. There is also a more
flexible linerange option in the latest listings package.

Another advantage is that you can easily run your external script to
test for errors, something you can not  do to included listings
source.

Bo


Re: listings improvement

2007-07-11 Thread Neal Becker
On Wednesday 11 July 2007, you wrote:
  I am just trying out listings and it seems pretty good.  One problem I
  see is I just needed to re-indent a bunch of code (happens to be python,
  so indent matters).  I thought maybe I'd just edit the lyx file in emacs,
  but found out that the form of the listing in the lyx file was not very
  friendly to this.

 This is why I tend to use external files as listings child documents.
 It is easier to modify an external file than doing so within lyx. An
 advantage of this approach is that  you can use 'firstline',
 'lastline' options to include part of the file. There is also a more
 flexible linerange option in the latest listings package.


I can't figure out how to use external file with lyx.  I only see 1 kind of 
insert for 'program listing', and nothing in the listing options that looks 
like a file name.




Re: listings improvement

2007-07-11 Thread Bo Peng

I can't figure out how to use external file with lyx.  I only see 1 kind of
insert for 'program listing', and nothing in the listing options that looks
like a file name.


Insert - File - Child Document - Include Type - Listing. You will
have to manually enter options like firstline in the option box.

I am not sure what we can do to make this easier to access... any idea?

Bo


Re: listings improvement

2007-07-11 Thread José Matos
On Wednesday 11 July 2007 17:03:50 Bo Peng wrote:

 Insert - File - Child Document - Include Type - Listing. You will
 have to manually enter options like firstline in the option box.

 I am not sure what we can do to make this easier to access... any idea?

  Merge graphics, external, include and listings insets into a single 
interface. Not for 1.5.0 though. ;-)

 Bo



-- 
José Abílio


Re: listings improvement

2007-07-11 Thread Neal Becker
On Wednesday 11 July 2007, Bo Peng wrote:
  I can't figure out how to use external file with lyx.  I only see 1 kind
  of insert for 'program listing', and nothing in the listing options that
  looks like a file name.

 Insert - File - Child Document - Include Type - Listing. You will
 have to manually enter options like firstline in the option box.

 I am not sure what we can do to make this easier to access... any idea?

 Bo

Make external file an option under listings insert would be more intuitive.


Re: listings improvement

2007-07-11 Thread Bo Peng

Make external file an option under listings insert would be more intuitive.


Do you mean menu items

insert -
  program listing
  program file listing

or something in the listings - right click dialog? The latter is
difficult because file listings is not an option of a normal listing
(which contains code, caption etc) and you can not somehow convert a
listings inset to file listing.

Bo


listings improvement

2007-07-11 Thread Neal Becker

I am just trying out listings and it seems pretty good.  One problem I see
is I just needed to re-indent a bunch of code (happens to be python, so
indent matters).  I thought maybe I'd just edit the lyx file in emacs, but
found out that the form of the listing in the lyx file was not very
friendly to this.

Since I doubt lyx will implement auto-indent or other emacs abilities (like
re-indent region), it would be nice if there was a more convenient way to
move back and forth between the lyx listing and an external tool.




Re: listings improvement

2007-07-11 Thread Bo Peng

I am just trying out listings and it seems pretty good.  One problem I see
is I just needed to re-indent a bunch of code (happens to be python, so
indent matters).  I thought maybe I'd just edit the lyx file in emacs, but
found out that the form of the listing in the lyx file was not very
friendly to this.


This is why I tend to use external files as listings child documents.
It is easier to modify an external file than doing so within lyx. An
advantage of this approach is that  you can use 'firstline',
'lastline' options to include part of the file. There is also a more
flexible linerange option in the latest listings package.

Another advantage is that you can easily run your external script to
test for errors, something you can not  do to included listings
source.

Bo


Re: listings improvement

2007-07-11 Thread Neal Becker
On Wednesday 11 July 2007, you wrote:
> > I am just trying out listings and it seems pretty good.  One problem I
> > see is I just needed to re-indent a bunch of code (happens to be python,
> > so indent matters).  I thought maybe I'd just edit the lyx file in emacs,
> > but found out that the form of the listing in the lyx file was not very
> > friendly to this.
>
> This is why I tend to use external files as listings child documents.
> It is easier to modify an external file than doing so within lyx. An
> advantage of this approach is that  you can use 'firstline',
> 'lastline' options to include part of the file. There is also a more
> flexible linerange option in the latest listings package.
>

I can't figure out how to use external file with lyx.  I only see 1 kind of 
insert for 'program listing', and nothing in the listing options that looks 
like a file name.




Re: listings improvement

2007-07-11 Thread Bo Peng

I can't figure out how to use external file with lyx.  I only see 1 kind of
insert for 'program listing', and nothing in the listing options that looks
like a file name.


Insert -> File -> Child Document -> Include Type -> Listing. You will
have to manually enter options like firstline in the option box.

I am not sure what we can do to make this easier to access... any idea?

Bo


Re: listings improvement

2007-07-11 Thread José Matos
On Wednesday 11 July 2007 17:03:50 Bo Peng wrote:
>
> Insert -> File -> Child Document -> Include Type -> Listing. You will
> have to manually enter options like firstline in the option box.
>
> I am not sure what we can do to make this easier to access... any idea?

  Merge graphics, external, include and listings insets into a single 
interface. Not for 1.5.0 though. ;-)

> Bo



-- 
José Abílio


Re: listings improvement

2007-07-11 Thread Neal Becker
On Wednesday 11 July 2007, Bo Peng wrote:
> > I can't figure out how to use external file with lyx.  I only see 1 kind
> > of insert for 'program listing', and nothing in the listing options that
> > looks like a file name.
>
> Insert -> File -> Child Document -> Include Type -> Listing. You will
> have to manually enter options like firstline in the option box.
>
> I am not sure what we can do to make this easier to access... any idea?
>
> Bo

Make external file an option under listings insert would be more intuitive.


Re: listings improvement

2007-07-11 Thread Bo Peng

Make external file an option under listings insert would be more intuitive.


Do you mean menu items

insert ->
  program listing
  program file listing

or something in the listings -> right click dialog? The latter is
difficult because file listings is not an option of a normal listing
(which contains code, caption etc) and you can not somehow convert a
listings inset to file listing.

Bo