aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog75
-rw-r--r--src/buffer.c3
-rw-r--r--src/ccl.c1
-rw-r--r--src/emacs.c2
-rw-r--r--src/fileio.c1
-rw-r--r--src/fns.c2
-rw-r--r--src/image.c109
-rw-r--r--src/lread.c37
-rw-r--r--src/minibuf.c22
-rw-r--r--src/search.c4
-rw-r--r--src/syssignal.h5
-rw-r--r--src/term.c6
-rw-r--r--src/unexelf.c14
-rw-r--r--src/window.c1
-rw-r--r--src/xterm.c1
15 files changed, 236 insertions, 47 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 61b658b6b88..213e7762485 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,76 @@
12005-10-21 Richard M. Stallman <rms@gnu.org>
2
3 * lread.c (Fload): Simplify gcpro structure.
4 Gcpro FOUND as well as FILE, but not EFOUND.
5 Unless preloading, record FOUND instead of FILE in Vload_history.
6 Rename repeat local FILE to MSG_FILE.
7 (syms_of_lread) <load-history>: Doc fix.
8
92005-10-21 Kenichi Handa <handa@m17n.org>
10
11 * search.c (boyer_moore): Surround the '||' part of expression in
12 `if' condition by parentheses explicitly.
13
142005-10-20 Kim F. Storm <storm@cua.dk>
15
16 * buffer.c (clone_per_buffer_values): Remove unused var tem.
17 (init_buffer): Remove unused vars dotstat, pwdstat.
18
19 * ccl.c (check_ccl_update): Remove unused var vp.
20
21 * fileio.c (auto_save_error): Call SAFE_FREE.
22
23 * fns.c (Fchar_table_range): Remove unused var i.
24
25 * minibuf.c (display_completion_list_1): New wrapper function
26 for Fdisplay_completion_list.
27 (Fminibuffer_completion_help): Use it.
28
29 * term.c (encode_terminal_code): Remove unused var src_start.
30
31 * window.c (Fwindow_tree): Remove unused var alist.
32
33 * xterm.c (x_calc_absolute_position): Remove unused vars win_x, win_y.
34
352005-10-20 Aubrey Jaffer <agj@alum.mit.edu> (tiny change)
36
37 * unexelf.c (unexec): Fix calls to `fatal' with less than 3
38 arguments.
39
402005-10-20 Olli Savia <ops@iki.fi> (tiny change)
41
42 * syssignal.h [__Lynx__]: Undef SIGPOLL along with SIGIO.
43
442005-10-20 Andreas Schwab <schwab@suse.de>
45
46 * minibuf.c (Fdisplay_completion_list): Doc fix.
47
482005-10-19 Kim F. Storm <storm@cua.dk>
49
50 * image.c (check_image_size): Handle integer Vmax_image_size value
51 directly as max pixel value. Use default frame size for null frame.
52 (syms_of_image) <max-image-size>: Describe integer value.
53
542005-10-19 Romain Francoise <romain@orebokech.com>
55
56 * emacs.c (main): Update copyright year.
57
582005-10-18 Chong Yidong <cyd@stupidchicken.com>
59
60 * image.c (Vmax_image_size): New variable.
61 (check_image_size): New function.
62 (xbm_read_bitmap_data, pbm_load, png_load, jpeg_load, tiff_load)
63 (gif_load, gs_load): Use it.
64 (lookup_image): Try loading again if previous load failed.
65 (xbm_read_bitmap_data): Add a new argument, a pointer to the frame
66 to display in, NULL if none.
67 (xbm_load_image, xbm_file_p): Pass xbm_read_bitmap_data the new
68 argument.
69
702005-10-18 Richard M. Stallman <rms@gnu.org>
71
72 * search.c (Fstring_match): Doc fix.
73
12005-10-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 742005-10-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 75
3 * macterm.c (note_mouse_movement): Use PtInRect. 76 * macterm.c (note_mouse_movement): Use PtInRect.
@@ -8,7 +81,7 @@
82005-10-16 Masatake YAMATO <jet@gyve.org> 812005-10-16 Masatake YAMATO <jet@gyve.org>
9 82
10 * minibuf.c (Fdisplay_completion_list): Add new optional 83 * minibuf.c (Fdisplay_completion_list): Add new optional
11 argument COMMON_SUBSTRING. Bind `completion-common-substring' 84 argument COMMON_SUBSTRING. Bind `completion-common-substring'
12 to the optional argument during running `completion-setup-hook'. 85 to the optional argument during running `completion-setup-hook'.
13 86
142005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 872005-10-16 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
diff --git a/src/buffer.c b/src/buffer.c
index c173136961e..5e304d5a1bb 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -485,7 +485,7 @@ static void
485clone_per_buffer_values (from, to) 485clone_per_buffer_values (from, to)
486 struct buffer *from, *to; 486 struct buffer *from, *to;
487{ 487{
488 Lisp_Object to_buffer, tem; 488 Lisp_Object to_buffer;
489 int offset; 489 int offset;
490 490
491 XSETBUFFER (to_buffer, to); 491 XSETBUFFER (to_buffer, to);
@@ -5112,7 +5112,6 @@ void
5112init_buffer () 5112init_buffer ()
5113{ 5113{
5114 char *pwd; 5114 char *pwd;
5115 struct stat dotstat, pwdstat;
5116 Lisp_Object temp; 5115 Lisp_Object temp;
5117 int len; 5116 int len;
5118 5117
diff --git a/src/ccl.c b/src/ccl.c
index 562215218bc..a5a39ca0d4b 100644
--- a/src/ccl.c
+++ b/src/ccl.c
@@ -2119,7 +2119,6 @@ int
2119check_ccl_update (ccl) 2119check_ccl_update (ccl)
2120 struct ccl_program *ccl; 2120 struct ccl_program *ccl;
2121{ 2121{
2122 struct Lisp_Vector *vp;
2123 Lisp_Object slot, ccl_prog; 2122 Lisp_Object slot, ccl_prog;
2124 2123
2125 if (ccl->idx < 0) 2124 if (ccl->idx < 0)
diff --git a/src/emacs.c b/src/emacs.c
index 9ada521f1e3..33941ae9227 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -897,7 +897,7 @@ main (argc, argv
897 else 897 else
898 { 898 {
899 printf ("GNU Emacs %s\n", SDATA (tem)); 899 printf ("GNU Emacs %s\n", SDATA (tem));
900 printf ("Copyright (C) 2004 Free Software Foundation, Inc.\n"); 900 printf ("Copyright (C) 2005 Free Software Foundation, Inc.\n");
901 printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n"); 901 printf ("GNU Emacs comes with ABSOLUTELY NO WARRANTY.\n");
902 printf ("You may redistribute copies of Emacs\n"); 902 printf ("You may redistribute copies of Emacs\n");
903 printf ("under the terms of the GNU General Public License.\n"); 903 printf ("under the terms of the GNU General Public License.\n");
diff --git a/src/fileio.c b/src/fileio.c
index 1cd996d2a4f..6806c7d025a 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -5797,6 +5797,7 @@ auto_save_error (error)
5797 Fsleep_for (make_number (1), Qnil); 5797 Fsleep_for (make_number (1), Qnil);
5798 } 5798 }
5799 5799
5800 SAFE_FREE ();
5800 UNGCPRO; 5801 UNGCPRO;
5801 return Qnil; 5802 return Qnil;
5802} 5803}
diff --git a/src/fns.c b/src/fns.c
index 73ed21d0fbe..d0d4da4cd57 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -2555,7 +2555,7 @@ Note that this function doesn't check the parent of CHAR-TABLE. */)
2555 Lisp_Object char_table, range; 2555 Lisp_Object char_table, range;
2556{ 2556{
2557 int charset_id, c1 = 0, c2 = 0; 2557 int charset_id, c1 = 0, c2 = 0;
2558 int size, i; 2558 int size;
2559 Lisp_Object ch, val, current_default; 2559 Lisp_Object ch, val, current_default;
2560 2560
2561 CHECK_CHAR_TABLE (char_table); 2561 CHECK_CHAR_TABLE (char_table);
diff --git a/src/image.c b/src/image.c
index 2463c24a33a..1996d8477e9 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1099,7 +1099,10 @@ or omitted means use the selected frame. */)
1099 1099
1100static struct image *make_image P_ ((Lisp_Object spec, unsigned hash)); 1100static struct image *make_image P_ ((Lisp_Object spec, unsigned hash));
1101static void free_image P_ ((struct frame *f, struct image *img)); 1101static void free_image P_ ((struct frame *f, struct image *img));
1102static int check_image_size P_ ((struct frame *f, int width, int height));
1102 1103
1104#define MAX_IMAGE_SIZE 6.0
1105Lisp_Object Vmax_image_size;
1103 1106
1104/* Allocate and return a new image structure for image specification 1107/* Allocate and return a new image structure for image specification
1105 SPEC. SPEC has a hash value of HASH. */ 1108 SPEC. SPEC has a hash value of HASH. */
@@ -1151,6 +1154,39 @@ free_image (f, img)
1151 } 1154 }
1152} 1155}
1153 1156
1157/* Return 1 if the given widths and heights are valid for display;
1158 otherwise, return 0. */
1159
1160int
1161check_image_size (f, width, height)
1162 struct frame *f;
1163 int width;
1164 int height;
1165{
1166 int w, h;
1167
1168 if (width <= 0 || height <= 0)
1169 return 0;
1170
1171 if (INTEGERP (Vmax_image_size))
1172 w = h = XINT (Vmax_image_size);
1173 else if (FLOATP (Vmax_image_size))
1174 {
1175 if (f != NULL)
1176 {
1177 w = FRAME_PIXEL_WIDTH (f);
1178 h = FRAME_PIXEL_HEIGHT (f);
1179 }
1180 else
1181 w = h = 1024; /* Arbitrary size for unknown frame. */
1182 w = (int) (XFLOAT_DATA (Vmax_image_size) * w);
1183 h = (int) (XFLOAT_DATA (Vmax_image_size) * h);
1184 }
1185 else
1186 return 1;
1187
1188 return (width <= w && height <= h);
1189}
1154 1190
1155/* Prepare image IMG for display on frame F. Must be called before 1191/* Prepare image IMG for display on frame F. Must be called before
1156 drawing an image. */ 1192 drawing an image. */
@@ -1708,6 +1744,12 @@ lookup_image (f, spec)
1708 if (img->hash == hash && !NILP (Fequal (img->spec, spec))) 1744 if (img->hash == hash && !NILP (Fequal (img->spec, spec)))
1709 break; 1745 break;
1710 1746
1747 if (img && img->load_failed_p)
1748 {
1749 free_image (f, img);
1750 img = NULL;
1751 }
1752
1711 /* If not found, create a new image and cache it. */ 1753 /* If not found, create a new image and cache it. */
1712 if (img == NULL) 1754 if (img == NULL)
1713 { 1755 {
@@ -2551,7 +2593,8 @@ static int xbm_load P_ ((struct frame *f, struct image *img));
2551static int xbm_load_image P_ ((struct frame *f, struct image *img, 2593static int xbm_load_image P_ ((struct frame *f, struct image *img,
2552 unsigned char *, unsigned char *)); 2594 unsigned char *, unsigned char *));
2553static int xbm_image_p P_ ((Lisp_Object object)); 2595static int xbm_image_p P_ ((Lisp_Object object));
2554static int xbm_read_bitmap_data P_ ((unsigned char *, unsigned char *, 2596static int xbm_read_bitmap_data P_ ((struct frame *f,
2597 unsigned char *, unsigned char *,
2555 int *, int *, unsigned char **)); 2598 int *, int *, unsigned char **));
2556static int xbm_file_p P_ ((Lisp_Object)); 2599static int xbm_file_p P_ ((Lisp_Object));
2557 2600
@@ -2939,7 +2982,8 @@ Create_Pixmap_From_Bitmap_Data(f, img, data, fg, bg, non_default_colors)
2939 CONTENTS looks like an in-memory XBM file. */ 2982 CONTENTS looks like an in-memory XBM file. */
2940 2983
2941static int 2984static int
2942xbm_read_bitmap_data (contents, end, width, height, data) 2985xbm_read_bitmap_data (f, contents, end, width, height, data)
2986 struct frame *f;
2943 unsigned char *contents, *end; 2987 unsigned char *contents, *end;
2944 int *width, *height; 2988 int *width, *height;
2945 unsigned char **data; 2989 unsigned char **data;
@@ -2992,7 +3036,7 @@ xbm_read_bitmap_data (contents, end, width, height, data)
2992 expect (XBM_TK_NUMBER); 3036 expect (XBM_TK_NUMBER);
2993 } 3037 }
2994 3038
2995 if (*width < 0 || *height < 0) 3039 if (!check_image_size (f, *width, *height))
2996 goto failure; 3040 goto failure;
2997 else if (data == NULL) 3041 else if (data == NULL)
2998 goto success; 3042 goto success;
@@ -3096,7 +3140,7 @@ xbm_load_image (f, img, contents, end)
3096 unsigned char *data; 3140 unsigned char *data;
3097 int success_p = 0; 3141 int success_p = 0;
3098 3142
3099 rc = xbm_read_bitmap_data (contents, end, &img->width, &img->height, &data); 3143 rc = xbm_read_bitmap_data (f, contents, end, &img->width, &img->height, &data);
3100 if (rc) 3144 if (rc)
3101 { 3145 {
3102 unsigned long foreground = FRAME_FOREGROUND_PIXEL (f); 3146 unsigned long foreground = FRAME_FOREGROUND_PIXEL (f);
@@ -3150,7 +3194,7 @@ xbm_file_p (data)
3150{ 3194{
3151 int w, h; 3195 int w, h;
3152 return (STRINGP (data) 3196 return (STRINGP (data)
3153 && xbm_read_bitmap_data (SDATA (data), 3197 && xbm_read_bitmap_data (NULL, SDATA (data),
3154 (SDATA (data) 3198 (SDATA (data)
3155 + SBYTES (data)), 3199 + SBYTES (data)),
3156 &w, &h, NULL)); 3200 &w, &h, NULL));
@@ -5465,8 +5509,7 @@ pbm_load (f, img)
5465 max_color_idx = 255; 5509 max_color_idx = 255;
5466 } 5510 }
5467 5511
5468 if (width < 0 5512 if (!check_image_size (f, width, height)
5469 || height < 0
5470 || (type != PBM_MONO && max_color_idx < 0)) 5513 || (type != PBM_MONO && max_color_idx < 0))
5471 goto error; 5514 goto error;
5472 5515
@@ -5966,6 +6009,9 @@ png_load (f, img)
5966 fn_png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 6009 fn_png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth, &color_type,
5967 &interlace_type, NULL, NULL); 6010 &interlace_type, NULL, NULL);
5968 6011
6012 if (!check_image_size (f, width, height))
6013 goto error;
6014
5969 /* If image contains simply transparency data, we prefer to 6015 /* If image contains simply transparency data, we prefer to
5970 construct a clipping mask. */ 6016 construct a clipping mask. */
5971 if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS)) 6017 if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
@@ -6726,6 +6772,12 @@ jpeg_load (f, img)
6726 width = img->width = cinfo.output_width; 6772 width = img->width = cinfo.output_width;
6727 height = img->height = cinfo.output_height; 6773 height = img->height = cinfo.output_height;
6728 6774
6775 if (!check_image_size (f, width, height))
6776 {
6777 image_error ("Invalid image size", Qnil, Qnil);
6778 longjmp (mgr.setjmp_buffer, 2);
6779 }
6780
6729 /* Create X image and pixmap. */ 6781 /* Create X image and pixmap. */
6730 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) 6782 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
6731 longjmp (mgr.setjmp_buffer, 2); 6783 longjmp (mgr.setjmp_buffer, 2);
@@ -7155,6 +7207,14 @@ tiff_load (f, img)
7155 of width x height 32-bit values. */ 7207 of width x height 32-bit values. */
7156 fn_TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width); 7208 fn_TIFFGetField (tiff, TIFFTAG_IMAGEWIDTH, &width);
7157 fn_TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height); 7209 fn_TIFFGetField (tiff, TIFFTAG_IMAGELENGTH, &height);
7210
7211 if (!check_image_size (f, width, height))
7212 {
7213 image_error ("Invalid image size", Qnil, Qnil);
7214 UNGCPRO;
7215 return 0;
7216 }
7217
7158 buf = (uint32 *) xmalloc (width * height * sizeof *buf); 7218 buf = (uint32 *) xmalloc (width * height * sizeof *buf);
7159 7219
7160 rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0); 7220 rc = fn_TIFFReadRGBAImage (tiff, width, height, buf, 0);
@@ -7459,6 +7519,15 @@ gif_load (f, img)
7459 } 7519 }
7460 } 7520 }
7461 7521
7522 /* Before reading entire contents, check the declared image size. */
7523 if (!check_image_size (f, gif->SWidth, gif->SHeight))
7524 {
7525 image_error ("Invalid image size", Qnil, Qnil);
7526 fn_DGifCloseFile (gif);
7527 UNGCPRO;
7528 return 0;
7529 }
7530
7462 /* Read entire contents. */ 7531 /* Read entire contents. */
7463 rc = fn_DGifSlurp (gif); 7532 rc = fn_DGifSlurp (gif);
7464 if (rc == GIF_ERROR) 7533 if (rc == GIF_ERROR)
@@ -7492,6 +7561,14 @@ gif_load (f, img)
7492 max (gif->Image.Top + gif->Image.Height, 7561 max (gif->Image.Top + gif->Image.Height,
7493 image_top + image_height)); 7562 image_top + image_height));
7494 7563
7564 if (!check_image_size (f, width, height))
7565 {
7566 image_error ("Invalid image size", Qnil, Qnil);
7567 fn_DGifCloseFile (gif);
7568 UNGCPRO;
7569 return 0;
7570 }
7571
7495 /* Create the X image and pixmap. */ 7572 /* Create the X image and pixmap. */
7496 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap)) 7573 if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
7497 { 7574 {
@@ -7944,6 +8021,12 @@ gs_load (f, img)
7944 in_height = XFASTINT (pt_height) / 72.0; 8021 in_height = XFASTINT (pt_height) / 72.0;
7945 img->height = in_height * FRAME_X_DISPLAY_INFO (f)->resy; 8022 img->height = in_height * FRAME_X_DISPLAY_INFO (f)->resy;
7946 8023
8024 if (!check_image_size (f, img->width, img->height))
8025 {
8026 image_error ("Invalid image size", Qnil, Qnil);
8027 return 0;
8028 }
8029
7947 /* Create the pixmap. */ 8030 /* Create the pixmap. */
7948 xassert (img->pixmap == NO_PIXMAP); 8031 xassert (img->pixmap == NO_PIXMAP);
7949 8032
@@ -8217,6 +8300,18 @@ listed; they're always supported. */);
8217 Vimage_library_alist = Qnil; 8300 Vimage_library_alist = Qnil;
8218 Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt); 8301 Fput (intern ("image-library-alist"), Qrisky_local_variable, Qt);
8219 8302
8303 DEFVAR_LISP ("max-image-size", &Vmax_image_size,
8304 doc: /* Maximum size of images.
8305Emacs will not load an image into memory if its pixel width or
8306pixel height exceeds this limit.
8307
8308If the value is an integer, it directly specifies the maximum
8309image height and width, measured in pixels. If it is a floating
8310point number, it specifies the maximum image height and width
8311as a ratio to the frame height and width. If the value is
8312non-numeric, there is no explicit limit on the size of images. */);
8313 Vmax_image_size = make_float (MAX_IMAGE_SIZE);
8314
8220 Vimage_type_cache = Qnil; 8315 Vimage_type_cache = Qnil;
8221 staticpro (&Vimage_type_cache); 8316 staticpro (&Vimage_type_cache);
8222 8317
diff --git a/src/lread.c b/src/lread.c
index 94fb5ddb155..43c7bf6cfc2 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -670,6 +670,11 @@ If optional fourth arg NOSUFFIX is non-nil, don't try adding
670If optional fifth arg MUST-SUFFIX is non-nil, insist on 670If optional fifth arg MUST-SUFFIX is non-nil, insist on
671 the suffix `.elc' or `.el'; don't accept just FILE unless 671 the suffix `.elc' or `.el'; don't accept just FILE unless
672 it ends in one of those suffixes or includes a directory name. 672 it ends in one of those suffixes or includes a directory name.
673
674Loading a file records its definitions, and its `provide' and
675`require' calls, in an element of `load-history' whose
676car is the file name loaded. See `load-history'.
677
673Return t if file exists. */) 678Return t if file exists. */)
674 (file, noerror, nomessage, nosuffix, must_suffix) 679 (file, noerror, nomessage, nosuffix, must_suffix)
675 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; 680 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
@@ -678,7 +683,7 @@ Return t if file exists. */)
678 register int fd = -1; 683 register int fd = -1;
679 int count = SPECPDL_INDEX (); 684 int count = SPECPDL_INDEX ();
680 Lisp_Object temp; 685 Lisp_Object temp;
681 struct gcpro gcpro1; 686 struct gcpro gcpro1, gcpro2;
682 Lisp_Object found, efound; 687 Lisp_Object found, efound;
683 /* 1 means we printed the ".el is newer" message. */ 688 /* 1 means we printed the ".el is newer" message. */
684 int newer = 0; 689 int newer = 0;
@@ -725,7 +730,8 @@ Return t if file exists. */)
725 int size = SBYTES (file); 730 int size = SBYTES (file);
726 Lisp_Object tmp[2]; 731 Lisp_Object tmp[2];
727 732
728 GCPRO1 (file); 733 found = Qnil;
734 GCPRO2 (file, found);
729 735
730 if (! NILP (must_suffix)) 736 if (! NILP (must_suffix))
731 { 737 {
@@ -812,6 +818,8 @@ Return t if file exists. */)
812 struct stat s1, s2; 818 struct stat s1, s2;
813 int result; 819 int result;
814 820
821 GCPRO2 (file, found);
822
815 if (!safe_to_load_p (fd)) 823 if (!safe_to_load_p (fd))
816 { 824 {
817 safe_p = 0; 825 safe_p = 0;
@@ -828,7 +836,6 @@ Return t if file exists. */)
828 836
829 compiled = 1; 837 compiled = 1;
830 838
831 GCPRO1 (efound);
832 efound = ENCODE_FILE (found); 839 efound = ENCODE_FILE (found);
833 840
834#ifdef DOS_NT 841#ifdef DOS_NT
@@ -838,7 +845,6 @@ Return t if file exists. */)
838 SSET (efound, SBYTES (efound) - 1, 0); 845 SSET (efound, SBYTES (efound) - 1, 0);
839 result = stat ((char *)SDATA (efound), &s2); 846 result = stat ((char *)SDATA (efound), &s2);
840 SSET (efound, SBYTES (efound) - 1, 'c'); 847 SSET (efound, SBYTES (efound) - 1, 'c');
841 UNGCPRO;
842 848
843 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime) 849 if (result >= 0 && (unsigned) s1.st_mtime < (unsigned) s2.st_mtime)
844 { 850 {
@@ -848,12 +854,13 @@ Return t if file exists. */)
848 /* If we won't print another message, mention this anyway. */ 854 /* If we won't print another message, mention this anyway. */
849 if (!NILP (nomessage)) 855 if (!NILP (nomessage))
850 { 856 {
851 Lisp_Object file; 857 Lisp_Object msg_file;
852 file = Fsubstring (found, make_number (0), make_number (-1)); 858 msg_file = Fsubstring (found, make_number (0), make_number (-1));
853 message_with_string ("Source file `%s' newer than byte-compiled file", 859 message_with_string ("Source file `%s' newer than byte-compiled file",
854 file, 1); 860 msg_file, 1);
855 } 861 }
856 } 862 }
863 UNGCPRO;
857 } 864 }
858 } 865 }
859 else 866 else
@@ -872,12 +879,12 @@ Return t if file exists. */)
872 } 879 }
873 } 880 }
874 881
882 GCPRO2 (file, found);
883
875#ifdef WINDOWSNT 884#ifdef WINDOWSNT
876 emacs_close (fd); 885 emacs_close (fd);
877 GCPRO1 (efound);
878 efound = ENCODE_FILE (found); 886 efound = ENCODE_FILE (found);
879 stream = fopen ((char *) SDATA (efound), fmode); 887 stream = fopen ((char *) SDATA (efound), fmode);
880 UNGCPRO;
881#else /* not WINDOWSNT */ 888#else /* not WINDOWSNT */
882 stream = fdopen (fd, fmode); 889 stream = fdopen (fd, fmode);
883#endif /* not WINDOWSNT */ 890#endif /* not WINDOWSNT */
@@ -904,7 +911,6 @@ Return t if file exists. */)
904 message_with_string ("Loading %s...", file, 1); 911 message_with_string ("Loading %s...", file, 1);
905 } 912 }
906 913
907 GCPRO1 (file);
908 record_unwind_protect (load_unwind, make_save_value (stream, 0)); 914 record_unwind_protect (load_unwind, make_save_value (stream, 0));
909 record_unwind_protect (load_descriptor_unwind, load_descriptor_list); 915 record_unwind_protect (load_descriptor_unwind, load_descriptor_list);
910 specbind (Qload_file_name, found); 916 specbind (Qload_file_name, found);
@@ -912,8 +918,8 @@ Return t if file exists. */)
912 load_descriptor_list 918 load_descriptor_list
913 = Fcons (make_number (fileno (stream)), load_descriptor_list); 919 = Fcons (make_number (fileno (stream)), load_descriptor_list);
914 load_in_progress++; 920 load_in_progress++;
915 readevalloop (Qget_file_char, stream, file, Feval, 921 readevalloop (Qget_file_char, stream, (! NILP (Vpurify_flag) ? file : found),
916 0, Qnil, Qnil, Qnil, Qnil); 922 Feval, 0, Qnil, Qnil, Qnil, Qnil);
917 unbind_to (count, Qnil); 923 unbind_to (count, Qnil);
918 924
919 /* Run any load-hooks for this file. */ 925 /* Run any load-hooks for this file. */
@@ -3880,7 +3886,7 @@ when the corresponding call to `provide' is made. */);
3880 Vafter_load_alist = Qnil; 3886 Vafter_load_alist = Qnil;
3881 3887
3882 DEFVAR_LISP ("load-history", &Vload_history, 3888 DEFVAR_LISP ("load-history", &Vload_history,
3883 doc: /* Alist mapping source file names to symbols and features. 3889 doc: /* Alist mapping file names to symbols and features.
3884Each alist element is a list that starts with a file name, 3890Each alist element is a list that starts with a file name,
3885except for one element (optional) that starts with nil and describes 3891except for one element (optional) that starts with nil and describes
3886definitions evaluated from buffers not visiting files. 3892definitions evaluated from buffers not visiting files.
@@ -3889,7 +3895,10 @@ and cons cells of the form `(provide . FEATURE)', `(require . FEATURE)',
3889`(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'. 3895`(defun . FUNCTION)', `(autoload . SYMBOL)', and `(t . SYMBOL)'.
3890An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)', 3896An element `(t . SYMBOL)' precedes an entry `(defun . FUNCTION)',
3891and means that SYMBOL was an autoload before this file redefined it 3897and means that SYMBOL was an autoload before this file redefined it
3892as a function. */); 3898as a function.
3899
3900For a preloaded file, the file name recorded is relative to the main Lisp
3901directory. These names are converted to absolute by `file-loadhist-lookup'. */);
3893 Vload_history = Qnil; 3902 Vload_history = Qnil;
3894 3903
3895 DEFVAR_LISP ("load-file-name", &Vload_file_name, 3904 DEFVAR_LISP ("load-file-name", &Vload_file_name,
diff --git a/src/minibuf.c b/src/minibuf.c
index 9c0f4a09284..cdee2ad8300 100644
--- a/src/minibuf.c
+++ b/src/minibuf.c
@@ -2367,14 +2367,14 @@ alternative, the second serves as annotation.
2367The actual completion alternatives, as inserted, are given `mouse-face' 2367The actual completion alternatives, as inserted, are given `mouse-face'
2368properties of `highlight'. 2368properties of `highlight'.
2369At the end, this runs the normal hook `completion-setup-hook'. 2369At the end, this runs the normal hook `completion-setup-hook'.
2370It can find the completion buffer in `standard-output'. 2370It can find the completion buffer in `standard-output'.
2371The optional second arg COMMON-SUBSTRING is a string. 2371The optional second arg COMMON-SUBSTRING is a string.
2372It is used to put faces, `completions-first-difference` and 2372It is used to put faces, `completions-first-difference` and
2373`completions-common-part' on the completion bufffer. The 2373`completions-common-part' on the completion buffer. The
2374`completions-common-part' face is put on the common substring 2374`completions-common-part' face is put on the common substring
2375specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil, 2375specified by COMMON-SUBSTRING. If COMMON-SUBSTRING is nil,
2376the faces are not put. 2376the faces are not put.
2377Internally, COMMON-SUBSTRING is bound to `completion-common-substring' 2377Internally, COMMON-SUBSTRING is bound to `completion-common-substring'
2378during running `completion-setup-hook'. */) 2378during running `completion-setup-hook'. */)
2379 (completions, common_substring) 2379 (completions, common_substring)
2380 Lisp_Object completions; 2380 Lisp_Object completions;
@@ -2550,7 +2550,7 @@ during running `completion-setup-hook'. */)
2550 2550
2551 specbind (intern ("completion-common-substring"), common_substring); 2551 specbind (intern ("completion-common-substring"), common_substring);
2552 call1 (Vrun_hooks, intern ("completion-setup-hook")); 2552 call1 (Vrun_hooks, intern ("completion-setup-hook"));
2553 2553
2554 unbind_to (count1, Qnil); 2554 unbind_to (count1, Qnil);
2555 } 2555 }
2556 2556
@@ -2559,6 +2559,14 @@ during running `completion-setup-hook'. */)
2559 return Qnil; 2559 return Qnil;
2560} 2560}
2561 2561
2562
2563static Lisp_Object
2564display_completion_list_1 (list)
2565 Lisp_Object list;
2566{
2567 return Fdisplay_completion_list (list, Qnil);
2568}
2569
2562DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_completion_help, 2570DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_completion_help,
2563 0, 0, "", 2571 0, 0, "",
2564 doc: /* Display a list of possible completions of the current minibuffer contents. */) 2572 doc: /* Display a list of possible completions of the current minibuffer contents. */)
@@ -2580,7 +2588,7 @@ DEFUN ("minibuffer-completion-help", Fminibuffer_completion_help, Sminibuffer_co
2580 } 2588 }
2581 else 2589 else
2582 internal_with_output_to_temp_buffer ("*Completions*", 2590 internal_with_output_to_temp_buffer ("*Completions*",
2583 Fdisplay_completion_list, 2591 display_completion_list_1,
2584 Fsort (completions, Qstring_lessp)); 2592 Fsort (completions, Qstring_lessp));
2585 return Qnil; 2593 return Qnil;
2586} 2594}
diff --git a/src/search.c b/src/search.c
index f60e6d0cfe2..d3a5bd838a9 100644
--- a/src/search.c
+++ b/src/search.c
@@ -429,7 +429,7 @@ string_match_1 (regexp, string, start, posix)
429 429
430DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0, 430DEFUN ("string-match", Fstring_match, Sstring_match, 2, 3, 0,
431 doc: /* Return index of start of first match for REGEXP in STRING, or nil. 431 doc: /* Return index of start of first match for REGEXP in STRING, or nil.
432Case is ignored if `case-fold-search' is non-nil in the current buffer. 432Matching ignores case if `case-fold-search' is non-nil.
433If third arg START is non-nil, start search at that index in STRING. 433If third arg START is non-nil, start search at that index in STRING.
434For index of first char beyond the match, do (match-end 0). 434For index of first char beyond the match, do (match-end 0).
435`match-end' and `match-beginning' also give indices of substrings 435`match-end' and `match-beginning' also give indices of substrings
@@ -1709,7 +1709,7 @@ boyer_moore (n, base_pat, len, len_byte, trt, inverse_trt,
1709 if (ASCII_BYTE_P (*ptr) || ! multibyte) 1709 if (ASCII_BYTE_P (*ptr) || ! multibyte)
1710 ch = *ptr; 1710 ch = *ptr;
1711 else if (charset_base 1711 else if (charset_base
1712 && (pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])) 1712 && ((pat_end - ptr) == 1 || CHAR_HEAD_P (ptr[1])))
1713 { 1713 {
1714 unsigned char *charstart = ptr - 1; 1714 unsigned char *charstart = ptr - 1;
1715 1715
diff --git a/src/syssignal.h b/src/syssignal.h
index 1e9c0dbb38a..3cb28220962 100644
--- a/src/syssignal.h
+++ b/src/syssignal.h
@@ -147,7 +147,10 @@ extern SIGMASKTYPE sigprocmask_set;
147#undef SIGINFO 147#undef SIGINFO
148#endif 148#endif
149#if defined (SIGIO) && defined (BROKEN_SIGIO) 149#if defined (SIGIO) && defined (BROKEN_SIGIO)
150#undef SIGIO 150# undef SIGIO
151# if defined (__Lynx__)
152# undef SIGPOLL /* Defined as SIGIO on LynxOS */
153# endif
151#endif 154#endif
152#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL) 155#if defined (SIGPOLL) && defined (BROKEN_SIGPOLL)
153#undef SIGPOLL 156#undef SIGPOLL
diff --git a/src/term.c b/src/term.c
index bb7f7354890..234be4a9271 100644
--- a/src/term.c
+++ b/src/term.c
@@ -639,7 +639,7 @@ encode_terminal_code (src, src_len, coding)
639 int src_len; 639 int src_len;
640 struct coding_system *coding; 640 struct coding_system *coding;
641{ 641{
642 struct glyph *src_start = src, *src_end = src + src_len; 642 struct glyph *src_end = src + src_len;
643 register GLYPH g; 643 register GLYPH g;
644 unsigned char *buf; 644 unsigned char *buf;
645 int nchars, nbytes, required; 645 int nchars, nbytes, required;
@@ -724,7 +724,7 @@ encode_terminal_code (src, src_len, coding)
724 if (SYMBOLP (coding->pre_write_conversion) 724 if (SYMBOLP (coding->pre_write_conversion)
725 && ! NILP (Ffboundp (coding->pre_write_conversion))) 725 && ! NILP (Ffboundp (coding->pre_write_conversion)))
726 { 726 {
727 run_pre_write_conversin_on_c_str (&encode_terminal_buf, 727 run_pre_write_conversin_on_c_str (&encode_terminal_buf,
728 &encode_terminal_bufsize, 728 &encode_terminal_bufsize,
729 nchars, nbytes, coding); 729 nchars, nbytes, coding);
730 nchars = coding->produced_char; 730 nchars = coding->produced_char;
@@ -1662,7 +1662,7 @@ produce_stretch_glyph (it)
1662 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to)) 1662 && calc_pixel_width_or_height (&tem, it, prop, 0, 1, &align_to))
1663 { 1663 {
1664 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p) 1664 if (it->glyph_row == NULL || !it->glyph_row->mode_line_p)
1665 align_to = (align_to < 0 1665 align_to = (align_to < 0
1666 ? 0 1666 ? 0
1667 : align_to - window_box_left_offset (it->w, TEXT_AREA)); 1667 : align_to - window_box_left_offset (it->w, TEXT_AREA));
1668 else if (align_to < 0) 1668 else if (align_to < 0)
diff --git a/src/unexelf.c b/src/unexelf.c
index e33a9a1aeb3..f50e849fdcf 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -702,7 +702,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
702#if MAP_ANON == 0 702#if MAP_ANON == 0
703 mmap_fd = open ("/dev/zero", O_RDONLY); 703 mmap_fd = open ("/dev/zero", O_RDONLY);
704 if (mmap_fd < 0) 704 if (mmap_fd < 0)
705 fatal ("Can't open /dev/zero for reading: errno %d\n", errno); 705 fatal ("Can't open /dev/zero for reading: errno %d\n", errno, 0);
706#endif 706#endif
707 707
708 /* We cannot use malloc here because that may use sbrk. If it does, 708 /* We cannot use malloc here because that may use sbrk. If it does,
@@ -713,7 +713,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
713 old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE, 713 old_base = mmap (NULL, old_file_size, PROT_READ | PROT_WRITE,
714 MAP_ANON | MAP_PRIVATE, mmap_fd, 0); 714 MAP_ANON | MAP_PRIVATE, mmap_fd, 0);
715 if (old_base == MAP_FAILED) 715 if (old_base == MAP_FAILED)
716 fatal ("Can't allocate buffer for %s\n", old_name); 716 fatal ("Can't allocate buffer for %s\n", old_name, 0);
717 717
718 if (read (old_file, old_base, stat_buf.st_size) != stat_buf.st_size) 718 if (read (old_file, old_base, stat_buf.st_size) != stat_buf.st_size)
719 fatal ("Didn't read all of %s: errno %d\n", old_name, errno); 719 fatal ("Didn't read all of %s: errno %d\n", old_name, errno);
@@ -802,7 +802,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
802 new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE, 802 new_base = mmap (NULL, new_file_size, PROT_READ | PROT_WRITE,
803 MAP_ANON | MAP_PRIVATE, mmap_fd, 0); 803 MAP_ANON | MAP_PRIVATE, mmap_fd, 0);
804 if (new_base == MAP_FAILED) 804 if (new_base == MAP_FAILED)
805 fatal ("Can't allocate buffer for %s\n", old_name); 805 fatal ("Can't allocate buffer for %s\n", old_name, 0);
806 806
807 new_file_h = (ElfW(Ehdr) *) new_base; 807 new_file_h = (ElfW(Ehdr) *) new_base;
808 new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff); 808 new_program_h = (ElfW(Phdr) *) ((byte *) new_base + old_file_h->e_phoff);
@@ -1079,7 +1079,7 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
1079 && old_mdebug_index != -1) 1079 && old_mdebug_index != -1)
1080 { 1080 {
1081 int diff = NEW_SECTION_H(nn).sh_offset 1081 int diff = NEW_SECTION_H(nn).sh_offset
1082 - OLD_SECTION_H(old_mdebug_index).sh_offset; 1082 - OLD_SECTION_H(old_mdebug_index).sh_offset;
1083 HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base); 1083 HDRR *phdr = (HDRR *)(NEW_SECTION_H (nn).sh_offset + new_base);
1084 1084
1085 if (diff) 1085 if (diff)
@@ -1257,9 +1257,13 @@ unexec (new_name, old_name, data_start, bss_start, entry_address)
1257 /* Write out new_file, and free the buffers. */ 1257 /* Write out new_file, and free the buffers. */
1258 1258
1259 if (write (new_file, new_base, new_file_size) != new_file_size) 1259 if (write (new_file, new_base, new_file_size) != new_file_size)
1260#ifndef emacs
1261 fatal ("Didn't write %d bytes: errno %d\n",
1262 new_file_size, errno);
1263#else
1260 fatal ("Didn't write %d bytes to %s: errno %d\n", 1264 fatal ("Didn't write %d bytes to %s: errno %d\n",
1261 new_file_size, new_base, errno); 1265 new_file_size, new_base, errno);
1262 1266#endif
1263 munmap (old_base, old_file_size); 1267 munmap (old_base, old_file_size);
1264 munmap (new_base, new_file_size); 1268 munmap (new_base, new_file_size);
1265 1269
diff --git a/src/window.c b/src/window.c
index 7b3f28ac799..520d5ae8eaa 100644
--- a/src/window.c
+++ b/src/window.c
@@ -6295,7 +6295,6 @@ selected frame. */)
6295 (frame) 6295 (frame)
6296 Lisp_Object frame; 6296 Lisp_Object frame;
6297{ 6297{
6298 Lisp_Object alist;
6299 FRAME_PTR f; 6298 FRAME_PTR f;
6300 6299
6301 if (NILP (frame)) 6300 if (NILP (frame))
diff --git a/src/xterm.c b/src/xterm.c
index ef40c8b790d..2aa1095f27c 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -8103,7 +8103,6 @@ void
8103x_calc_absolute_position (f) 8103x_calc_absolute_position (f)
8104 struct frame *f; 8104 struct frame *f;
8105{ 8105{
8106 int win_x = 0, win_y = 0;
8107 int flags = f->size_hint_flags; 8106 int flags = f->size_hint_flags;
8108 8107
8109 /* We have nothing to do if the current position 8108 /* We have nothing to do if the current position