Re: .lyx/preferences needs a warning

2004-01-16 Thread Christian Ridderström
On Mon, 12 Jan 2004, Andre Poenitz wrote:

 On Fri, Jan 09, 2004 at 04:56:29PM +0100, Lars Gullik Bjønnes wrote:
  Christian Ridderström [EMAIL PROTECTED] writes:
  
  | I think it'll be a bit too omständigt to define command-sequences
  | in 
  
  omstendig - circumstantial, detailed  (long-winded)
 
 umständlich
 
 I found it quite readable, but now I see why people insist on getting
 that spellcheck-on-the-fly thingy...

Actually, I couldn't think of a good word in English so I just used the 
Swedish word ...  (I knew Lars would understand at least :-)

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-16 Thread Christian Ridderström
On Mon, 12 Jan 2004, Andre Poenitz wrote:

> On Fri, Jan 09, 2004 at 04:56:29PM +0100, Lars Gullik Bjønnes wrote:
> > Christian Ridderström <[EMAIL PROTECTED]> writes:
> > 
> > | I think it'll be a bit too "omständigt" to define command-sequences
> > | in 
> > 
> > "omstendig" -> circumstantial, detailed  (long-winded)
> 
> "umständlich"
> 
> I found it quite readable, but now I see why people insist on getting
> that spellcheck-on-the-fly thingy...

Actually, I couldn't think of a good word in English so I just used the 
Swedish word ...  (I knew Lars would understand at least :-)

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Fri, Jan 09, 2004 at 03:22:28PM +0100, Lars Gullik Bjønnes wrote:
 Who told you that you should be able to edit preferences manually at
 all?

It used to work that way for eight years or so and I still use it this
way.

 | Simple solution: Add a message to the beginning of .lyx/preferences 
 | saying something like edit at your own risk.
 
 No. DO NOT EDIT THIS FILE
 
 would be better.

Maybe.

 
 | Intermediate solution: Add a bind-section to preferences?
 
 yes. with gui.

Optionally, yes.

However, a only solution this would be a regression. Editing the
preference files manually is much faster than clicking around in some
Gui.

[...]

Other proposal: Have some .lyx/preferences.user (or similar) that's read
after .lyx/preferences and never touched by LyX itself (pretty much the
same mechanism as most shell setups)

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Fri, Jan 09, 2004 at 04:56:29PM +0100, Lars Gullik Bjønnes wrote:
 Christian Ridderström [EMAIL PROTECTED] writes:
 
 | I think it'll be a bit too omständigt to define command-sequences
 | in 
 
 omstendig - circumstantial, detailed  (long-winded)

umständlich

I found it quite readable, but now I see why people insist on getting
that spellcheck-on-the-fly thingy...

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Sat, Jan 10, 2004 at 12:26:44PM +0100, Jean-Marc Lasgouttes wrote:
 Moreover, if you bind them to some key, then you can have something
 like different editing modes (vi?).

Vi mode is difficult as we'd need that command/insert mode distinction,
i.e. two completely different bindings for all keys.
 
 It seems better than editing text files through a clunky interface.

Indeed.

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Lars Gullik Bjønnes
Andre Poenitz [EMAIL PROTECTED] writes:

| On Fri, Jan 09, 2004 at 03:22:28PM +0100, Lars Gullik Bjønnes wrote:
 Who told you that you should be able to edit preferences manually at
 all?

| It used to work that way for eight years or so and I still use it this
| way.

 | Simple solution: Add a message to the beginning of .lyx/preferences 
 | saying something like edit at your own risk.
 
 No. DO NOT EDIT THIS FILE
 
 would be better.

| Maybe.

 
 | Intermediate solution: Add a bind-section to preferences?
 
 yes. with gui.

| Optionally, yes.

| However, a only solution this would be a regression. Editing the
| preference files manually is much faster than clicking around in some
| Gui.

No. Not allowing arbitrary editiong of preferences is not a
regression. It has never been supported.
And you can always create your own bind file.

-- 
Lgb



Re: .lyx/preferences needs a warning

2004-01-12 Thread Jean-Marc Lasgouttes
 Andre == Andre Poenitz [EMAIL PROTECTED] writes:

Andre On Sat, Jan 10, 2004 at 12:26:44PM +0100, Jean-Marc Lasgouttes
Andre wrote:
 Moreover, if you bind them to some key, then you can have something
 like different editing modes (vi?).

Andre Vi mode is difficult as we'd need that command/insert mode
Andre distinction, i.e. two completely different bindings for all
Andre keys.

Yes, what I propose is to have also an lfun that loads a complete
binding file... 
 
JMarc


Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Fri, Jan 09, 2004 at 03:22:28PM +0100, Lars Gullik Bjønnes wrote:
> Who told you that you should be able to edit preferences manually at
> all?

It used to work that way for eight years or so and I still use it this
way.

> | Simple solution: Add a message to the beginning of .lyx/preferences 
> | saying something like "edit at your own risk".
> 
> No. "DO NOT EDIT THIS FILE"
> 
> would be better.

Maybe.

> >
> | Intermediate solution: Add a bind-section to preferences?
> 
> yes. with gui.

Optionally, yes.

However, a only "solution" this would be a regression. Editing the
preference files manually is much faster than clicking around in some
Gui.

[...]

Other proposal: Have some .lyx/preferences.user (or similar) that's read
after .lyx/preferences and never touched by LyX itself (pretty much the
same mechanism as most shell setups)

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Fri, Jan 09, 2004 at 04:56:29PM +0100, Lars Gullik Bjønnes wrote:
> Christian Ridderström <[EMAIL PROTECTED]> writes:
> 
> | I think it'll be a bit too "omständigt" to define command-sequences
> | in 
> 
> "omstendig" -> circumstantial, detailed  (long-winded)

"umständlich"

I found it quite readable, but now I see why people insist on getting
that spellcheck-on-the-fly thingy...

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Andre Poenitz
On Sat, Jan 10, 2004 at 12:26:44PM +0100, Jean-Marc Lasgouttes wrote:
> Moreover, if you bind them to some key, then you can have something
> like different editing modes (vi?).

Vi mode is difficult as we'd need that command/insert mode distinction,
i.e. two completely different bindings for all keys.
 
> It seems better than editing text files through a clunky interface.

Indeed.

Andre'


Re: .lyx/preferences needs a warning

2004-01-12 Thread Lars Gullik Bjønnes
Andre Poenitz <[EMAIL PROTECTED]> writes:

| On Fri, Jan 09, 2004 at 03:22:28PM +0100, Lars Gullik Bjønnes wrote:
>> Who told you that you should be able to edit preferences manually at
>> all?
>
| It used to work that way for eight years or so and I still use it this
| way.
>
>> | Simple solution: Add a message to the beginning of .lyx/preferences 
>> | saying something like "edit at your own risk".
>> 
>> No. "DO NOT EDIT THIS FILE"
>> 
>> would be better.
>
| Maybe.
>
>> >
>> | Intermediate solution: Add a bind-section to preferences?
>> 
>> yes. with gui.
>
| Optionally, yes.
>
| However, a only "solution" this would be a regression. Editing the
| preference files manually is much faster than clicking around in some
| Gui.

No. Not allowing arbitrary editiong of preferences is not a
regression. It has never been supported.
And you can always create your own bind file.

-- 
Lgb



Re: .lyx/preferences needs a warning

2004-01-12 Thread Jean-Marc Lasgouttes
> "Andre" == Andre Poenitz <[EMAIL PROTECTED]> writes:

Andre> On Sat, Jan 10, 2004 at 12:26:44PM +0100, Jean-Marc Lasgouttes
Andre> wrote:
>> Moreover, if you bind them to some key, then you can have something
>> like different editing modes (vi?).

Andre> Vi mode is difficult as we'd need that command/insert mode
Andre> distinction, i.e. two completely different bindings for all
Andre> keys.

Yes, what I propose is to have also an lfun that loads a complete
binding file... 
 
JMarc


Re: .lyx/preferences needs a warning

2004-01-10 Thread Jean-Marc Lasgouttes
 Christian == Christian Ridderström [EMAIL PROTECTED] writes:

Christian I think the ability to re-read the bind-files etc without
Christian start/stopping lyx is more import

A simple solution would be to add new lfuns key-bind and bindfile-read
(with better names...). This is trivial to do, and would allow you to
do redfinitions from the minibuffer. 

Moreover, if you bind them to some key, then you can have something
like different editing modes (vi?).

It seems better than editing text files through a clunky interface.

JMarc


Re: .lyx/preferences needs a warning

2004-01-10 Thread Jean-Marc Lasgouttes
> "Christian" == Christian Ridderström <[EMAIL PROTECTED]> writes:

Christian> I think the ability to re-read the bind-files etc without
Christian> start/stopping lyx is more import

A simple solution would be to add new lfuns key-bind and bindfile-read
(with better names...). This is trivial to do, and would allow you to
do redfinitions from the minibuffer. 

Moreover, if you bind them to some key, then you can have something
like different editing modes (vi?).

It seems better than editing text files through a clunky interface.

JMarc


Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström [EMAIL PROTECTED] writes:

| Hi

| While testing other stuff  I noticed a behaviour about 
| .lyx/preferences that means it (at least) should get a small warning 
| text in the beginning.

| Here's an example of the problem:

| 1. Add\bind C-o self-insert Oops to .lyx/preferences
| 2. Start lyx and verify that C-o inserts Oops;, so far so good...
| 3. Edit-Preferences and choose Save
|(you can toggle something twice to activate the Save-button)
| 4. Exit lyx
| 5. Start lyx and verify that C-o no longer works.

| Why? Well I guess lyx isn't expecting a \bind-statement in preferences 
| and has no code for handling unexpected statements. Then when the 
| preferences are saved, unexpected statements are simply ignored and 
| hence lost.

Who told you that you should be able to edit preferences manually at
all?

| Simple solution: Add a message to the beginning of .lyx/preferences 
| saying something like edit at your own risk.

No. DO NOT EDIT THIS FILE

would be better.


| Intermediate solution: Add a bind-section to preferences?

yes. with gui.


| Advanced solution: Change how lyx handles configuration statements that 
| don't belong to one of the categories in preferences, i.e. let them either 
| stay where they are, or move them to an 'unknown'-section.

no.

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Christian Ridderström wrote:

 Simple solution: Add a message to the beginning of .lyx/preferences 
 saying something like edit at your own risk.

Oh, I just noticed that it contains this text already:

# This file is written by LyX, if you want to make your own
# modifications you should do them from inside LyX and save

The text looks a bit 'cut off' though at the end... some snooping reveals 
it's because of formatting of the source code in src/lyxrc.C - silly...

Anyway, going with Lars' dictatorial DO NOT EDIT, how about the 
attached patch? (the message is slightly different, and I'm not 100% 
sure that putting a '\' at the end of a line is standard).

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr
Index: lyxrc.C
===
RCS file: /cvs/lyx/lyx-devel/src/lyxrc.C,v
retrieving revision 1.162
diff -u -r1.162 lyxrc.C
--- lyxrc.C 2003/12/14 16:33:53 1.162
+++ lyxrc.C 2004/01/09 15:26:44
@@ -1067,19 +1067,21 @@
 
 void LyXRC::output(ostream  os) const
 {
-   os  ### This file is part of\n
-   ### \n
-   ###  LyX, The Document Processor\n
-   ###\n
-   ###  Copyright 1995 Matthias Ettrich\n
-   ###  Copyright 1995-2001 The LyX Team.\n
-   ###\n
-   ### \n
-   \n
-   # This file is written by LyX, if you want to make your own\n
-   # modifications you should do them from inside LyX and save\n
-   \n;
-
+   os  \
+### This file is part of\n\
+### ==\n\
+###  LyX, The Document Processor\n\
+###\n\
+###  Copyright 1995 Matthias Ettrich\n\
+###  Copyright 1995-2001 The LyX Team.\n\
+###\n\
+### ==\n\
+\n\
+# This file contains user preferences. It is read during startup\n\
+# and overwritten when 'Save' is selected in the 'preferences dialog'.\n\
+# DO NOT EDIT THIS FILE - changes should me made from within Lyx.\n\
+\n;
+   
// Why the switch you might ask. It is a trick to ensure that all
// the elements in the LyXRCTags enum is handled. As you can see
// there are no breaks at all. So it is just a huge fall-through.


Re: .lyx/preferences needs a warning

2004-01-09 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
 | Intermediate solution: Add a bind-section to preferences?
 yes. with gui.

Agreed. All that's needed is a text view of the currently seleted 
bind or ui file together with a 'save as' option.

Feel free ;-)

-- 
Angus



Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Lars Gullik Bjønnes wrote:

 Christian Ridderström [EMAIL PROTECTED] writes:
 
 | Hi
 
 | While testing other stuff  I noticed a behaviour about 
 | .lyx/preferences that means it (at least) should get a small warning 
 | text in the beginning.
 
 | Here's an example of the problem:
 
 | 1. Add  \bind C-o self-insert Oops to .lyx/preferences
 | 2. Start lyx and verify that C-o inserts Oops;, so far so good...
 | 3. Edit-Preferences and choose Save
 |(you can toggle something twice to activate the Save-button)
 | 4. Exit lyx
 | 5. Start lyx and verify that C-o no longer works.
 
 | Why? Well I guess lyx isn't expecting a \bind-statement in preferences 
 | and has no code for handling unexpected statements. Then when the 
 | preferences are saved, unexpected statements are simply ignored and 
 | hence lost.
 
 Who told you that you should be able to edit preferences manually at
 all?
 

Who needs to be told.. I just do it ;-)  Seriosoly thoug, as I wrote:

I find it quite convenient to define temporary bindings 
/command-sequences in prefereces, since I'd otherwise have to 
modify one of the standard .bind-files.

This really is practical when you're testing a temporary thing, 
typically when playing with a command sequnce that you want to bind.

 | Simple solution: Add a message to the beginning of .lyx/preferences 
 | saying something like edit at your own risk.
 
 No. DO NOT EDIT THIS FILE
 
 would be better.
 
 
 | Intermediate solution: Add a bind-section to preferences?
 
 yes. with gui.
 
 
 | Advanced solution: Change how lyx handles configuration statements that 
 | don't belong to one of the categories in preferences, i.e. let them either 
 | stay where they are, or move them to an 'unknown'-section.
 
 no.
 

What about:
 Thoughts? 
 Should I bugzilla this?

Since I hadn't seen the message before, maybe it's moot? (See other mail).

Or should I bugzilla the idea of adding a bind-section?

An alternative suggestion is that a preference setting is added that  
makes LyX read a manually created preferences file (after LyX has read 
.lyx/preferences) ... then you could manually fiddle with this file when 
you want to play with keybindings etc.

I think it'll be a bit too omständigt to define command-sequences in 
the preferences dialog (compared to editing a simple text-file, similar to 
the .bind-files) -- you'll have to go to the dialog every time you make a 
change, and then save, stop lyx and restart. OTOH, if lyx actually 
interpreted the definitions when you 'apply', that'd be quite different.



/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström [EMAIL PROTECTED] writes:

| On Fri, 9 Jan 2004, Christian Ridderström wrote:

 Simple solution: Add a message to the beginning of .lyx/preferences 
 saying something like edit at your own risk.

| Oh, I just noticed that it contains this text already:

| # This file is written by LyX, if you want to make your own
| # modifications you should do them from inside LyX and save

| The text looks a bit 'cut off' though at the end... some snooping reveals 
| it's because of formatting of the source code in src/lyxrc.C - silly...

| Anyway, going with Lars' dictatorial DO NOT EDIT, how about the 
| attached patch? (the message is slightly different, and I'm not 100% 
| sure that putting a '\' at the end of a line is standard).

| /Christian

| -- 
| Christian Ridderström   http://www.md.kth.se/~chr

| Index: lyxrc.C
| ===
| RCS file: /cvs/lyx/lyx-devel/src/lyxrc.C,v
| retrieving revision 1.162
| diff -u -r1.162 lyxrc.C
| --- lyxrc.C   2003/12/14 16:33:53 1.162
| +++ lyxrc.C   2004/01/09 15:26:44
| @@ -1067,19 +1067,21 @@
|  
|  void LyXRC::output(ostream  os) const
|  {
| - os  ### This file is part of\n
| - ### \n
| - ###  LyX, The Document Processor\n
| - ###\n
| - ###  Copyright 1995 Matthias Ettrich\n
| - ###  Copyright 1995-2001 The LyX Team.\n
| - ###\n
| - ### \n
| - \n
| - # This file is written by LyX, if you want to make your own\n
| - # modifications you should do them from inside LyX and save\n
| - \n;
| -
| + os  \
| +### This file is part of\n\
| +### ==\n\
| +###  LyX, The Document Processor\n\
| +###\n\
| +###  Copyright 1995 Matthias Ettrich\n\
| +###  Copyright 1995-2001 The LyX Team.\n\
| +###\n\
| +### ==\n\
| +\n\
| +# This file contains user preferences. It is read during startup\n\
| +# and overwritten when 'Save' is selected in the 'preferences dialog'.\n\
| +# DO NOT EDIT THIS FILE - changes should me made from within Lyx.\n\
| +\n;
| + 

I liked the old formatting better.

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Angus Leeming wrote:

 Lars Gullik Bjønnes wrote:
  | Intermediate solution: Add a bind-section to preferences?
  yes. with gui.
 
 Agreed. All that's needed is a text view of the currently seleted 
 bind or ui file together with a 'save as' option.
 
 Feel free ;-)

Bah.. I was just trying to make some sense of Nirmals bug report when I 
encountered this... (although it's quite tempting - see my other reply).

I just want to know what to bugzilla ... ;-)

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Jean-Marc Lasgouttes
 Christian == Christian Ridderström [EMAIL PROTECTED] writes:

Christian Hi While testing other stuff I noticed a behaviour about
Christian .lyx/preferences that means it (at least) should get a
Christian small warning text in the beginning.

Christian Here's an example of the problem:

Christian 1. Add \bind C-o self-insert Oops to .lyx/preferences
Christian 2. Start lyx and verify that C-o inserts Oops;, so far so
Christian good... 3. Edit-Preferences and choose Save (you can
Christian toggle something twice to activate the Save-button) 4. Exit
Christian lyx 5. Start lyx and verify that C-o no longer works.

Christian Why? Well I guess lyx isn't expecting a \bind-statement in
Christian preferences and has no code for handling unexpected
Christian statements. Then when the preferences are saved, unexpected
Christian statements are simply ignored and hence lost.

Actually, this is probably my doing. At chemnitz, I remove all parsing
of \bind commands (so this is only for 1.4.0cvs, right?) from lyxrc.
The bindings should now be defined in a bind file. 

The old scheme was just too weird, and did not fit very well with
prefs.

I have probably forgotten to adjust documentation and the various FAQ
entries, though :)

Christian (I find it quite convenient to define temporary
Christian bindings/command-sequences in prefereces, since I'd
Christian otherwise have to modify one of the standard .bind-files).

You can always have a file mybindings.bind that reads

\bind_file cua
\bind foo bar

If we get a bindings editor, it would just create such a file (like
for menus and toolbar).

JMarc



Re: .lyx/preferences needs a warning

2004-01-09 Thread Ronald Florence
Christian Ridderström [EMAIL PROTECTED] writes:

 An alternative suggestion is that a preference setting is added that  
 makes LyX read a manually created preferences file (after LyX has read 
 .lyx/preferences) ... then you could manually fiddle with this file when 
 you want to play with keybindings etc.
 
 I think it'll be a bit too omständigt to define command-sequences in 
 the preferences dialog (compared to editing a simple text-file, similar to 
 the .bind-files) -- you'll have to go to the dialog every time you make a 
 change, and then save, stop lyx and restart.

What's wrong with editing a copy of your preferred bind file in
~/.lyx/bind?  I thought that was the canonical procedure for
experimenting with and setting bind preferences.  
-- 

Ronald Florence www.18james.com



Re: .lyx/preferences needs a warning

2004-01-09 Thread Jean-Marc Lasgouttes
 Lars == Lars Gullik Bjønnes [EMAIL PROTECTED] writes:

I see:

| +### This file is part of\n\
| +### ==\n\
| +###  LyX, The Document Processor\n\
| +###\n\
| +###  Copyright 1995 Matthias Ettrich\n\
| +###  Copyright 1995-2001 The LyX Team.\n\
| +###\n\
| +### ==\n\
| +\n\

Do we really want to assert a copyright on the preferences of our
users? This would be really nasty...

JMarc


Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström [EMAIL PROTECTED] writes:

| I think it'll be a bit too omständigt to define command-sequences
| in 

omstendig - circumstantial, detailed  (long-winded)

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Angus Leeming wrote:

 Lars Gullik Bjønnes wrote:
  | Intermediate solution: Add a bind-section to preferences?
  yes. with gui.
 
 Agreed. All that's needed is a text view of the currently seleted 
 bind or ui file together with a 'save as' option.

Blast... now you've got me started.

No, that's not enough because you might not have write access to these 
files. Besides, it screams bloat to put editing of these files in lyx.

(maybe add a button for opening the files in your favourite editor though)

/Christian


-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Jean-Marc Lasgouttes wrote:


 Christian preferences and has no code for handling unexpected
 Christian statements. Then when the preferences are saved, unexpected
 Christian statements are simply ignored and hence lost.
 
 Actually, this is probably my doing. At chemnitz, I remove all parsing
 of \bind commands (so this is only for 1.4.0cvs, right?) from lyxrc.

No... 1.3.3 actually.
sighI was only trying to understand Nirmals bug report./sigh

Anyway, seems the whole thing is a non-issue then since lyx-1.4 doesn't 
like \bind in .lyx/preferences. 

 I have probably forgotten to adjust documentation and the various FAQ
 entries, though :)

Not AFAIK

 Christian (I find it quite convenient to define temporary
 Christian bindings/command-sequences in prefereces, since I'd
 Christian otherwise have to modify one of the standard .bind-files).
 
 You can always have a file mybindings.bind that reads
 
 \bind_file cua
 \bind foo bar

True... good idea actually. I'll add that to the wiki somewhere.

 If we get a bindings editor, it would just create such a file (like
 for menus and toolbar).

I think the ability to re-read the bind-files etc without start/stopping 
lyx is more import 

/Christian

PS. I'm sorry I didn't think to check this in 1.4 before wasting 
everybodys time.

PPS. This ability to re-read the bind-files.. (could be activated through 
a button in the preferences dialog), is that something to bugzilla, or do 
we already have plans that solves this?


-- 
Dr. Christian Ridderström, +46-8-768 39 44   http://www.md.kth.se/~chr



Re: .lyx/preferences needs a warning

2004-01-09 Thread Angus Leeming
Christian Ridderström wrote:

 On Fri, 9 Jan 2004, Angus Leeming wrote:
 
 Lars Gullik Bjønnes wrote:
  | Intermediate solution: Add a bind-section to preferences?
  yes. with gui.
 
 Agreed. All that's needed is a text view of the currently seleted
 bind or ui file together with a 'save as' option.
 
 Blast... now you've got me started.
 
 No, that's not enough because you might not have write access to
 these files. 

You don't need write access to these files. You need a 'save as' 
option.

 Besides, it screams bloat to put editing of these files
 in lyx.

Then don't do it.

 (maybe add a button for opening the files in your favourite editor
 though)

Feel free. See InsetExternal's edit button.

-- 
Angus



Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström <[EMAIL PROTECTED]> writes:

| Hi
>
| While testing other stuff  I noticed a behaviour about 
| .lyx/preferences that means it (at least) should get a small warning 
| text in the beginning.
>
| Here's an example of the "problem":
>
| 1. Add\bind "C-o" "self-insert Oops" to .lyx/preferences
| 2. Start lyx and verify that C-o inserts "Oops;", so far so good...
| 3. Edit->Preferences and choose "Save"
|(you can toggle something twice to activate the Save-button)
| 4. Exit lyx
| 5. Start lyx and verify that C-o no longer works.
>
| Why? Well I guess lyx isn't expecting a \bind-statement in preferences 
| and has no code for handling unexpected statements. Then when the 
| preferences are saved, unexpected statements are simply ignored and 
| hence lost.

Who told you that you should be able to edit preferences manually at
all?

| Simple solution: Add a message to the beginning of .lyx/preferences 
| saying something like "edit at your own risk".

No. "DO NOT EDIT THIS FILE"

would be better.

>
| Intermediate solution: Add a bind-section to preferences?

yes. with gui.

>
| Advanced solution: Change how lyx handles configuration statements that 
| don't belong to one of the categories in preferences, i.e. let them either 
| stay where they are, or move them to an 'unknown'-section.

no.

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Christian Ridderström wrote:

> Simple solution: Add a message to the beginning of .lyx/preferences 
> saying something like "edit at your own risk".

Oh, I just noticed that it contains this text already:

# This file is written by LyX, if you want to make your own
# modifications you should do them from inside LyX and save

The text looks a bit 'cut off' though at the end... some snooping reveals 
it's because of formatting of the source code in src/lyxrc.C - silly...

Anyway, going with Lars' dictatorial DO NOT EDIT, how about the 
attached patch? (the message is slightly different, and I'm not 100% 
sure that putting a '\' at the end of a line is standard).

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr
Index: lyxrc.C
===
RCS file: /cvs/lyx/lyx-devel/src/lyxrc.C,v
retrieving revision 1.162
diff -u -r1.162 lyxrc.C
--- lyxrc.C 2003/12/14 16:33:53 1.162
+++ lyxrc.C 2004/01/09 15:26:44
@@ -1067,19 +1067,21 @@
 
 void LyXRC::output(ostream & os) const
 {
-   os << "### This file is part of\n"
-  << "### \n"
-  << "###  LyX, The Document Processor\n"
-  << "###\n"
-  << "###  Copyright 1995 Matthias Ettrich\n"
-  << "###  Copyright 1995-2001 The LyX Team.\n"
-  << "###\n"
-  << "### \n"
-  << "\n"
-  << "# This file is written by LyX, if you want to make your own\n"
-  << "# modifications you should do them from inside LyX and save\n"
-  << "\n";
-
+   os << "\
+### This file is part of\n\
+### ==\n\
+###  LyX, The Document Processor\n\
+###\n\
+###  Copyright 1995 Matthias Ettrich\n\
+###  Copyright 1995-2001 The LyX Team.\n\
+###\n\
+### ==\n\
+\n\
+# This file contains user preferences. It is read during startup\n\
+# and overwritten when 'Save' is selected in the 'preferences dialog'.\n\
+# DO NOT EDIT THIS FILE - changes should me made from within Lyx.\n\
+\n";
+   
// Why the switch you might ask. It is a trick to ensure that all
// the elements in the LyXRCTags enum is handled. As you can see
// there are no breaks at all. So it is just a huge fall-through.


Re: .lyx/preferences needs a warning

2004-01-09 Thread Angus Leeming
Lars Gullik Bjønnes wrote:
> | Intermediate solution: Add a bind-section to preferences?
> yes. with gui.

Agreed. All that's needed is a text view of the currently seleted 
bind or ui file together with a 'save as' option.

Feel free ;-)

-- 
Angus



Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Lars Gullik Bjønnes wrote:

> Christian Ridderström <[EMAIL PROTECTED]> writes:
> 
> | Hi
> >
> | While testing other stuff  I noticed a behaviour about 
> | .lyx/preferences that means it (at least) should get a small warning 
> | text in the beginning.
> >
> | Here's an example of the "problem":
> >
> | 1. Add  \bind "C-o" "self-insert Oops" to .lyx/preferences
> | 2. Start lyx and verify that C-o inserts "Oops;", so far so good...
> | 3. Edit->Preferences and choose "Save"
> |(you can toggle something twice to activate the Save-button)
> | 4. Exit lyx
> | 5. Start lyx and verify that C-o no longer works.
> >
> | Why? Well I guess lyx isn't expecting a \bind-statement in preferences 
> | and has no code for handling unexpected statements. Then when the 
> | preferences are saved, unexpected statements are simply ignored and 
> | hence lost.
> 
> Who told you that you should be able to edit preferences manually at
> all?
> 

Who needs to be told.. I just do it ;-)  Seriosoly thoug, as I wrote:

I find it quite convenient to define temporary bindings 
/command-sequences in prefereces, since I'd otherwise have to 
modify one of the standard .bind-files.

This really is practical when you're testing a temporary thing, 
typically when playing with a command sequnce that you want to bind.

> | Simple solution: Add a message to the beginning of .lyx/preferences 
> | saying something like "edit at your own risk".
> 
> No. "DO NOT EDIT THIS FILE"
> 
> would be better.
> 
> >
> | Intermediate solution: Add a bind-section to preferences?
> 
> yes. with gui.
> 
> >
> | Advanced solution: Change how lyx handles configuration statements that 
> | don't belong to one of the categories in preferences, i.e. let them either 
> | stay where they are, or move them to an 'unknown'-section.
> 
> no.
> 

What about:
>> Thoughts? 
>> Should I bugzilla this?

Since I hadn't seen the message before, maybe it's moot? (See other mail).

Or should I bugzilla the idea of adding a bind-section?

An alternative suggestion is that a preference setting is added that  
makes LyX read a manually created preferences file (after LyX has read 
.lyx/preferences) ... then you could manually fiddle with this file when 
you want to play with keybindings etc.

I think it'll be a bit too "omständigt" to define command-sequences in 
the preferences dialog (compared to editing a simple text-file, similar to 
the .bind-files) -- you'll have to go to the dialog every time you make a 
change, and then save, stop lyx and restart. OTOH, if lyx actually 
interpreted the definitions when you 'apply', that'd be quite different.



/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström <[EMAIL PROTECTED]> writes:

| On Fri, 9 Jan 2004, Christian Ridderström wrote:
>
>> Simple solution: Add a message to the beginning of .lyx/preferences 
>> saying something like "edit at your own risk".
>
| Oh, I just noticed that it contains this text already:
>
| # This file is written by LyX, if you want to make your own
| # modifications you should do them from inside LyX and save
>
| The text looks a bit 'cut off' though at the end... some snooping reveals 
| it's because of formatting of the source code in src/lyxrc.C - silly...
>
| Anyway, going with Lars' dictatorial DO NOT EDIT, how about the 
| attached patch? (the message is slightly different, and I'm not 100% 
| sure that putting a '\' at the end of a line is standard).
>
| /Christian
>
| -- 
| Christian Ridderström   http://www.md.kth.se/~chr
>
| Index: lyxrc.C
| ===
| RCS file: /cvs/lyx/lyx-devel/src/lyxrc.C,v
| retrieving revision 1.162
| diff -u -r1.162 lyxrc.C
| --- lyxrc.C   2003/12/14 16:33:53 1.162
| +++ lyxrc.C   2004/01/09 15:26:44
| @@ -1067,19 +1067,21 @@
|  
|  void LyXRC::output(ostream & os) const
|  {
| - os << "### This file is part of\n"
| -<< "### \n"
| -<< "###  LyX, The Document Processor\n"
| -<< "###\n"
| -<< "###  Copyright 1995 Matthias Ettrich\n"
| -<< "###  Copyright 1995-2001 The LyX Team.\n"
| -<< "###\n"
| -<< "### \n"
| -<< "\n"
| -<< "# This file is written by LyX, if you want to make your own\n"
| -<< "# modifications you should do them from inside LyX and save\n"
| -<< "\n";
| -
| + os << "\
| +### This file is part of\n\
| +### ==\n\
| +###  LyX, The Document Processor\n\
| +###\n\
| +###  Copyright 1995 Matthias Ettrich\n\
| +###  Copyright 1995-2001 The LyX Team.\n\
| +###\n\
| +### ==\n\
| +\n\
| +# This file contains user preferences. It is read during startup\n\
| +# and overwritten when 'Save' is selected in the 'preferences dialog'.\n\
| +# DO NOT EDIT THIS FILE - changes should me made from within Lyx.\n\
| +\n";
| + 

I liked the old formatting better.

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Angus Leeming wrote:

> Lars Gullik Bjønnes wrote:
> > | Intermediate solution: Add a bind-section to preferences?
> > yes. with gui.
> 
> Agreed. All that's needed is a text view of the currently seleted 
> bind or ui file together with a 'save as' option.
> 
> Feel free ;-)

Bah.. I was just trying to make some sense of Nirmals bug report when I 
encountered this... (although it's quite tempting - see my other reply).

I just want to know what to bugzilla ... ;-)

/Christian

-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Jean-Marc Lasgouttes
> "Christian" == Christian Ridderström <[EMAIL PROTECTED]> writes:

Christian> Hi While testing other stuff I noticed a behaviour about
Christian> .lyx/preferences that means it (at least) should get a
Christian> small warning text in the beginning.

Christian> Here's an example of the "problem":

Christian> 1. Add \bind "C-o" "self-insert Oops" to .lyx/preferences
Christian> 2. Start lyx and verify that C-o inserts "Oops;", so far so
Christian> good... 3. Edit->Preferences and choose "Save" (you can
Christian> toggle something twice to activate the Save-button) 4. Exit
Christian> lyx 5. Start lyx and verify that C-o no longer works.

Christian> Why? Well I guess lyx isn't expecting a \bind-statement in
Christian> preferences and has no code for handling unexpected
Christian> statements. Then when the preferences are saved, unexpected
Christian> statements are simply ignored and hence lost.

Actually, this is probably my doing. At chemnitz, I remove all parsing
of \bind commands (so this is only for 1.4.0cvs, right?) from lyxrc.
The bindings should now be defined in a bind file. 

The old scheme was just too weird, and did not fit very well with
prefs.

I have probably forgotten to adjust documentation and the various FAQ
entries, though :)

Christian> (I find it quite convenient to define temporary
Christian> bindings/command-sequences in prefereces, since I'd
Christian> otherwise have to modify one of the standard .bind-files).

You can always have a file mybindings.bind that reads

\bind_file "cua"
\bind "foo" "bar"

If we get a bindings editor, it would just create such a file (like
for menus and toolbar).

JMarc



Re: .lyx/preferences needs a warning

2004-01-09 Thread Ronald Florence
Christian Ridderström <[EMAIL PROTECTED]> writes:

> An alternative suggestion is that a preference setting is added that  
> makes LyX read a manually created preferences file (after LyX has read 
> .lyx/preferences) ... then you could manually fiddle with this file when 
> you want to play with keybindings etc.
> 
> I think it'll be a bit too "omständigt" to define command-sequences in 
> the preferences dialog (compared to editing a simple text-file, similar to 
> the .bind-files) -- you'll have to go to the dialog every time you make a 
> change, and then save, stop lyx and restart.

What's wrong with editing a copy of your preferred bind file in
~/.lyx/bind?  I thought that was the canonical procedure for
experimenting with and setting bind preferences.  
-- 

Ronald Florence www.18james.com



Re: .lyx/preferences needs a warning

2004-01-09 Thread Jean-Marc Lasgouttes
> "Lars" == Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes:

I see:

| +### This file is part of\n\
| +### ==\n\
| +###  LyX, The Document Processor\n\
| +###\n\
| +###  Copyright 1995 Matthias Ettrich\n\
| +###  Copyright 1995-2001 The LyX Team.\n\
| +###\n\
| +### ==\n\
| +\n\

Do we really want to assert a copyright on the preferences of our
users? This would be really nasty...

JMarc


Re: .lyx/preferences needs a warning

2004-01-09 Thread Lars Gullik Bjønnes
Christian Ridderström <[EMAIL PROTECTED]> writes:

| I think it'll be a bit too "omständigt" to define command-sequences
| in 

"omstendig" -> circumstantial, detailed  (long-winded)

-- 
Lgb


Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Angus Leeming wrote:

> Lars Gullik Bjønnes wrote:
> > | Intermediate solution: Add a bind-section to preferences?
> > yes. with gui.
> 
> Agreed. All that's needed is a text view of the currently seleted 
> bind or ui file together with a 'save as' option.

Blast... now you've got me started.

No, that's not enough because you might not have write access to these 
files. Besides, it screams bloat to put editing of these files in lyx.

(maybe add a button for opening the files in your favourite editor though)

/Christian


-- 
Christian Ridderström   http://www.md.kth.se/~chr




Re: .lyx/preferences needs a warning

2004-01-09 Thread Christian Ridderström
On Fri, 9 Jan 2004, Jean-Marc Lasgouttes wrote:


> Christian> preferences and has no code for handling unexpected
> Christian> statements. Then when the preferences are saved, unexpected
> Christian> statements are simply ignored and hence lost.
> 
> Actually, this is probably my doing. At chemnitz, I remove all parsing
> of \bind commands (so this is only for 1.4.0cvs, right?) from lyxrc.

No... 1.3.3 actually.
I was only trying to understand Nirmals bug report.

Anyway, seems the whole thing is a non-issue then since lyx-1.4 doesn't 
like \bind in .lyx/preferences. 

> I have probably forgotten to adjust documentation and the various FAQ
> entries, though :)

Not AFAIK

> Christian> (I find it quite convenient to define temporary
> Christian> bindings/command-sequences in prefereces, since I'd
> Christian> otherwise have to modify one of the standard .bind-files).
> 
> You can always have a file mybindings.bind that reads
> 
> \bind_file "cua"
> \bind "foo" "bar"

True... good idea actually. I'll add that to the wiki somewhere.

> If we get a bindings editor, it would just create such a file (like
> for menus and toolbar).

I think the ability to re-read the bind-files etc without start/stopping 
lyx is more import 

/Christian

PS. I'm sorry I didn't think to check this in 1.4 before wasting 
everybodys time.

PPS. This ability to re-read the bind-files.. (could be activated through 
a button in the preferences dialog), is that something to bugzilla, or do 
we already have plans that solves this?


-- 
Dr. Christian Ridderström, +46-8-768 39 44   http://www.md.kth.se/~chr



Re: .lyx/preferences needs a warning

2004-01-09 Thread Angus Leeming
Christian Ridderström wrote:

> On Fri, 9 Jan 2004, Angus Leeming wrote:
> 
>> Lars Gullik Bjønnes wrote:
>> > | Intermediate solution: Add a bind-section to preferences?
>> > yes. with gui.
>> 
>> Agreed. All that's needed is a text view of the currently seleted
>> bind or ui file together with a 'save as' option.
> 
> Blast... now you've got me started.
> 
> No, that's not enough because you might not have write access to
> these files. 

You don't need write access to these files. You need a 'save as' 
option.

> Besides, it screams bloat to put editing of these files
> in lyx.

Then don't do it.

> (maybe add a button for opening the files in your favourite editor
> though)

Feel free. See InsetExternal's edit button.

-- 
Angus