[ESS-bugs] ess-mode 5.3.8; when editing R documents, 'delete' key behaves as 'backspace'

Marek Jarocinski marek.jarocinski at gmail.com
Sun Sep 7 22:41:37 CEST 2008


Dear Stephen,

I have found a solution to this problem:
All I need to do is to comment out line 173 of ess-mode.el, which says:
  (define-key ess-mode-map "\177"	'backward-delete-char-untabify)
After this line is commented out, DEL key deletes forward, the same as
in all other modes.
Does that mean that it was an intended behavior in ESS?

Best,

Marek

On Sun, Sep 7, 2008 at 4:04 PM, Marek Jarocinski
<marek.jarocinski at gmail.com> wrote:
> Hi Stephen,
>
> Thanks for your advice, but this did not help me.
> Neither the function 'normal-erase-is-backspace-mode'
> nor the variable 'normal-erase-is-backspace'
> are defined in my version of xemacs.
>
> I have exactly the same problem also on another computer, in which I
> have xemacs 21.4.21.
> Please note that the problem is not that DEL does not delete, but that
> it deletes backward instead of forward. This happens only in the
> buffers that are open in the ESS mode, in other buffers of the same
> instance of xemacs everything works as usual.
>
> Please help,
>
> Marek
>
>
>
>
> On Sat, Sep 6, 2008 at 10:16 PM, Stephen Eglen
> <S.J.Eglen at damtp.cam.ac.uk> wrote:
>> hi Marek,
>>
>> You say you are on XEmacs, so this may not help, but the following below
>> is from the info node of Emacs.  Does any of this advice help you?
>>
>> Stephen
>>
>> File: emacs,  Node: DEL Does Not Delete,  Next: Stuck Recursive,  Up: Lossage
>>
>> 59.1 If <DEL> Fails to Delete
>> =============================
>>
>> Every keyboard has a large key, a little ways above the <RET> or
>> <ENTER> key, which you normally use outside Emacs to erase the last
>> character that you typed.  We call this key "the usual erasure key".
>> In Emacs, it is supposed to be equivalent to <DEL>, and when Emacs is
>> properly configured for your terminal, it translates that key into the
>> character <DEL>.
>>
>>   When Emacs starts up on a graphical display, it determines
>> automatically which key should be <DEL>.  In some unusual cases Emacs
>> gets the wrong information from the system.  If the usual erasure key
>> deletes forwards instead of backwards, that is probably what
>> happened--Emacs ought to be treating the <DELETE> key as <DEL>, but it
>> isn't.
>>
>>   On a graphical display, if the usual erasure key is labeled
>> <BACKSPACE> and there is a <DELETE> key elsewhere, but the <DELETE> key
>> deletes backward instead of forward, that too suggests Emacs got the
>> wrong information--but in the opposite sense.  It ought to be treating
>> the <BACKSPACE> key as <DEL>, and treating <DELETE> differently, but it
>> isn't.
>>
>>   On a text-only terminal, if you find the usual erasure key prompts
>> for a Help command, like `Control-h', instead of deleting a character,
>> it means that key is actually sending the <BS> character.  Emacs ought
>> to be treating <BS> as <DEL>, but it isn't.
>>
>>   In all of those cases, the immediate remedy is the same: use the
>> command `M-x normal-erase-is-backspace-mode'.  This toggles between the
>> two modes that Emacs supports for handling <DEL>, so if Emacs starts in
>> the wrong mode, this should switch to the right mode.  On a text-only
>> terminal, if you want to ask for help when <BS> is treated as <DEL>,
>> use <F1>; `C-?' may also work, if it sends character code 127.
>>
>>   To fix the problem automatically for every Emacs session, you can
>> put one of the following lines into your `.emacs' file (*note Init
>> File::).  For the first case above, where <DELETE> deletes forwards
>> instead of backwards, use this line to make <DELETE> act as <DEL>
>> (resulting in behavior compatible with Emacs 20 and previous versions):
>>
>>     (normal-erase-is-backspace-mode 0)
>>
>> For the other two cases, where <BACKSPACE> ought to act as <DEL>, use
>> this line:
>>
>>     (normal-erase-is-backspace-mode 1)
>>
>>   Another way to fix the problem for every Emacs session is to
>> customize the variable `normal-erase-is-backspace': the value `t'
>> specifies the mode where <BS> or <BACKSPACE> is <DEL>, and `nil'
>> specifies the other mode.  *Note Easy Customization::.
>>
>>   On a graphical display, it can also happen that the usual erasure key
>> is labeled <BACKSPACE>, there is a <DELETE> key elsewhere, and both
>> keys delete forward.  This probably means that someone has redefined
>> your <BACKSPACE> key as a <DELETE> key.  With X, this is typically done
>> with a command to the `xmodmap' program when you start the server or
>> log in.  The most likely motive for this customization was to support
>> old versions of Emacs, so we recommend you simply remove it now.
>>
>>
>
>
>
> --
> Marek Jarocinski
> European Central Bank, DG-Research
> http://www.econ.upf.edu/~jarocins
>



-- 
Marek Jarocinski
European Central Bank, DG-Research
http://www.econ.upf.edu/~jarocins



More information about the ESS-bugs mailing list