From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Tak Ota Newsgroups: gmane.emacs.devel Subject: Re: Unicode support for the MS Windows clipboard [new patch] Date: Mon, 15 Nov 2004 13:41:41 -0800 (PST) Organization: Sony Electronics Inc. Message-ID: <20041115.134141.01367685.Takaaki.Ota@am.sony.com> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1100554978 24508 80.91.229.6 (15 Nov 2004 21:42:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 15 Nov 2004 21:42:58 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 15 22:42:44 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CTocV-0002Xa-00 for ; Mon, 15 Nov 2004 22:42:44 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CTolE-0000u3-C0 for ged-emacs-devel@m.gmane.org; Mon, 15 Nov 2004 16:51:44 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1CTokc-0000XB-BE for emacs-devel@gnu.org; Mon, 15 Nov 2004 16:51:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1CTokb-0000VM-9h for emacs-devel@gnu.org; Mon, 15 Nov 2004 16:51:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1CToka-0000Ue-Uu for emacs-devel@gnu.org; Mon, 15 Nov 2004 16:51:04 -0500 Original-Received: from [160.33.82.68] (helo=mail1.fw-sj.sony.com) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1CTobh-0004O3-Bq for emacs-devel@gnu.org; Mon, 15 Nov 2004 16:41:53 -0500 Original-Received: from mail3.sjc.in.sel.sony.com (mail3.sjc.in.sel.sony.com [43.134.1.211]) by mail1.fw-sj.sony.com (8.12.11/8.12.11) with ESMTP id iAFLfhmf027826; Mon, 15 Nov 2004 21:41:43 GMT Original-Received: from localhost ([43.191.18.96]) by mail3.sjc.in.sel.sony.com (8.12.11/8.12.11) with ESMTP id iAFLfhci016104; Mon, 15 Nov 2004 21:41:43 GMT Original-To: Benjamin.Riefenstahl@epost.de In-Reply-To: X-Telephone: +1-858-942-3239 X-Fax------: +1-858-942-9142 X-SnailMail: 16450 West Bernardo Drive MZ7205, San Diego, CA 92127-1804 X-Mailer: Mew-4.1.50 on Emacs-21.3.50.1 (i386-mingw-nt5.1.2600) of 2004-11-11 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:29889 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:29889 Benny, While using emacs for some time (days) the clipboard operation becomes unavailable and the following error messages appear in the message buffer. Copying from emacs and pasting in another application: "Error in delayed clipboard rendering: Text is read-only" Yanking from clipboard into emacs: "w32-get-clipboard-data:(text-read-only)" After restarting the emacs the problem is gone for a while then it comes back in later time. Is there a possibility of leaking memory handles? -Tak Mon, 08 Nov 2004 18:24:44 +0100: Benjamin Riefenstahl wrote: > Hi all, > > > Now that my papers are in order (;-)), here is a new version of the > much discussed patch to support the Unicode clipboard on Windows > (attached). > > Notes: > > - I didn't provide user-level documentation except a short mention in > etc/NEWS. The defaults should work fine and there should be less > need to customize this than on X11. > > - There is a short discussion of the use of the customization in > comments in the code. Something similar may be usefull in the ELisp > manual, probably in "Window System Selections." > > > benny > > > 2004-11-08 Benjamin Riefenstahl > > * w32select.c: Summary: Thorough rework to implement Unicode > clipboard operations and delayed rendering. > > Drop last_clipboard_text and related code, keep track of > ownership via clipboard_owner instead. Drop old #if0 > sections. > > (DEFAULT_LCID, ANSICP, OEMCP, QUNICODE, QANSICP, QOEMCP) > (clipboard_owner, modifying_clipboard, cfg_coding_system) > (cfg_codepage, cfg_lcid, cfg_clipboard_type, current_text) > (current_coding_system, current_requires_encoding) > (current_num_nls, current_clipboard_type, current_lcid): New > static variables. > > (convert_to_handle_as_ascii, convert_to_handle_as_coded) > (render, render_all, run_protected, lisp_error_handler) > (owner_callback, create_owner, setup_config) > (enum_locale_callback, cp_from_locale, coding_from_cp): New > local functions. > > (term_w32select, globals_of_w32select): New global functions. > > (Fw32_set_clipboard_data): Ignore parameter FRAME, use > clipboard_owner instead. Use delayed rendering and provide > all text formats. Provide CF_LOCALE if necessary. > > (Fw32_get_clipboard_data): Handle CF_UNICODETEXT and > CF_LOCALE. Fall back to CF_TEXT, if CF_UNICODETEXT is not > available. Force DOS line-ends for decoding. > > (Fx_selection_exists_p): Handle CF_UNICODETEXT. > > (syms_of_w32select): Init and register new variables. > > * w32.h: Add prototypes for globals_of_w32select and > term_w32select. Make the neighboring K&R declarations into > prototypes, too. > > * emacs.c: Include w32.h to get function prototypes. > (main): Call globals_of_w32select. > > * w32.c (term_ntproc): Call term_w32select. > > * mule-cmds.el (set-locale-environment): Remove call to > set-selection-coding-system on Windows. > > * s/ms-w32.h: Guard MSC-specific #pragmas with an #ifdef. > > >