all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Inconsistant Delete Key
@ 2002-09-06 15:32 CarlC
  2002-09-09  8:47 ` John McCabe
  0 siblings, 1 reply; 13+ messages in thread
From: CarlC @ 2002-09-06 15:32 UTC (permalink / raw)


Hi, all. I'm sure this subject has been talked about, ad nauseum, but I have
a new take on it.

I am running emacs 20.7.1. I had the usual problem with the delete key not
doing a delete-char. I have somewhat corrected the problem in ~/.emacs,
although it seems a kludge to me. My problem is that when I start emacs with
a filename argument, sometimes the delete key does a delete-char, and other
times it does a backward-delete-char. This seems to be dependent on the file
that I initial open from the command line. I am at a loss as to this
inconsistancy.

My default .emacs file had:

;; Set up the keyboard so the delete key on both the regular keyboard
;; and the keypad delete the character under the cursor and to the right
;; under X, instead of the default, backspace behavior.
(global-set-key [delete] 'delete-char)
(global-set-key [kp-delete] 'delete-char)

I added:

(global-set-key "\C-h" 'backward-delete-char)
(global-set-key "\C-?" 'delete-char)

Thanks, in advance, for any help.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-06 15:32 Inconsistant Delete Key CarlC
@ 2002-09-09  8:47 ` John McCabe
  2002-09-09 13:49   ` CarlC
  0 siblings, 1 reply; 13+ messages in thread
From: John McCabe @ 2002-09-09  8:47 UTC (permalink / raw)


On Fri, 06 Sep 2002 15:32:31 GMT, "CarlC" <carlc@snowbd.com> wrote:

>This seems to be dependent on the file that I initial open from the
>command line.

In what way? In other words, are there particular types of file that
cause the behaviour to be different?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-09  8:47 ` John McCabe
@ 2002-09-09 13:49   ` CarlC
  2002-09-09 16:30     ` John McCabe
                       ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: CarlC @ 2002-09-09 13:49 UTC (permalink / raw)


John, your question sparked me to do some more testing. The filename does
make a difference on my delete key. If I "emacs trash", the key works like I
want it to. If I "cp trash trash.el; emacs trash.el", it does not.

I guess my question should be: How do I make the delete key consistant in
all modes for 20.7.1? Thanks for your help.

"John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
news:3d7c6002.2436493@news.demon.co.uk...
> On Fri, 06 Sep 2002 15:32:31 GMT, "CarlC" <carlc@snowbd.com> wrote:
>
> >This seems to be dependent on the file that I initial open from the
> >command line.
>
> In what way? In other words, are there particular types of file that
> cause the behaviour to be different?
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-09 13:49   ` CarlC
@ 2002-09-09 16:30     ` John McCabe
  2002-09-10  8:32     ` John McCabe
  2002-09-10  9:03     ` Kai Großjohann
  2 siblings, 0 replies; 13+ messages in thread
From: John McCabe @ 2002-09-09 16:30 UTC (permalink / raw)


On Mon, 09 Sep 2002 13:49:13 GMT, "CarlC" <carlc@snowbd.com> wrote:

>John, your question sparked me to do some more testing. The filename does
>make a difference on my delete key. If I "emacs trash", the key works like I
>want it to. If I "cp trash trash.el; emacs trash.el", it does not.
>
>I guess my question should be: How do I make the delete key consistant in
>all modes for 20.7.1? Thanks for your help.

I'm not really sure of the answer at the moment, but it looks like the
behaviour is being overridden when you enter Emacs-Lisp mode in this
case. Are there any other file types that cause the problem? 

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-09 13:49   ` CarlC
  2002-09-09 16:30     ` John McCabe
@ 2002-09-10  8:32     ` John McCabe
  2002-09-10 21:43       ` CarlC
  2002-09-10  9:03     ` Kai Großjohann
  2 siblings, 1 reply; 13+ messages in thread
From: John McCabe @ 2002-09-10  8:32 UTC (permalink / raw)


On Mon, 09 Sep 2002 13:49:13 GMT, "CarlC" <carlc@snowbd.com> wrote:

>John, your question sparked me to do some more testing. The filename does
>make a difference on my delete key. If I "emacs trash", the key works like I
>want it to. If I "cp trash trash.el; emacs trash.el", it does not.
>
>I guess my question should be: How do I make the delete key consistant in
>all modes for 20.7.1? Thanks for your help.
>
>"John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
>news:3d7c6002.2436493@news.demon.co.uk...
>> On Fri, 06 Sep 2002 15:32:31 GMT, "CarlC" <carlc@snowbd.com> wrote:
>>
>> >This seems to be dependent on the file that I initial open from the
>> >command line.
>>
>> In what way? In other words, are there particular types of file that
>> cause the behaviour to be different?

Try this:

(global-set-key [delete] "\C-d")

I've just noticed that's what I use, and I seem to recall that the
reason I changed this from 'delete-char was due to a similar issue to
what you describe.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-09 13:49   ` CarlC
  2002-09-09 16:30     ` John McCabe
  2002-09-10  8:32     ` John McCabe
@ 2002-09-10  9:03     ` Kai Großjohann
  2002-09-10 21:32       ` CarlC
  2 siblings, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-09-10  9:03 UTC (permalink / raw)


"CarlC" <carlc@snowbd.com> writes:

> John, your question sparked me to do some more testing. The filename does
> make a difference on my delete key. If I "emacs trash", the key works like I
> want it to. If I "cp trash trash.el; emacs trash.el", it does not.

What does C-h k <delete> say in the two cases?

kai
-- 
A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-10  9:03     ` Kai Großjohann
@ 2002-09-10 21:32       ` CarlC
  2002-09-11  8:26         ` John McCabe
  2002-09-12 15:01         ` Kai Großjohann
  0 siblings, 2 replies; 13+ messages in thread
From: CarlC @ 2002-09-10 21:32 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1740 bytes --]

Here is the describe key output from my to edit sessions:

---------------------------------------------
GOOD:
DEL runs the command delete-char
   which is an interactive built-in function.

Delete the following N characters (previous if N is negative).
Optional second arg KILLFLAG non-nil means kill instead (save in kill ring).
Interactively, N is the prefix arg, and KILLFLAG is set if
N was explicitly specified.

(delete-char N &optional KILLFLAG)
--------------------------------------------------------
BAD:
DEL runs the command backward-delete-char-untabify
   which is an interactive compiled Lisp function in `simple'.
(backward-delete-char-untabify ARG &optional KILLP)

Delete characters backward, changing tabs into spaces.
The exact behavior depends on `backward-delete-char-untabify-method'.
Delete ARG chars, and kill (save in kill ring) if KILLP is non-nil.
Interactively, ARG is the prefix arg (default 1)
and KILLP is t if a prefix arg was specified.
----------------------------------------------------------
One thing that bothers me on this is that it is calling this key DEL. I
assume this is the same as [delete]. I also assume that [delete] is
synonymous with octal 177 value.

Thanks.

"Kai Großjohann" <Kai.Grossjohann@CS.Uni-Dortmund.DE> wrote in message
news:vafptvmqkqq.fsf@lucy.cs.uni-dortmund.de...
> "CarlC" <carlc@snowbd.com> writes:
>
> > John, your question sparked me to do some more testing. The filename
does
> > make a difference on my delete key. If I "emacs trash", the key works
like I
> > want it to. If I "cp trash trash.el; emacs trash.el", it does not.
>
> What does C-h k <delete> say in the two cases?
>
> kai
> --
> A large number of young women don't trust men with beards.  (BFBS Radio)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-10  8:32     ` John McCabe
@ 2002-09-10 21:43       ` CarlC
  0 siblings, 0 replies; 13+ messages in thread
From: CarlC @ 2002-09-10 21:43 UTC (permalink / raw)


> >>
> >> In what way? In other words, are there particular types of file that
> >> cause the behaviour to be different?

Here are results from identical files with different extensions:

Filename        Worked?
---------        ----------
trash                Yes
trash.el             No
trash.c                No
trash.txt            Yes
trash.fd            Yes

Does the mode work entirely off of the extension or does it also check
content? Thanks.

>
> Try this:
>
> (global-set-key [delete] "\C-d")
>

This didn't seem to have any affect.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-10 21:32       ` CarlC
@ 2002-09-11  8:26         ` John McCabe
  2002-09-11 12:46           ` CarlC
  2002-09-12 15:01         ` Kai Großjohann
  1 sibling, 1 reply; 13+ messages in thread
From: John McCabe @ 2002-09-11  8:26 UTC (permalink / raw)


On Tue, 10 Sep 2002 21:32:26 GMT, "CarlC" <carlc@snowbd.com> wrote:

>One thing that bothers me on this is that it is calling this key DEL. I
>assume this is the same as [delete]. I also assume that [delete] is
>synonymous with octal 177 value.

In emacs-lips mode, with the setting I mentioned earlier, I find that
the Backspace key on my keyboard returns:

==========
DEL runs the command backward-delete-char-untabify
   which is an interactive compiled Lisp function in `simple'.
(backward-delete-char-untabify ARG &optional KILLP)
==========

So what you are talking about appears to be the backspace key, in
which case you're trying to map the backspace key (which is synonymous
with \177) to delete-char.

In that case you should be able to use:

(global-set-key [backspace] 'delete-char)

What system are you using? If it's a windows system, does the key
you're referring to the one above the Enter key or the key marked
"Delete" in the "Home", "Insert", "End", "Delete", "Page Up", "Page
Down" block?

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-11  8:26         ` John McCabe
@ 2002-09-11 12:46           ` CarlC
  0 siblings, 0 replies; 13+ messages in thread
From: CarlC @ 2002-09-11 12:46 UTC (permalink / raw)



"John McCabe" <john.nospam@nospamassen.nospamdemon.co.uk> wrote in message
news:3d7efc39.1522729@news.demon.co.uk...
> On Tue, 10 Sep 2002 21:32:26 GMT, "CarlC" <carlc@snowbd.com> wrote:
> In emacs-lips mode, with the setting I mentioned earlier, I find that
> the Backspace key on my keyboard returns:
>
> ==========
> DEL runs the command backward-delete-char-untabify
>    which is an interactive compiled Lisp function in `simple'.
> (backward-delete-char-untabify ARG &optional KILLP)
> ==========
>
> So what you are talking about appears to be the backspace key, in
> which case you're trying to map the backspace key (which is synonymous
> with \177) to delete-char.

My delete key sends \177. My backspace sends C-h.

>
> In that case you should be able to use:
>
> (global-set-key [backspace] 'delete-char)

This did not seem to have any affect

>
> What system are you using? If it's a windows system, does the key
> you're referring to the one above the Enter key or the key marked
> "Delete" in the "Home", "Insert", "End", "Delete", "Page Up", "Page
> Down" block?

I am using a terminal emulator that emulates SCO ansi on a win machine. It
telnets into a Red Hat box with TERM set to scoansi. I am using SCO ansi due
to its full function key support (although I would prefer to use a data
general emulation that emacs can't stand).

>
>

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-10 21:32       ` CarlC
  2002-09-11  8:26         ` John McCabe
@ 2002-09-12 15:01         ` Kai Großjohann
  2002-09-13 20:09           ` CarlC
  1 sibling, 1 reply; 13+ messages in thread
From: Kai Großjohann @ 2002-09-12 15:01 UTC (permalink / raw)


"CarlC" <carlc@snowbd.com> writes:

> Here is the describe key output from my to edit sessions:
>
> ---------------------------------------------
> GOOD:
> DEL runs the command delete-char
> --------------------------------------------------------
> BAD:
> DEL runs the command backward-delete-char-untabify

I think that you have a statement that binds DEL to delete-char in
your ~/.emacs file.  Don't do that.

You should arrange that Emacs sees <delete> when you hit the delete
key and DEL when you hit the backspace key.  DEL is ascii 127.

I have configured xterm to send ESC [ 3 ~ when I hit <delete> and
then I have told Emacs that this is <delete>.  xterm sends DEL (ascii
127, ^?) when I hit <backspace>.

Which kind of terminal do you use?

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-12 15:01         ` Kai Großjohann
@ 2002-09-13 20:09           ` CarlC
  2002-09-13 21:47             ` Kai Großjohann
  0 siblings, 1 reply; 13+ messages in thread
From: CarlC @ 2002-09-13 20:09 UTC (permalink / raw)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]


"Kai Großjohann" <Kai.Grossjohann@CS.Uni-Dortmund.DE> wrote in message
news:vafu1kv8d6n.fsf@lucy.cs.uni-dortmund.de...
> "CarlC" <carlc@snowbd.com> writes:
>
> > Here is the describe key output from my to edit sessions:
> >
> > ---------------------------------------------
> > GOOD:
> > DEL runs the command delete-char
> > --------------------------------------------------------
> > BAD:
> > DEL runs the command backward-delete-char-untabify
>
> I think that you have a statement that binds DEL to delete-char in
> your ~/.emacs file.  Don't do that.

I have [delete] bound to delete-char. I don't have any references to DEL.

>
> You should arrange that Emacs sees <delete> when you hit the delete
> key and DEL when you hit the backspace key.  DEL is ascii 127.

I _believe_ that my "delete" key sends 127 and my "backspace" key send ^H.

>
> I have configured xterm to send ESC [ 3 ~ when I hit <delete> and
> then I have told Emacs that this is <delete>.  xterm sends DEL (ascii
> 127, ^?) when I hit <backspace>.
>
> Which kind of terminal do you use?

I am running a win terminal emulator for sco ansi. My TERM is set to
scoansi.

>
> kai
> --
> ~/.signature is: umop 3p!sdn    (Frank Nobis)

Thanks.

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Inconsistant Delete Key
  2002-09-13 20:09           ` CarlC
@ 2002-09-13 21:47             ` Kai Großjohann
  0 siblings, 0 replies; 13+ messages in thread
From: Kai Großjohann @ 2002-09-13 21:47 UTC (permalink / raw)


"CarlC" <carlc@snowbd.com> writes:

> "Kai Großjohann" <Kai.Grossjohann@CS.Uni-Dortmund.DE> wrote in message
> news:vafu1kv8d6n.fsf@lucy.cs.uni-dortmund.de...
>> "CarlC" <carlc@snowbd.com> writes:
>>
>> > Here is the describe key output from my to edit sessions:
>> >
>> > ---------------------------------------------
>> > GOOD:
>> > DEL runs the command delete-char
>> > --------------------------------------------------------
>> > BAD:
>> > DEL runs the command backward-delete-char-untabify
>>
>> I think that you have a statement that binds DEL to delete-char in
>> your ~/.emacs file.  Don't do that.
>
> I have [delete] bound to delete-char. I don't have any references to DEL.

That's okay, then.  (You don't have reference to ^? or C-? either,
right?  Okay, okay, just a check.)

>> You should arrange that Emacs sees <delete> when you hit the delete
>> key and DEL when you hit the backspace key.  DEL is ascii 127.
>
> I _believe_ that my "delete" key sends 127 and my "backspace" key send ^H.

Whee.  So what might be wrong?  Does it help to frob
normal-erase-is-backspace (from customize only, use function
normal-erase-is-backspace-mode from Lisp)?

And then, you can still do

(define-key emacs-lisp-mode-map (kbd "<delete>") 'delete-char)

I wonder if that does anything useful.  (It takes effect only for
*.el files.)

kai
-- 
~/.signature is: umop 3p!sdn    (Frank Nobis)

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2002-09-13 21:47 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-06 15:32 Inconsistant Delete Key CarlC
2002-09-09  8:47 ` John McCabe
2002-09-09 13:49   ` CarlC
2002-09-09 16:30     ` John McCabe
2002-09-10  8:32     ` John McCabe
2002-09-10 21:43       ` CarlC
2002-09-10  9:03     ` Kai Großjohann
2002-09-10 21:32       ` CarlC
2002-09-11  8:26         ` John McCabe
2002-09-11 12:46           ` CarlC
2002-09-12 15:01         ` Kai Großjohann
2002-09-13 20:09           ` CarlC
2002-09-13 21:47             ` Kai Großjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.