From 41a48e45f57cfc1a27401c2b4442e5ac2653a54a Mon Sep 17 00:00:00 2001 From: Juanma Barranquero Date: Mon, 14 Oct 2002 11:02:07 +0000 Subject: [PATCH] (syms_of_win32select): Fix docstring for `selection-coding-system'. --- src/ChangeLog | 7 +++++ src/w32select.c | 71 +++++++++++++++++++++++++------------------------ 2 files changed, 43 insertions(+), 35 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 40b8d3748f7..082ef6e2f69 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2002-10-14 Juanma Barranquero + + * w16select.c (syms_of_win16select): Fix docstring for + `selection-coding-system'. + + * w32select.c (syms_of_w32select): Likewise. + 2002-10-14 Stefan Monnier * syntax.c (scan_lists): Don't get fooled by a symbol ending with diff --git a/src/w32select.c b/src/w32select.c index fc5aab52b04..77f2aea6df7 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -1,6 +1,6 @@ /* Selection processing for Emacs on the Microsoft W32 API. Copyright (C) 1993, 1994 Free Software Foundation. - + This file is part of GNU Emacs. GNU Emacs is free software; you can redistribute it and/or modify @@ -57,16 +57,16 @@ DEFUN ("w32-open-clipboard", Fw32_open_clipboard, Sw32_open_clipboard, 0, 1, 0, Lisp_Object frame; { BOOL ok = FALSE; - + if (!NILP (frame)) CHECK_LIVE_FRAME (frame); - + BLOCK_INPUT; - + ok = OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL); - + UNBLOCK_INPUT; - + return (ok ? frame : Qnil); } @@ -77,13 +77,13 @@ Assigns ownership of the clipboard to the window which opened it. */) () { BOOL ok = FALSE; - + BLOCK_INPUT; - + ok = EmptyClipboard (); - + UNBLOCK_INPUT; - + return (ok ? Qt : Qnil); } @@ -93,13 +93,13 @@ DEFUN ("w32-close-clipboard", Fw32_close_clipboard, () { BOOL ok = FALSE; - + BLOCK_INPUT; - + ok = CloseClipboard (); - + UNBLOCK_INPUT; - + return (ok ? Qt : Qnil); } @@ -119,10 +119,10 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, unsigned char *dst; CHECK_STRING (string); - + if (!NILP (frame)) CHECK_LIVE_FRAME (frame); - + BLOCK_INPUT; nbytes = SBYTES (string) + 1; @@ -159,7 +159,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, if ((dst = (unsigned char *) GlobalLock (htext)) == NULL) goto error; - + /* convert to CRLF line endings expected by clipboard */ while (1) { @@ -176,12 +176,12 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, next[-1] = '\r'; next[0] = '\n'; dst = next + 1; - } + } else /* copied remaining partial line -> now finished */ break; } - + GlobalUnlock (htext); Vlast_coding_system_used = Qraw_text; @@ -237,18 +237,18 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, if (htext2 != NULL) htext = htext2; } } - + if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) goto error; ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext); - + CloseClipboard (); - + if (ok) goto done; error: - + ok = FALSE; if (htext) GlobalFree (htext); if (last_clipboard_text) @@ -256,7 +256,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data, done: UNBLOCK_INPUT; - + return (ok ? string : Qnil); } @@ -268,15 +268,15 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, { HANDLE htext; Lisp_Object ret = Qnil; - + if (!NILP (frame)) CHECK_LIVE_FRAME (frame); - + BLOCK_INPUT; - + if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) goto done; - + if ((htext = GetClipboardData (CF_TEXT)) == NULL) goto closeclip; @@ -286,10 +286,10 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, int nbytes; int truelen; int require_decoding = 0; - + if ((src = (unsigned char *) GlobalLock (htext)) == NULL) goto closeclip; - + nbytes = strlen (src); /* If the text in clipboard is identical to what we put there @@ -397,10 +397,10 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data, closeclip: CloseClipboard (); - + done: UNBLOCK_INPUT; - + return (ret); } @@ -442,7 +442,7 @@ and t is the same as `SECONDARY'. */) return Qnil; } -void +void syms_of_w32select () { #if 0 @@ -457,8 +457,9 @@ syms_of_w32select () DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, doc: /* Coding system for communicating with other programs. When sending or receiving text via cut_buffer, selection, and clipboard, -the text is encoded or decoded by this coding system. */); - Vselection_coding_system=intern ("iso-latin-1-dos"); +the text is encoded or decoded by this coding system. +The default value is `iso-latin-1-dos'. */); + Vselection_coding_system = intern ("iso-latin-1-dos"); DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, doc: /* Coding system for the next communication with other programs. -- 2.39.2