saneman <ddd@sdf.com> writes:
I have redefined C-d to comment/uncomment. But when I press delete it
also inserts a comment (% i latex mode). Is it possible to assign
something to the key 'd' without change 'delete'?
I have this in my .emacs file:
(global-set-key "\C-d" 'comment-dwim)
(define-key function-key-map [delete] [deletechar])
But delete still inserts a comment instead of deleting a character.
That's strange. The doc of define-key doesn't mention vectors for
the def argument.
I would just write:
(global-set-key (kbd "C-d") 'comment-dwim)
This shouldn't change the binding of the delete key.
Note that (string= "\C-d" "C-d").