Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running GNU Emacs 21.4.1 on a (remote) remote Linux ((CentOS) box, using my MacBook as the X-server. Works fine, unless I try to delete a word, line, or region. Then it locks up for 30 seconds or so. It sounds like a minor thing, but you realize how often you do a delete when you have to stop for 30 seconds every time.

My theory is that Emacs is trying to put the text in the X-server cut-and-paste buffer, which is trying to put it in the OSX cut-and-paste buffer and somewhere along the way, the process is blocked until it times out. (My only evidence for this theory is (a) copy-region behaves the same way and (b) deleted text doesn't show up in the buffer.)

Any suggestions appreciated.


 (setq interprogram-cut-function nil)

fixed me right up. Which makes perfect sense. Thanks, Trey.

share|improve this question

migrated from Jan 11 '11 at 7:43

This question came from our site for professional and enthusiast programmers.

I have occasionally had the same problem on my Linux box (using Gnome), and haven't tracked down the ultimate cause. However, toggling the cut/paste behavior often clears it up. I've written these two utilities that I run when the problem crops up. You may find them useful:

(defun xor (a b)
  (or (and a (not b)) (and (not a) b)))

(defun reset-cut ()
  "toggle the intprogram cut function to avoid odd x hangup"
  (message "Cut is %s" (setq interprogram-cut-function (xor interprogram-cut-function 'x-select-text))))

(defun reset-paste ()
  "toggle the intprogram paste function to avoid odd x hangup"
  (message "Paste is %s" (setq interprogram-paste-function (xor interprogram-paste-function 'x-cut-buffer-or-selection-value))))
share|improve this answer
No xor function for me. Setting interprogram-cut-function to 'x-select-text` doesn't seem to help. – Malvolio Jan 10 '11 at 22:56
@Malvolio I updated the answer to provide xor, and you might need to leave the cut-function as nil for a while. – Trey Jackson Jan 10 '11 at 23:00
Setting the cut-function to nil did it. – Malvolio Jan 10 '11 at 23:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .