help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

protect paste operations from key rebindings


From: Dan Davison
Subject: protect paste operations from key rebindings
Date: Sat, 16 Aug 2008 09:43:44 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

As an experiment, I've bound ( and [ and " to functions which
automatically insert the closing character, and leave point
inbetween. I think I like this behaviour, at least while
programming. I'm running ubuntu with gnome. Unfortunately, if I'm
running emacs in a gnome-terminal (no X), and I paste the X clipboard
contents into a buffer using both mouse buttons, or shift-insert, then
my keybindings have their effect, and I get all sorts of undesired
doubled parentheses and stuff. This doesn't happen when I yank text
killed by emacs. In emacs -nw the X clipboard contents do not enter
the kill-ring (no way round that, right?). However in emacs with X
enabled, my keybindings have no effect on pasted text from the X
clipboard, whether by C-y or both-mouse-buttons / shift-insert.

Is there anyway I can obtain literal pasting from the X clipboard
under emacs -nw? Or any way I can redefine my functions such that they
don't affect text pasted in this way? Currently I'm using
insert-parentheses for "(", and simple-minded stuff like

(defun dan-insert-square-brackets ()
  (interactive)
  (insert "[]")
  (backward-char))

for "[".

Thanks a lot,

Dan

-- 
www.stats.ox.ac.uk/~davison




reply via email to

[Prev in Thread] Current Thread [Next in Thread]