aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKaroly Lorentey2004-11-13 18:21:48 +0000
committerKaroly Lorentey2004-11-13 18:21:48 +0000
commitf590a2a442d19f3a74d7bbd02bbcb4e3239f2327 (patch)
tree0ea1998c7a87cdc3faa9d00d3ea71b981cc1153a /src
parent050ddd28da8d0bb44f06575e93c6bd7feb758829 (diff)
parentc37ee7cb84b11bf38e1f391b2015a2ec74e5c4e1 (diff)
downloademacs-f590a2a442d19f3a74d7bbd02bbcb4e3239f2327.tar.gz
emacs-f590a2a442d19f3a74d7bbd02bbcb4e3239f2327.zip
Merged in changes from CVS trunk.
Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-672 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-266
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/config.in3
-rw-r--r--src/editfns.c46
-rw-r--r--src/eval.c2
-rw-r--r--src/fns.c9
-rw-r--r--src/frame.c2
-rw-r--r--src/macros.c4
-rw-r--r--src/print.c9
-rw-r--r--src/xmenu.c23
9 files changed, 106 insertions, 18 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a38c3f7baeb..b65bb2d5714 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,5 +1,31 @@
12004-11-06 Lars Brinkhoff <lars@nocrew.org>
2
3 * config.in: Regenerate (add HAVE_GETRUSAGE).
4 * editfns.c (Fget_internal_run_time): New function.
5 (syms_of_data): Defsubr it.
6 * fns.c (sxhash): As far as possible, merge calculation of
7 hash code for symbols and strings.
8
92004-11-06 Eli Zaretskii <eliz@gnu.org>
10
11 * frame.c (syms_of_frame): Fix the example in the doc string.
12
132004-11-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
14
15 * eval.c (Feval): Remove check for INPUT_BLOCKED_P.
16
17 * xmenu.c (popup_get_selection, create_and_show_popup_menu)
18 (create_and_show_dialog): Revert change from 2004-10-31.
19
20
212004-11-05 Luc Teirlinck <teirllm@auburn.edu>
22
23 * macros.c (syms_of_macros) <defining-kbd-macro>: Doc fix.
24
12004-11-05 Kim F. Storm <storm@cua.dk> 252004-11-05 Kim F. Storm <storm@cua.dk>
2 26
27 * print.c (print_object): Print Lisp_Misc_Save_Value objects.
28
3 * fileio.c (Ffile_modes): Doc fix. 29 * fileio.c (Ffile_modes): Doc fix.
4 (auto_save_1): Check for Ffile_modes nil value. 30 (auto_save_1): Check for Ffile_modes nil value.
5 31
diff --git a/src/config.in b/src/config.in
index a2087b98b1f..c253f0c411b 100644
--- a/src/config.in
+++ b/src/config.in
@@ -196,6 +196,9 @@ Boston, MA 02111-1307, USA. */
196/* Define to 1 if you have the `getpt' function. */ 196/* Define to 1 if you have the `getpt' function. */
197#undef HAVE_GETPT 197#undef HAVE_GETPT
198 198
199/* Define to 1 if you have the `getrusage' function. */
200#undef HAVE_GETRUSAGE
201
199/* Define to 1 if you have the `getsockname' function. */ 202/* Define to 1 if you have the `getsockname' function. */
200#undef HAVE_GETSOCKNAME 203#undef HAVE_GETSOCKNAME
201 204
diff --git a/src/editfns.c b/src/editfns.c
index e83e53e9d24..2e8134d4495 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -39,6 +39,10 @@ Boston, MA 02111-1307, USA. */
39#include <stdio.h> 39#include <stdio.h>
40#endif 40#endif
41 41
42#if defined HAVE_SYS_RESOURCE_H
43#include <sys/resource.h>
44#endif
45
42#include <ctype.h> 46#include <ctype.h>
43 47
44#include "lisp.h" 48#include "lisp.h"
@@ -1375,6 +1379,47 @@ resolution finer than a second. */)
1375 1379
1376 return Flist (3, result); 1380 return Flist (3, result);
1377} 1381}
1382
1383DEFUN ("get-internal-run-time", Fget_internal_run_time, Sget_internal_run_time,
1384 0, 0, 0,
1385 doc: /* Return the current run time used by Emacs.
1386The time is returned as a list of three integers. The first has the
1387most significant 16 bits of the seconds, while the second has the
1388least significant 16 bits. The third integer gives the microsecond
1389count.
1390
1391On systems that can't determine the run time, get-internal-run-time
1392does the same thing as current-time. The microsecond count is zero on
1393systems that do not provide resolution finer than a second. */)
1394 ()
1395{
1396#ifdef HAVE_GETRUSAGE
1397 struct rusage usage;
1398 Lisp_Object result[3];
1399 int secs, usecs;
1400
1401 if (getrusage (RUSAGE_SELF, &usage) < 0)
1402 /* This shouldn't happen. What action is appropriate? */
1403 Fsignal (Qerror, Qnil);
1404
1405 /* Sum up user time and system time. */
1406 secs = usage.ru_utime.tv_sec + usage.ru_stime.tv_sec;
1407 usecs = usage.ru_utime.tv_usec + usage.ru_stime.tv_usec;
1408 if (usecs >= 1000000)
1409 {
1410 usecs -= 1000000;
1411 secs++;
1412 }
1413
1414 XSETINT (result[0], (secs >> 16) & 0xffff);
1415 XSETINT (result[1], (secs >> 0) & 0xffff);
1416 XSETINT (result[2], usecs);
1417
1418 return Flist (3, result);
1419#else
1420 return Fcurrent_time ();
1421#endif
1422}
1378 1423
1379 1424
1380int 1425int
@@ -4315,6 +4360,7 @@ functions if all the text being accessed has this property. */);
4315 defsubr (&Suser_full_name); 4360 defsubr (&Suser_full_name);
4316 defsubr (&Semacs_pid); 4361 defsubr (&Semacs_pid);
4317 defsubr (&Scurrent_time); 4362 defsubr (&Scurrent_time);
4363 defsubr (&Sget_internal_run_time);
4318 defsubr (&Sformat_time_string); 4364 defsubr (&Sformat_time_string);
4319 defsubr (&Sfloat_time); 4365 defsubr (&Sfloat_time);
4320 defsubr (&Sdecode_time); 4366 defsubr (&Sdecode_time);
diff --git a/src/eval.c b/src/eval.c
index 5fb35cee58b..d1d5d195762 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1996,7 +1996,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0,
1996 struct backtrace backtrace; 1996 struct backtrace backtrace;
1997 struct gcpro gcpro1, gcpro2, gcpro3; 1997 struct gcpro gcpro1, gcpro2, gcpro3;
1998 1998
1999 if (handling_signal || INPUT_BLOCKED_P) 1999 if (handling_signal)
2000 abort (); 2000 abort ();
2001 2001
2002 if (SYMBOLP (form)) 2002 if (SYMBOLP (form))
diff --git a/src/fns.c b/src/fns.c
index b366cab196a..e0167ebf990 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -5007,15 +5007,14 @@ sxhash (obj, depth)
5007 hash = XUINT (obj); 5007 hash = XUINT (obj);
5008 break; 5008 break;
5009 5009
5010 case Lisp_Symbol:
5011 hash = sxhash_string (SDATA (SYMBOL_NAME (obj)),
5012 SCHARS (SYMBOL_NAME (obj)));
5013 break;
5014
5015 case Lisp_Misc: 5010 case Lisp_Misc:
5016 hash = XUINT (obj); 5011 hash = XUINT (obj);
5017 break; 5012 break;
5018 5013
5014 case Lisp_Symbol:
5015 obj = SYMBOL_NAME (obj);
5016 /* Fall through. */
5017
5019 case Lisp_String: 5018 case Lisp_String:
5020 hash = sxhash_string (SDATA (obj), SCHARS (obj)); 5019 hash = sxhash_string (SDATA (obj), SCHARS (obj));
5021 break; 5020 break;
diff --git a/src/frame.c b/src/frame.c
index 1935df35508..80d1876ef11 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -4285,7 +4285,7 @@ is a reasonable practice. See also the variable `x-resource-name'. */);
4285 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist, 4285 DEFVAR_LISP ("default-frame-alist", &Vdefault_frame_alist,
4286 doc: /* Alist of default values for frame creation. 4286 doc: /* Alist of default values for frame creation.
4287These may be set in your init file, like this: 4287These may be set in your init file, like this:
4288 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)) 4288 (setq default-frame-alist '((width . 80) (height . 55) (menu-bar-lines . 1)))
4289These override values given in window system configuration data, 4289These override values given in window system configuration data,
4290 including X Windows' defaults database. 4290 including X Windows' defaults database.
4291For values specific to the first Emacs frame, see `initial-frame-alist'. 4291For values specific to the first Emacs frame, see `initial-frame-alist'.
diff --git a/src/macros.c b/src/macros.c
index d0219a3be04..09ae87b0a59 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -392,7 +392,9 @@ syms_of_macros ()
392 defsubr (&Sstore_kbd_macro_event); 392 defsubr (&Sstore_kbd_macro_event);
393 393
394 DEFVAR_KBOARD ("defining-kbd-macro", defining_kbd_macro, 394 DEFVAR_KBOARD ("defining-kbd-macro", defining_kbd_macro,
395 doc: /* Non-nil while a keyboard macro is being defined. Don't set this! */); 395 doc: /* Non-nil while a keyboard macro is being defined. Don't set this!
396The value is the symbol `append' while appending to the definition of
397an existing macro. */);
396 398
397 DEFVAR_LISP ("executing-macro", &Vexecuting_macro, 399 DEFVAR_LISP ("executing-macro", &Vexecuting_macro,
398 doc: /* Currently executing keyboard macro (string or vector); nil if none executing. */); 400 doc: /* Currently executing keyboard macro (string or vector); nil if none executing. */);
diff --git a/src/print.c b/src/print.c
index 5a0f7fe6220..76c648b9a2e 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2085,6 +2085,15 @@ print_object (obj, printcharfun, escapeflag)
2085 PRINTCHAR ('>'); 2085 PRINTCHAR ('>');
2086 break; 2086 break;
2087 2087
2088 case Lisp_Misc_Save_Value:
2089 strout ("#<save_value ", -1, -1, printcharfun, 0);
2090 sprintf(buf, "ptr=0x%08x int=%d",
2091 (unsigned long) XSAVE_VALUE (obj)->pointer,
2092 XSAVE_VALUE (obj)->integer);
2093 strout (buf, -1, -1, printcharfun, 0);
2094 PRINTCHAR ('>');
2095 break;
2096
2088 default: 2097 default:
2089 goto badtype; 2098 goto badtype;
2090 } 2099 }
diff --git a/src/xmenu.c b/src/xmenu.c
index 145e4f70b9c..a08f4610101 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -115,7 +115,7 @@ extern XtAppContext Xt_app_con;
115 115
116static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **)); 116static Lisp_Object xdialog_show P_ ((FRAME_PTR, int, Lisp_Object, char **));
117static void popup_get_selection P_ ((XEvent *, struct x_display_info *, 117static void popup_get_selection P_ ((XEvent *, struct x_display_info *,
118 LWLIB_ID, int)); 118 LWLIB_ID, int, int));
119 119
120/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */ 120/* Define HAVE_BOXES if menus can handle radio and toggle buttons. */
121 121
@@ -157,6 +157,8 @@ static void single_keymap_panes P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
157static void list_of_panes P_ ((Lisp_Object)); 157static void list_of_panes P_ ((Lisp_Object));
158static void list_of_items P_ ((Lisp_Object)); 158static void list_of_items P_ ((Lisp_Object));
159 159
160extern EMACS_TIME timer_check P_ ((int));
161
160 162
161/* This holds a Lisp vector that holds the results of decoding 163/* This holds a Lisp vector that holds the results of decoding
162 the keymaps or alist-of-alists that specify a menu. 164 the keymaps or alist-of-alists that specify a menu.
@@ -1122,27 +1124,27 @@ on the left of the dialog box and all following items on the right.
1122 1124
1123 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed. 1125 If DOWN_ON_KEYPRESS is nonzero, pop down if a key is pressed.
1124 1126
1125 This function used to have a DO_TIMERS argument which was
1126 1 in the dialog case, and caused it to run Lisp-level timers.
1127 That was unsafe so we removed it, but does anyone remember
1128 why menus and dialogs were treated differently?
1129
1130 NOTE: All calls to popup_get_selection should be protected 1127 NOTE: All calls to popup_get_selection should be protected
1131 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */ 1128 with BLOCK_INPUT, UNBLOCK_INPUT wrappers. */
1132 1129
1133#ifdef USE_X_TOOLKIT 1130#ifdef USE_X_TOOLKIT
1134static void 1131static void
1135popup_get_selection (initial_event, dpyinfo, id, down_on_keypress) 1132popup_get_selection (initial_event, dpyinfo, id, do_timers, down_on_keypress)
1136 XEvent *initial_event; 1133 XEvent *initial_event;
1137 struct x_display_info *dpyinfo; 1134 struct x_display_info *dpyinfo;
1138 LWLIB_ID id; 1135 LWLIB_ID id;
1136 int do_timers;
1139 int down_on_keypress; 1137 int down_on_keypress;
1140{ 1138{
1141 XEvent event; 1139 XEvent event;
1142 1140
1143 while (popup_activated_flag) 1141 while (popup_activated_flag)
1144 { 1142 {
1145 if (initial_event) 1143 /* If we have no events to run, consider timers. */
1144 if (do_timers && !XtAppPending (Xt_app_con))
1145 timer_check (1);
1146
1147 if (initial_event)
1146 { 1148 {
1147 event = *initial_event; 1149 event = *initial_event;
1148 initial_event = 0; 1150 initial_event = 0;
@@ -2488,7 +2490,7 @@ create_and_show_popup_menu (f, first_wv, x, y, for_click)
2488 popup_activated_flag = 1; 2490 popup_activated_flag = 1;
2489 2491
2490 /* Process events that apply to the menu. */ 2492 /* Process events that apply to the menu. */
2491 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0); 2493 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), menu_id, 0, 0);
2492 2494
2493 /* fp turned off the following statement and wrote a comment 2495 /* fp turned off the following statement and wrote a comment
2494 that it is unnecessary--that the menu has already disappeared. 2496 that it is unnecessary--that the menu has already disappeared.
@@ -2882,7 +2884,8 @@ create_and_show_dialog (f, first_wv)
2882 Fcons (make_number (dialog_id >> (fact)), 2884 Fcons (make_number (dialog_id >> (fact)),
2883 make_number (dialog_id & ~(-1 << (fact))))); 2885 make_number (dialog_id & ~(-1 << (fact)))));
2884 2886
2885 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id, 1); 2887 popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f),
2888 dialog_id, 1, 1);
2886 2889
2887 unbind_to (count, Qnil); 2890 unbind_to (count, Qnil);
2888 } 2891 }