/* Lisp functions pertaining to editing.
- Copyright (C) 1985,86,87,89,93,94,95,96,97,98, 1999, 2000
+ Copyright (C) 1985,86,87,89,93,94,95,96,97,98, 1999, 2000, 2001
Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "buffer.h"
#include "charset.h"
#include "coding.h"
+#include "frame.h"
#include "window.h"
#include "systime.h"
+#ifdef STDC_HEADERS
+#include <float.h>
+#define MAX_10_EXP DBL_MAX_10_EXP
+#else
+#define MAX_10_EXP 310
+#endif
+
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))
}
\f
+#if 0 /* Not used. */
+
/* Return nonzero if POS1 and POS2 have the same value
for the text property PROP. */
return EQ (pval1, pval2);
}
+#endif /* 0 */
+
/* Return the direction from which the text-property PROP would be
inherited by any new text inserted at POS: 1 if it would be
inherited from the char after POS, -1 if it would be inherited from
tem = XCDR (info);
if (visible_p
&& !EQ (tem, selected_window)
- /* This also verifies that the window is still live. */
- && XBUFFER (XWINDOW (tem)->buffer) == current_buffer)
+ && (tem1 = XWINDOW (tem)->buffer,
+ (/* Window is live... */
+ BUFFERP (tem1)
+ /* ...and it shows the current buffer. */
+ && XBUFFER (tem1) == current_buffer)))
Fset_window_point (tem, make_number (PT));
UNGCPRO;
instead of the current time. The argument should have the forms:\n\
(HIGH . LOW) or (HIGH LOW USEC) or (HIGH LOW . USEC).\n\
Thus, you can use times obtained from `current-time'\n\
-and from `file-attributes'.")
+and from `file-attributes'.\n\
+\n\
+WARNING: Since the result is floating point, it may not be exact.\n\
+Do not use this function if precise time stamps are required.")
(specified_time)
Lisp_Object specified_time;
{
if (! lisp_time_argument (specified_time, &sec, &usec))
error ("Invalid time specification");
- return make_float (sec + usec * 0.0000001);
+ return make_float ((sec * 1e6 + usec) / 1e6);
}
/* Write information into buffer S of size MAXSIZE, according to the
/* On Japanese w32, we can get a Japanese string as time
zone name. Don't accept that. */
char *p;
- for (p = s; *p && isalnum (*p); ++p)
+ for (p = s; *p && (isalnum (*p) || *p == ' '); ++p)
;
if (p == s || *p)
s = NULL;
return unbind_to (count, val);
}
\f
-#ifndef HAVE_MENUS
-
-/* Buffer for the most recent text displayed by Fmessage. */
+/* Buffer for the most recent text displayed by Fmessage_box. */
static char *message_text;
/* Allocated length of that buffer. */
static int message_length;
-#endif /* not HAVE_MENUS */
-
DEFUN ("message", Fmessage, Smessage, 1, MANY, 0,
"Print a one-line message at the bottom of the screen.\n\
The first argument is a format control string, and the rest are data\n\
register Lisp_Object val;
val = Fformat (nargs, args);
#ifdef HAVE_MENUS
+ /* The MS-DOS frames support popup menus even though they are
+ not FRAME_WINDOW_P. */
+ if (FRAME_WINDOW_P (XFRAME (selected_frame))
+ || FRAME_MSDOS_P (XFRAME (selected_frame)))
{
Lisp_Object pane, menu, obj;
struct gcpro gcpro1;
UNGCPRO;
return val;
}
-#else /* not HAVE_MENUS */
+#endif /* HAVE_MENUS */
/* Copy the data so that it won't move when we GC. */
if (! message_text)
{
message2 (message_text, STRING_BYTES (XSTRING (val)),
STRING_MULTIBYTE (val));
return val;
-#endif /* not HAVE_MENUS */
}
}
#ifdef HAVE_MENUS
/* Note that we're using sprintf to print floats,
so we have to take into account what that function
prints. */
- thissize = 200 + precision;
+ thissize = MAX_10_EXP + 100 + precision;
}
else
{