all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* protect paste operations from key rebindings
@ 2008-08-16  8:43 Dan Davison
  2008-08-16  9:32 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Davison @ 2008-08-16  8:43 UTC (permalink / raw)
  To: help-gnu-emacs mailing list

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




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

* Re: protect paste operations from key rebindings
  2008-08-16  8:43 protect paste operations from key rebindings Dan Davison
@ 2008-08-16  9:32 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2008-08-16  9:32 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 16 Aug 2008 09:43:44 +0100
> From: Dan Davison <davison@stats.ox.ac.uk>
> 
> Is there anyway I can obtain literal pasting from the X clipboard
> under emacs -nw?

Unless Emacs can know somehow that the text comes from a clipboard, I
don't think you can.  But since it is you who pastes the text, you can
disable your "smart insertion" (e.g., with some keybinding) and then
reenable it again after pasting the clipboard text.




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

end of thread, other threads:[~2008-08-16  9:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-16  8:43 protect paste operations from key rebindings Dan Davison
2008-08-16  9:32 ` Eli Zaretskii

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.