aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2002-10-14 11:02:07 +0000
committerJuanma Barranquero2002-10-14 11:02:07 +0000
commit41a48e45f57cfc1a27401c2b4442e5ac2653a54a (patch)
treed36cd1d878609b6e3e298890d33a8538407c16ea /src
parentb45b1e81c90a761eb088ec922c79bee528f19160 (diff)
downloademacs-41a48e45f57cfc1a27401c2b4442e5ac2653a54a.tar.gz
emacs-41a48e45f57cfc1a27401c2b4442e5ac2653a54a.zip
(syms_of_win32select): Fix docstring for `selection-coding-system'.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/w32select.c71
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 @@
12002-10-14 Juanma Barranquero <lektu@terra.es>
2
3 * w16select.c (syms_of_win16select): Fix docstring for
4 `selection-coding-system'.
5
6 * w32select.c (syms_of_w32select): Likewise.
7
12002-10-14 Stefan Monnier <monnier@cs.yale.edu> 82002-10-14 Stefan Monnier <monnier@cs.yale.edu>
2 9
3 * syntax.c (scan_lists): Don't get fooled by a symbol ending with 10 * 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 @@
1/* Selection processing for Emacs on the Microsoft W32 API. 1/* Selection processing for Emacs on the Microsoft W32 API.
2 Copyright (C) 1993, 1994 Free Software Foundation. 2 Copyright (C) 1993, 1994 Free Software Foundation.
3 3
4This file is part of GNU Emacs. 4This file is part of GNU Emacs.
5 5
6GNU Emacs is free software; you can redistribute it and/or modify 6GNU 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,
57 Lisp_Object frame; 57 Lisp_Object frame;
58{ 58{
59 BOOL ok = FALSE; 59 BOOL ok = FALSE;
60 60
61 if (!NILP (frame)) 61 if (!NILP (frame))
62 CHECK_LIVE_FRAME (frame); 62 CHECK_LIVE_FRAME (frame);
63 63
64 BLOCK_INPUT; 64 BLOCK_INPUT;
65 65
66 ok = OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL); 66 ok = OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL);
67 67
68 UNBLOCK_INPUT; 68 UNBLOCK_INPUT;
69 69
70 return (ok ? frame : Qnil); 70 return (ok ? frame : Qnil);
71} 71}
72 72
@@ -77,13 +77,13 @@ Assigns ownership of the clipboard to the window which opened it. */)
77 () 77 ()
78{ 78{
79 BOOL ok = FALSE; 79 BOOL ok = FALSE;
80 80
81 BLOCK_INPUT; 81 BLOCK_INPUT;
82 82
83 ok = EmptyClipboard (); 83 ok = EmptyClipboard ();
84 84
85 UNBLOCK_INPUT; 85 UNBLOCK_INPUT;
86 86
87 return (ok ? Qt : Qnil); 87 return (ok ? Qt : Qnil);
88} 88}
89 89
@@ -93,13 +93,13 @@ DEFUN ("w32-close-clipboard", Fw32_close_clipboard,
93 () 93 ()
94{ 94{
95 BOOL ok = FALSE; 95 BOOL ok = FALSE;
96 96
97 BLOCK_INPUT; 97 BLOCK_INPUT;
98 98
99 ok = CloseClipboard (); 99 ok = CloseClipboard ();
100 100
101 UNBLOCK_INPUT; 101 UNBLOCK_INPUT;
102 102
103 return (ok ? Qt : Qnil); 103 return (ok ? Qt : Qnil);
104} 104}
105 105
@@ -119,10 +119,10 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
119 unsigned char *dst; 119 unsigned char *dst;
120 120
121 CHECK_STRING (string); 121 CHECK_STRING (string);
122 122
123 if (!NILP (frame)) 123 if (!NILP (frame))
124 CHECK_LIVE_FRAME (frame); 124 CHECK_LIVE_FRAME (frame);
125 125
126 BLOCK_INPUT; 126 BLOCK_INPUT;
127 127
128 nbytes = SBYTES (string) + 1; 128 nbytes = SBYTES (string) + 1;
@@ -159,7 +159,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
159 159
160 if ((dst = (unsigned char *) GlobalLock (htext)) == NULL) 160 if ((dst = (unsigned char *) GlobalLock (htext)) == NULL)
161 goto error; 161 goto error;
162 162
163 /* convert to CRLF line endings expected by clipboard */ 163 /* convert to CRLF line endings expected by clipboard */
164 while (1) 164 while (1)
165 { 165 {
@@ -176,12 +176,12 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
176 next[-1] = '\r'; 176 next[-1] = '\r';
177 next[0] = '\n'; 177 next[0] = '\n';
178 dst = next + 1; 178 dst = next + 1;
179 } 179 }
180 else 180 else
181 /* copied remaining partial line -> now finished */ 181 /* copied remaining partial line -> now finished */
182 break; 182 break;
183 } 183 }
184 184
185 GlobalUnlock (htext); 185 GlobalUnlock (htext);
186 186
187 Vlast_coding_system_used = Qraw_text; 187 Vlast_coding_system_used = Qraw_text;
@@ -237,18 +237,18 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
237 if (htext2 != NULL) htext = htext2; 237 if (htext2 != NULL) htext = htext2;
238 } 238 }
239 } 239 }
240 240
241 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) 241 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL))
242 goto error; 242 goto error;
243 243
244 ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext); 244 ok = EmptyClipboard () && SetClipboardData (CF_TEXT, htext);
245 245
246 CloseClipboard (); 246 CloseClipboard ();
247 247
248 if (ok) goto done; 248 if (ok) goto done;
249 249
250 error: 250 error:
251 251
252 ok = FALSE; 252 ok = FALSE;
253 if (htext) GlobalFree (htext); 253 if (htext) GlobalFree (htext);
254 if (last_clipboard_text) 254 if (last_clipboard_text)
@@ -256,7 +256,7 @@ DEFUN ("w32-set-clipboard-data", Fw32_set_clipboard_data,
256 256
257 done: 257 done:
258 UNBLOCK_INPUT; 258 UNBLOCK_INPUT;
259 259
260 return (ok ? string : Qnil); 260 return (ok ? string : Qnil);
261} 261}
262 262
@@ -268,15 +268,15 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
268{ 268{
269 HANDLE htext; 269 HANDLE htext;
270 Lisp_Object ret = Qnil; 270 Lisp_Object ret = Qnil;
271 271
272 if (!NILP (frame)) 272 if (!NILP (frame))
273 CHECK_LIVE_FRAME (frame); 273 CHECK_LIVE_FRAME (frame);
274 274
275 BLOCK_INPUT; 275 BLOCK_INPUT;
276 276
277 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL)) 277 if (!OpenClipboard ((!NILP (frame) && FRAME_W32_P (XFRAME (frame))) ? FRAME_W32_WINDOW (XFRAME (frame)) : NULL))
278 goto done; 278 goto done;
279 279
280 if ((htext = GetClipboardData (CF_TEXT)) == NULL) 280 if ((htext = GetClipboardData (CF_TEXT)) == NULL)
281 goto closeclip; 281 goto closeclip;
282 282
@@ -286,10 +286,10 @@ DEFUN ("w32-get-clipboard-data", Fw32_get_clipboard_data,
286 int nbytes; 286 int nbytes;
287 int truelen; 287 int truelen;
288 int require_decoding = 0; 288 int require_decoding = 0;
289 289
290 if ((src = (unsigned char *) GlobalLock (htext)) == NULL) 290 if ((src = (unsigned char *) GlobalLock (htext)) == NULL)
291 goto closeclip; 291 goto closeclip;
292 292
293 nbytes = strlen (src); 293 nbytes = strlen (src);
294 294
295 /* If the text in clipboard is identical to what we put there 295 /* 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,
397 397
398 closeclip: 398 closeclip:
399 CloseClipboard (); 399 CloseClipboard ();
400 400
401 done: 401 done:
402 UNBLOCK_INPUT; 402 UNBLOCK_INPUT;
403 403
404 return (ret); 404 return (ret);
405} 405}
406 406
@@ -442,7 +442,7 @@ and t is the same as `SECONDARY'. */)
442 return Qnil; 442 return Qnil;
443} 443}
444 444
445void 445void
446syms_of_w32select () 446syms_of_w32select ()
447{ 447{
448#if 0 448#if 0
@@ -457,8 +457,9 @@ syms_of_w32select ()
457 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system, 457 DEFVAR_LISP ("selection-coding-system", &Vselection_coding_system,
458 doc: /* Coding system for communicating with other programs. 458 doc: /* Coding system for communicating with other programs.
459When sending or receiving text via cut_buffer, selection, and clipboard, 459When sending or receiving text via cut_buffer, selection, and clipboard,
460the text is encoded or decoded by this coding system. */); 460the text is encoded or decoded by this coding system.
461 Vselection_coding_system=intern ("iso-latin-1-dos"); 461The default value is `iso-latin-1-dos'. */);
462 Vselection_coding_system = intern ("iso-latin-1-dos");
462 463
463 DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system, 464 DEFVAR_LISP ("next-selection-coding-system", &Vnext_selection_coding_system,
464 doc: /* Coding system for the next communication with other programs. 465 doc: /* Coding system for the next communication with other programs.