From: Dan Davison <davison@stats.ox.ac.uk>
To: help-gnu-emacs mailing list <help-gnu-emacs@gnu.org>
Subject: protect paste operations from key rebindings
Date: Sat, 16 Aug 2008 09:43:44 +0100 [thread overview]
Message-ID: <20080816084344.GA12511@stats.ox.ac.uk> (raw)
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
next reply other threads:[~2008-08-16 8:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-16 8:43 Dan Davison [this message]
2008-08-16 9:32 ` protect paste operations from key rebindings Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080816084344.GA12511@stats.ox.ac.uk \
--to=davison@stats.ox.ac.uk \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.