delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/02/25/04:33:41

Date: Thu, 25 Feb 1999 11:27:50 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Martin Str|mberg <ams AT ludd DOT luth DOT se>
cc: DJGPP <djgpp AT delorie DOT com>
Subject: Re: emacs hangs my machine
In-Reply-To: <199902242251.XAA21024@father.ludd.luth.se>
Message-ID: <Pine.SUN.3.91.990225112521.2772Q-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com

On Wed, 24 Feb 1999, Martin Str|mberg wrote:

> I can easily install the emacs source. Please send me the patch, and
> I'll try to make it.

Attached.  Apply it from the top Emacs directory (%DJDIR%/gnu/emacs)
with the following command:

     patch -p0 -b -V numbered < patch-file

> Additionally, I don't think I need clipboard support; I even didn't
> know it was there!

When you yank (aka paste) text with C-y, Emacs first checks the
clipboard, and if there's some text there, it yanks it before any text
you have on your Emacs kill ring.  When you kill text, it is put into
the clipboard.  Setting x-select-enable-clipboard to nil disables both
of these features.

> I'm not sure I understand why you haven't updated the emacs package on
> simtel.

Two reasons: (1) nobody complained, until now (I guess kills larger
than 600K aren't all that frequent); and (2) too many other things on
my agenda ;-).  I didn't even remember I haven't put this bugfix into
v19.34, since the bug was discovered in v20 before the last upload of
19.34.

> Anyhow, how about if I succeed to make emacs, I send it to you
> (only the emacs.exe) and you put it into the emacs package?

Producing the binary is the least problem when preparing an upload.  
There's much more to it than just saying "make install".  But thanks
for the offer, anyway.

-------------------------------------------------------------------
*** src/w16select.c~1	Wed Mar 19 17:21:38 1997
--- src/w16select.c	Thu Feb 25 10:11:34 1999
*************** alloc_xfer_buf (want_size)
*** 169,174 ****
--- 169,179 ----
    if (want_size <= _go32_info_block.size_of_transfer_buffer)
      return __tb & 0xfffff;
  
+   /* Don't even try to allocate more than 1MB of memory: DOS cannot
+      possibly handle that (it will overflow the BX register below).  */
+   if (want_size > 0xfffff)
+     return 0;
+ 
    /* Need size rounded up to the nearest paragraph, and in
       paragraph units (1 paragraph = 16 bytes).  */
    clipboard_xfer_buf_info.size = (want_size + 15) >> 4;
*************** set_clipboard_data (Format, Data, Size)
*** 221,231 ****
    unsigned long xbuf_addr, buf_offset;
    unsigned char *dp = Data, *dstart = dp;
  
!   if (Format != CF_TEXT)
      return 0;
  
    /* need to know final size after '\r' chars are inserted (the
!      standard CF_TEXT clipboard format uses CRLF line endings,
       while Emacs uses just LF internally).  */
    truelen = Size;
    /* avoid using strchr because it recomputes the length everytime */
--- 226,236 ----
    unsigned long xbuf_addr, buf_offset;
    unsigned char *dp = Data, *dstart = dp;
  
!   if (Format != CF_OEMTEXT)
      return 0;
  
    /* need to know final size after '\r' chars are inserted (the
!      standard CF_OEMTEXT clipboard format uses CRLF line endings,
       while Emacs uses just LF internally).  */
    truelen = Size;
    /* avoid using strchr because it recomputes the length everytime */
*************** get_clipboard_data (Format, Data, Size)
*** 304,310 ****
    unsigned long xbuf_addr;
    unsigned char *dp = Data;
  
!   if (Format != CF_TEXT)
      return 0;
  
    if (Size == 0)
--- 309,315 ----
    unsigned long xbuf_addr;
    unsigned char *dp = Data;
  
!   if (Format != CF_OEMTEXT)
      return 0;
  
    if (Size == 0)
*************** DEFUN ("win16-set-clipboard-data", Fwin1
*** 415,430 ****
    if (!open_clipboard ())
      goto error;
    
!   ok = empty_clipboard () && (ok1 = set_clipboard_data (CF_TEXT, src, nbytes));
    
    close_clipboard ();
    
!   if (ok) goto done;
  
   error:
    
    ok = 0;
  
    /* Notify user if the text is too large to fit into DOS memory.
       (This will happen somewhere after 600K bytes (470K in DJGPP v1.x),
       depending on user system configuration.)  If we just silently
--- 420,438 ----
    if (!open_clipboard ())
      goto error;
    
!   ok = empty_clipboard () && (ok1 = set_clipboard_data (CF_OEMTEXT, src, nbytes));
    
    close_clipboard ();
    
!   if (ok) goto unblock;
  
   error:
    
    ok = 0;
  
+  unblock:
+   UNBLOCK_INPUT;
+ 
    /* Notify user if the text is too large to fit into DOS memory.
       (This will happen somewhere after 600K bytes (470K in DJGPP v1.x),
       depending on user system configuration.)  If we just silently
*************** DEFUN ("win16-set-clipboard-data", Fwin1
*** 437,444 ****
      }
    
   done:
-   UNBLOCK_INPUT;
- 
    return (ok ? string : Qnil);
  }
  
--- 445,450 ----
*************** DEFUN ("win16-get-clipboard-data", Fwin1
*** 464,479 ****
    BLOCK_INPUT;
    
    if (!open_clipboard ())
!     goto done;
  
!   if ((data_size = get_clipboard_data_size (CF_TEXT)) == 0 ||
        (htext = (unsigned char *)xmalloc (data_size)) == 0)
      goto closeclip;
  
    /* need to know final size after '\r' chars are removed because
       we can't change the string size manually, and doing an extra
       copy is silly */
!   if ((truelen = get_clipboard_data (CF_TEXT, htext, data_size)) == 0)
      goto closeclip;
  
    ret = make_string (htext, truelen);
--- 470,485 ----
    BLOCK_INPUT;
    
    if (!open_clipboard ())
!     goto unblock;
  
!   if ((data_size = get_clipboard_data_size (CF_OEMTEXT)) == 0 ||
        (htext = (unsigned char *)xmalloc (data_size)) == 0)
      goto closeclip;
  
    /* need to know final size after '\r' chars are removed because
       we can't change the string size manually, and doing an extra
       copy is silly */
!   if ((truelen = get_clipboard_data (CF_OEMTEXT, htext, data_size)) == 0)
      goto closeclip;
  
    ret = make_string (htext, truelen);
*************** DEFUN ("win16-get-clipboard-data", Fwin1
*** 482,490 ****
   closeclip:
    close_clipboard ();
    
!  done:
    UNBLOCK_INPUT;
    
    return (ret);
  }
  
--- 488,497 ----
   closeclip:
    close_clipboard ();
    
!  unblock:
    UNBLOCK_INPUT;
    
+  done:
    return (ret);
  }
  
*************** and t is the same as `SECONDARY'.")
*** 524,530 ****
  
        if (open_clipboard ())
  	{
! 	  if (get_clipboard_data_size (CF_TEXT))
  	    val = Qt;
  	  close_clipboard ();
  	}
--- 531,537 ----
  
        if (open_clipboard ())
  	{
! 	  if (get_clipboard_data_size (CF_OEMTEXT))
  	    val = Qt;
  	  close_clipboard ();
  	}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019