aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2000-08-17 06:11:09 +0000
committerEli Zaretskii2000-08-17 06:11:09 +0000
commitaae41d97a4501836c911c61cec82bbb6cf955327 (patch)
tree6cbb71ecc0204e65c141adf5899c8203453ebb78 /src
parent357438ebe064605fbd5301ab2e04d27600a8ec0b (diff)
downloademacs-aae41d97a4501836c911c61cec82bbb6cf955327.tar.gz
emacs-aae41d97a4501836c911c61cec82bbb6cf955327.zip
(set_clipboard_data): If there's not enough memory
to put text into clipboard, return 1, as Fw16_set_clipboard_data expects. In case of other failures, return 3. (system_error_msg): New error message. (Fw16_set_clipboard_data): If set_clipboard_data returns 3, print system_error_msg.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog9
-rw-r--r--src/w16select.c15
2 files changed, 19 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 77f7ffc9498..a17b16c4e2d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,12 @@
12000-08-17 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * w16select.c (set_clipboard_data): If there's not enough memory
4 to put text into clipboard, return 1, as Fw16_set_clipboard_data
5 expects. In case of other failures, return 3.
6 (system_error_msg): New error message.
7 (Fw16_set_clipboard_data): If set_clipboard_data returns 3, print
8 system_error_msg.
9
12000-08-16 Gerd Moellmann <gerd@gnu.org> 102000-08-16 Gerd Moellmann <gerd@gnu.org>
2 11
3 * term.c (write_glyphs): Also turn off inverse video after turning 12 * term.c (write_glyphs): Also turn off inverse video after turning
diff --git a/src/w16select.c b/src/w16select.c
index dec1af7726b..df739a1356c 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -248,7 +248,7 @@ set_clipboard_data (Format, Data, Size, Raw)
248 unsigned char *dp = Data, *dstart = dp; 248 unsigned char *dp = Data, *dstart = dp;
249 249
250 if (Format != CF_OEMTEXT) 250 if (Format != CF_OEMTEXT)
251 return 0; 251 return 3;
252 252
253 /* need to know final size after '\r' chars are inserted (the 253 /* need to know final size after '\r' chars are inserted (the
254 standard CF_OEMTEXT clipboard format uses CRLF line endings, 254 standard CF_OEMTEXT clipboard format uses CRLF line endings,
@@ -266,10 +266,10 @@ set_clipboard_data (Format, Data, Size, Raw)
266 } 266 }
267 267
268 if (clipboard_compact (truelen) < truelen) 268 if (clipboard_compact (truelen) < truelen)
269 return 0; 269 return 1;
270 270
271 if ((xbuf_addr = alloc_xfer_buf (truelen)) == 0) 271 if ((xbuf_addr = alloc_xfer_buf (truelen)) == 0)
272 return 0; 272 return 1;
273 273
274 /* Move the buffer into the low memory, convert LF into CR-LF if needed. */ 274 /* Move the buffer into the low memory, convert LF into CR-LF if needed. */
275 if (Raw) 275 if (Raw)
@@ -333,8 +333,8 @@ set_clipboard_data (Format, Data, Size, Raw)
333 if (regs.x.ax == 0) 333 if (regs.x.ax == 0)
334 *last_clipboard_text = '\0'; 334 *last_clipboard_text = '\0';
335 335
336 /* Zero means success, otherwise (1 or 2) it's an error. */ 336 /* Zero means success, otherwise (1, 2, or 3) it's an error. */
337 return regs.x.ax > 0 ? 0 : 1; 337 return regs.x.ax > 0 ? 0 : 3;
338} 338}
339 339
340/* Return the size of the clipboard data of format FORMAT. */ 340/* Return the size of the clipboard data of format FORMAT. */
@@ -477,6 +477,8 @@ static char no_mem_msg[] =
477 "(Not enough DOS memory to put saved text into clipboard.)"; 477 "(Not enough DOS memory to put saved text into clipboard.)";
478static char binary_msg[] = 478static char binary_msg[] =
479 "(Binary characters in saved text; clipboard data not set.)"; 479 "(Binary characters in saved text; clipboard data not set.)";
480static char system_error_msg[] =
481 "(Clipboard interface failure; clipboard data not set.)";
480 482
481DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_data, 1, 2, 0, 483DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_data, 1, 2, 0,
482 "This sets the clipboard data to the given text.") 484 "This sets the clipboard data to the given text.")
@@ -577,6 +579,9 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
577 case 2: 579 case 2:
578 message2 (binary_msg, sizeof (binary_msg) - 1, 0); 580 message2 (binary_msg, sizeof (binary_msg) - 1, 0);
579 break; 581 break;
582 case 3:
583 message2 (system_error_msg, sizeof (system_error_msg) - 1, 0);
584 break;
580 } 585 }
581 sit_for (2, 0, 0, 1, 1); 586 sit_for (2, 0, 0, 1, 1);
582 } 587 }