From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Sebastian Wiesner Newsgroups: gmane.emacs.bugs Subject: bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X Date: Wed, 16 Oct 2013 09:11:38 +0200 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381907603 1904 80.91.229.3 (16 Oct 2013 07:13:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 16 Oct 2013 07:13:23 +0000 (UTC) To: 15628@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Oct 16 09:13:26 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1VWLIK-0006cV-EI for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 09:13:24 +0200 Original-Received: from localhost ([::1]:45656 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLIJ-0005th-Ua for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 Oct 2013 03:13:23 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35726) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLI8-0005rf-8V for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:13:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWLHz-0001xO-RI for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:13:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:39549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLHz-0001xH-NW for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:13:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VWLHy-0000B6-Mz for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:13:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Sebastian Wiesner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 16 Oct 2013 07:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 15628 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.1381907538629 (code B ref -1); Wed, 16 Oct 2013 07:13:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 16 Oct 2013 07:12:18 +0000 Original-Received: from localhost ([127.0.0.1]:53567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWLHE-0000A4-VN for submit@debbugs.gnu.org; Wed, 16 Oct 2013 03:12:17 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:33896) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VWLHB-00009q-4h for submit@debbugs.gnu.org; Wed, 16 Oct 2013 03:12:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWLGx-0001rC-JP for submit@debbugs.gnu.org; Wed, 16 Oct 2013 03:12:07 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:57253) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLGx-0001r6-Gu for submit@debbugs.gnu.org; Wed, 16 Oct 2013 03:11:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLGo-0005Ym-W6 for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:11:59 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VWLGg-0001ok-EQ for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:11:50 -0400 Original-Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:55347) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VWLGg-0001ob-7K for bug-gnu-emacs@gnu.org; Wed, 16 Oct 2013 03:11:42 -0400 Original-Received: by mail-ea0-f174.google.com with SMTP id z15so140705ead.33 for ; Wed, 16 Oct 2013 00:11:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:mime-version:content-type; bh=1/Yikqi0eEuJZDERneQPAk07D6oOiqkGEudJzJthT2Y=; b=paUUpFn4IGh9J6UZMQBZTyZYGCcFrpdYdJ1LezG8+BEKLNShHBbKVLSJ7HxVmrVQ7M d0lfOk/V/d0IwAWw+htsEBtTd7wo3SvlhGYmN0y0WrpOaJI1phYY6SgrmzAE03JkVBSG 8HNoVGP/hgVDU0SDcZDB2DAiikVJEC9m2SCKxzxEuk6vL6nXi2gd6/0QcFfPiFXgNO79 Du4ghVjBlzqhv36AKFmEFLKbH8HkwLWqtPeQt7iSSmL9c7pC7qK333RpbdCby3MOqi1Z vh8McFSpjCNgeAHkG/auVE0SEUE5hUfuISsx9xDc8wyH+a8SWD3g93FrWNNSnv68zfnM L88Q== X-Received: by 10.15.99.205 with SMTP id bl53mr67988eeb.82.1381907501279; Wed, 16 Oct 2013 00:11:41 -0700 (PDT) Original-Received: from lunaryorn-air.fritz.box (mnch-4d047401.pool.mediaWays.net. [77.4.116.1]) by mx.google.com with ESMTPSA id m54sm175996717eex.2.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 16 Oct 2013 00:11:40 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:79307 Archived-At: On OS X 10.8, "ns-get-selection-internal" calls quit on unsupported pasteboard content, such as images. This behaviour breaks all yanking and killing. The quit signal interrupts "kill-new" and "current-kill" while these functions try to retrieve the pasteboard content via "ns-get-pasteboard" (called by "x-selection-value", which is the default "interprogram-paste-function" on OS X), which internally calls "ns-get-selection-internal". Hence, "kill-new" fails to save the given kill to the kill ring, and "current-kill" fails to pop the latest kill from the kill ring. To reproduce, start Emacs, set "save-interprogram-paste-before-kill" to t, copy an image (e.g. from an iPhoto Library), and then try to yank or kill. For the latter, the following stacktrace is given with "debug-on-quit": Debugger entered--Lisp error: (quit "empty or unsupported pasteboard type") ns-get-selection-internal(CLIPBOARD) ns-get-pasteboard() x-selection-value() kill-new(#("elisp-slime-nav" 0 15 (fontified t face font-lock-constant-face))) copy-region-as-kill(39166 39181) kill-ring-save(39166 39181) #(kill-ring-save nil nil) ad-Advice-call-interactively(# kill-ring-save nil nil) apply(ad-Advice-call-interactively # (kill-ring-save nil nil)) call-interactively(kill-ring-save nil nil) command-execute(kill-ring-save) This unfortunate interaction makes "save-interprogram-paste-before-kill" nearly useless on OS X, because the user always needs to inspect the pasteboard manually and remove content unsupported by Emacs before being able to reliably kill and yank. I think "ns-get-selection-interal" should simply ignore unknown pasteboard content, or at least respect a user option to ignore unknown pasteboard content. This unknown content is of no use to Emacs anyway, so there is no point in even trying to put it onto the kill ring.