diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/.gdbinit | 8 | ||||
| -rw-r--r-- | src/alloc.c | 2 | ||||
| -rw-r--r-- | src/eval.c | 42 | ||||
| -rw-r--r-- | src/fns.c | 209 | ||||
| -rw-r--r-- | src/keyboard.c | 10 | ||||
| -rw-r--r-- | src/search.c | 55 | ||||
| -rw-r--r-- | src/xdisp.c | 12 | ||||
| -rw-r--r-- | src/xfns.c | 10 | ||||
| -rw-r--r-- | src/xterm.c | 15 |
9 files changed, 126 insertions, 237 deletions
diff --git a/src/.gdbinit b/src/.gdbinit index 91a921119e8..fd470e31384 100644 --- a/src/.gdbinit +++ b/src/.gdbinit | |||
| @@ -32,9 +32,12 @@ end | |||
| 32 | 32 | ||
| 33 | define xwindow | 33 | define xwindow |
| 34 | print (struct window *) ($ & 0x00ffffff) | 34 | print (struct window *) ($ & 0x00ffffff) |
| 35 | print ($->left)@4 | ||
| 36 | print $$ | ||
| 35 | end | 37 | end |
| 36 | document xwindow | 38 | document xwindow |
| 37 | Print $ as a window pointer, assuming it is an Elisp window value. | 39 | Print $ as a window pointer, assuming it is an Elisp window value. |
| 40 | Print the window's position as { left, top, height, width }. | ||
| 38 | end | 41 | end |
| 39 | 42 | ||
| 40 | define xmarker | 43 | define xmarker |
| @@ -46,9 +49,12 @@ end | |||
| 46 | 49 | ||
| 47 | define xbuffer | 50 | define xbuffer |
| 48 | print (struct buffer *) ($ & 0x00ffffff) | 51 | print (struct buffer *) ($ & 0x00ffffff) |
| 52 | print &((struct Lisp_String *) (($->name) & 0x00ffffff))->data | ||
| 53 | print $$ | ||
| 49 | end | 54 | end |
| 50 | document xbuffer | 55 | document xbuffer |
| 51 | Print $ as a buffer pointer, assuming it is an Elisp buffer value. | 56 | Set $ as a buffer pointer, assuming it is an Elisp buffer value. |
| 57 | Print the name of the buffer. | ||
| 52 | end | 58 | end |
| 53 | 59 | ||
| 54 | define xsymbol | 60 | define xsymbol |
diff --git a/src/alloc.c b/src/alloc.c index 9c63f8fe132..c0d92e33802 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -960,7 +960,7 @@ Does not copy symbols.") | |||
| 960 | 960 | ||
| 961 | struct gcpro *gcprolist; | 961 | struct gcpro *gcprolist; |
| 962 | 962 | ||
| 963 | #define NSTATICS 256 | 963 | #define NSTATICS 512 |
| 964 | 964 | ||
| 965 | Lisp_Object *staticvec[NSTATICS] = {0}; | 965 | Lisp_Object *staticvec[NSTATICS] = {0}; |
| 966 | 966 | ||
diff --git a/src/eval.c b/src/eval.c index d3d475f4d10..0e012d45008 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -41,8 +41,9 @@ struct backtrace | |||
| 41 | struct backtrace *next; | 41 | struct backtrace *next; |
| 42 | Lisp_Object *function; | 42 | Lisp_Object *function; |
| 43 | Lisp_Object *args; /* Points to vector of args. */ | 43 | Lisp_Object *args; /* Points to vector of args. */ |
| 44 | int nargs; /* length of vector */ | 44 | int nargs; /* Length of vector. |
| 45 | /* if nargs is UNEVALLED, args points to slot holding list of unevalled args */ | 45 | If nargs is UNEVALLED, args points to slot holding |
| 46 | list of unevalled args */ | ||
| 46 | char evalargs; | 47 | char evalargs; |
| 47 | /* Nonzero means call value of debugger when done with this operation. */ | 48 | /* Nonzero means call value of debugger when done with this operation. */ |
| 48 | char debug_on_exit; | 49 | char debug_on_exit; |
| @@ -451,20 +452,33 @@ and input is currently coming from the keyboard (not in keyboard macro).") | |||
| 451 | if (!INTERACTIVE) | 452 | if (!INTERACTIVE) |
| 452 | return Qnil; | 453 | return Qnil; |
| 453 | 454 | ||
| 454 | /* Unless the object was compiled, skip the frame of interactive-p itself | ||
| 455 | (if interpreted) or the frame of byte-code (if called from | ||
| 456 | compiled function). */ | ||
| 457 | btp = backtrace_list; | 455 | btp = backtrace_list; |
| 458 | if (XTYPE (*btp->function) != Lisp_Compiled) | 456 | |
| 457 | /* If this isn't a byte-compiled function, there may be a frame at | ||
| 458 | the top for Finteractive_p itself. If so, skip it. */ | ||
| 459 | fun = Findirect_function (*btp->function); | ||
| 460 | if (XTYPE (fun) == Lisp_Subr | ||
| 461 | && (struct Lisp_Subr *) XPNTR (fun) == &Sinteractive_p) | ||
| 459 | btp = btp->next; | 462 | btp = btp->next; |
| 460 | while (btp | 463 | |
| 461 | && (btp->nargs == UNEVALLED || EQ (*btp->function, Qbytecode))) | 464 | /* If we're running an Emacs 18-style byte-compiled function, there |
| 465 | may be a frame for Fbytecode. Now, given the strictest | ||
| 466 | definition, this function isn't really being called | ||
| 467 | interactively, but because that's the way Emacs 18 always builds | ||
| 468 | byte-compiled functions, we'll accept it for now. */ | ||
| 469 | if (EQ (*btp->function, Qbytecode)) | ||
| 470 | btp = btp->next; | ||
| 471 | |||
| 472 | /* If this isn't a byte-compiled function, then we may now be | ||
| 473 | looking at several frames for special forms. Skip past them. */ | ||
| 474 | while (btp && | ||
| 475 | btp->nargs == UNEVALLED) | ||
| 462 | btp = btp->next; | 476 | btp = btp->next; |
| 463 | 477 | ||
| 464 | /* btp now points at the frame of the innermost function | 478 | /* btp now points at the frame of the innermost function that isn't |
| 465 | that DOES eval its args. | 479 | a special form, ignoring frames for Finteractive_p and/or |
| 466 | If it is a built-in function (such as load or eval-region) | 480 | Fbytecode at the top. If this frame is for a built-in function |
| 467 | return nil. */ | 481 | (such as load or eval-region) return nil. */ |
| 468 | fun = Findirect_function (*btp->function); | 482 | fun = Findirect_function (*btp->function); |
| 469 | if (XTYPE (fun) == Lisp_Subr) | 483 | if (XTYPE (fun) == Lisp_Subr) |
| 470 | return Qnil; | 484 | return Qnil; |
| @@ -2320,8 +2334,8 @@ See also variable `debug-on-quit'."); | |||
| 2320 | 2334 | ||
| 2321 | DEFVAR_BOOL ("debug-on-quit", &debug_on_quit, | 2335 | DEFVAR_BOOL ("debug-on-quit", &debug_on_quit, |
| 2322 | "*Non-nil means enter debugger if quit is signaled (C-G, for example).\n\ | 2336 | "*Non-nil means enter debugger if quit is signaled (C-G, for example).\n\ |
| 2323 | Does not apply if quit is handled by a `condition-case'. | 2337 | Does not apply if quit is handled by a `condition-case'.\n\ |
| 2324 | A non-nil value is equivalent to a `debug-on-error' value containing 'quit."); | 2338 | A non-nil value is equivalent to a `debug-on-error' value containing `quit'."); |
| 2325 | debug_on_quit = 0; | 2339 | debug_on_quit = 0; |
| 2326 | 2340 | ||
| 2327 | DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, | 2341 | DEFVAR_BOOL ("debug-on-next-call", &debug_on_next_call, |
| @@ -20,41 +20,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 20 | 20 | ||
| 21 | #include "config.h" | 21 | #include "config.h" |
| 22 | 22 | ||
| 23 | #ifdef LOAD_AVE_TYPE | ||
| 24 | #ifdef BSD | ||
| 25 | /* It appears param.h defines BSD and BSD4_3 in 4.3 | ||
| 26 | and is not considerate enough to avoid bombing out | ||
| 27 | if they are already defined. */ | ||
| 28 | #undef BSD | ||
| 29 | #ifdef BSD4_3 | ||
| 30 | #undef BSD4_3 | ||
| 31 | #define XBSD4_3 /* XBSD4_3 says BSD4_3 is supposed to be defined. */ | ||
| 32 | #endif | ||
| 33 | #include <sys/param.h> | ||
| 34 | /* Now if BSD or BSD4_3 was defined and is no longer, | ||
| 35 | define it again. */ | ||
| 36 | #ifndef BSD | ||
| 37 | #define BSD | ||
| 38 | #endif | ||
| 39 | #ifdef XBSD4_3 | ||
| 40 | #ifndef BSD4_3 | ||
| 41 | #define BSD4_3 | ||
| 42 | #endif | ||
| 43 | #endif /* XBSD4_3 */ | ||
| 44 | #endif /* BSD */ | ||
| 45 | #ifndef VMS | ||
| 46 | #ifndef NLIST_STRUCT | ||
| 47 | #include <a.out.h> | ||
| 48 | #else /* NLIST_STRUCT */ | ||
| 49 | #include <nlist.h> | ||
| 50 | #endif /* NLIST_STRUCT */ | ||
| 51 | #endif /* not VMS */ | ||
| 52 | #endif /* LOAD_AVE_TYPE */ | ||
| 53 | |||
| 54 | #ifdef DGUX | ||
| 55 | #include <sys/dg_sys_info.h> /* for load average info - DJB */ | ||
| 56 | #endif | ||
| 57 | |||
| 58 | /* Note on some machines this defines `vector' as a typedef, | 23 | /* Note on some machines this defines `vector' as a typedef, |
| 59 | so make sure we don't use that name in this file. */ | 24 | so make sure we don't use that name in this file. */ |
| 60 | #undef vector | 25 | #undef vector |
| @@ -1226,171 +1191,27 @@ and can rub it out if not confirmed.") | |||
| 1226 | UNGCPRO; | 1191 | UNGCPRO; |
| 1227 | } | 1192 | } |
| 1228 | 1193 | ||
| 1229 | /* Avoid static vars inside a function since in HPUX they dump as pure. */ | ||
| 1230 | #ifdef DGUX | ||
| 1231 | static struct dg_sys_info_load_info load_info; /* what-a-mouthful! */ | ||
| 1232 | |||
| 1233 | #else /* Not DGUX */ | ||
| 1234 | |||
| 1235 | static int ldav_initialized; | ||
| 1236 | static int ldav_channel; | ||
| 1237 | #ifdef LOAD_AVE_TYPE | ||
| 1238 | #ifndef VMS | ||
| 1239 | static struct nlist ldav_nl[2]; | ||
| 1240 | #endif /* VMS */ | ||
| 1241 | #endif /* LOAD_AVE_TYPE */ | ||
| 1242 | |||
| 1243 | #define channel ldav_channel | ||
| 1244 | #define initialized ldav_initialized | ||
| 1245 | #define nl ldav_nl | ||
| 1246 | #endif /* Not DGUX */ | ||
| 1247 | |||
| 1248 | DEFUN ("load-average", Fload_average, Sload_average, 0, 0, 0, | 1194 | DEFUN ("load-average", Fload_average, Sload_average, 0, 0, 0, |
| 1249 | "Return list of 1 minute, 5 minute and 15 minute load averages.\n\ | 1195 | "Return list of 1 minute, 5 minute and 15 minute load averages.\n\ |
| 1250 | Each of the three load averages is multiplied by 100,\n\ | 1196 | Each of the three load averages is multiplied by 100,\n\ |
| 1251 | then converted to integer.") | 1197 | then converted to integer.\n\ |
| 1198 | If the 5-minute or 15-minute load averages are not available, return a\n\ | ||
| 1199 | shortened list, containing only those averages which are available.") | ||
| 1252 | () | 1200 | () |
| 1253 | { | 1201 | { |
| 1254 | #ifdef DGUX | 1202 | double load_ave[3]; |
| 1255 | /* perhaps there should be a "sys_load_avg" call in sysdep.c?! - DJB */ | 1203 | int loads = getloadavg (load_ave, 3); |
| 1256 | load_info.one_minute = 0.0; /* just in case there is an error */ | 1204 | Lisp_Object ret; |
| 1257 | load_info.five_minute = 0.0; | ||
| 1258 | load_info.fifteen_minute = 0.0; | ||
| 1259 | dg_sys_info (&load_info, DG_SYS_INFO_LOAD_INFO_TYPE, | ||
| 1260 | DG_SYS_INFO_LOAD_VERSION_0); | ||
| 1261 | |||
| 1262 | return Fcons (make_number ((int)(load_info.one_minute * 100.0)), | ||
| 1263 | Fcons (make_number ((int)(load_info.five_minute * 100.0)), | ||
| 1264 | Fcons (make_number ((int)(load_info.fifteen_minute * 100.0)), | ||
| 1265 | Qnil))); | ||
| 1266 | #else /* not DGUX */ | ||
| 1267 | #ifndef LOAD_AVE_TYPE | ||
| 1268 | error ("load-average not implemented for this operating system"); | ||
| 1269 | |||
| 1270 | #else /* LOAD_AVE_TYPE defined */ | ||
| 1271 | |||
| 1272 | LOAD_AVE_TYPE load_ave[3]; | ||
| 1273 | #ifdef VMS | ||
| 1274 | #ifndef eunice | ||
| 1275 | #include <iodef.h> | ||
| 1276 | #include <descrip.h> | ||
| 1277 | #else | ||
| 1278 | #include <vms/iodef.h> | ||
| 1279 | struct {int dsc$w_length; char *dsc$a_pointer;} descriptor; | ||
| 1280 | #endif /* eunice */ | ||
| 1281 | #endif /* VMS */ | ||
| 1282 | |||
| 1283 | /* If this fails for any reason, we can return (0 0 0) */ | ||
| 1284 | load_ave[0] = 0.0; load_ave[1] = 0.0; load_ave[2] = 0.0; | ||
| 1285 | |||
| 1286 | #ifdef VMS | ||
| 1287 | /* | ||
| 1288 | * VMS specific code -- read from the Load Ave driver | ||
| 1289 | */ | ||
| 1290 | |||
| 1291 | /* | ||
| 1292 | * Ensure that there is a channel open to the load ave device | ||
| 1293 | */ | ||
| 1294 | if (initialized == 0) | ||
| 1295 | { | ||
| 1296 | /* Attempt to open the channel */ | ||
| 1297 | #ifdef eunice | ||
| 1298 | descriptor.size = 18; | ||
| 1299 | descriptor.ptr = "$$VMS_LOAD_AVERAGE"; | ||
| 1300 | #else | ||
| 1301 | $DESCRIPTOR(descriptor, "LAV0:"); | ||
| 1302 | #endif | ||
| 1303 | if (sys$assign (&descriptor, &channel, 0, 0) & 1) | ||
| 1304 | initialized = 1; | ||
| 1305 | } | ||
| 1306 | /* | ||
| 1307 | * Read the load average vector | ||
| 1308 | */ | ||
| 1309 | if (initialized) | ||
| 1310 | { | ||
| 1311 | if (!(sys$qiow (0, channel, IO$_READVBLK, 0, 0, 0, | ||
| 1312 | load_ave, 12, 0, 0, 0, 0) | ||
| 1313 | & 1)) | ||
| 1314 | { | ||
| 1315 | sys$dassgn (channel); | ||
| 1316 | initialized = 0; | ||
| 1317 | } | ||
| 1318 | } | ||
| 1319 | #else /* not VMS */ | ||
| 1320 | /* | ||
| 1321 | * 4.2BSD UNIX-specific code -- read _avenrun from /dev/kmem | ||
| 1322 | */ | ||
| 1323 | |||
| 1324 | /* | ||
| 1325 | * Make sure we have the address of _avenrun | ||
| 1326 | */ | ||
| 1327 | if (nl[0].n_value == 0) | ||
| 1328 | { | ||
| 1329 | /* | ||
| 1330 | * Get the address of _avenrun | ||
| 1331 | */ | ||
| 1332 | #ifndef NLIST_STRUCT | ||
| 1333 | strcpy (nl[0].n_name, LDAV_SYMBOL); | ||
| 1334 | nl[1].n_zeroes = 0; | ||
| 1335 | #else /* NLIST_STRUCT */ | ||
| 1336 | #ifdef convex | ||
| 1337 | nl[0].n_un.n_name = LDAV_SYMBOL; | ||
| 1338 | nl[1].n_un.n_name = 0; | ||
| 1339 | #else /* not convex */ | ||
| 1340 | nl[0].n_name = LDAV_SYMBOL; | ||
| 1341 | nl[1].n_name = 0; | ||
| 1342 | #endif /* not convex */ | ||
| 1343 | #endif /* NLIST_STRUCT */ | ||
| 1344 | |||
| 1345 | nlist (KERNEL_FILE, nl); | ||
| 1346 | |||
| 1347 | #ifdef FIXUP_KERNEL_SYMBOL_ADDR | ||
| 1348 | FIXUP_KERNEL_SYMBOL_ADDR (nl); | ||
| 1349 | #endif /* FIXUP_KERNEL_SYMBOL_ADDR */ | ||
| 1350 | } | ||
| 1351 | /* | ||
| 1352 | * Make sure we have /dev/kmem open | ||
| 1353 | */ | ||
| 1354 | if (initialized == 0) | ||
| 1355 | { | ||
| 1356 | /* | ||
| 1357 | * Open /dev/kmem | ||
| 1358 | */ | ||
| 1359 | channel = open ("/dev/kmem", 0); | ||
| 1360 | if (channel >= 0) initialized = 1; | ||
| 1361 | } | ||
| 1362 | /* | ||
| 1363 | * If we can, get the load ave values | ||
| 1364 | */ | ||
| 1365 | if ((nl[0].n_value != 0) && (initialized != 0)) | ||
| 1366 | { | ||
| 1367 | /* | ||
| 1368 | * Seek to the correct address | ||
| 1369 | */ | ||
| 1370 | lseek (channel, (long) nl[0].n_value, 0); | ||
| 1371 | if (read (channel, load_ave, sizeof load_ave) | ||
| 1372 | != sizeof(load_ave)) | ||
| 1373 | { | ||
| 1374 | close (channel); | ||
| 1375 | initialized = 0; | ||
| 1376 | } | ||
| 1377 | } | ||
| 1378 | #endif /* not VMS */ | ||
| 1379 | |||
| 1380 | /* | ||
| 1381 | * Return the list of load average values | ||
| 1382 | */ | ||
| 1383 | return Fcons (make_number (LOAD_AVE_CVT (load_ave[0])), | ||
| 1384 | Fcons (make_number (LOAD_AVE_CVT (load_ave[1])), | ||
| 1385 | Fcons (make_number (LOAD_AVE_CVT (load_ave[2])), | ||
| 1386 | Qnil))); | ||
| 1387 | #endif /* LOAD_AVE_TYPE */ | ||
| 1388 | #endif /* not DGUX */ | ||
| 1389 | } | ||
| 1390 | 1205 | ||
| 1391 | #undef channel | 1206 | if (loads < 0) |
| 1392 | #undef initialized | 1207 | error ("load-average not implemented for this operating system"); |
| 1393 | #undef nl | 1208 | |
| 1209 | ret = Qnil; | ||
| 1210 | while (loads > 0) | ||
| 1211 | ret = Fcons (make_number ((int) (load_ave[--loads] * 100.0)), ret); | ||
| 1212 | |||
| 1213 | return ret; | ||
| 1214 | } | ||
| 1394 | 1215 | ||
| 1395 | Lisp_Object Vfeatures; | 1216 | Lisp_Object Vfeatures; |
| 1396 | 1217 | ||
diff --git a/src/keyboard.c b/src/keyboard.c index 12d936ad0d8..97b98c98b98 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1491,7 +1491,7 @@ kbd_buffer_store_event (event) | |||
| 1491 | get returned to Emacs as an event, the next event read | 1491 | get returned to Emacs as an event, the next event read |
| 1492 | will set Vlast_event_screen again, so this is safe to do. */ | 1492 | will set Vlast_event_screen again, so this is safe to do. */ |
| 1493 | extern SIGTYPE interrupt_signal (); | 1493 | extern SIGTYPE interrupt_signal (); |
| 1494 | XSET (Vlast_event_screen, Lisp_Screen, event->screen); | 1494 | Vlast_event_screen = SCREEN_FOCUS_SCREEN (event->screen); |
| 1495 | last_event_timestamp = event->timestamp; | 1495 | last_event_timestamp = event->timestamp; |
| 1496 | interrupt_signal (); | 1496 | interrupt_signal (); |
| 1497 | return; | 1497 | return; |
| @@ -1610,6 +1610,10 @@ kbd_buffer_get_event () | |||
| 1610 | { | 1610 | { |
| 1611 | if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) | 1611 | if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) |
| 1612 | kbd_fetch_ptr = kbd_buffer; | 1612 | kbd_fetch_ptr = kbd_buffer; |
| 1613 | /* Do the redirection specified by the focus_screen | ||
| 1614 | member now, before we return this event. */ | ||
| 1615 | kbd_fetch_ptr->screen = | ||
| 1616 | XSCREEN (SCREEN_FOCUS_SCREEN (kbd_fetch_ptr->screen)); | ||
| 1613 | XSET (Vlast_event_screen, Lisp_Screen, kbd_fetch_ptr->screen); | 1617 | XSET (Vlast_event_screen, Lisp_Screen, kbd_fetch_ptr->screen); |
| 1614 | last_event_timestamp = kbd_fetch_ptr->timestamp; | 1618 | last_event_timestamp = kbd_fetch_ptr->timestamp; |
| 1615 | obj = make_lispy_event (kbd_fetch_ptr); | 1619 | obj = make_lispy_event (kbd_fetch_ptr); |
| @@ -2765,7 +2769,7 @@ typed while in this function is treated like any other character, and\n\ | |||
| 2765 | GCPRO1 (keybuf[0]); | 2769 | GCPRO1 (keybuf[0]); |
| 2766 | gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0])); | 2770 | gcpro1.nvars = (sizeof keybuf/sizeof (keybuf[0])); |
| 2767 | 2771 | ||
| 2768 | if (! NILP (continue_echo)) | 2772 | if (NILP (continue_echo)) |
| 2769 | this_command_key_count = 0; | 2773 | this_command_key_count = 0; |
| 2770 | 2774 | ||
| 2771 | i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])), | 2775 | i = read_key_sequence (keybuf, (sizeof keybuf/sizeof (keybuf[0])), |
| @@ -3050,7 +3054,7 @@ Actually, the value is nil only if we can be sure that no input is available.") | |||
| 3050 | } | 3054 | } |
| 3051 | 3055 | ||
| 3052 | DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0, | 3056 | DEFUN ("recent-keys", Frecent_keys, Srecent_keys, 0, 0, 0, |
| 3053 | "Return a vector of last 100 events read from terminal.") | 3057 | "Return vector of last 100 chars read from terminal.") |
| 3054 | () | 3058 | () |
| 3055 | { | 3059 | { |
| 3056 | Lisp_Object val; | 3060 | Lisp_Object val; |
diff --git a/src/search.c b/src/search.c index 88eb72ab1f4..5e2a96c87fa 100644 --- a/src/search.c +++ b/src/search.c | |||
| @@ -59,9 +59,10 @@ Lisp_Object last_regexp; | |||
| 59 | able to free or re-allocate it properly. */ | 59 | able to free or re-allocate it properly. */ |
| 60 | static struct re_registers search_regs; | 60 | static struct re_registers search_regs; |
| 61 | 61 | ||
| 62 | /* Nonzero if search_regs are indices in a string; 0 if in a buffer. */ | 62 | /* The buffer in which the last search was performed, or |
| 63 | 63 | Qt if the last search was done in a string; | |
| 64 | static int search_regs_from_string; | 64 | Qnil if no searching has been done yet. */ |
| 65 | static Lisp_Object last_thing_searched; | ||
| 65 | 66 | ||
| 66 | /* error condition signalled when regexp compile_pattern fails */ | 67 | /* error condition signalled when regexp compile_pattern fails */ |
| 67 | 68 | ||
| @@ -178,7 +179,7 @@ data if you want to preserve them.") | |||
| 178 | search_regs.start[i] += BEGV; | 179 | search_regs.start[i] += BEGV; |
| 179 | search_regs.end[i] += BEGV; | 180 | search_regs.end[i] += BEGV; |
| 180 | } | 181 | } |
| 181 | search_regs_from_string = 0; | 182 | XSET (last_thing_searched, Lisp_Buffer, current_buffer); |
| 182 | immediate_quit = 0; | 183 | immediate_quit = 0; |
| 183 | return val; | 184 | return val; |
| 184 | } | 185 | } |
| @@ -219,7 +220,7 @@ matched by parenthesis constructs in the pattern.") | |||
| 219 | XSTRING (string)->size, s, XSTRING (string)->size - s, | 220 | XSTRING (string)->size, s, XSTRING (string)->size - s, |
| 220 | &search_regs); | 221 | &search_regs); |
| 221 | immediate_quit = 0; | 222 | immediate_quit = 0; |
| 222 | search_regs_from_string = 1; | 223 | last_thing_searched = Qt; |
| 223 | if (val == -2) | 224 | if (val == -2) |
| 224 | matcher_overflow (); | 225 | matcher_overflow (); |
| 225 | if (val < 0) return Qnil; | 226 | if (val < 0) return Qnil; |
| @@ -587,7 +588,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) | |||
| 587 | search_regs.start[i] += j; | 588 | search_regs.start[i] += j; |
| 588 | search_regs.end[i] += j; | 589 | search_regs.end[i] += j; |
| 589 | } | 590 | } |
| 590 | search_regs_from_string = 0; | 591 | XSET (last_thing_searched, Lisp_Buffer, current_buffer); |
| 591 | /* Set pos to the new position. */ | 592 | /* Set pos to the new position. */ |
| 592 | pos = search_regs.start[0]; | 593 | pos = search_regs.start[0]; |
| 593 | } | 594 | } |
| @@ -614,7 +615,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) | |||
| 614 | search_regs.start[i] += j; | 615 | search_regs.start[i] += j; |
| 615 | search_regs.end[i] += j; | 616 | search_regs.end[i] += j; |
| 616 | } | 617 | } |
| 617 | search_regs_from_string = 0; | 618 | XSET (last_thing_searched, Lisp_Buffer, current_buffer); |
| 618 | pos = search_regs.end[0]; | 619 | pos = search_regs.end[0]; |
| 619 | } | 620 | } |
| 620 | else | 621 | else |
| @@ -804,7 +805,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) | |||
| 804 | = pos + cursor - p2 + ((direction > 0) | 805 | = pos + cursor - p2 + ((direction > 0) |
| 805 | ? 1 - len : 0); | 806 | ? 1 - len : 0); |
| 806 | search_regs.end[0] = len + search_regs.start[0]; | 807 | search_regs.end[0] = len + search_regs.start[0]; |
| 807 | search_regs_from_string = 0; | 808 | XSET (last_thing_searched, Lisp_Buffer, current_buffer); |
| 808 | if ((n -= direction) != 0) | 809 | if ((n -= direction) != 0) |
| 809 | cursor += dirlen; /* to resume search */ | 810 | cursor += dirlen; /* to resume search */ |
| 810 | else | 811 | else |
| @@ -878,7 +879,7 @@ search_buffer (string, pos, lim, n, RE, trt, inverse_trt) | |||
| 878 | search_regs.start[0] | 879 | search_regs.start[0] |
| 879 | = pos + ((direction > 0) ? 1 - len : 0); | 880 | = pos + ((direction > 0) ? 1 - len : 0); |
| 880 | search_regs.end[0] = len + search_regs.start[0]; | 881 | search_regs.end[0] = len + search_regs.start[0]; |
| 881 | search_regs_from_string = 0; | 882 | XSET (last_thing_searched, Lisp_Buffer, current_buffer); |
| 882 | if ((n -= direction) != 0) | 883 | if ((n -= direction) != 0) |
| 883 | pos += dirlen; /* to resume search */ | 884 | pos += dirlen; /* to resume search */ |
| 884 | else | 885 | else |
| @@ -1221,6 +1222,9 @@ Use `store-match-data' to reinstate the data in this list.") | |||
| 1221 | Lisp_Object *data; | 1222 | Lisp_Object *data; |
| 1222 | int i, len; | 1223 | int i, len; |
| 1223 | 1224 | ||
| 1225 | if (NILP (last_thing_searched)) | ||
| 1226 | error ("match-data called before any match found"); | ||
| 1227 | |||
| 1224 | data = (Lisp_Object *) alloca ((2 * search_regs.num_regs) | 1228 | data = (Lisp_Object *) alloca ((2 * search_regs.num_regs) |
| 1225 | * sizeof (Lisp_Object)); | 1229 | * sizeof (Lisp_Object)); |
| 1226 | 1230 | ||
| @@ -1230,19 +1234,26 @@ Use `store-match-data' to reinstate the data in this list.") | |||
| 1230 | int start = search_regs.start[i]; | 1234 | int start = search_regs.start[i]; |
| 1231 | if (start >= 0) | 1235 | if (start >= 0) |
| 1232 | { | 1236 | { |
| 1233 | if (search_regs_from_string) | 1237 | if (EQ (last_thing_searched, Qt)) |
| 1234 | { | 1238 | { |
| 1235 | XFASTINT (data[2 * i]) = start; | 1239 | XFASTINT (data[2 * i]) = start; |
| 1236 | XFASTINT (data[2 * i + 1]) = search_regs.end[i]; | 1240 | XFASTINT (data[2 * i + 1]) = search_regs.end[i]; |
| 1237 | } | 1241 | } |
| 1238 | else | 1242 | else if (XTYPE (last_thing_searched) == Lisp_Buffer) |
| 1239 | { | 1243 | { |
| 1240 | data[2 * i] = Fmake_marker (); | 1244 | data[2 * i] = Fmake_marker (); |
| 1241 | Fset_marker (data[2 * i], make_number (start), Qnil); | 1245 | Fset_marker (data[2 * i], |
| 1246 | make_number (start), | ||
| 1247 | last_thing_searched); | ||
| 1242 | data[2 * i + 1] = Fmake_marker (); | 1248 | data[2 * i + 1] = Fmake_marker (); |
| 1243 | Fset_marker (data[2 * i + 1], | 1249 | Fset_marker (data[2 * i + 1], |
| 1244 | make_number (search_regs.end[i]), Qnil); | 1250 | make_number (search_regs.end[i]), |
| 1251 | last_thing_searched); | ||
| 1245 | } | 1252 | } |
| 1253 | else | ||
| 1254 | /* last_thing_searched must always be Qt, a buffer, or Qnil. */ | ||
| 1255 | abort (); | ||
| 1256 | |||
| 1246 | len = i; | 1257 | len = i; |
| 1247 | } | 1258 | } |
| 1248 | else | 1259 | else |
| @@ -1264,6 +1275,10 @@ LIST should have been created by calling `match-data' previously.") | |||
| 1264 | if (!CONSP (list) && !NILP (list)) | 1275 | if (!CONSP (list) && !NILP (list)) |
| 1265 | list = wrong_type_argument (Qconsp, list, 0); | 1276 | list = wrong_type_argument (Qconsp, list, 0); |
| 1266 | 1277 | ||
| 1278 | /* Unless we find a marker with a buffer in LIST, assume that this | ||
| 1279 | match data came from a string. */ | ||
| 1280 | last_thing_searched = Qt; | ||
| 1281 | |||
| 1267 | /* Allocate registers if they don't already exist. */ | 1282 | /* Allocate registers if they don't already exist. */ |
| 1268 | { | 1283 | { |
| 1269 | int length = Flength (list) / 2; | 1284 | int length = Flength (list) / 2; |
| @@ -1302,9 +1317,14 @@ LIST should have been created by calling `match-data' previously.") | |||
| 1302 | } | 1317 | } |
| 1303 | else | 1318 | else |
| 1304 | { | 1319 | { |
| 1305 | if (XTYPE (marker) == Lisp_Marker | 1320 | if (XTYPE (marker) == Lisp_Marker) |
| 1306 | && XMARKER (marker)->buffer == 0) | 1321 | { |
| 1307 | XFASTINT (marker) = 0; | 1322 | if (XMARKER (marker)->buffer == 0) |
| 1323 | XFASTINT (marker) = 0; | ||
| 1324 | else | ||
| 1325 | XSET (last_thing_searched, Lisp_Buffer, | ||
| 1326 | XMARKER (marker)->buffer); | ||
| 1327 | } | ||
| 1308 | 1328 | ||
| 1309 | CHECK_NUMBER_COERCE_MARKER (marker, 0); | 1329 | CHECK_NUMBER_COERCE_MARKER (marker, 0); |
| 1310 | search_regs.start[i] = XINT (marker); | 1330 | search_regs.start[i] = XINT (marker); |
| @@ -1383,6 +1403,9 @@ syms_of_search () | |||
| 1383 | last_regexp = Qnil; | 1403 | last_regexp = Qnil; |
| 1384 | staticpro (&last_regexp); | 1404 | staticpro (&last_regexp); |
| 1385 | 1405 | ||
| 1406 | last_thing_searched = Qnil; | ||
| 1407 | staticpro (&last_thing_searched); | ||
| 1408 | |||
| 1386 | defsubr (&Sstring_match); | 1409 | defsubr (&Sstring_match); |
| 1387 | defsubr (&Slooking_at); | 1410 | defsubr (&Slooking_at); |
| 1388 | defsubr (&Sskip_chars_forward); | 1411 | defsubr (&Sskip_chars_forward); |
diff --git a/src/xdisp.c b/src/xdisp.c index 2045f7f9f2c..60bdafea9d8 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -311,6 +311,18 @@ echo_area_display () | |||
| 311 | /* If desired cursor location is on this line, put it at end of text */ | 311 | /* If desired cursor location is on this line, put it at end of text */ |
| 312 | if (SCREEN_CURSOR_Y (s) == vpos) | 312 | if (SCREEN_CURSOR_Y (s) == vpos) |
| 313 | SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos]; | 313 | SCREEN_CURSOR_X (s) = s->desired_glyphs->used[vpos]; |
| 314 | |||
| 315 | /* Fill the rest of the minibuffer window with blank lines. */ | ||
| 316 | { | ||
| 317 | int i; | ||
| 318 | |||
| 319 | for (i = vpos + 1; i < vpos + XWINDOW (minibuf_window)->height; i++) | ||
| 320 | { | ||
| 321 | get_display_line (s, i, 0); | ||
| 322 | display_string (XWINDOW (minibuf_window), vpos, | ||
| 323 | "", 0, 0, 0, SCREEN_WIDTH (s)); | ||
| 324 | } | ||
| 325 | } | ||
| 314 | } | 326 | } |
| 315 | else if (!EQ (minibuf_window, selected_window)) | 327 | else if (!EQ (minibuf_window, selected_window)) |
| 316 | windows_or_buffers_changed++; | 328 | windows_or_buffers_changed++; |
diff --git a/src/xfns.c b/src/xfns.c index 6d32925f95b..6eb248c6baf 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -1043,6 +1043,10 @@ x_set_name (s, arg, oldval) | |||
| 1043 | { | 1043 | { |
| 1044 | CHECK_STRING (arg, 0); | 1044 | CHECK_STRING (arg, 0); |
| 1045 | 1045 | ||
| 1046 | /* Don't change the name if it's already ARG. */ | ||
| 1047 | if (! NILP (Fstring_equal (arg, s->name))) | ||
| 1048 | return; | ||
| 1049 | |||
| 1046 | if (s->display.x->window_desc) | 1050 | if (s->display.x->window_desc) |
| 1047 | { | 1051 | { |
| 1048 | #ifdef HAVE_X11 | 1052 | #ifdef HAVE_X11 |
| @@ -1056,7 +1060,6 @@ x_set_name (s, arg, oldval) | |||
| 1056 | XSetWMIconName (XDISPLAY s->display.x->window_desc, &prop); | 1060 | XSetWMIconName (XDISPLAY s->display.x->window_desc, &prop); |
| 1057 | UNBLOCK_INPUT; | 1061 | UNBLOCK_INPUT; |
| 1058 | #else | 1062 | #else |
| 1059 | s->name = arg; | ||
| 1060 | BLOCK_INPUT; | 1063 | BLOCK_INPUT; |
| 1061 | XStoreName (XDISPLAY s->display.x->window_desc, | 1064 | XStoreName (XDISPLAY s->display.x->window_desc, |
| 1062 | (char *) XSTRING (arg)->data); | 1065 | (char *) XSTRING (arg)->data); |
| @@ -1065,6 +1068,8 @@ x_set_name (s, arg, oldval) | |||
| 1065 | UNBLOCK_INPUT; | 1068 | UNBLOCK_INPUT; |
| 1066 | #endif | 1069 | #endif |
| 1067 | } | 1070 | } |
| 1071 | |||
| 1072 | s->name = arg; | ||
| 1068 | } | 1073 | } |
| 1069 | 1074 | ||
| 1070 | void | 1075 | void |
| @@ -1868,8 +1873,9 @@ be shared by the new screen.") | |||
| 1868 | build_string ("white"), "background", string); | 1873 | build_string ("white"), "background", string); |
| 1869 | x_default_parameter (s, parms, "border-width", | 1874 | x_default_parameter (s, parms, "border-width", |
| 1870 | make_number (2), "BorderWidth", number); | 1875 | make_number (2), "BorderWidth", number); |
| 1876 | /* This defaults to 2 in order to match XTerms. */ | ||
| 1871 | x_default_parameter (s, parms, "internal-border-width", | 1877 | x_default_parameter (s, parms, "internal-border-width", |
| 1872 | make_number (1), "InternalBorderWidth", number); | 1878 | make_number (2), "InternalBorderWidth", number); |
| 1873 | 1879 | ||
| 1874 | /* Also do the stuff which must be set before the window exists. */ | 1880 | /* Also do the stuff which must be set before the window exists. */ |
| 1875 | x_default_parameter (s, parms, "foreground-color", | 1881 | x_default_parameter (s, parms, "foreground-color", |
diff --git a/src/xterm.c b/src/xterm.c index 7bf039a1cf1..194f8d6177a 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -1995,7 +1995,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 1995 | { | 1995 | { |
| 1996 | bufp->kind = non_ascii_keystroke; | 1996 | bufp->kind = non_ascii_keystroke; |
| 1997 | XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); | 1997 | XSET (bufp->code, Lisp_Int, (unsigned) keysym - 0xff50); |
| 1998 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 1998 | bufp->screen = s; |
| 1999 | bufp->modifiers = x_convert_modifiers (modifiers); | 1999 | bufp->modifiers = x_convert_modifiers (modifiers); |
| 2000 | bufp->timestamp = event.xkey.time; | 2000 | bufp->timestamp = event.xkey.time; |
| 2001 | bufp++; | 2001 | bufp++; |
| @@ -2012,7 +2012,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2012 | *copy_buffer |= METABIT; | 2012 | *copy_buffer |= METABIT; |
| 2013 | bufp->kind = ascii_keystroke; | 2013 | bufp->kind = ascii_keystroke; |
| 2014 | XSET (bufp->code, Lisp_Int, *copy_buffer); | 2014 | XSET (bufp->code, Lisp_Int, *copy_buffer); |
| 2015 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 2015 | bufp->screen = s; |
| 2016 | bufp->timestamp = event.xkey.time; | 2016 | bufp->timestamp = event.xkey.time; |
| 2017 | bufp++; | 2017 | bufp++; |
| 2018 | } | 2018 | } |
| @@ -2021,7 +2021,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2021 | { | 2021 | { |
| 2022 | bufp->kind = ascii_keystroke; | 2022 | bufp->kind = ascii_keystroke; |
| 2023 | XSET (bufp->code, Lisp_Int, copy_buffer[i]); | 2023 | XSET (bufp->code, Lisp_Int, copy_buffer[i]); |
| 2024 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 2024 | bufp->screen = s; |
| 2025 | bufp->timestamp = event.xkey.time; | 2025 | bufp->timestamp = event.xkey.time; |
| 2026 | bufp++; | 2026 | bufp++; |
| 2027 | } | 2027 | } |
| @@ -2071,7 +2071,7 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2071 | bufp->kind = ascii_keystroke; | 2071 | bufp->kind = ascii_keystroke; |
| 2072 | XSET (bufp->code, Lisp_Int, where_mapping[i]); | 2072 | XSET (bufp->code, Lisp_Int, where_mapping[i]); |
| 2073 | XSET (bufp->time, Lisp_Int, event.xkey.time); | 2073 | XSET (bufp->time, Lisp_Int, event.xkey.time); |
| 2074 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 2074 | bufp->screen = s; |
| 2075 | bufp++; | 2075 | bufp++; |
| 2076 | } | 2076 | } |
| 2077 | count += nbytes; | 2077 | count += nbytes; |
| @@ -2308,13 +2308,13 @@ XTread_socket (sd, bufp, numchars, waitp, expected) | |||
| 2308 | { | 2308 | { |
| 2309 | bufp->kind = ascii_keystroke; | 2309 | bufp->kind = ascii_keystroke; |
| 2310 | bufp->code = (char) 'X' & 037; /* C-x */ | 2310 | bufp->code = (char) 'X' & 037; /* C-x */ |
| 2311 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 2311 | bufp->screen = s; |
| 2312 | XSET (bufp->time, Lisp_Int, event.xkey.time); | 2312 | XSET (bufp->time, Lisp_Int, event.xkey.time); |
| 2313 | bufp++; | 2313 | bufp++; |
| 2314 | 2314 | ||
| 2315 | bufp->kind = ascii_keystroke; | 2315 | bufp->kind = ascii_keystroke; |
| 2316 | bufp->code = (char) 0; /* C-@ */ | 2316 | bufp->code = (char) 0; /* C-@ */ |
| 2317 | bufp->screen = XSCREEN (SCREEN_FOCUS_SCREEN (s)); | 2317 | bufp->screen = s; |
| 2318 | XSET (bufp->time, Lisp_Int, event.xkey.time); | 2318 | XSET (bufp->time, Lisp_Int, event.xkey.time); |
| 2319 | bufp++; | 2319 | bufp++; |
| 2320 | 2320 | ||
| @@ -3606,6 +3606,9 @@ x_wm_set_size_hint (s, prompting) | |||
| 3606 | Window window = s->display.x->window_desc; | 3606 | Window window = s->display.x->window_desc; |
| 3607 | 3607 | ||
| 3608 | size_hints.flags = PResizeInc | PMinSize | PMaxSize; | 3608 | size_hints.flags = PResizeInc | PMinSize | PMaxSize; |
| 3609 | #ifdef PBaseSize | ||
| 3610 | size_hints.flags |= PBaseSize; | ||
| 3611 | #endif | ||
| 3609 | 3612 | ||
| 3610 | flexlines = s->height; | 3613 | flexlines = s->height; |
| 3611 | 3614 | ||