Article View: comp.sources.bugs
Article #571jove 4.14 spell-buffer bugfix
From: Wietse Venema
Date: Mon, 31 Dec 1990 16:56
Date: Mon, 31 Dec 1990 16:56
42 lines
1632 bytes
1632 bytes
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]");
Technical Details
Message-ID:
<2234@wzv.win.tue.nl>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!uunet!mcsun!hp4nl!svin02!wzv!wietseShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!uunet!mcsun!hp4nl!svin02!wzv!wietse From: wietse@wzv.win.tue.nl (Wietse Venema) Newsgroups: comp.sources.bugs Subject: jove 4.14 spell-buffer bugfix Keywords: jove,spell Message-ID: <2234@wzv.win.tue.nl> Date: 31 Dec 90 16:56:41 GMT Organization: Eindhoven University of Technology, The Netherlands Lines: 42