Bug#466486: can't prevent indenting at newline when pasting

2008-02-21 Thread G. Milde
In the course of discreet bug hunting, 
On 21.02.08, Drew Parsons wrote:
 On Wed, 2008-02-20 at 10:52 +0100, G. Milde wrote:

  * The changed keybinding must be defined *after* loading the default
keybindings, e.g. by *appending* the line

 setkey(newline_indent, ^M); % correct mouse-insertion problem

to ~/.jed/jed.rc.

  * Also, you must load an emulation file before (or set the variable
_Jed_Emulation to a non  value), otherwise the _Jed_Default_Emulation
will be loaded *after* evaluation of jed.rc - actually this might be the
problem we need to clarify in the docs.

 OK, these two points sound like they explain the problem.  Now in
 jed.rc, I have no other settings other than these ones attempting to
 change the mouse pasting behaviour.  I don't know about
 Default_Emulation at all or how to fix it correctly?

The advice in REDME.Debian is

  jed.rc   user startup configuration (move the jed.rc from the
   examples/ here and modify to your needs)

where the example file contains the code to select an emulation.
A minimalistic jed.rc could look like:

  % load emulation
  require(emacs);
  %require(cua);
  
  % change keybindings
  setkey(newline_indent, ^M); % correct mouse-insertion problem
  

 Shouldn't Default_Emulation be set automatically set first with jed.rc
 user settings overriding any default settings?

The problem is that:

1. Only *one* emulation file should be loaded

   - in order to speed up jed startup
  
   - to prevent incompatibilities, or definitions that are not
 overridden in a different emulation mode.
  
2. The emulation mode should be configurable by the user.

3. Jed needs to use a sensible emulation mode also if there is no user
   setting. 
  
The upstream solution is provide a fallback, if there is no indication
that the user has choosen an emulation. To achieve this, an emulation
mode sets the variable `_Jed_Emulation`. If this variable is not set, the
mode defined in the variable `_Jed_Default_Emulation` is evaluated
(naturally, this can only happen after evaluating jed.rc).

(On Debian, `_Jed_Default_Emulation` is set in /etc/jed.d/05jed-common.sl
and can be configured by the sysadmin.)
  

I will update README.Debian and README.Debian-startup to make this more
clear.

Günter
  



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#466486: can't prevent indenting at newline when pasting

2008-02-21 Thread G. Milde
On 21.02.08, G. Milde wrote:

  OK, these two points sound like they explain the problem.  
...

Actually, there is more: 

  Many editing modes (c_mode, slang_mode, perl_mode, php_mode, to name but a
  few) bind the return key to newline_and_indent() in their local keymap.
  Therefore you will need to change this binding in the global_mode_hook.
  
  In your jed.rc, write e.g.

  % fix staircase effect with mouse-pasting in an x-terminal
  #ifndef XWINDOWS IBMPC_SYSTEM
  define global_mode_hook (hook)
  {
 setkey(newline_indent, ^M);   
  }
  #endif

  or add the setkey() line to an already existing global_mode_hook()
  definition.
  
 I will update README.Debian and README.Debian-startup to make this more
 clear.

 Günter




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#466486: can't prevent indenting at newline when pasting

2008-02-20 Thread Drew Parsons
On Wed, 2008-02-20 at 10:52 +0100, G. Milde wrote:
 
 Are you sure?
 
 What are e.g. the values for variables set in /etc/jed.d/05jed-common.sl 
 
Default_Jedrc_Startup_File

Using Help-Describe variable,
String_Type `Default_Jedrc_Startup_File' == /home/drew/.jed/jed.rc 
(so it should be reading it!)

Jed_Doc_Files
String_Type `Jed_Doc_Files'
== 
/usr/share/jed/jed-extra/drop-in/libfuns.txt,/usr/share/jed/doc/hlp/jedfuns.hlp,/usr/share/jed/doc/hlp/libfuns.hlp,/usr/share/doc/libslang2/slangfun.txt,/usr/share/jed/jed-extra/utils/libfuns.txt,/usr/share/jed/jed-extra/libfuns.txt


M-X insert(get_jed_library_path);
  
/usr/share/jed/jed-extra/drop-in/,/usr/share/jed/lib,/usr/share/jed/jed-extra/utils/,/usr/share/jed/jed-extra/


 * Are other settings in jed.rc respected?
 
  set_color_scheme (blue1);

Seems ok, the background comes up blue instead of black.  So jed.rc *is*
being read.

  require(cua);
Yes, that works too.  With jed,  C-x C-c no longer works for exiting,
with jed -n I get the emacs bindings back again.
 

 
 * The changed keybinding must be defined *after* loading the default
   keybindings, e.g. by *appending* the line
   
setkey(newline_indent, ^M); % correct mouse-insertion problem
   
   to ~/.jed/jed.rc.
   
 * Also, you must load an emulation file before (or set the variable
   _Jed_Emulation to a non  value), otherwise the _Jed_Default_Emulation
   will be loaded *after* evaluation of jed.rc - actually this might be the
   problem we need to clarify in the docs.

OK, these two points sound like they explain the problem.  Now in
jed.rc, I have no other settings other than these ones attempting to
change the mouse pasting behaviour.  I don't know about
Default_Emulation at all or how to fix it correctly?

Shouldn't Default_Emulation be set automatically set first with jed.rc
user settings overriding any default settings?

Drew



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#466486: can't prevent indenting at newline when pasting

2008-02-19 Thread G. Milde
On 19.02.08, Drew Parsons wrote:
 I use jed from a X terminal.  When I copypaste with the mouse, the
 text gets indented with each newline.

 This problem is addressed in /usr/share/doc/jed/README.Debian, with a
 variety of solutions offered.

 A2: Temporarily change the keybinding 
...
 - this does work, thanks.  But it's inconvenient to set manually like
 this each time.

How about paste()? (A1) This is basically a function to automate this task,
recommended by the Jed author.

 Neither of these solutions A3 or A4 work.  I've tried placing either
 of them in ~/.jedrc, moving that to ~/.jed/jed.rc, copying it to
 /etc/jed.d/99newline-noindent.sl.  Nothing works.

 Could you review these instructions in README.Debian to confirm if
 they are still valid, and provide corrected instructions?

A4 works nice here with 

  !if (is_defined(x_server_vendor))
setkey(newline_indent, ^M); % correct mouse-insertion problem
 
in a file called by ~/jed.rc and newline_indent defined in txtutils.sl from
the jed-extra package.

What does HelpShow_Key return for the [Return] key after applying A3 or A4?

Does it work if you put the code in a buffer and run M-x evalbuffer?

Can you test whether the ~/.jed/jed.rc file is evaluated?


Thanks

Günter



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#466486: can't prevent indenting at newline when pasting

2008-02-19 Thread Drew Parsons
On Tue, 2008-02-19 at 14:40 +0100, G. Milde wrote:
 
  A2: Temporarily change the keybinding 
 ...
  - this does work, thanks.  But it's inconvenient to set manually like
  this each time.
 
 How about paste()? (A1) This is basically a function to automate this task,
 recommended by the Jed author.

You're right, it's probably the best workaround.  Still not as
convenient as just clicking the mouse button though :)


 A4 works nice here with 
 
   !if (is_defined(x_server_vendor))
 setkey(newline_indent, ^M); % correct mouse-insertion problem
  
 in a file called by ~/jed.rc and newline_indent defined in txtutils.sl from
 the jed-extra package.

I installed jed-extra and tried this in ~/.jed/jed.rc, but it didn't
help, not even with just setkey(newline_indent, ^M); on its own.

 What does HelpShow_Key return for the [Return] key after applying A3 or A4?

With nothing set in jed.rc:
Key ^M runs the internal function newline_and_indent

With A3, setkey(newline, ^M);
Key ^M runs the internal function newline_and_indent   --- there's
the problem, no change!

Same again with A4, setkey(newline_indent,^M);

It's like jed.rc is being completely ignored.  It doesn't make a
difference whether I'm trying to make the settings in ~/.jed/jed.rc,
~/.jedrc or even /etc/jed.d/99newline-noindent.sl :(

 Does it work if you put the code in a buffer and run M-x evalbuffer?

Yes, that works! For both A3 and A4 (both versions).


 Can you test whether the ~/.jed/jed.rc file is evaluated?

Apparently it is not, nor is /etc/jed.d.


Thanks,
Drew



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Bug#466486: can't prevent indenting at newline when pasting

2008-02-18 Thread Drew Parsons
Package: jed
Version: 1:0.99.18+dfsg.1-9
Severity: normal

I use jed from a X terminal.  When I copypaste with the mouse, the
text gets indented with each newline.

This problem is addressed in /usr/share/doc/jed/README.Debian, with a
variety of solutions offered.

A2: Temporarily change the keybinding by doing:
  1. M-X local_setkey(newline,^M)

- this does work, thanks.  But it's inconvenient to set manually like
this each time.


A3: Bind newline_and_indent to a different key. In jed.rc do e.g.:
 setkey(newline_and_indent, \e^M);   % Key_Alt_Return
  setkey(newline, ^M);
A4: Use the fact that Jed can tell whether there is
input pending after the carriage return. Define in your jed.rc (or any
other file evaluated at startup):
 public define newline_indent ()
  {
 if (input_pending(0))
   newline();
  else
  call (newline_and_indent);
 }
  setkey(newline_indent,^M);


Neither of these solutions A3 or A4 work.  I've tried placing either
of them in ~/.jedrc, moving that to ~/.jed/jed.rc, copying it to
/etc/jed.d/99newline-noindent.sl.  Nothing works.


Could you review these instructions in README.Debian to confirm if
they are still valid, and provide corrected instructions?

Thanks,
Drew


-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.24
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages jed depends on:
ii  jed-common1:0.99.18+dfsg.1-9 S-Lang runtime files for jed and x
ii  libc6 2.7-6  GNU C Library: Shared libraries
ii  libgpmg1  1.19.6-25  General Purpose Mouse - shared lib
ii  libslang2 2.1.3-2The S-Lang programming library - r

jed recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]