Subject: Re: 23.0.60; A combination of PC Selection, Visual Lines and emacsclient redefines C-backspace

From: Dan Nicolaescu <[email-masked]>
Date: Wed, 21 Jan 2009 22:21:28 -0800 (PST)

> > there's probably some problem with pc-selection-mode and the way it
  > > interacts with normal-erase-is-backspace.
  > 
  > The problem is not pc-selection mode, but how Emacs does
  > normal-erase-is-backspace in multi-tty situations.  Here's an even
  > simpler recipe, not involving pc-selection-mode or the daemon:
  > 
  > 1. Add the following line to .emacs:
  > 
  >      (global-set-key [C-delete] 'kill-line)
  > 
  > 2. emacs -nw -f server-start
  > 3. emacsclient -c
  > 4. C-h k C-backspace
  > 
  >   => <C-backspace> runs the command kill-line

This happens because:

(defun normal-erase-is-backspace-setup-frame (&optional frame)
  "Set up `normal-erase-is-backspace-mode' on FRAME, if necessary."
  (unless frame (setq frame (selected-frame)))
  (unless (terminal-parameter nil 'normal-erase-is-backspace)
    (normal-erase-is-backspace-mode
      (if (if (eq normal-erase-is-backspace 'maybe)

When using "emacs -nw -f server-start" the "(unless (terminal-parameter"
test passes and `normal-erase-is-backspace' is run.

When using "emacs -f server-start" the `terminal-parameter' call returns
non-ni, so `normal-erase-is-backspace' is not run.  
It seems that terminal-parameters are copied from the first frame
created...

Not sure how normal-erase-is-backspace is supposed to work...