Subject: Re: bug#12183: 24.1.50; Unrecognized pasteboard formats quit yank in Emacs.app
From: Jan Djärv <[email-masked]>
To: Jason T. Miller <[email-masked]>
Cc: [email-masked]
Date: Sat, 8 Sep 2012 16:48:30 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello.

11 aug 2012 kl. 22:02 skrev Jason T. Miller <[email-masked]>:

> 1. Start Emacs.app in OS X (or, presumably, GNUstep). On OS X,
>    $PATH_TO_EMACS_APP/Contents/MacOS/Emacs -Q
> is fine.
> 
> 2. Load something in the pasteboard that lacks a plain text representation*.
> 
> 3. Yank. Emacs aborts the yank with the quit message "empty or unsupported
> pasteboard type".
> 
> From my perspective at least, this behavior is never useful, frequently annoying,
> and particularly painful when `save-interprogram-paste-before-kill' is enabled.
> My preferred solution is for Emacs to simply ignore unsupported pasteboard data.
> For example, replacing
> 
>    (defun ns-get-pasteboard ()
>      "Returns the value of the pasteboard."
>      (ns-get-selection-internal 'CLIPBOARD))
> 
> with
> 
>    (defun ns-get-pasteboard ()
>      "Returns the value of the pasteboard, or nil for unsupported formats."
>     (condition-case nil
>         (ns-get-selection-internal 'CLIPBOARD)
>       (quit nil)))
> 
> has this effect, while retaining the old behavior in the Objective-C
> implementation for applications that require special handling for empty,
> unrecognized, and invalid pasteboard data.

I checked in your suggestion in to the trunk.  Emacs beeps too much, I don't think it should beep when scrolling hits top or bottom for example.

Thanks,

	Jan D.