unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X
@ 2013-10-16  7:11 Sebastian Wiesner
  2013-10-16 16:56 ` Jan Djärv
  0 siblings, 1 reply; 3+ messages in thread
From: Sebastian Wiesner @ 2013-10-16  7:11 UTC (permalink / raw)
  To: 15628


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)
  #<subr call-interactively>(kill-ring-save nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> kill-ring-save nil nil)
  apply(ad-Advice-call-interactively #<subr 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.





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

* bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X
  2013-10-16  7:11 bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X Sebastian Wiesner
@ 2013-10-16 16:56 ` Jan Djärv
  2013-10-20 12:03   ` Sebastian Wiesner
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Djärv @ 2013-10-16 16:56 UTC (permalink / raw)
  To: Sebastian Wiesner; +Cc: 15628-done

Hello.

I've removed the FQuit in trunk.

	Jan D.

16 okt 2013 kl. 09:11 skrev Sebastian Wiesner <lunaryorn@gmail.com>:

> 
> 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)
>  #<subr call-interactively>(kill-ring-save nil nil)
>  ad-Advice-call-interactively(#<subr call-interactively> kill-ring-save nil nil)
>  apply(ad-Advice-call-interactively #<subr 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.
> 
> 






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

* bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X
  2013-10-16 16:56 ` Jan Djärv
@ 2013-10-20 12:03   ` Sebastian Wiesner
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Wiesner @ 2013-10-20 12:03 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 15628-done

2013/10/16 Jan Djärv <jan.h.d@swipnet.se>:
> Hello.
>
> I've removed the FQuit in trunk.

Great, thank you!

>         Jan D.
>
> 16 okt 2013 kl. 09:11 skrev Sebastian Wiesner <lunaryorn@gmail.com>:
>
>>
>> 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)
>>  #<subr call-interactively>(kill-ring-save nil nil)
>>  ad-Advice-call-interactively(#<subr call-interactively> kill-ring-save nil nil)
>>  apply(ad-Advice-call-interactively #<subr 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.
>>
>>
>





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

end of thread, other threads:[~2013-10-20 12:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-16  7:11 bug#15628: 24.3.50; ns-get-selection-internal quits on unsupported pasteboard content on OS X Sebastian Wiesner
2013-10-16 16:56 ` Jan Djärv
2013-10-20 12:03   ` Sebastian Wiesner

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).