aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-04-28 14:10:58 +0000
committerKaroly Lorentey2004-04-28 14:10:58 +0000
commit9a3ab26af39540424723a27ab3a7f3cd204660c8 (patch)
tree9b6ffcbabad04dabde455962297ea3247586dcfb /src
parent6c8caecfb9c96879b8ea6f1e08314408be40a832 (diff)
parent66dc9a0f2f01edcef8f8ad0d891905409120c081 (diff)
downloademacs-9a3ab26af39540424723a27ab3a7f3cd204660c8.tar.gz
emacs-9a3ab26af39540424723a27ab3a7f3cd204660c8.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-256 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-257 {arch}/=cvs-sync-make-log: Use new features of tla-changelogs-to-log git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-154
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog20
-rw-r--r--src/editfns.c4
-rw-r--r--src/fileio.c56
-rw-r--r--src/msdos.c21
-rw-r--r--src/xdisp.c16
5 files changed, 108 insertions, 9 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4db9b8cb4d9..c3314cb98e5 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,23 @@
12004-04-27 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * xdisp.c (x_produce_glyphs): Fix the proverbial int/Lisp_Object mixup.
4 (on_hot_spot_p): Make sure we always return a value.
5 (Flookup_image_map): Remove unused var ix and iy.
6 (note_mode_line_or_margin_highlight): Remove unused var `image'.
7
82004-04-27 Eli Zaretskii <eliz@gnu.org>
9
10 * msdos.c (init_environment): If one of the TMP... environment
11 variables is set to a drive letter without a trailing slash,
12 append a slash.
13
142004-04-27 Matthew Mundell <matt@mundell.ukfsn.org>
15
16 * editfns.c (lisp_time_argument): Provide externally.
17
18 * fileio.c (Fset_file_times): New function.
19 (syms_of_fileio): Intern and staticpro it.
20
12004-04-27 Kim F. Storm <storm@cua.dk> 212004-04-27 Kim F. Storm <storm@cua.dk>
2 22
3 * xdisp.c (x_produce_glyphs): Fix last change; handle newline in 23 * xdisp.c (x_produce_glyphs): Fix last change; handle newline in
diff --git a/src/editfns.c b/src/editfns.c
index a5c3aea14bc..51187c0e473 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -73,7 +73,7 @@ static int tm_diff P_ ((struct tm *, struct tm *));
73static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *)); 73static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *));
74static void update_buffer_properties P_ ((int, int)); 74static void update_buffer_properties P_ ((int, int));
75static Lisp_Object region_limit P_ ((int)); 75static Lisp_Object region_limit P_ ((int));
76static int lisp_time_argument P_ ((Lisp_Object, time_t *, int *)); 76int lisp_time_argument P_ ((Lisp_Object, time_t *, int *));
77static size_t emacs_memftimeu P_ ((char *, size_t, const char *, 77static size_t emacs_memftimeu P_ ((char *, size_t, const char *,
78 size_t, const struct tm *, int)); 78 size_t, const struct tm *, int));
79static void general_insert_function P_ ((void (*) (const unsigned char *, int), 79static void general_insert_function P_ ((void (*) (const unsigned char *, int),
@@ -1377,7 +1377,7 @@ resolution finer than a second. */)
1377} 1377}
1378 1378
1379 1379
1380static int 1380int
1381lisp_time_argument (specified_time, result, usec) 1381lisp_time_argument (specified_time, result, usec)
1382 Lisp_Object specified_time; 1382 Lisp_Object specified_time;
1383 time_t *result; 1383 time_t *result;
diff --git a/src/fileio.c b/src/fileio.c
index 38b2cbd5b52..db1aac0afda 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -325,6 +325,7 @@ Lisp_Object Qfile_regular_p;
325Lisp_Object Qfile_accessible_directory_p; 325Lisp_Object Qfile_accessible_directory_p;
326Lisp_Object Qfile_modes; 326Lisp_Object Qfile_modes;
327Lisp_Object Qset_file_modes; 327Lisp_Object Qset_file_modes;
328Lisp_Object Qset_file_times;
328Lisp_Object Qfile_newer_than_file_p; 329Lisp_Object Qfile_newer_than_file_p;
329Lisp_Object Qinsert_file_contents; 330Lisp_Object Qinsert_file_contents;
330Lisp_Object Qwrite_region; 331Lisp_Object Qwrite_region;
@@ -3440,7 +3441,59 @@ The value is an integer. */)
3440 XSETINT (value, (~ realmask) & 0777); 3441 XSETINT (value, (~ realmask) & 0777);
3441 return value; 3442 return value;
3442} 3443}
3444
3445extern int lisp_time_argument P_ ((Lisp_Object, time_t *, int *));
3446
3447DEFUN ("set-file-times", Fset_file_times, Sset_file_times, 1, 2, 0,
3448 doc: /* Set times of file FILENAME to TIME.
3449Set both access and modification times.
3450Return t on success, else nil.
3451Use the current time if TIME is nil. TIME is in the format of
3452`current-time'. */)
3453 (filename, time)
3454 Lisp_Object filename, time;
3455{
3456 Lisp_Object absname, encoded_absname;
3457 Lisp_Object handler;
3458 time_t sec;
3459 int usec;
3460
3461 if (! lisp_time_argument (time, &sec, &usec))
3462 error ("Invalid time specification");
3463
3464 absname = Fexpand_file_name (filename, current_buffer->directory);
3465
3466 /* If the file name has special constructs in it,
3467 call the corresponding file handler. */
3468 handler = Ffind_file_name_handler (absname, Qset_file_times);
3469 if (!NILP (handler))
3470 return call3 (handler, Qset_file_times, absname, time);
3471
3472 encoded_absname = ENCODE_FILE (absname);
3443 3473
3474 {
3475 EMACS_TIME t;
3476
3477 EMACS_SET_SECS (t, sec);
3478 EMACS_SET_USECS (t, usec);
3479
3480 if (set_file_times (SDATA (encoded_absname), t, t))
3481 {
3482#ifdef DOS_NT
3483 struct stat st;
3484
3485 /* Setting times on a directory always fails. */
3486 if (stat (SDATA (encoded_absname), &st) == 0
3487 && (st.st_mode & S_IFMT) == S_IFDIR)
3488 return Qnil;
3489#endif
3490 report_file_error ("Setting file times", Fcons (absname, Qnil));
3491 return Qnil;
3492 }
3493 }
3494
3495 return Qt;
3496}
3444 3497
3445#ifdef __NetBSD__ 3498#ifdef __NetBSD__
3446#define unix 42 3499#define unix 42
@@ -6344,6 +6397,7 @@ syms_of_fileio ()
6344 Qfile_accessible_directory_p = intern ("file-accessible-directory-p"); 6397 Qfile_accessible_directory_p = intern ("file-accessible-directory-p");
6345 Qfile_modes = intern ("file-modes"); 6398 Qfile_modes = intern ("file-modes");
6346 Qset_file_modes = intern ("set-file-modes"); 6399 Qset_file_modes = intern ("set-file-modes");
6400 Qset_file_times = intern ("set-file-times");
6347 Qfile_newer_than_file_p = intern ("file-newer-than-file-p"); 6401 Qfile_newer_than_file_p = intern ("file-newer-than-file-p");
6348 Qinsert_file_contents = intern ("insert-file-contents"); 6402 Qinsert_file_contents = intern ("insert-file-contents");
6349 Qwrite_region = intern ("write-region"); 6403 Qwrite_region = intern ("write-region");
@@ -6377,6 +6431,7 @@ syms_of_fileio ()
6377 staticpro (&Qfile_accessible_directory_p); 6431 staticpro (&Qfile_accessible_directory_p);
6378 staticpro (&Qfile_modes); 6432 staticpro (&Qfile_modes);
6379 staticpro (&Qset_file_modes); 6433 staticpro (&Qset_file_modes);
6434 staticpro (&Qset_file_times);
6380 staticpro (&Qfile_newer_than_file_p); 6435 staticpro (&Qfile_newer_than_file_p);
6381 staticpro (&Qinsert_file_contents); 6436 staticpro (&Qinsert_file_contents);
6382 staticpro (&Qwrite_region); 6437 staticpro (&Qwrite_region);
@@ -6600,6 +6655,7 @@ a non-nil value. */);
6600 defsubr (&Sfile_regular_p); 6655 defsubr (&Sfile_regular_p);
6601 defsubr (&Sfile_modes); 6656 defsubr (&Sfile_modes);
6602 defsubr (&Sset_file_modes); 6657 defsubr (&Sset_file_modes);
6658 defsubr (&Sset_file_times);
6603 defsubr (&Sset_default_file_modes); 6659 defsubr (&Sset_default_file_modes);
6604 defsubr (&Sdefault_file_modes); 6660 defsubr (&Sdefault_file_modes);
6605 defsubr (&Sfile_newer_than_file_p); 6661 defsubr (&Sfile_newer_than_file_p);
diff --git a/src/msdos.c b/src/msdos.c
index 39d28564890..b30e51bbb36 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -4408,9 +4408,28 @@ init_environment (argc, argv, skip_args)
4408 for (i = 0; i < imax ; i++) 4408 for (i = 0; i < imax ; i++)
4409 { 4409 {
4410 const char *tmp = tempdirs[i]; 4410 const char *tmp = tempdirs[i];
4411 char buf[FILENAME_MAX];
4411 4412
4412 if (*tmp == '$') 4413 if (*tmp == '$')
4413 tmp = getenv (tmp + 1); 4414 {
4415 int tmp_len;
4416
4417 tmp = getenv (tmp + 1);
4418 if (!tmp)
4419 continue;
4420
4421 /* Some lusers set TMPDIR=e:, probably because some losing
4422 programs cannot handle multiple slashes if they use e:/.
4423 e: fails in `access' below, so we interpret e: as e:/. */
4424 tmp_len = strlen(tmp);
4425 if (tmp[tmp_len - 1] != '/' && tmp[tmp_len - 1] != '\\')
4426 {
4427 strcpy(buf, tmp);
4428 buf[tmp_len++] = '/', buf[tmp_len] = 0;
4429 tmp = buf;
4430 }
4431 }
4432
4414 /* Note that `access' can lie to us if the directory resides on a 4433 /* Note that `access' can lie to us if the directory resides on a
4415 read-only filesystem, like CD-ROM or a write-protected floppy. 4434 read-only filesystem, like CD-ROM or a write-protected floppy.
4416 The only way to be really sure is to actually create a file and 4435 The only way to be really sure is to actually create a file and
diff --git a/src/xdisp.c b/src/xdisp.c
index d5e12e68546..e77fa98cab1 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -18707,7 +18707,8 @@ x_produce_glyphs (it)
18707 it->pixel_width = 0; 18707 it->pixel_width = 0;
18708 it->nglyphs = 0; 18708 it->nglyphs = 0;
18709 18709
18710 lh = Fget_text_property (IT_CHARPOS (*it), Qline_height, it->object); 18710 lh = Fget_text_property (make_number (IT_CHARPOS (*it)),
18711 Qline_height, it->object);
18711 18712
18712 if (EQ (lh, Qt)) 18713 if (EQ (lh, Qt))
18713 { 18714 {
@@ -18753,17 +18754,20 @@ x_produce_glyphs (it)
18753 if (INTEGERP (lh)) 18754 if (INTEGERP (lh))
18754 explicit_height = XINT (lh); 18755 explicit_height = XINT (lh);
18755 else if (FLOATP (lh)) 18756 else if (FLOATP (lh))
18756 explicit_height = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lh); 18757 explicit_height = (it->phys_ascent + it->phys_descent)
18758 * XFLOAT_DATA (lh);
18757 18759
18758 if (explicit_height > it->ascent + it->descent) 18760 if (explicit_height > it->ascent + it->descent)
18759 it->ascent = explicit_height - it->descent; 18761 it->ascent = explicit_height - it->descent;
18760 } 18762 }
18761 18763
18762 lsp = Fget_text_property (IT_CHARPOS (*it), Qline_spacing, it->object); 18764 lsp = Fget_text_property (make_number (IT_CHARPOS (*it)),
18765 Qline_spacing, it->object);
18763 if (INTEGERP (lsp)) 18766 if (INTEGERP (lsp))
18764 extra_line_spacing = XINT (lsp); 18767 extra_line_spacing = XINT (lsp);
18765 else if (FLOATP (lsp)) 18768 else if (FLOATP (lsp))
18766 extra_line_spacing = (it->phys_ascent + it->phys_descent) * XFLOAT_DATA (lsp); 18769 extra_line_spacing = (it->phys_ascent + it->phys_descent)
18770 * XFLOAT_DATA (lsp);
18767 } 18771 }
18768 else if (it->char_to_display == '\t') 18772 else if (it->char_to_display == '\t')
18769 { 18773 {
@@ -21342,8 +21346,8 @@ phys_cursor_in_rect_p (w, r)
21342 I assume the effect is the same -- and this is portable. */ 21346 I assume the effect is the same -- and this is portable. */
21343 return x_intersect_rectangles (&cr, r, &result); 21347 return x_intersect_rectangles (&cr, r, &result);
21344 } 21348 }
21345 else 21349 /* If we don't understand the format, pretend we're not in the hot-spot. */
21346 return 0; 21350 return 0;
21347} 21351}
21348 21352
21349 21353