From wietse@wzv.win.tue.nl Mon Dec 31 19:30:18 1990
Received: from svin01 (svin01.win.tue.nl) by svbs01.bs.win.tue.nl (4.1/1.45)
    id AA22781; Mon, 31 Dec 90 19:30:17 +0100
Received: from svin02.info.win.tue.nl by svin01 (4.1/1.45)
    id AA08033; Mon, 31 Dec 90 19:30:32 +0100
Received: from wzv.win.tue.nl by svin02.info.win.tue.nl (4.1/1.45)
    id AA16486; Mon, 31 Dec 90 19:29:43 +0100
Received: by wzv.win.tue.nl (4.1/1.45)
    id AA20803; Mon, 31 Dec 90 18:00:18 +0100
Date: Mon, 31 Dec 90 18:00:18 +0100
From: wietse@wzv.win.tue.nl (Wietse Venema)
Message-Id: <9012311700.AA20803@wzv.win.tue.nl>
To: wswietse@win.tue.nl
Subject: jove 4.14 bugfix
Status: RO

Problem:
	The Jove 4.14 `spell-buffer' command produces weird results when
	the current buffer is not associated with a file.

Repeat-by:

	Do a `C-X ! some-shell-command', then invoke the spell command
	on the resulting buffer. 

Analysis:

	If the current buffer has no file name, SpelBuffer() passes the
	command `spell (null)' to the shell. 

Workaround:

	Apply the patch below. If the current buffer has no file name,
	SpelBuffer now forces put_bufs() to ask for a file name and to
	write the current buffer to file (even if it was not modified).  

		Wietse Venema
		Eindhoven University of Technology
		The Netherlands

*** proc.c-	Fri Jul 28 05:41:14 1989
--- proc.c	Mon Dec 31 17:41:32 1990
***************
*** 401,407 ****
--- 401,413 ----
  		com[100];
  	Window	*savewp = curwind;
  
+ 	if (curbuf->b_fname == 0) {
+ 		curbuf->b_type = B_FILE;	/* buffer needs file name */
+ 		curbuf->b_modified = YES;	/* buffer needs to be saved */
+ 	}
  	put_bufs(0);
+ 	if (curbuf->b_fname == 0)
+ 		return;
  	swritef(com, "spell %s", curbuf->b_fname);
  	(void) UnixToBuf(Spell, YES, EWSize, YES, Shell, ShFlags, com, (char *) 0);
  	message("[Delete the irrelevant words and then type C-X C-C]");

