diff options
| author | Jim Blandy | 1992-01-13 21:48:08 +0000 |
|---|---|---|
| committer | Jim Blandy | 1992-01-13 21:48:08 +0000 |
| commit | 265a9e559da4ac72d154ecd638c51801b3e97847 (patch) | |
| tree | 633e4dc50761c2cd5201a7874e23eee9e51aecea /src | |
| parent | d427b66a664c0e1ffc818dfa5b87b45b4857d2ae (diff) | |
| download | emacs-265a9e559da4ac72d154ecd638c51801b3e97847.tar.gz emacs-265a9e559da4ac72d154ecd638c51801b3e97847.zip | |
*** empty log message ***
Diffstat (limited to 'src')
| -rw-r--r-- | src/alloc.c | 10 | ||||
| -rw-r--r-- | src/buffer.c | 111 | ||||
| -rw-r--r-- | src/buffer.h | 3 | ||||
| -rw-r--r-- | src/bytecode.c | 26 | ||||
| -rw-r--r-- | src/callint.c | 22 | ||||
| -rw-r--r-- | src/cmds.c | 30 | ||||
| -rw-r--r-- | src/commands.h | 2 | ||||
| -rw-r--r-- | src/dired.c | 18 | ||||
| -rw-r--r-- | src/dispextern.h | 23 | ||||
| -rw-r--r-- | src/doc.c | 11 | ||||
| -rw-r--r-- | src/eval.c | 104 | ||||
| -rw-r--r-- | src/fileio.c | 83 | ||||
| -rw-r--r-- | src/filelock.c | 13 | ||||
| -rw-r--r-- | src/floatfns.c | 41 | ||||
| -rw-r--r-- | src/fns.c | 89 | ||||
| -rw-r--r-- | src/frame.c | 34 | ||||
| -rw-r--r-- | src/frame.h | 37 | ||||
| -rw-r--r-- | src/hftctl.c | 420 | ||||
| -rw-r--r-- | src/keymap.c | 152 | ||||
| -rw-r--r-- | src/lread.c | 56 | ||||
| -rw-r--r-- | src/macros.c | 8 | ||||
| -rw-r--r-- | src/ralloc.c | 2 | ||||
| -rw-r--r-- | src/sunfns.c | 4 | ||||
| -rw-r--r-- | src/syntax.c | 22 | ||||
| -rw-r--r-- | src/termhooks.h | 44 | ||||
| -rw-r--r-- | src/undo.c | 12 | ||||
| -rw-r--r-- | src/unexaix.c | 4 | ||||
| -rw-r--r-- | src/unexec.c | 65 | ||||
| -rw-r--r-- | src/window.c | 246 | ||||
| -rw-r--r-- | src/xdisp.c | 74 | ||||
| -rw-r--r-- | src/xfns.c | 130 | ||||
| -rw-r--r-- | src/xmenu.c | 4 | ||||
| -rw-r--r-- | src/xrdb.c | 3 | ||||
| -rw-r--r-- | src/xselect.c.old | 16 | ||||
| -rw-r--r-- | src/xterm.c | 4 | ||||
| -rw-r--r-- | src/xterm.h | 3 |
36 files changed, 1013 insertions, 913 deletions
diff --git a/src/alloc.c b/src/alloc.c index 856ac104c9d..24bb67c6dda 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -329,7 +329,7 @@ Any number of arguments, even zero arguments, are allowed.") | |||
| 329 | XFASTINT (len) = nargs; | 329 | XFASTINT (len) = nargs; |
| 330 | val = Fmake_list (len, Qnil); | 330 | val = Fmake_list (len, Qnil); |
| 331 | val_tail = val; | 331 | val_tail = val; |
| 332 | while (!NULL (val_tail)) | 332 | while (!NILP (val_tail)) |
| 333 | { | 333 | { |
| 334 | XCONS (val_tail)->car = *args++; | 334 | XCONS (val_tail)->car = *args++; |
| 335 | val_tail = XCONS (val_tail)->cdr; | 335 | val_tail = XCONS (val_tail)->cdr; |
| @@ -425,14 +425,14 @@ significance.") | |||
| 425 | register struct Lisp_Vector *p; | 425 | register struct Lisp_Vector *p; |
| 426 | 426 | ||
| 427 | XFASTINT (len) = nargs; | 427 | XFASTINT (len) = nargs; |
| 428 | if (!NULL (Vpurify_flag)) | 428 | if (!NILP (Vpurify_flag)) |
| 429 | val = make_pure_vector (len); | 429 | val = make_pure_vector (len); |
| 430 | else | 430 | else |
| 431 | val = Fmake_vector (len, Qnil); | 431 | val = Fmake_vector (len, Qnil); |
| 432 | p = XVECTOR (val); | 432 | p = XVECTOR (val); |
| 433 | for (index = 0; index < nargs; index++) | 433 | for (index = 0; index < nargs; index++) |
| 434 | { | 434 | { |
| 435 | if (!NULL (Vpurify_flag)) | 435 | if (!NILP (Vpurify_flag)) |
| 436 | args[index] = Fpurecopy (args[index]); | 436 | args[index] = Fpurecopy (args[index]); |
| 437 | p->contents[index] = args[index]; | 437 | p->contents[index] = args[index]; |
| 438 | } | 438 | } |
| @@ -905,7 +905,7 @@ Does not copy symbols.") | |||
| 905 | register Lisp_Object new, tem; | 905 | register Lisp_Object new, tem; |
| 906 | register int i; | 906 | register int i; |
| 907 | 907 | ||
| 908 | if (NULL (Vpurify_flag)) | 908 | if (NILP (Vpurify_flag)) |
| 909 | return obj; | 909 | return obj; |
| 910 | 910 | ||
| 911 | if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) | 911 | if ((PNTR_COMPARISON_TYPE) XPNTR (obj) < (PNTR_COMPARISON_TYPE) ((char *) pure + PURESIZE) |
| @@ -1041,7 +1041,7 @@ Garbage collection happens automatically if you cons more than\n\ | |||
| 1041 | 1041 | ||
| 1042 | /* Save a copy of the contents of the stack, for debugging. */ | 1042 | /* Save a copy of the contents of the stack, for debugging. */ |
| 1043 | #if MAX_SAVE_STACK > 0 | 1043 | #if MAX_SAVE_STACK > 0 |
| 1044 | if (NULL (Vpurify_flag)) | 1044 | if (NILP (Vpurify_flag)) |
| 1045 | { | 1045 | { |
| 1046 | i = &stack_top_variable - stack_bottom; | 1046 | i = &stack_top_variable - stack_bottom; |
| 1047 | if (i < 0) i = -i; | 1047 | if (i < 0) i = -i; |
diff --git a/src/buffer.c b/src/buffer.c index 68575d845f0..55d85f979ba 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -25,9 +25,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 25 | #define MAXPATHLEN 1024 | 25 | #define MAXPATHLEN 1024 |
| 26 | #endif /* not MAXPATHLEN */ | 26 | #endif /* not MAXPATHLEN */ |
| 27 | 27 | ||
| 28 | #ifdef NULL | ||
| 29 | #undef NULL | ||
| 30 | #endif | ||
| 31 | #include "config.h" | 28 | #include "config.h" |
| 32 | #include "lisp.h" | 29 | #include "lisp.h" |
| 33 | #include "window.h" | 30 | #include "window.h" |
| @@ -163,7 +160,7 @@ If there is no such live buffer, return nil.") | |||
| 163 | if (XTYPE (buf) != Lisp_Buffer) continue; | 160 | if (XTYPE (buf) != Lisp_Buffer) continue; |
| 164 | if (XTYPE (XBUFFER (buf)->filename) != Lisp_String) continue; | 161 | if (XTYPE (XBUFFER (buf)->filename) != Lisp_String) continue; |
| 165 | tem = Fstring_equal (XBUFFER (buf)->filename, filename); | 162 | tem = Fstring_equal (XBUFFER (buf)->filename, filename); |
| 166 | if (!NULL (tem)) | 163 | if (!NILP (tem)) |
| 167 | return buf; | 164 | return buf; |
| 168 | } | 165 | } |
| 169 | return Qnil; | 166 | return Qnil; |
| @@ -185,7 +182,7 @@ The value is never nil.") | |||
| 185 | register struct buffer *b; | 182 | register struct buffer *b; |
| 186 | 183 | ||
| 187 | buf = Fget_buffer (name); | 184 | buf = Fget_buffer (name); |
| 188 | if (!NULL (buf)) | 185 | if (!NILP (buf)) |
| 189 | return buf; | 186 | return buf; |
| 190 | 187 | ||
| 191 | b = (struct buffer *) malloc (sizeof (struct buffer)); | 188 | b = (struct buffer *) malloc (sizeof (struct buffer)); |
| @@ -227,14 +224,14 @@ The value is never nil.") | |||
| 227 | b->name = name; | 224 | b->name = name; |
| 228 | 225 | ||
| 229 | function = buffer_defaults.major_mode; | 226 | function = buffer_defaults.major_mode; |
| 230 | if (NULL (function)) | 227 | if (NILP (function)) |
| 231 | { | 228 | { |
| 232 | tem = Fget (current_buffer->major_mode, Qmode_class); | 229 | tem = Fget (current_buffer->major_mode, Qmode_class); |
| 233 | if (EQ (tem, Qnil)) | 230 | if (EQ (tem, Qnil)) |
| 234 | function = current_buffer->major_mode; | 231 | function = current_buffer->major_mode; |
| 235 | } | 232 | } |
| 236 | 233 | ||
| 237 | if (NULL (function) || EQ (function, Qfundamental_mode)) | 234 | if (NILP (function) || EQ (function, Qfundamental_mode)) |
| 238 | return buf; | 235 | return buf; |
| 239 | 236 | ||
| 240 | /* To select a nonfundamental mode, | 237 | /* To select a nonfundamental mode, |
| @@ -327,7 +324,7 @@ until an unused name is found, and then return that name.") | |||
| 327 | CHECK_STRING (name, 0); | 324 | CHECK_STRING (name, 0); |
| 328 | 325 | ||
| 329 | tem = Fget_buffer (name); | 326 | tem = Fget_buffer (name); |
| 330 | if (NULL (tem)) | 327 | if (NILP (tem)) |
| 331 | return name; | 328 | return name; |
| 332 | 329 | ||
| 333 | count = 1; | 330 | count = 1; |
| @@ -336,7 +333,7 @@ until an unused name is found, and then return that name.") | |||
| 336 | sprintf (number, "<%d>", ++count); | 333 | sprintf (number, "<%d>", ++count); |
| 337 | gentemp = concat2 (name, build_string (number)); | 334 | gentemp = concat2 (name, build_string (number)); |
| 338 | tem = Fget_buffer (gentemp); | 335 | tem = Fget_buffer (gentemp); |
| 339 | if (NULL (tem)) | 336 | if (NILP (tem)) |
| 340 | return gentemp; | 337 | return gentemp; |
| 341 | } | 338 | } |
| 342 | } | 339 | } |
| @@ -348,7 +345,7 @@ With no argument or nil as argument, return the name of the current buffer.") | |||
| 348 | (buffer) | 345 | (buffer) |
| 349 | register Lisp_Object buffer; | 346 | register Lisp_Object buffer; |
| 350 | { | 347 | { |
| 351 | if (NULL (buffer)) | 348 | if (NILP (buffer)) |
| 352 | return current_buffer->name; | 349 | return current_buffer->name; |
| 353 | CHECK_BUFFER (buffer, 0); | 350 | CHECK_BUFFER (buffer, 0); |
| 354 | return XBUFFER (buffer)->name; | 351 | return XBUFFER (buffer)->name; |
| @@ -360,7 +357,7 @@ No argument or nil as argument means use the current buffer.") | |||
| 360 | (buffer) | 357 | (buffer) |
| 361 | register Lisp_Object buffer; | 358 | register Lisp_Object buffer; |
| 362 | { | 359 | { |
| 363 | if (NULL (buffer)) | 360 | if (NILP (buffer)) |
| 364 | return current_buffer->filename; | 361 | return current_buffer->filename; |
| 365 | CHECK_BUFFER (buffer, 0); | 362 | CHECK_BUFFER (buffer, 0); |
| 366 | return XBUFFER (buffer)->filename; | 363 | return XBUFFER (buffer)->filename; |
| @@ -378,7 +375,7 @@ No argument or nil as argument means use current buffer as BUFFER.") | |||
| 378 | register struct buffer *buf; | 375 | register struct buffer *buf; |
| 379 | register Lisp_Object val; | 376 | register Lisp_Object val; |
| 380 | 377 | ||
| 381 | if (NULL (buffer)) | 378 | if (NILP (buffer)) |
| 382 | buf = current_buffer; | 379 | buf = current_buffer; |
| 383 | else | 380 | else |
| 384 | { | 381 | { |
| @@ -433,7 +430,7 @@ No argument or nil as argument means use current buffer as BUFFER.") | |||
| 433 | register Lisp_Object buffer; | 430 | register Lisp_Object buffer; |
| 434 | { | 431 | { |
| 435 | register struct buffer *buf; | 432 | register struct buffer *buf; |
| 436 | if (NULL (buffer)) | 433 | if (NILP (buffer)) |
| 437 | buf = current_buffer; | 434 | buf = current_buffer; |
| 438 | else | 435 | else |
| 439 | { | 436 | { |
| @@ -459,17 +456,17 @@ A non-nil FLAG means mark the buffer modified.") | |||
| 459 | If buffer becoming unmodified, unlock the file. */ | 456 | If buffer becoming unmodified, unlock the file. */ |
| 460 | 457 | ||
| 461 | fn = current_buffer->filename; | 458 | fn = current_buffer->filename; |
| 462 | if (!NULL (fn)) | 459 | if (!NILP (fn)) |
| 463 | { | 460 | { |
| 464 | already = current_buffer->save_modified < MODIFF; | 461 | already = current_buffer->save_modified < MODIFF; |
| 465 | if (!already && !NULL (flag)) | 462 | if (!already && !NILP (flag)) |
| 466 | lock_file (fn); | 463 | lock_file (fn); |
| 467 | else if (already && NULL (flag)) | 464 | else if (already && NILP (flag)) |
| 468 | unlock_file (fn); | 465 | unlock_file (fn); |
| 469 | } | 466 | } |
| 470 | #endif /* CLASH_DETECTION */ | 467 | #endif /* CLASH_DETECTION */ |
| 471 | 468 | ||
| 472 | current_buffer->save_modified = NULL (flag) ? MODIFF : 0; | 469 | current_buffer->save_modified = NILP (flag) ? MODIFF : 0; |
| 473 | update_mode_lines++; | 470 | update_mode_lines++; |
| 474 | return flag; | 471 | return flag; |
| 475 | } | 472 | } |
| @@ -484,7 +481,7 @@ No argument or nil as argument means use current buffer as BUFFER.") | |||
| 484 | register Lisp_Object buffer; | 481 | register Lisp_Object buffer; |
| 485 | { | 482 | { |
| 486 | register struct buffer *buf; | 483 | register struct buffer *buf; |
| 487 | if (NULL (buffer)) | 484 | if (NILP (buffer)) |
| 488 | buf = current_buffer; | 485 | buf = current_buffer; |
| 489 | else | 486 | else |
| 490 | { | 487 | { |
| @@ -513,9 +510,9 @@ This does not change the name of the visited file (if any).") | |||
| 513 | tem = Fget_buffer (name); | 510 | tem = Fget_buffer (name); |
| 514 | if (XBUFFER (tem) == current_buffer) | 511 | if (XBUFFER (tem) == current_buffer) |
| 515 | return current_buffer->name; | 512 | return current_buffer->name; |
| 516 | if (!NULL (tem)) | 513 | if (!NILP (tem)) |
| 517 | { | 514 | { |
| 518 | if (!NULL (distinguish)) | 515 | if (!NILP (distinguish)) |
| 519 | name = Fgenerate_new_buffer_name (name); | 516 | name = Fgenerate_new_buffer_name (name); |
| 520 | else | 517 | else |
| 521 | error ("Buffer name \"%s\" is in use", XSTRING (name)->data); | 518 | error ("Buffer name \"%s\" is in use", XSTRING (name)->data); |
| @@ -524,7 +521,7 @@ This does not change the name of the visited file (if any).") | |||
| 524 | current_buffer->name = name; | 521 | current_buffer->name = name; |
| 525 | XSET (buf, Lisp_Buffer, current_buffer); | 522 | XSET (buf, Lisp_Buffer, current_buffer); |
| 526 | Fsetcar (Frassq (buf, Vbuffer_alist), name); | 523 | Fsetcar (Frassq (buf, Vbuffer_alist), name); |
| 527 | if (NULL (current_buffer->filename) && !NULL (current_buffer->auto_save_file_name)) | 524 | if (NILP (current_buffer->filename) && !NILP (current_buffer->auto_save_file_name)) |
| 528 | call0 (intern ("rename-auto-save-file")); | 525 | call0 (intern ("rename-auto-save-file")); |
| 529 | return name; | 526 | return name; |
| 530 | } | 527 | } |
| @@ -540,7 +537,7 @@ If BUFFER is omitted or nil, some interesting buffer is returned.") | |||
| 540 | register Lisp_Object tail, buf, notsogood, tem; | 537 | register Lisp_Object tail, buf, notsogood, tem; |
| 541 | notsogood = Qnil; | 538 | notsogood = Qnil; |
| 542 | 539 | ||
| 543 | for (tail = Vbuffer_alist; !NULL (tail); tail = Fcdr (tail)) | 540 | for (tail = Vbuffer_alist; !NILP (tail); tail = Fcdr (tail)) |
| 544 | { | 541 | { |
| 545 | buf = Fcdr (Fcar (tail)); | 542 | buf = Fcdr (Fcar (tail)); |
| 546 | if (EQ (buf, buffer)) | 543 | if (EQ (buf, buffer)) |
| @@ -548,12 +545,12 @@ If BUFFER is omitted or nil, some interesting buffer is returned.") | |||
| 548 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') | 545 | if (XSTRING (XBUFFER (buf)->name)->data[0] == ' ') |
| 549 | continue; | 546 | continue; |
| 550 | tem = Fget_buffer_window (buf, Qnil); | 547 | tem = Fget_buffer_window (buf, Qnil); |
| 551 | if (NULL (tem)) | 548 | if (NILP (tem)) |
| 552 | return buf; | 549 | return buf; |
| 553 | if (NULL (notsogood)) | 550 | if (NILP (notsogood)) |
| 554 | notsogood = buf; | 551 | notsogood = buf; |
| 555 | } | 552 | } |
| 556 | if (!NULL (notsogood)) | 553 | if (!NILP (notsogood)) |
| 557 | return notsogood; | 554 | return notsogood; |
| 558 | return Fget_buffer_create (build_string ("*scratch*")); | 555 | return Fget_buffer_create (build_string ("*scratch*")); |
| 559 | } | 556 | } |
| @@ -579,12 +576,12 @@ No argument or nil as argument means do this for the current buffer.") | |||
| 579 | register struct buffer *b; | 576 | register struct buffer *b; |
| 580 | register Lisp_Object buf1; | 577 | register Lisp_Object buf1; |
| 581 | 578 | ||
| 582 | if (NULL (buf)) | 579 | if (NILP (buf)) |
| 583 | b = current_buffer; | 580 | b = current_buffer; |
| 584 | else | 581 | else |
| 585 | { | 582 | { |
| 586 | buf1 = Fget_buffer (buf); | 583 | buf1 = Fget_buffer (buf); |
| 587 | if (NULL (buf1)) nsberror (buf); | 584 | if (NILP (buf1)) nsberror (buf); |
| 588 | b = XBUFFER (buf1); | 585 | b = XBUFFER (buf1); |
| 589 | } | 586 | } |
| 590 | 587 | ||
| @@ -620,24 +617,24 @@ with `delete-process'.") | |||
| 620 | register struct Lisp_Marker *m; | 617 | register struct Lisp_Marker *m; |
| 621 | struct gcpro gcpro1, gcpro2; | 618 | struct gcpro gcpro1, gcpro2; |
| 622 | 619 | ||
| 623 | if (NULL (bufname)) | 620 | if (NILP (bufname)) |
| 624 | buf = Fcurrent_buffer (); | 621 | buf = Fcurrent_buffer (); |
| 625 | else | 622 | else |
| 626 | buf = Fget_buffer (bufname); | 623 | buf = Fget_buffer (bufname); |
| 627 | if (NULL (buf)) | 624 | if (NILP (buf)) |
| 628 | nsberror (bufname); | 625 | nsberror (bufname); |
| 629 | 626 | ||
| 630 | b = XBUFFER (buf); | 627 | b = XBUFFER (buf); |
| 631 | 628 | ||
| 632 | /* Query if the buffer is still modified. */ | 629 | /* Query if the buffer is still modified. */ |
| 633 | if (INTERACTIVE && !NULL (b->filename) | 630 | if (INTERACTIVE && !NILP (b->filename) |
| 634 | && BUF_MODIFF (b) > b->save_modified) | 631 | && BUF_MODIFF (b) > b->save_modified) |
| 635 | { | 632 | { |
| 636 | GCPRO2 (buf, bufname); | 633 | GCPRO2 (buf, bufname); |
| 637 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", | 634 | tem = do_yes_or_no_p (format1 ("Buffer %s modified; kill anyway? ", |
| 638 | XSTRING (b->name)->data)); | 635 | XSTRING (b->name)->data)); |
| 639 | UNGCPRO; | 636 | UNGCPRO; |
| 640 | if (NULL (tem)) | 637 | if (NILP (tem)) |
| 641 | return Qnil; | 638 | return Qnil; |
| 642 | } | 639 | } |
| 643 | 640 | ||
| @@ -660,7 +657,7 @@ with `delete-process'.") | |||
| 660 | if (EQ (buf, XWINDOW (minibuf_window)->buffer)) | 657 | if (EQ (buf, XWINDOW (minibuf_window)->buffer)) |
| 661 | return Qnil; | 658 | return Qnil; |
| 662 | 659 | ||
| 663 | if (NULL (b->name)) | 660 | if (NILP (b->name)) |
| 664 | return Qnil; | 661 | return Qnil; |
| 665 | 662 | ||
| 666 | /* Make this buffer not be current. | 663 | /* Make this buffer not be current. |
| @@ -696,7 +693,7 @@ with `delete-process'.") | |||
| 696 | { | 693 | { |
| 697 | Lisp_Object tem; | 694 | Lisp_Object tem; |
| 698 | tem = Fsymbol_value (intern ("delete-auto-save-files")); | 695 | tem = Fsymbol_value (intern ("delete-auto-save-files")); |
| 699 | if (! NULL (tem)) | 696 | if (! NILP (tem)) |
| 700 | unlink (XSTRING (b->auto_save_file_name)->data); | 697 | unlink (XSTRING (b->auto_save_file_name)->data); |
| 701 | } | 698 | } |
| 702 | 699 | ||
| @@ -739,7 +736,7 @@ record_buffer (buf) | |||
| 739 | /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist) | 736 | /* Effectively do Vbuffer_alist = Fdelq (link, Vbuffer_alist) |
| 740 | but cannot use Fdelq here it that allows quitting. */ | 737 | but cannot use Fdelq here it that allows quitting. */ |
| 741 | 738 | ||
| 742 | if (NULL (prev)) | 739 | if (NILP (prev)) |
| 743 | Vbuffer_alist = XCONS (Vbuffer_alist)->cdr; | 740 | Vbuffer_alist = XCONS (Vbuffer_alist)->cdr; |
| 744 | else | 741 | else |
| 745 | XCONS (prev)->cdr = XCONS (XCONS (prev)->cdr)->cdr; | 742 | XCONS (prev)->cdr = XCONS (XCONS (prev)->cdr)->cdr; |
| @@ -766,15 +763,15 @@ the window-buffer correspondences.") | |||
| 766 | if (EQ (minibuf_window, selected_window)) | 763 | if (EQ (minibuf_window, selected_window)) |
| 767 | error ("Cannot switch buffers in minibuffer window"); | 764 | error ("Cannot switch buffers in minibuffer window"); |
| 768 | tem = Fwindow_dedicated_p (selected_window); | 765 | tem = Fwindow_dedicated_p (selected_window); |
| 769 | if (!NULL (tem)) | 766 | if (!NILP (tem)) |
| 770 | error ("Cannot switch buffers in a dedicated window"); | 767 | error ("Cannot switch buffers in a dedicated window"); |
| 771 | 768 | ||
| 772 | if (NULL (bufname)) | 769 | if (NILP (bufname)) |
| 773 | buf = Fother_buffer (Fcurrent_buffer ()); | 770 | buf = Fother_buffer (Fcurrent_buffer ()); |
| 774 | else | 771 | else |
| 775 | buf = Fget_buffer_create (bufname); | 772 | buf = Fget_buffer_create (bufname); |
| 776 | Fset_buffer (buf); | 773 | Fset_buffer (buf); |
| 777 | if (NULL (norecord)) | 774 | if (NILP (norecord)) |
| 778 | record_buffer (buf); | 775 | record_buffer (buf); |
| 779 | 776 | ||
| 780 | Fset_window_buffer (EQ (selected_window, minibuf_window) | 777 | Fset_window_buffer (EQ (selected_window, minibuf_window) |
| @@ -794,7 +791,7 @@ window even if BUFFER is already visible in the selected window.") | |||
| 794 | Lisp_Object bufname, other; | 791 | Lisp_Object bufname, other; |
| 795 | { | 792 | { |
| 796 | register Lisp_Object buf; | 793 | register Lisp_Object buf; |
| 797 | if (NULL (bufname)) | 794 | if (NILP (bufname)) |
| 798 | buf = Fother_buffer (Fcurrent_buffer ()); | 795 | buf = Fother_buffer (Fcurrent_buffer ()); |
| 799 | else | 796 | else |
| 800 | buf = Fget_buffer_create (bufname); | 797 | buf = Fget_buffer_create (bufname); |
| @@ -834,7 +831,7 @@ set_buffer_internal (b) | |||
| 834 | /* Look down buffer's list of local Lisp variables | 831 | /* Look down buffer's list of local Lisp variables |
| 835 | to find and update any that forward into C variables. */ | 832 | to find and update any that forward into C variables. */ |
| 836 | 833 | ||
| 837 | for (tail = b->local_var_alist; !NULL (tail); tail = XCONS (tail)->cdr) | 834 | for (tail = b->local_var_alist; !NILP (tail); tail = XCONS (tail)->cdr) |
| 838 | { | 835 | { |
| 839 | valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; | 836 | valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; |
| 840 | if ((XTYPE (valcontents) == Lisp_Buffer_Local_Value | 837 | if ((XTYPE (valcontents) == Lisp_Buffer_Local_Value |
| @@ -850,7 +847,7 @@ set_buffer_internal (b) | |||
| 850 | /* Do the same with any others that were local to the previous buffer */ | 847 | /* Do the same with any others that were local to the previous buffer */ |
| 851 | 848 | ||
| 852 | if (old_buf) | 849 | if (old_buf) |
| 853 | for (tail = old_buf->local_var_alist; !NULL (tail); tail = XCONS (tail)->cdr) | 850 | for (tail = old_buf->local_var_alist; !NILP (tail); tail = XCONS (tail)->cdr) |
| 854 | { | 851 | { |
| 855 | valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; | 852 | valcontents = XSYMBOL (XCONS (XCONS (tail)->car)->car)->value; |
| 856 | if ((XTYPE (valcontents) == Lisp_Buffer_Local_Value | 853 | if ((XTYPE (valcontents) == Lisp_Buffer_Local_Value |
| @@ -876,9 +873,9 @@ Use `switch-to-buffer' or `pop-to-buffer' to switch buffers permanently.") | |||
| 876 | { | 873 | { |
| 877 | register Lisp_Object buffer; | 874 | register Lisp_Object buffer; |
| 878 | buffer = Fget_buffer (bufname); | 875 | buffer = Fget_buffer (bufname); |
| 879 | if (NULL (buffer)) | 876 | if (NILP (buffer)) |
| 880 | nsberror (bufname); | 877 | nsberror (bufname); |
| 881 | if (NULL (XBUFFER (buffer)->name)) | 878 | if (NILP (XBUFFER (buffer)->name)) |
| 882 | error ("Selecting deleted buffer"); | 879 | error ("Selecting deleted buffer"); |
| 883 | set_buffer_internal (XBUFFER (buffer)); | 880 | set_buffer_internal (XBUFFER (buffer)); |
| 884 | return buffer; | 881 | return buffer; |
| @@ -889,7 +886,7 @@ DEFUN ("barf-if-buffer-read-only", Fbarf_if_buffer_read_only, | |||
| 889 | "Signal a `buffer-read-only' error if the current buffer is read-only.") | 886 | "Signal a `buffer-read-only' error if the current buffer is read-only.") |
| 890 | () | 887 | () |
| 891 | { | 888 | { |
| 892 | while (!NULL (current_buffer->read_only)) | 889 | while (!NILP (current_buffer->read_only)) |
| 893 | Fsignal (Qbuffer_read_only, (Fcons (Fcurrent_buffer (), Qnil))); | 890 | Fsignal (Qbuffer_read_only, (Fcons (Fcurrent_buffer (), Qnil))); |
| 894 | return Qnil; | 891 | return Qnil; |
| 895 | } | 892 | } |
| @@ -903,7 +900,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.") | |||
| 903 | { | 900 | { |
| 904 | register Lisp_Object aelt, link; | 901 | register Lisp_Object aelt, link; |
| 905 | 902 | ||
| 906 | if (NULL (buf)) | 903 | if (NILP (buf)) |
| 907 | { | 904 | { |
| 908 | XSET (buf, Lisp_Buffer, current_buffer); | 905 | XSET (buf, Lisp_Buffer, current_buffer); |
| 909 | Fswitch_to_buffer (Fother_buffer (buf), Qnil); | 906 | Fswitch_to_buffer (Fother_buffer (buf), Qnil); |
| @@ -913,7 +910,7 @@ thus, the least likely buffer for \\[switch-to-buffer] to select by default.") | |||
| 913 | Lisp_Object buf1; | 910 | Lisp_Object buf1; |
| 914 | 911 | ||
| 915 | buf1 = Fget_buffer (buf); | 912 | buf1 = Fget_buffer (buf); |
| 916 | if (NULL (buf1)) | 913 | if (NILP (buf1)) |
| 917 | nsberror (buf); | 914 | nsberror (buf); |
| 918 | buf = buf1; | 915 | buf = buf1; |
| 919 | } | 916 | } |
| @@ -983,7 +980,7 @@ list_buffers_1 (files) | |||
| 983 | 980 | ||
| 984 | tail = intern ("Buffer-menu-mode"); | 981 | tail = intern ("Buffer-menu-mode"); |
| 985 | if (!EQ (tail, current_buffer->major_mode) | 982 | if (!EQ (tail, current_buffer->major_mode) |
| 986 | && (tem = Ffboundp (tail), !NULL (tem))) | 983 | && (tem = Ffboundp (tail), !NILP (tem))) |
| 987 | call0 (tail); | 984 | call0 (tail); |
| 988 | Fbuffer_disable_undo (Vstandard_output); | 985 | Fbuffer_disable_undo (Vstandard_output); |
| 989 | current_buffer->read_only = Qnil; | 986 | current_buffer->read_only = Qnil; |
| @@ -992,7 +989,7 @@ list_buffers_1 (files) | |||
| 992 | MR Buffer Size Mode File\n\ | 989 | MR Buffer Size Mode File\n\ |
| 993 | -- ------ ---- ---- ----\n", -1); | 990 | -- ------ ---- ---- ----\n", -1); |
| 994 | 991 | ||
| 995 | for (tail = Vbuffer_alist; !NULL (tail); tail = Fcdr (tail)) | 992 | for (tail = Vbuffer_alist; !NILP (tail); tail = Fcdr (tail)) |
| 996 | { | 993 | { |
| 997 | buf = Fcdr (Fcar (tail)); | 994 | buf = Fcdr (Fcar (tail)); |
| 998 | b = XBUFFER (buf); | 995 | b = XBUFFER (buf); |
| @@ -1000,7 +997,7 @@ list_buffers_1 (files) | |||
| 1000 | if (XSTRING (b->name)->data[0] == ' ') | 997 | if (XSTRING (b->name)->data[0] == ' ') |
| 1001 | continue; | 998 | continue; |
| 1002 | /* Optionally don't mention buffers that lack files. */ | 999 | /* Optionally don't mention buffers that lack files. */ |
| 1003 | if (!NULL (files) && NULL (b->filename)) | 1000 | if (!NILP (files) && NILP (b->filename)) |
| 1004 | continue; | 1001 | continue; |
| 1005 | /* Identify the current buffer. */ | 1002 | /* Identify the current buffer. */ |
| 1006 | if (b == old) | 1003 | if (b == old) |
| @@ -1008,7 +1005,7 @@ list_buffers_1 (files) | |||
| 1008 | write_string (b == old ? "." : " ", -1); | 1005 | write_string (b == old ? "." : " ", -1); |
| 1009 | /* Identify modified buffers */ | 1006 | /* Identify modified buffers */ |
| 1010 | write_string (BUF_MODIFF (b) > b->save_modified ? "*" : " ", -1); | 1007 | write_string (BUF_MODIFF (b) > b->save_modified ? "*" : " ", -1); |
| 1011 | write_string (NULL (b->read_only) ? " " : "% ", -1); | 1008 | write_string (NILP (b->read_only) ? " " : "% ", -1); |
| 1012 | Fprinc (b->name, Qnil); | 1009 | Fprinc (b->name, Qnil); |
| 1013 | Findent_to (col1, make_number (2)); | 1010 | Findent_to (col1, make_number (2)); |
| 1014 | XFASTINT (tem) = BUF_Z (b) - BUF_BEG (b); | 1011 | XFASTINT (tem) = BUF_Z (b) - BUF_BEG (b); |
| @@ -1017,7 +1014,7 @@ list_buffers_1 (files) | |||
| 1017 | Fprinc (b->mode_name, Qnil); | 1014 | Fprinc (b->mode_name, Qnil); |
| 1018 | Findent_to (col3, minspace); | 1015 | Findent_to (col3, minspace); |
| 1019 | 1016 | ||
| 1020 | if (!NULL (b->filename)) | 1017 | if (!NILP (b->filename)) |
| 1021 | Fprinc (b->filename, Qnil); | 1018 | Fprinc (b->filename, Qnil); |
| 1022 | else | 1019 | else |
| 1023 | { | 1020 | { |
| @@ -1025,7 +1022,7 @@ list_buffers_1 (files) | |||
| 1025 | Lisp_Object tem; | 1022 | Lisp_Object tem; |
| 1026 | set_buffer_internal (b); | 1023 | set_buffer_internal (b); |
| 1027 | tem = Fboundp (other_file_symbol); | 1024 | tem = Fboundp (other_file_symbol); |
| 1028 | if (!NULL (tem)) | 1025 | if (!NILP (tem)) |
| 1029 | { | 1026 | { |
| 1030 | tem = Fsymbol_value (other_file_symbol); | 1027 | tem = Fsymbol_value (other_file_symbol); |
| 1031 | Fset_buffer (Vstandard_output); | 1028 | Fset_buffer (Vstandard_output); |
| @@ -1085,7 +1082,7 @@ a non-nil `permanent-local' property are not eliminated by this function.") | |||
| 1085 | /* Make sure no local variables remain set up with this buffer | 1082 | /* Make sure no local variables remain set up with this buffer |
| 1086 | for their current values. */ | 1083 | for their current values. */ |
| 1087 | 1084 | ||
| 1088 | for (alist = oalist; !NULL (alist); alist = XCONS (alist)->cdr) | 1085 | for (alist = oalist; !NILP (alist); alist = XCONS (alist)->cdr) |
| 1089 | { | 1086 | { |
| 1090 | sym = XCONS (XCONS (alist)->car)->car; | 1087 | sym = XCONS (XCONS (alist)->car)->car; |
| 1091 | 1088 | ||
| @@ -1115,11 +1112,11 @@ a non-nil `permanent-local' property are not eliminated by this function.") | |||
| 1115 | /* Any which are supposed to be permanent, | 1112 | /* Any which are supposed to be permanent, |
| 1116 | make local again, with the same values they had. */ | 1113 | make local again, with the same values they had. */ |
| 1117 | 1114 | ||
| 1118 | for (alist = oalist; !NULL (alist); alist = XCONS (alist)->cdr) | 1115 | for (alist = oalist; !NILP (alist); alist = XCONS (alist)->cdr) |
| 1119 | { | 1116 | { |
| 1120 | sym = XCONS (XCONS (alist)->car)->car; | 1117 | sym = XCONS (XCONS (alist)->car)->car; |
| 1121 | tem = Fget (sym, Qpermanent_local); | 1118 | tem = Fget (sym, Qpermanent_local); |
| 1122 | if (! NULL (tem)) | 1119 | if (! NILP (tem)) |
| 1123 | { | 1120 | { |
| 1124 | Fmake_local_variable (sym); | 1121 | Fmake_local_variable (sym); |
| 1125 | Fset (sym, XCONS (XCONS (alist)->car)->cdr); | 1122 | Fset (sym, XCONS (XCONS (alist)->car)->cdr); |
| @@ -1146,7 +1143,7 @@ if any protected fields overlap this portion.") | |||
| 1146 | Lisp_Object fieldlist; | 1143 | Lisp_Object fieldlist; |
| 1147 | Lisp_Object collector; | 1144 | Lisp_Object collector; |
| 1148 | 1145 | ||
| 1149 | if (NULL (buffer)) | 1146 | if (NILP (buffer)) |
| 1150 | fieldlist = current_buffer->fieldlist; | 1147 | fieldlist = current_buffer->fieldlist; |
| 1151 | else | 1148 | else |
| 1152 | { | 1149 | { |
| @@ -1174,9 +1171,9 @@ if any protected fields overlap this portion.") | |||
| 1174 | if ((start_loc < field_start && end_loc > field_start) | 1171 | if ((start_loc < field_start && end_loc > field_start) |
| 1175 | || (start_loc >= field_start && start_loc < field_end)) | 1172 | || (start_loc >= field_start && start_loc < field_end)) |
| 1176 | { | 1173 | { |
| 1177 | if (!NULL (error_check)) | 1174 | if (!NILP (error_check)) |
| 1178 | { | 1175 | { |
| 1179 | if (!NULL (FIELD_PROTECTED_FLAG (field))) | 1176 | if (!NILP (FIELD_PROTECTED_FLAG (field))) |
| 1180 | { | 1177 | { |
| 1181 | struct gcpro gcpro1; | 1178 | struct gcpro gcpro1; |
| 1182 | GCPRO1 (fieldlist); | 1179 | GCPRO1 (fieldlist); |
diff --git a/src/buffer.h b/src/buffer.h index f475bbdbafe..a1d838c037d 100644 --- a/src/buffer.h +++ b/src/buffer.h | |||
| @@ -128,7 +128,6 @@ struct buffer_text | |||
| 128 | for this buffer. It is incremented for | 128 | for this buffer. It is incremented for |
| 129 | each such event, and never otherwise | 129 | each such event, and never otherwise |
| 130 | changed. */ | 130 | changed. */ |
| 131 | |||
| 132 | }; | 131 | }; |
| 133 | 132 | ||
| 134 | struct buffer | 133 | struct buffer |
| @@ -148,7 +147,7 @@ struct buffer | |||
| 148 | /* Flags saying which DEFVAR_PER_BUFFER variables | 147 | /* Flags saying which DEFVAR_PER_BUFFER variables |
| 149 | are local to this buffer. */ | 148 | are local to this buffer. */ |
| 150 | int local_var_flags; | 149 | int local_var_flags; |
| 151 | /* Value of text.modified as of when visited file was read or written. */ | 150 | /* Value of text.modiff as of when visited file was read or written. */ |
| 152 | int save_modified; | 151 | int save_modified; |
| 153 | /* Set to the modtime of the visited file when read or written. | 152 | /* Set to the modtime of the visited file when read or written. |
| 154 | -1 means visited file was nonexistent. | 153 | -1 means visited file was nonexistent. |
diff --git a/src/bytecode.c b/src/bytecode.c index eb5b117f683..acde450299c 100644 --- a/src/bytecode.c +++ b/src/bytecode.c | |||
| @@ -450,7 +450,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 450 | 450 | ||
| 451 | case Bgotoifnil: | 451 | case Bgotoifnil: |
| 452 | op = FETCH2; | 452 | op = FETCH2; |
| 453 | if (NULL (POP)) | 453 | if (NILP (POP)) |
| 454 | { | 454 | { |
| 455 | QUIT; | 455 | QUIT; |
| 456 | pc = XSTRING (string_saved)->data + op; | 456 | pc = XSTRING (string_saved)->data + op; |
| @@ -459,7 +459,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 459 | 459 | ||
| 460 | case Bgotoifnonnil: | 460 | case Bgotoifnonnil: |
| 461 | op = FETCH2; | 461 | op = FETCH2; |
| 462 | if (!NULL (POP)) | 462 | if (!NILP (POP)) |
| 463 | { | 463 | { |
| 464 | QUIT; | 464 | QUIT; |
| 465 | pc = XSTRING (string_saved)->data + op; | 465 | pc = XSTRING (string_saved)->data + op; |
| @@ -468,7 +468,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 468 | 468 | ||
| 469 | case Bgotoifnilelsepop: | 469 | case Bgotoifnilelsepop: |
| 470 | op = FETCH2; | 470 | op = FETCH2; |
| 471 | if (NULL (TOP)) | 471 | if (NILP (TOP)) |
| 472 | { | 472 | { |
| 473 | QUIT; | 473 | QUIT; |
| 474 | pc = XSTRING (string_saved)->data + op; | 474 | pc = XSTRING (string_saved)->data + op; |
| @@ -478,7 +478,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 478 | 478 | ||
| 479 | case Bgotoifnonnilelsepop: | 479 | case Bgotoifnonnilelsepop: |
| 480 | op = FETCH2; | 480 | op = FETCH2; |
| 481 | if (!NULL (TOP)) | 481 | if (!NILP (TOP)) |
| 482 | { | 482 | { |
| 483 | QUIT; | 483 | QUIT; |
| 484 | pc = XSTRING (string_saved)->data + op; | 484 | pc = XSTRING (string_saved)->data + op; |
| @@ -492,7 +492,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 492 | break; | 492 | break; |
| 493 | 493 | ||
| 494 | case BRgotoifnil: | 494 | case BRgotoifnil: |
| 495 | if (NULL (POP)) | 495 | if (NILP (POP)) |
| 496 | { | 496 | { |
| 497 | QUIT; | 497 | QUIT; |
| 498 | pc += *pc - 128; | 498 | pc += *pc - 128; |
| @@ -501,7 +501,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 501 | break; | 501 | break; |
| 502 | 502 | ||
| 503 | case BRgotoifnonnil: | 503 | case BRgotoifnonnil: |
| 504 | if (!NULL (POP)) | 504 | if (!NILP (POP)) |
| 505 | { | 505 | { |
| 506 | QUIT; | 506 | QUIT; |
| 507 | pc += *pc - 128; | 507 | pc += *pc - 128; |
| @@ -511,7 +511,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 511 | 511 | ||
| 512 | case BRgotoifnilelsepop: | 512 | case BRgotoifnilelsepop: |
| 513 | op = *pc++; | 513 | op = *pc++; |
| 514 | if (NULL (TOP)) | 514 | if (NILP (TOP)) |
| 515 | { | 515 | { |
| 516 | QUIT; | 516 | QUIT; |
| 517 | pc += op - 128; | 517 | pc += op - 128; |
| @@ -521,7 +521,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 521 | 521 | ||
| 522 | case BRgotoifnonnilelsepop: | 522 | case BRgotoifnonnilelsepop: |
| 523 | op = *pc++; | 523 | op = *pc++; |
| 524 | if (!NULL (TOP)) | 524 | if (!NILP (TOP)) |
| 525 | { | 525 | { |
| 526 | QUIT; | 526 | QUIT; |
| 527 | pc += op - 128; | 527 | pc += op - 128; |
| @@ -598,7 +598,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 598 | { | 598 | { |
| 599 | if (CONSP (v1)) | 599 | if (CONSP (v1)) |
| 600 | v1 = XCONS (v1)->cdr; | 600 | v1 = XCONS (v1)->cdr; |
| 601 | else if (!NULL (v1)) | 601 | else if (!NILP (v1)) |
| 602 | { | 602 | { |
| 603 | immediate_quit = 0; | 603 | immediate_quit = 0; |
| 604 | v1 = wrong_type_argument (Qlistp, v1); | 604 | v1 = wrong_type_argument (Qlistp, v1); |
| @@ -622,7 +622,7 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 622 | break; | 622 | break; |
| 623 | 623 | ||
| 624 | case Blistp: | 624 | case Blistp: |
| 625 | TOP = CONSP (TOP) || NULL (TOP) ? Qt : Qnil; | 625 | TOP = CONSP (TOP) || NILP (TOP) ? Qt : Qnil; |
| 626 | break; | 626 | break; |
| 627 | 627 | ||
| 628 | case Beq: | 628 | case Beq: |
| @@ -636,21 +636,21 @@ If the third argument is incorrect, Emacs may crash.") | |||
| 636 | break; | 636 | break; |
| 637 | 637 | ||
| 638 | case Bnot: | 638 | case Bnot: |
| 639 | TOP = NULL (TOP) ? Qt : Qnil; | 639 | TOP = NILP (TOP) ? Qt : Qnil; |
| 640 | break; | 640 | break; |
| 641 | 641 | ||
| 642 | case Bcar: | 642 | case Bcar: |
| 643 | v1 = TOP; | 643 | v1 = TOP; |
| 644 | docar: | 644 | docar: |
| 645 | if (CONSP (v1)) TOP = XCONS (v1)->car; | 645 | if (CONSP (v1)) TOP = XCONS (v1)->car; |
| 646 | else if (NULL (v1)) TOP = Qnil; | 646 | else if (NILP (v1)) TOP = Qnil; |
| 647 | else Fcar (wrong_type_argument (Qlistp, v1)); | 647 | else Fcar (wrong_type_argument (Qlistp, v1)); |
| 648 | break; | 648 | break; |
| 649 | 649 | ||
| 650 | case Bcdr: | 650 | case Bcdr: |
| 651 | v1 = TOP; | 651 | v1 = TOP; |
| 652 | if (CONSP (v1)) TOP = XCONS (v1)->cdr; | 652 | if (CONSP (v1)) TOP = XCONS (v1)->cdr; |
| 653 | else if (NULL (v1)) TOP = Qnil; | 653 | else if (NILP (v1)) TOP = Qnil; |
| 654 | else Fcdr (wrong_type_argument (Qlistp, v1)); | 654 | else Fcdr (wrong_type_argument (Qlistp, v1)); |
| 655 | break; | 655 | break; |
| 656 | 656 | ||
diff --git a/src/callint.c b/src/callint.c index 723224310f2..a77a0180f5c 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -103,7 +103,7 @@ quotify_arg (exp) | |||
| 103 | register Lisp_Object exp; | 103 | register Lisp_Object exp; |
| 104 | { | 104 | { |
| 105 | if (XTYPE (exp) != Lisp_Int && XTYPE (exp) != Lisp_String | 105 | if (XTYPE (exp) != Lisp_Int && XTYPE (exp) != Lisp_String |
| 106 | && !NULL (exp) && !EQ (exp, Qt)) | 106 | && !NILP (exp) && !EQ (exp, Qt)) |
| 107 | return Fcons (Qquote, Fcons (exp, Qnil)); | 107 | return Fcons (Qquote, Fcons (exp, Qnil)); |
| 108 | 108 | ||
| 109 | return exp; | 109 | return exp; |
| @@ -131,7 +131,7 @@ static void | |||
| 131 | check_mark () | 131 | check_mark () |
| 132 | { | 132 | { |
| 133 | Lisp_Object tem = Fmarker_buffer (current_buffer->mark); | 133 | Lisp_Object tem = Fmarker_buffer (current_buffer->mark); |
| 134 | if (NULL (tem) || (XBUFFER (tem) != current_buffer)) | 134 | if (NILP (tem) || (XBUFFER (tem) != current_buffer)) |
| 135 | error ("The mark is not set now"); | 135 | error ("The mark is not set now"); |
| 136 | } | 136 | } |
| 137 | 137 | ||
| @@ -221,7 +221,7 @@ retry: | |||
| 221 | else if (EQ (funcar, Qlambda)) | 221 | else if (EQ (funcar, Qlambda)) |
| 222 | { | 222 | { |
| 223 | specs = Fassq (Qinteractive, Fcdr (Fcdr (fun))); | 223 | specs = Fassq (Qinteractive, Fcdr (Fcdr (fun))); |
| 224 | if (NULL (specs)) | 224 | if (NILP (specs)) |
| 225 | goto lose; | 225 | goto lose; |
| 226 | specs = Fcar (Fcdr (specs)); | 226 | specs = Fcar (Fcdr (specs)); |
| 227 | } | 227 | } |
| @@ -236,7 +236,7 @@ retry: | |||
| 236 | { | 236 | { |
| 237 | i = num_input_chars; | 237 | i = num_input_chars; |
| 238 | specs = Feval (specs); | 238 | specs = Feval (specs); |
| 239 | if (i != num_input_chars || !NULL (record)) | 239 | if (i != num_input_chars || !NILP (record)) |
| 240 | Vcommand_history | 240 | Vcommand_history |
| 241 | = Fcons (Fcons (function, quotify_args (Fcopy_sequence (specs))), | 241 | = Fcons (Fcons (function, quotify_args (Fcopy_sequence (specs))), |
| 242 | Vcommand_history); | 242 | Vcommand_history); |
| @@ -251,13 +251,13 @@ retry: | |||
| 251 | if (*string == '*') | 251 | if (*string == '*') |
| 252 | { | 252 | { |
| 253 | string++; | 253 | string++; |
| 254 | if (!NULL (current_buffer->read_only)) | 254 | if (!NILP (current_buffer->read_only)) |
| 255 | Fbarf_if_buffer_read_only (); | 255 | Fbarf_if_buffer_read_only (); |
| 256 | } | 256 | } |
| 257 | else if (*string == '@') | 257 | else if (*string == '@') |
| 258 | { | 258 | { |
| 259 | string++; | 259 | string++; |
| 260 | if (!NULL (Vmouse_window)) | 260 | if (!NILP (Vmouse_window)) |
| 261 | Fselect_window (Vmouse_window); | 261 | Fselect_window (Vmouse_window); |
| 262 | } | 262 | } |
| 263 | else break; | 263 | else break; |
| @@ -379,7 +379,7 @@ retry: | |||
| 379 | 379 | ||
| 380 | case 'K': /* Mouse click. */ | 380 | case 'K': /* Mouse click. */ |
| 381 | args[i] = last_command_char; | 381 | args[i] = last_command_char; |
| 382 | if (NULL (Fmouse_click_p (args[i]))) | 382 | if (NILP (Fmouse_click_p (args[i]))) |
| 383 | error ("%s must be bound to a mouse click.", | 383 | error ("%s must be bound to a mouse click.", |
| 384 | (XTYPE (function) == Lisp_Symbol | 384 | (XTYPE (function) == Lisp_Symbol |
| 385 | ? (char *) XSYMBOL (function)->name->data | 385 | ? (char *) XSYMBOL (function)->name->data |
| @@ -394,7 +394,7 @@ retry: | |||
| 394 | break; | 394 | break; |
| 395 | 395 | ||
| 396 | case 'N': /* Prefix arg, else number from minibuffer */ | 396 | case 'N': /* Prefix arg, else number from minibuffer */ |
| 397 | if (!NULL (prefix_arg)) | 397 | if (!NILP (prefix_arg)) |
| 398 | goto have_prefix_arg; | 398 | goto have_prefix_arg; |
| 399 | case 'n': /* Read number from minibuffer. */ | 399 | case 'n': /* Read number from minibuffer. */ |
| 400 | do | 400 | do |
| @@ -470,7 +470,7 @@ retry: | |||
| 470 | if (varies[i] == 0) | 470 | if (varies[i] == 0) |
| 471 | arg_from_tty = 1; | 471 | arg_from_tty = 1; |
| 472 | 472 | ||
| 473 | if (NULL (visargs[i]) && XTYPE (args[i]) == Lisp_String) | 473 | if (NILP (visargs[i]) && XTYPE (args[i]) == Lisp_String) |
| 474 | visargs[i] = args[i]; | 474 | visargs[i] = args[i]; |
| 475 | 475 | ||
| 476 | tem = (unsigned char *) index (tem, '\n'); | 476 | tem = (unsigned char *) index (tem, '\n'); |
| @@ -482,7 +482,7 @@ retry: | |||
| 482 | 482 | ||
| 483 | args[0] = function; | 483 | args[0] = function; |
| 484 | 484 | ||
| 485 | if (arg_from_tty || !NULL (record)) | 485 | if (arg_from_tty || !NILP (record)) |
| 486 | { | 486 | { |
| 487 | visargs[0] = function; | 487 | visargs[0] = function; |
| 488 | for (i = 1; i < count + 1; i++) | 488 | for (i = 1; i < count + 1; i++) |
| @@ -519,7 +519,7 @@ Its numeric meaning is what you would get from `(interactive \"p\")'.") | |||
| 519 | may use XSETINT. */ | 519 | may use XSETINT. */ |
| 520 | XFASTINT (val) = 0; | 520 | XFASTINT (val) = 0; |
| 521 | 521 | ||
| 522 | if (NULL (raw)) | 522 | if (NILP (raw)) |
| 523 | XFASTINT (val) = 1; | 523 | XFASTINT (val) = 1; |
| 524 | else if (XTYPE (raw) == Lisp_Symbol) | 524 | else if (XTYPE (raw) == Lisp_Symbol) |
| 525 | XSETINT (val, -1); | 525 | XSETINT (val, -1); |
diff --git a/src/cmds.c b/src/cmds.c index 18821e24b06..2a212ad6223 100644 --- a/src/cmds.c +++ b/src/cmds.c | |||
| @@ -33,7 +33,7 @@ On reaching end of buffer, stop and signal error.") | |||
| 33 | (n) | 33 | (n) |
| 34 | Lisp_Object n; | 34 | Lisp_Object n; |
| 35 | { | 35 | { |
| 36 | if (NULL (n)) | 36 | if (NILP (n)) |
| 37 | XFASTINT (n) = 1; | 37 | XFASTINT (n) = 1; |
| 38 | else | 38 | else |
| 39 | CHECK_NUMBER (n, 0); | 39 | CHECK_NUMBER (n, 0); |
| @@ -58,7 +58,7 @@ On attempt to pass beginning or end of buffer, stop and signal error.") | |||
| 58 | (n) | 58 | (n) |
| 59 | Lisp_Object n; | 59 | Lisp_Object n; |
| 60 | { | 60 | { |
| 61 | if (NULL (n)) | 61 | if (NILP (n)) |
| 62 | XFASTINT (n) = 1; | 62 | XFASTINT (n) = 1; |
| 63 | else | 63 | else |
| 64 | CHECK_NUMBER (n, 0); | 64 | CHECK_NUMBER (n, 0); |
| @@ -82,7 +82,7 @@ With positive ARG, a non-empty line at the end counts as one line\n\ | |||
| 82 | int pos; | 82 | int pos; |
| 83 | int count, shortage, negp; | 83 | int count, shortage, negp; |
| 84 | 84 | ||
| 85 | if (NULL (n)) | 85 | if (NILP (n)) |
| 86 | count = 1; | 86 | count = 1; |
| 87 | else | 87 | else |
| 88 | { | 88 | { |
| @@ -109,7 +109,7 @@ If scan reaches end of buffer, stop there without error.") | |||
| 109 | (n) | 109 | (n) |
| 110 | Lisp_Object n; | 110 | Lisp_Object n; |
| 111 | { | 111 | { |
| 112 | if (NULL (n)) | 112 | if (NILP (n)) |
| 113 | XFASTINT (n) = 1; | 113 | XFASTINT (n) = 1; |
| 114 | else | 114 | else |
| 115 | CHECK_NUMBER (n, 0); | 115 | CHECK_NUMBER (n, 0); |
| @@ -129,7 +129,7 @@ If scan reaches end of buffer, stop there without error.") | |||
| 129 | register int pos; | 129 | register int pos; |
| 130 | register int stop; | 130 | register int stop; |
| 131 | 131 | ||
| 132 | if (NULL (n)) | 132 | if (NILP (n)) |
| 133 | XFASTINT (n) = 1; | 133 | XFASTINT (n) = 1; |
| 134 | else | 134 | else |
| 135 | CHECK_NUMBER (n, 0); | 135 | CHECK_NUMBER (n, 0); |
| @@ -155,7 +155,7 @@ ARG was explicitly specified.") | |||
| 155 | { | 155 | { |
| 156 | CHECK_NUMBER (n, 0); | 156 | CHECK_NUMBER (n, 0); |
| 157 | 157 | ||
| 158 | if (NULL (killflag)) | 158 | if (NILP (killflag)) |
| 159 | { | 159 | { |
| 160 | if (XINT (n) < 0) | 160 | if (XINT (n) < 0) |
| 161 | { | 161 | { |
| @@ -225,7 +225,7 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long.") | |||
| 225 | 225 | ||
| 226 | arg = Fprefix_numeric_value (arg1); | 226 | arg = Fprefix_numeric_value (arg1); |
| 227 | 227 | ||
| 228 | if (!NULL (current_buffer->read_only)) | 228 | if (!NILP (current_buffer->read_only)) |
| 229 | Fsignal (Qbuffer_read_only, Qnil); | 229 | Fsignal (Qbuffer_read_only, Qnil); |
| 230 | 230 | ||
| 231 | /* Inserting a newline at the end of a line | 231 | /* Inserting a newline at the end of a line |
| @@ -245,7 +245,7 @@ In Auto Fill mode, if no numeric arg, break the preceding line if it's long.") | |||
| 245 | if (flag) | 245 | if (flag) |
| 246 | insert (&c1, 1); | 246 | insert (&c1, 1); |
| 247 | else | 247 | else |
| 248 | internal_self_insert ('\n', !NULL (arg1)); | 248 | internal_self_insert ('\n', !NILP (arg1)); |
| 249 | XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ | 249 | XFASTINT (arg)--; /* Ok since old and new vals both nonneg */ |
| 250 | } | 250 | } |
| 251 | 251 | ||
| @@ -265,10 +265,10 @@ internal_self_insert (c1, noautofill) | |||
| 265 | register enum syntaxcode synt; | 265 | register enum syntaxcode synt; |
| 266 | register int c = c1; | 266 | register int c = c1; |
| 267 | 267 | ||
| 268 | if (!NULL (Vbefore_change_function) || !NULL (Vafter_change_function)) | 268 | if (!NILP (Vbefore_change_function) || !NILP (Vafter_change_function)) |
| 269 | hairy = 1; | 269 | hairy = 1; |
| 270 | 270 | ||
| 271 | if (!NULL (current_buffer->overwrite_mode) | 271 | if (!NILP (current_buffer->overwrite_mode) |
| 272 | && point < ZV | 272 | && point < ZV |
| 273 | && c != '\n' && FETCH_CHAR (point) != '\n' | 273 | && c != '\n' && FETCH_CHAR (point) != '\n' |
| 274 | && (FETCH_CHAR (point) != '\t' | 274 | && (FETCH_CHAR (point) != '\t' |
| @@ -278,18 +278,18 @@ internal_self_insert (c1, noautofill) | |||
| 278 | del_range (point, point + 1); | 278 | del_range (point, point + 1); |
| 279 | hairy = 1; | 279 | hairy = 1; |
| 280 | } | 280 | } |
| 281 | if (!NULL (current_buffer->abbrev_mode) | 281 | if (!NILP (current_buffer->abbrev_mode) |
| 282 | && SYNTAX (c) != Sword | 282 | && SYNTAX (c) != Sword |
| 283 | && NULL (current_buffer->read_only) | 283 | && NILP (current_buffer->read_only) |
| 284 | && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword) | 284 | && point > BEGV && SYNTAX (FETCH_CHAR (point - 1)) == Sword) |
| 285 | { | 285 | { |
| 286 | tem = Fexpand_abbrev (); | 286 | tem = Fexpand_abbrev (); |
| 287 | if (!NULL (tem)) | 287 | if (!NILP (tem)) |
| 288 | hairy = 1; | 288 | hairy = 1; |
| 289 | } | 289 | } |
| 290 | if ((c == ' ' || c == '\n') | 290 | if ((c == ' ' || c == '\n') |
| 291 | && !noautofill | 291 | && !noautofill |
| 292 | && !NULL (current_buffer->auto_fill_function) | 292 | && !NILP (current_buffer->auto_fill_function) |
| 293 | && current_column () > XFASTINT (current_buffer->fill_column)) | 293 | && current_column () > XFASTINT (current_buffer->fill_column)) |
| 294 | { | 294 | { |
| 295 | if (c1 != '\n') | 295 | if (c1 != '\n') |
| @@ -303,7 +303,7 @@ internal_self_insert (c1, noautofill) | |||
| 303 | insert (&c1, 1); | 303 | insert (&c1, 1); |
| 304 | synt = SYNTAX (c); | 304 | synt = SYNTAX (c); |
| 305 | if ((synt == Sclose || synt == Smath) | 305 | if ((synt == Sclose || synt == Smath) |
| 306 | && !NULL (Vblink_paren_function) && INTERACTIVE) | 306 | && !NILP (Vblink_paren_function) && INTERACTIVE) |
| 307 | { | 307 | { |
| 308 | call0 (Vblink_paren_function); | 308 | call0 (Vblink_paren_function); |
| 309 | hairy = 1; | 309 | hairy = 1; |
diff --git a/src/commands.h b/src/commands.h index de2c7e3c3d3..26141818fe9 100644 --- a/src/commands.h +++ b/src/commands.h | |||
| @@ -58,7 +58,7 @@ extern Lisp_Object Vexecuting_macro; | |||
| 58 | 58 | ||
| 59 | /* Nonzero if input is coming from the keyboard */ | 59 | /* Nonzero if input is coming from the keyboard */ |
| 60 | 60 | ||
| 61 | #define INTERACTIVE (NULL (Vexecuting_macro) && !noninteractive) | 61 | #define INTERACTIVE (NILP (Vexecuting_macro) && !noninteractive) |
| 62 | 62 | ||
| 63 | /* Set this nonzero to force reconsideration of mode line. */ | 63 | /* Set this nonzero to force reconsideration of mode line. */ |
| 64 | 64 | ||
diff --git a/src/dired.c b/src/dired.c index 0cdc062c699..f04ed255883 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -46,8 +46,6 @@ extern struct direct *readdir (); | |||
| 46 | 46 | ||
| 47 | #endif | 47 | #endif |
| 48 | 48 | ||
| 49 | #undef NULL | ||
| 50 | |||
| 51 | #include "lisp.h" | 49 | #include "lisp.h" |
| 52 | #include "buffer.h" | 50 | #include "buffer.h" |
| 53 | #include "commands.h" | 51 | #include "commands.h" |
| @@ -81,7 +79,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\ | |||
| 81 | int length; | 79 | int length; |
| 82 | Lisp_Object list, name; | 80 | Lisp_Object list, name; |
| 83 | 81 | ||
| 84 | if (!NULL (match)) | 82 | if (!NILP (match)) |
| 85 | { | 83 | { |
| 86 | CHECK_STRING (match, 3); | 84 | CHECK_STRING (match, 3); |
| 87 | /* Compile it now so we don't get an error after opendir */ | 85 | /* Compile it now so we don't get an error after opendir */ |
| @@ -110,10 +108,10 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\ | |||
| 110 | len = NAMLEN (dp); | 108 | len = NAMLEN (dp); |
| 111 | if (dp->d_ino) | 109 | if (dp->d_ino) |
| 112 | { | 110 | { |
| 113 | if (NULL (match) | 111 | if (NILP (match) |
| 114 | || (0 <= re_search (&searchbuf, dp->d_name, len, 0, len, 0))) | 112 | || (0 <= re_search (&searchbuf, dp->d_name, len, 0, len, 0))) |
| 115 | { | 113 | { |
| 116 | if (!NULL (full)) | 114 | if (!NILP (full)) |
| 117 | { | 115 | { |
| 118 | int index = XSTRING (dirname)->size; | 116 | int index = XSTRING (dirname)->size; |
| 119 | int total = len + index; | 117 | int total = len + index; |
| @@ -140,7 +138,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\ | |||
| 140 | } | 138 | } |
| 141 | } | 139 | } |
| 142 | closedir (d); | 140 | closedir (d); |
| 143 | if (!NULL (nosort)) | 141 | if (!NILP (nosort)) |
| 144 | return list; | 142 | return list; |
| 145 | return Fsort (Fnreverse (list), Qstring_lessp); | 143 | return Fsort (Fnreverse (list), Qstring_lessp); |
| 146 | } | 144 | } |
| @@ -233,7 +231,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 233 | ** It would not actually be helpful to the user to ignore any possible | 231 | ** It would not actually be helpful to the user to ignore any possible |
| 234 | completions when making a list of them.** */ | 232 | completions when making a list of them.** */ |
| 235 | 233 | ||
| 236 | for (passcount = !!all_flag; NULL (bestmatch) && passcount < 2; passcount++) | 234 | for (passcount = !!all_flag; NILP (bestmatch) && passcount < 2; passcount++) |
| 237 | { | 235 | { |
| 238 | if (!(d = opendir (XSTRING (Fdirectory_file_name (dirname))->data))) | 236 | if (!(d = opendir (XSTRING (Fdirectory_file_name (dirname))->data))) |
| 239 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); | 237 | report_file_error ("Opening directory", Fcons (dirname, Qnil)); |
| @@ -254,7 +252,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 254 | 252 | ||
| 255 | len = NAMLEN (dp); | 253 | len = NAMLEN (dp); |
| 256 | 254 | ||
| 257 | if (!NULL (Vquit_flag) && NULL (Vinhibit_quit)) | 255 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) |
| 258 | goto quit; | 256 | goto quit; |
| 259 | if (!dp->d_ino | 257 | if (!dp->d_ino |
| 260 | || len < XSTRING (file)->size | 258 | || len < XSTRING (file)->size |
| @@ -297,7 +295,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 297 | 295 | ||
| 298 | matchcount++; | 296 | matchcount++; |
| 299 | 297 | ||
| 300 | if (all_flag || NULL (bestmatch)) | 298 | if (all_flag || NILP (bestmatch)) |
| 301 | { | 299 | { |
| 302 | /* This is a possible completion */ | 300 | /* This is a possible completion */ |
| 303 | if (directoryp) | 301 | if (directoryp) |
| @@ -341,7 +339,7 @@ file_name_completion (file, dirname, all_flag, ver_flag) | |||
| 341 | 339 | ||
| 342 | unbind_to (count, Qnil); | 340 | unbind_to (count, Qnil); |
| 343 | 341 | ||
| 344 | if (all_flag || NULL (bestmatch)) | 342 | if (all_flag || NILP (bestmatch)) |
| 345 | return bestmatch; | 343 | return bestmatch; |
| 346 | if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) | 344 | if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) |
| 347 | return Qt; | 345 | return Qt; |
diff --git a/src/dispextern.h b/src/dispextern.h index 1d7b8710aba..365f229fb53 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -48,22 +48,27 @@ struct screen_glyphs | |||
| 48 | int height; | 48 | int height; |
| 49 | int width; | 49 | int width; |
| 50 | 50 | ||
| 51 | int *used; /* Vector of widths (in chars) of lines. */ | 51 | /* Contents of the screen. |
| 52 | /* Vector of line contents. | 52 | glyphs[V][H] is the glyph at position V, H. |
| 53 | m->glyphs[V][H] is the glyph at position V, H. | 53 | Note that glyphs[V][-1], |
| 54 | Note that ->glyphs[...][screen_width] is always 0 | 54 | glyphs[V][used[V]], |
| 55 | and so is ->glyphs[...][-1]. */ | 55 | and glyphs[V][screen_width] are always '\0'. */ |
| 56 | GLYPH **glyphs; | 56 | GLYPH **glyphs; |
| 57 | /* long vector from which the strings in `glyphs' are taken. */ | 57 | /* long vector from which the strings in `glyphs' are taken. */ |
| 58 | GLYPH *total_contents; | 58 | GLYPH *total_contents; |
| 59 | 59 | ||
| 60 | /* When representing a desired screen, | ||
| 61 | enable[n] == 0 means that line n is same as current screen. | ||
| 62 | When representing current screen contents, | ||
| 63 | enable[n] == 0 means that line n is blank. */ | ||
| 64 | char *enable; | ||
| 65 | |||
| 66 | /* Everything on line n after column used[n] is considered blank. */ | ||
| 67 | int *used; | ||
| 68 | |||
| 60 | /* highlight[n] != 0 iff line n is highlighted. */ | 69 | /* highlight[n] != 0 iff line n is highlighted. */ |
| 61 | char *highlight; | 70 | char *highlight; |
| 62 | 71 | ||
| 63 | /* When representing a desired screen, enable[n] == 0 implies line | ||
| 64 | n is same as current screen. When representing current screen | ||
| 65 | contents, enable[n] == 0 implies line n is blank. */ | ||
| 66 | char *enable; | ||
| 67 | 72 | ||
| 68 | /* Buffer offset of this line's first char. */ | 73 | /* Buffer offset of this line's first char. */ |
| 69 | int *bufp; | 74 | int *bufp; |
| @@ -31,7 +31,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 31 | #define O_RDONLY 0 | 31 | #define O_RDONLY 0 |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | #undef NULL | ||
| 35 | #include "lisp.h" | 34 | #include "lisp.h" |
| 36 | #include "buffer.h" | 35 | #include "buffer.h" |
| 37 | 36 | ||
| @@ -348,7 +347,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 348 | int length; | 347 | int length; |
| 349 | struct gcpro gcpro1; | 348 | struct gcpro gcpro1; |
| 350 | 349 | ||
| 351 | if (NULL (str)) | 350 | if (NILP (str)) |
| 352 | return Qnil; | 351 | return Qnil; |
| 353 | 352 | ||
| 354 | CHECK_STRING (str, 0); | 353 | CHECK_STRING (str, 0); |
| @@ -388,7 +387,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 388 | tem = Fintern (make_string (start, length), Qnil); | 387 | tem = Fintern (make_string (start, length), Qnil); |
| 389 | tem = Fwhere_is_internal (tem, keymap, Qnil, Qt, Qnil); | 388 | tem = Fwhere_is_internal (tem, keymap, Qnil, Qt, Qnil); |
| 390 | 389 | ||
| 391 | if (NULL (tem)) /* but not on any keys */ | 390 | if (NILP (tem)) /* but not on any keys */ |
| 392 | { | 391 | { |
| 393 | new = (unsigned char *) xrealloc (buf, bsize += 4); | 392 | new = (unsigned char *) xrealloc (buf, bsize += 4); |
| 394 | bufp += new - buf; | 393 | bufp += new - buf; |
| @@ -429,10 +428,10 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 429 | in case it is a local variable. */ | 428 | in case it is a local variable. */ |
| 430 | name = Fintern (make_string (start, length), Qnil); | 429 | name = Fintern (make_string (start, length), Qnil); |
| 431 | tem = Fboundp (name); | 430 | tem = Fboundp (name); |
| 432 | if (! NULL (tem)) | 431 | if (! NILP (tem)) |
| 433 | { | 432 | { |
| 434 | tem = Fsymbol_value (name); | 433 | tem = Fsymbol_value (name); |
| 435 | if (! NULL (tem)) | 434 | if (! NILP (tem)) |
| 436 | tem = get_keymap_1 (tem, 0); | 435 | tem = get_keymap_1 (tem, 0); |
| 437 | } | 436 | } |
| 438 | 437 | ||
| @@ -440,7 +439,7 @@ thus, \\=\\=\\=\\= puts \\=\\= into the output, and \\=\\=\\=\\[ puts \\=\\[ int | |||
| 440 | oldbuf = current_buffer; | 439 | oldbuf = current_buffer; |
| 441 | set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); | 440 | set_buffer_internal (XBUFFER (Vprin1_to_string_buffer)); |
| 442 | 441 | ||
| 443 | if (NULL (tem)) | 442 | if (NILP (tem)) |
| 444 | { | 443 | { |
| 445 | name = Fsymbol_name (name); | 444 | name = Fsymbol_name (name); |
| 446 | insert_string ("\nUses keymap \""); | 445 | insert_string ("\nUses keymap \""); |
diff --git a/src/eval.c b/src/eval.c index 6940b8dbada..f549f9d1ffe 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -180,7 +180,7 @@ If all args return nil, return nil.") | |||
| 180 | Lisp_Object args_left; | 180 | Lisp_Object args_left; |
| 181 | struct gcpro gcpro1; | 181 | struct gcpro gcpro1; |
| 182 | 182 | ||
| 183 | if (NULL(args)) | 183 | if (NILP(args)) |
| 184 | return Qnil; | 184 | return Qnil; |
| 185 | 185 | ||
| 186 | args_left = args; | 186 | args_left = args; |
| @@ -189,11 +189,11 @@ If all args return nil, return nil.") | |||
| 189 | do | 189 | do |
| 190 | { | 190 | { |
| 191 | val = Feval (Fcar (args_left)); | 191 | val = Feval (Fcar (args_left)); |
| 192 | if (!NULL (val)) | 192 | if (!NILP (val)) |
| 193 | break; | 193 | break; |
| 194 | args_left = Fcdr (args_left); | 194 | args_left = Fcdr (args_left); |
| 195 | } | 195 | } |
| 196 | while (!NULL(args_left)); | 196 | while (!NILP(args_left)); |
| 197 | 197 | ||
| 198 | UNGCPRO; | 198 | UNGCPRO; |
| 199 | return val; | 199 | return val; |
| @@ -210,7 +210,7 @@ If no arg yields nil, return the last arg's value.") | |||
| 210 | Lisp_Object args_left; | 210 | Lisp_Object args_left; |
| 211 | struct gcpro gcpro1; | 211 | struct gcpro gcpro1; |
| 212 | 212 | ||
| 213 | if (NULL(args)) | 213 | if (NILP(args)) |
| 214 | return Qt; | 214 | return Qt; |
| 215 | 215 | ||
| 216 | args_left = args; | 216 | args_left = args; |
| @@ -219,11 +219,11 @@ If no arg yields nil, return the last arg's value.") | |||
| 219 | do | 219 | do |
| 220 | { | 220 | { |
| 221 | val = Feval (Fcar (args_left)); | 221 | val = Feval (Fcar (args_left)); |
| 222 | if (NULL (val)) | 222 | if (NILP (val)) |
| 223 | break; | 223 | break; |
| 224 | args_left = Fcdr (args_left); | 224 | args_left = Fcdr (args_left); |
| 225 | } | 225 | } |
| 226 | while (!NULL(args_left)); | 226 | while (!NILP(args_left)); |
| 227 | 227 | ||
| 228 | UNGCPRO; | 228 | UNGCPRO; |
| 229 | return val; | 229 | return val; |
| @@ -244,7 +244,7 @@ If COND yields nil, and there are no ELSE's, the value is nil.") | |||
| 244 | cond = Feval (Fcar (args)); | 244 | cond = Feval (Fcar (args)); |
| 245 | UNGCPRO; | 245 | UNGCPRO; |
| 246 | 246 | ||
| 247 | if (!NULL (cond)) | 247 | if (!NILP (cond)) |
| 248 | return Feval (Fcar (Fcdr (args))); | 248 | return Feval (Fcar (Fcdr (args))); |
| 249 | return Fprogn (Fcdr (Fcdr (args))); | 249 | return Fprogn (Fcdr (Fcdr (args))); |
| 250 | } | 250 | } |
| @@ -266,11 +266,11 @@ CONDITION's value if non-nil is returned from the cond-form.") | |||
| 266 | 266 | ||
| 267 | val = Qnil; | 267 | val = Qnil; |
| 268 | GCPRO1 (args); | 268 | GCPRO1 (args); |
| 269 | while (!NULL (args)) | 269 | while (!NILP (args)) |
| 270 | { | 270 | { |
| 271 | clause = Fcar (args); | 271 | clause = Fcar (args); |
| 272 | val = Feval (Fcar (clause)); | 272 | val = Feval (Fcar (clause)); |
| 273 | if (!NULL (val)) | 273 | if (!NILP (val)) |
| 274 | { | 274 | { |
| 275 | if (!EQ (XCONS (clause)->cdr, Qnil)) | 275 | if (!EQ (XCONS (clause)->cdr, Qnil)) |
| 276 | val = Fprogn (XCONS (clause)->cdr); | 276 | val = Fprogn (XCONS (clause)->cdr); |
| @@ -297,14 +297,14 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, | |||
| 297 | if (!EQ (Vmocklisp_arguments, Qt)) | 297 | if (!EQ (Vmocklisp_arguments, Qt)) |
| 298 | { | 298 | { |
| 299 | val = make_number (0); | 299 | val = make_number (0); |
| 300 | while (!NULL (args) && (tem = Fcar (args), XTYPE (tem) == Lisp_Symbol)) | 300 | while (!NILP (args) && (tem = Fcar (args), XTYPE (tem) == Lisp_Symbol)) |
| 301 | { | 301 | { |
| 302 | QUIT; | 302 | QUIT; |
| 303 | specbind (tem, val), args = Fcdr (args); | 303 | specbind (tem, val), args = Fcdr (args); |
| 304 | } | 304 | } |
| 305 | } | 305 | } |
| 306 | 306 | ||
| 307 | if (NULL(args)) | 307 | if (NILP(args)) |
| 308 | return Qnil; | 308 | return Qnil; |
| 309 | 309 | ||
| 310 | args_left = args; | 310 | args_left = args; |
| @@ -315,7 +315,7 @@ DEFUN ("progn", Fprogn, Sprogn, 0, UNEVALLED, 0, | |||
| 315 | val = Feval (Fcar (args_left)); | 315 | val = Feval (Fcar (args_left)); |
| 316 | args_left = Fcdr (args_left); | 316 | args_left = Fcdr (args_left); |
| 317 | } | 317 | } |
| 318 | while (!NULL(args_left)); | 318 | while (!NILP(args_left)); |
| 319 | 319 | ||
| 320 | UNGCPRO; | 320 | UNGCPRO; |
| 321 | return val; | 321 | return val; |
| @@ -333,7 +333,7 @@ whose values are discarded.") | |||
| 333 | struct gcpro gcpro1, gcpro2; | 333 | struct gcpro gcpro1, gcpro2; |
| 334 | register int argnum = 0; | 334 | register int argnum = 0; |
| 335 | 335 | ||
| 336 | if (NULL(args)) | 336 | if (NILP(args)) |
| 337 | return Qnil; | 337 | return Qnil; |
| 338 | 338 | ||
| 339 | args_left = args; | 339 | args_left = args; |
| @@ -348,7 +348,7 @@ whose values are discarded.") | |||
| 348 | Feval (Fcar (args_left)); | 348 | Feval (Fcar (args_left)); |
| 349 | args_left = Fcdr (args_left); | 349 | args_left = Fcdr (args_left); |
| 350 | } | 350 | } |
| 351 | while (!NULL(args_left)); | 351 | while (!NILP(args_left)); |
| 352 | 352 | ||
| 353 | UNGCPRO; | 353 | UNGCPRO; |
| 354 | return val; | 354 | return val; |
| @@ -368,7 +368,7 @@ whose values are discarded.") | |||
| 368 | 368 | ||
| 369 | val = Qnil; | 369 | val = Qnil; |
| 370 | 370 | ||
| 371 | if (NULL(args)) | 371 | if (NILP(args)) |
| 372 | return Qnil; | 372 | return Qnil; |
| 373 | 373 | ||
| 374 | args_left = args; | 374 | args_left = args; |
| @@ -383,7 +383,7 @@ whose values are discarded.") | |||
| 383 | Feval (Fcar (args_left)); | 383 | Feval (Fcar (args_left)); |
| 384 | args_left = Fcdr (args_left); | 384 | args_left = Fcdr (args_left); |
| 385 | } | 385 | } |
| 386 | while (!NULL(args_left)); | 386 | while (!NILP(args_left)); |
| 387 | 387 | ||
| 388 | UNGCPRO; | 388 | UNGCPRO; |
| 389 | return val; | 389 | return val; |
| @@ -400,7 +400,7 @@ Each SYM is set before the next VAL is computed.") | |||
| 400 | register Lisp_Object val, sym; | 400 | register Lisp_Object val, sym; |
| 401 | struct gcpro gcpro1; | 401 | struct gcpro gcpro1; |
| 402 | 402 | ||
| 403 | if (NULL(args)) | 403 | if (NILP(args)) |
| 404 | return Qnil; | 404 | return Qnil; |
| 405 | 405 | ||
| 406 | args_left = args; | 406 | args_left = args; |
| @@ -413,7 +413,7 @@ Each SYM is set before the next VAL is computed.") | |||
| 413 | Fset (sym, val); | 413 | Fset (sym, val); |
| 414 | args_left = Fcdr (Fcdr (args_left)); | 414 | args_left = Fcdr (Fcdr (args_left)); |
| 415 | } | 415 | } |
| 416 | while (!NULL(args_left)); | 416 | while (!NILP(args_left)); |
| 417 | 417 | ||
| 418 | UNGCPRO; | 418 | UNGCPRO; |
| 419 | return val; | 419 | return val; |
| @@ -491,7 +491,7 @@ See also the function `interactive'.") | |||
| 491 | 491 | ||
| 492 | fn_name = Fcar (args); | 492 | fn_name = Fcar (args); |
| 493 | defn = Fcons (Qlambda, Fcdr (args)); | 493 | defn = Fcons (Qlambda, Fcdr (args)); |
| 494 | if (!NULL (Vpurify_flag)) | 494 | if (!NILP (Vpurify_flag)) |
| 495 | defn = Fpurecopy (defn); | 495 | defn = Fpurecopy (defn); |
| 496 | Ffset (fn_name, defn); | 496 | Ffset (fn_name, defn); |
| 497 | return fn_name; | 497 | return fn_name; |
| @@ -512,7 +512,7 @@ and the result should be a form to be evaluated instead of the original.") | |||
| 512 | 512 | ||
| 513 | fn_name = Fcar (args); | 513 | fn_name = Fcar (args); |
| 514 | defn = Fcons (Qmacro, Fcons (Qlambda, Fcdr (args))); | 514 | defn = Fcons (Qmacro, Fcons (Qlambda, Fcdr (args))); |
| 515 | if (!NULL (Vpurify_flag)) | 515 | if (!NILP (Vpurify_flag)) |
| 516 | defn = Fpurecopy (defn); | 516 | defn = Fpurecopy (defn); |
| 517 | Ffset (fn_name, defn); | 517 | Ffset (fn_name, defn); |
| 518 | return fn_name; | 518 | return fn_name; |
| @@ -536,16 +536,16 @@ If INITVALUE is missing, SYMBOL's value is not set.") | |||
| 536 | 536 | ||
| 537 | sym = Fcar (args); | 537 | sym = Fcar (args); |
| 538 | tem = Fcdr (args); | 538 | tem = Fcdr (args); |
| 539 | if (!NULL (tem)) | 539 | if (!NILP (tem)) |
| 540 | { | 540 | { |
| 541 | tem = Fdefault_boundp (sym); | 541 | tem = Fdefault_boundp (sym); |
| 542 | if (NULL (tem)) | 542 | if (NILP (tem)) |
| 543 | Fset_default (sym, Feval (Fcar (Fcdr (args)))); | 543 | Fset_default (sym, Feval (Fcar (Fcdr (args)))); |
| 544 | } | 544 | } |
| 545 | tem = Fcar (Fcdr (Fcdr (args))); | 545 | tem = Fcar (Fcdr (Fcdr (args))); |
| 546 | if (!NULL (tem)) | 546 | if (!NILP (tem)) |
| 547 | { | 547 | { |
| 548 | if (!NULL (Vpurify_flag)) | 548 | if (!NILP (Vpurify_flag)) |
| 549 | tem = Fpurecopy (tem); | 549 | tem = Fpurecopy (tem); |
| 550 | Fput (sym, Qvariable_documentation, tem); | 550 | Fput (sym, Qvariable_documentation, tem); |
| 551 | } | 551 | } |
| @@ -573,9 +573,9 @@ it would override the user's choice.") | |||
| 573 | sym = Fcar (args); | 573 | sym = Fcar (args); |
| 574 | Fset_default (sym, Feval (Fcar (Fcdr (args)))); | 574 | Fset_default (sym, Feval (Fcar (Fcdr (args)))); |
| 575 | tem = Fcar (Fcdr (Fcdr (args))); | 575 | tem = Fcar (Fcdr (Fcdr (args))); |
| 576 | if (!NULL (tem)) | 576 | if (!NILP (tem)) |
| 577 | { | 577 | { |
| 578 | if (!NULL (Vpurify_flag)) | 578 | if (!NILP (Vpurify_flag)) |
| 579 | tem = Fpurecopy (tem); | 579 | tem = Fpurecopy (tem); |
| 580 | Fput (sym, Qvariable_documentation, tem); | 580 | Fput (sym, Qvariable_documentation, tem); |
| 581 | } | 581 | } |
| @@ -617,7 +617,7 @@ Each VALUEFORM can refer to the symbols already bound by this VARLIST.") | |||
| 617 | GCPRO3 (args, elt, varlist); | 617 | GCPRO3 (args, elt, varlist); |
| 618 | 618 | ||
| 619 | varlist = Fcar (args); | 619 | varlist = Fcar (args); |
| 620 | while (!NULL (varlist)) | 620 | while (!NILP (varlist)) |
| 621 | { | 621 | { |
| 622 | QUIT; | 622 | QUIT; |
| 623 | elt = Fcar (varlist); | 623 | elt = Fcar (varlist); |
| @@ -661,7 +661,7 @@ All the VALUEFORMs are evalled before any symbols are bound.") | |||
| 661 | GCPRO2 (args, *temps); | 661 | GCPRO2 (args, *temps); |
| 662 | gcpro2.nvars = 0; | 662 | gcpro2.nvars = 0; |
| 663 | 663 | ||
| 664 | for (argnum = 0; !NULL (varlist); varlist = Fcdr (varlist)) | 664 | for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) |
| 665 | { | 665 | { |
| 666 | QUIT; | 666 | QUIT; |
| 667 | elt = Fcar (varlist); | 667 | elt = Fcar (varlist); |
| @@ -674,7 +674,7 @@ All the VALUEFORMs are evalled before any symbols are bound.") | |||
| 674 | UNGCPRO; | 674 | UNGCPRO; |
| 675 | 675 | ||
| 676 | varlist = Fcar (args); | 676 | varlist = Fcar (args); |
| 677 | for (argnum = 0; !NULL (varlist); varlist = Fcdr (varlist)) | 677 | for (argnum = 0; !NILP (varlist); varlist = Fcdr (varlist)) |
| 678 | { | 678 | { |
| 679 | elt = Fcar (varlist); | 679 | elt = Fcar (varlist); |
| 680 | tem = temps[argnum++]; | 680 | tem = temps[argnum++]; |
| @@ -702,7 +702,7 @@ until TEST returns nil.") | |||
| 702 | 702 | ||
| 703 | test = Fcar (args); | 703 | test = Fcar (args); |
| 704 | body = Fcdr (args); | 704 | body = Fcdr (args); |
| 705 | while (tem = Feval (test), !NULL (tem)) | 705 | while (tem = Feval (test), !NILP (tem)) |
| 706 | { | 706 | { |
| 707 | QUIT; | 707 | QUIT; |
| 708 | Fprogn (body); | 708 | Fprogn (body); |
| @@ -747,7 +747,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.") | |||
| 747 | { | 747 | { |
| 748 | QUIT; | 748 | QUIT; |
| 749 | tem = Fassq (sym, env); | 749 | tem = Fassq (sym, env); |
| 750 | if (NULL (tem)) | 750 | if (NILP (tem)) |
| 751 | { | 751 | { |
| 752 | def = XSYMBOL (sym)->function; | 752 | def = XSYMBOL (sym)->function; |
| 753 | if (XTYPE (def) == Lisp_Symbol && !EQ (def, Qunbound)) | 753 | if (XTYPE (def) == Lisp_Symbol && !EQ (def, Qunbound)) |
| @@ -770,7 +770,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.") | |||
| 770 | } | 770 | } |
| 771 | /* Right now TEM is the result from SYM in ENV, | 771 | /* Right now TEM is the result from SYM in ENV, |
| 772 | and if TEM is nil then DEF is SYM's function definition. */ | 772 | and if TEM is nil then DEF is SYM's function definition. */ |
| 773 | if (NULL (tem)) | 773 | if (NILP (tem)) |
| 774 | { | 774 | { |
| 775 | /* SYM is not mentioned in ENV. | 775 | /* SYM is not mentioned in ENV. |
| 776 | Look at its function definition. */ | 776 | Look at its function definition. */ |
| @@ -782,7 +782,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.") | |||
| 782 | { | 782 | { |
| 783 | /* Autoloading function: will it be a macro when loaded? */ | 783 | /* Autoloading function: will it be a macro when loaded? */ |
| 784 | tem = Fcar (Fnthcdr (make_number (4), def)); | 784 | tem = Fcar (Fnthcdr (make_number (4), def)); |
| 785 | if (NULL (tem)) | 785 | if (NILP (tem)) |
| 786 | break; | 786 | break; |
| 787 | /* Yes, load it and try again. */ | 787 | /* Yes, load it and try again. */ |
| 788 | do_autoload (def, sym); | 788 | do_autoload (def, sym); |
| @@ -795,7 +795,7 @@ definitions to shadow the loaded ones for use in file byte-compilation.") | |||
| 795 | else | 795 | else |
| 796 | { | 796 | { |
| 797 | expander = XCONS (tem)->cdr; | 797 | expander = XCONS (tem)->cdr; |
| 798 | if (NULL (expander)) | 798 | if (NILP (expander)) |
| 799 | break; | 799 | break; |
| 800 | } | 800 | } |
| 801 | explicit: | 801 | explicit: |
| @@ -897,7 +897,7 @@ Both TAG and VALUE are evalled.") | |||
| 897 | 897 | ||
| 898 | while (1) | 898 | while (1) |
| 899 | { | 899 | { |
| 900 | if (!NULL (tag)) | 900 | if (!NILP (tag)) |
| 901 | for (c = catchlist; c; c = c->next) | 901 | for (c = catchlist; c; c = c->next) |
| 902 | { | 902 | { |
| 903 | if (EQ (c->tag, tag)) | 903 | if (EQ (c->tag, tag)) |
| @@ -980,7 +980,7 @@ See also the function `signal' for more info.") | |||
| 980 | c.gcpro = gcprolist; | 980 | c.gcpro = gcprolist; |
| 981 | if (_setjmp (c.jmp)) | 981 | if (_setjmp (c.jmp)) |
| 982 | { | 982 | { |
| 983 | if (!NULL (h.var)) | 983 | if (!NILP (h.var)) |
| 984 | specbind (h.var, Fcdr (c.val)); | 984 | specbind (h.var, Fcdr (c.val)); |
| 985 | val = Fprogn (Fcdr (Fcar (c.val))); | 985 | val = Fprogn (Fcdr (Fcar (c.val))); |
| 986 | unbind_to (c.pdlcount, Qnil); | 986 | unbind_to (c.pdlcount, Qnil); |
| @@ -991,10 +991,10 @@ See also the function `signal' for more info.") | |||
| 991 | h.var = Fcar (args); | 991 | h.var = Fcar (args); |
| 992 | h.handler = Fcdr (Fcdr (args)); | 992 | h.handler = Fcdr (Fcdr (args)); |
| 993 | 993 | ||
| 994 | for (val = h.handler; ! NULL (val); val = Fcdr (val)) | 994 | for (val = h.handler; ! NILP (val); val = Fcdr (val)) |
| 995 | { | 995 | { |
| 996 | tem = Fcar (val); | 996 | tem = Fcar (val); |
| 997 | if ((!NULL (tem)) && | 997 | if ((!NILP (tem)) && |
| 998 | (!CONSP (tem) || (XTYPE (XCONS (tem)->car) != Lisp_Symbol))) | 998 | (!CONSP (tem) || (XTYPE (XCONS (tem)->car) != Lisp_Symbol))) |
| 999 | error ("Invalid condition handler", tem); | 999 | error ("Invalid condition handler", tem); |
| 1000 | } | 1000 | } |
| @@ -1095,7 +1095,7 @@ See also the function `condition-case'.") | |||
| 1095 | error ("Returning a value from an error is no longer supported"); | 1095 | error ("Returning a value from an error is no longer supported"); |
| 1096 | #endif | 1096 | #endif |
| 1097 | 1097 | ||
| 1098 | if (!NULL (clause)) | 1098 | if (!NILP (clause)) |
| 1099 | { | 1099 | { |
| 1100 | struct handler *h = handlerlist; | 1100 | struct handler *h = handlerlist; |
| 1101 | /* Restore the polling-suppression count. */ | 1101 | /* Restore the polling-suppression count. */ |
| @@ -1155,7 +1155,7 @@ find_handler_clause (handlers, conditions, sig, data, debugger_value_ptr) | |||
| 1155 | if (!CONSP (tem1)) | 1155 | if (!CONSP (tem1)) |
| 1156 | continue; | 1156 | continue; |
| 1157 | tem = Fmemq (Fcar (tem1), conditions); | 1157 | tem = Fmemq (Fcar (tem1), conditions); |
| 1158 | if (!NULL (tem)) | 1158 | if (!NILP (tem)) |
| 1159 | return tem1; | 1159 | return tem1; |
| 1160 | } | 1160 | } |
| 1161 | return Qnil; | 1161 | return Qnil; |
| @@ -1202,7 +1202,7 @@ Also, a symbol satisfies `commandp' if its function definition does so.") | |||
| 1202 | { | 1202 | { |
| 1203 | if (++i > 10) return Qnil; | 1203 | if (++i > 10) return Qnil; |
| 1204 | tem = Ffboundp (fun); | 1204 | tem = Ffboundp (fun); |
| 1205 | if (NULL (tem)) return Qnil; | 1205 | if (NILP (tem)) return Qnil; |
| 1206 | fun = Fsymbol_function (fun); | 1206 | fun = Fsymbol_function (fun); |
| 1207 | } | 1207 | } |
| 1208 | 1208 | ||
| @@ -1353,7 +1353,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 1353 | if (EQ (Vmocklisp_arguments, Qt)) | 1353 | if (EQ (Vmocklisp_arguments, Qt)) |
| 1354 | return Fsymbol_value (form); | 1354 | return Fsymbol_value (form); |
| 1355 | val = Fsymbol_value (form); | 1355 | val = Fsymbol_value (form); |
| 1356 | if (NULL (val)) | 1356 | if (NILP (val)) |
| 1357 | XFASTINT (val) = 0; | 1357 | XFASTINT (val) = 0; |
| 1358 | else if (EQ (val, Qt)) | 1358 | else if (EQ (val, Qt)) |
| 1359 | XFASTINT (val) = 1; | 1359 | XFASTINT (val) = 1; |
| @@ -1438,7 +1438,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 1438 | gcpro3.var = vals; | 1438 | gcpro3.var = vals; |
| 1439 | gcpro3.nvars = 0; | 1439 | gcpro3.nvars = 0; |
| 1440 | 1440 | ||
| 1441 | while (!NULL (args_left)) | 1441 | while (!NILP (args_left)) |
| 1442 | { | 1442 | { |
| 1443 | vals[argnum++] = Feval (Fcar (args_left)); | 1443 | vals[argnum++] = Feval (Fcar (args_left)); |
| 1444 | args_left = Fcdr (args_left); | 1444 | args_left = Fcdr (args_left); |
| @@ -1528,7 +1528,7 @@ DEFUN ("eval", Feval, Seval, 1, 1, 0, | |||
| 1528 | done: | 1528 | done: |
| 1529 | if (!EQ (Vmocklisp_arguments, Qt)) | 1529 | if (!EQ (Vmocklisp_arguments, Qt)) |
| 1530 | { | 1530 | { |
| 1531 | if (NULL (val)) | 1531 | if (NILP (val)) |
| 1532 | XFASTINT (val) = 0; | 1532 | XFASTINT (val) = 0; |
| 1533 | else if (EQ (val, Qt)) | 1533 | else if (EQ (val, Qt)) |
| 1534 | XFASTINT (val) = 1; | 1534 | XFASTINT (val) = 1; |
| @@ -1614,7 +1614,7 @@ Thus, (apply '+ 1 2 '(3 4)) returns 10.") | |||
| 1614 | /* Spread the last arg we got. Its first element goes in | 1614 | /* Spread the last arg we got. Its first element goes in |
| 1615 | the slot that it used to occupy, hence this value of I. */ | 1615 | the slot that it used to occupy, hence this value of I. */ |
| 1616 | i = nargs - 1; | 1616 | i = nargs - 1; |
| 1617 | while (!NULL (spread_arg)) | 1617 | while (!NILP (spread_arg)) |
| 1618 | { | 1618 | { |
| 1619 | funcall_args [i++] = XCONS (spread_arg)->car; | 1619 | funcall_args [i++] = XCONS (spread_arg)->car; |
| 1620 | spread_arg = XCONS (spread_arg)->cdr; | 1620 | spread_arg = XCONS (spread_arg)->cdr; |
| @@ -1631,7 +1631,7 @@ apply1 (fn, arg) | |||
| 1631 | struct gcpro gcpro1; | 1631 | struct gcpro gcpro1; |
| 1632 | 1632 | ||
| 1633 | GCPRO1 (fn); | 1633 | GCPRO1 (fn); |
| 1634 | if (NULL (arg)) | 1634 | if (NILP (arg)) |
| 1635 | RETURN_UNGCPRO (Ffuncall (1, &fn)); | 1635 | RETURN_UNGCPRO (Ffuncall (1, &fn)); |
| 1636 | gcpro1.nvars = 2; | 1636 | gcpro1.nvars = 2; |
| 1637 | #ifdef NO_ARG_ARRAY | 1637 | #ifdef NO_ARG_ARRAY |
| @@ -1942,7 +1942,7 @@ funcall_lambda (fun, nargs, arg_vector) | |||
| 1942 | else abort (); | 1942 | else abort (); |
| 1943 | 1943 | ||
| 1944 | i = 0; | 1944 | i = 0; |
| 1945 | for (; !NULL (syms_left); syms_left = Fcdr (syms_left)) | 1945 | for (; !NILP (syms_left); syms_left = Fcdr (syms_left)) |
| 1946 | { | 1946 | { |
| 1947 | QUIT; | 1947 | QUIT; |
| 1948 | next = Fcar (syms_left); | 1948 | next = Fcar (syms_left); |
| @@ -2042,7 +2042,7 @@ unbind_to (count, value) | |||
| 2042 | int count; | 2042 | int count; |
| 2043 | Lisp_Object value; | 2043 | Lisp_Object value; |
| 2044 | { | 2044 | { |
| 2045 | int quitf = !NULL (Vquit_flag); | 2045 | int quitf = !NILP (Vquit_flag); |
| 2046 | struct gcpro gcpro1; | 2046 | struct gcpro gcpro1; |
| 2047 | 2047 | ||
| 2048 | GCPRO1 (value); | 2048 | GCPRO1 (value); |
| @@ -2056,12 +2056,12 @@ unbind_to (count, value) | |||
| 2056 | (*specpdl_ptr->func) (specpdl_ptr->old_value); | 2056 | (*specpdl_ptr->func) (specpdl_ptr->old_value); |
| 2057 | /* Note that a "binding" of nil is really an unwind protect, | 2057 | /* Note that a "binding" of nil is really an unwind protect, |
| 2058 | so in that case the "old value" is a list of forms to evaluate. */ | 2058 | so in that case the "old value" is a list of forms to evaluate. */ |
| 2059 | else if (NULL (specpdl_ptr->symbol)) | 2059 | else if (NILP (specpdl_ptr->symbol)) |
| 2060 | Fprogn (specpdl_ptr->old_value); | 2060 | Fprogn (specpdl_ptr->old_value); |
| 2061 | else | 2061 | else |
| 2062 | Fset (specpdl_ptr->symbol, specpdl_ptr->old_value); | 2062 | Fset (specpdl_ptr->symbol, specpdl_ptr->old_value); |
| 2063 | } | 2063 | } |
| 2064 | if (NULL (Vquit_flag) && quitf) Vquit_flag = Qt; | 2064 | if (NILP (Vquit_flag) && quitf) Vquit_flag = Qt; |
| 2065 | 2065 | ||
| 2066 | UNGCPRO; | 2066 | UNGCPRO; |
| 2067 | 2067 | ||
| @@ -2125,7 +2125,7 @@ The debugger is entered when that frame exits, if the flag is non-nil.") | |||
| 2125 | } | 2125 | } |
| 2126 | 2126 | ||
| 2127 | if (backlist) | 2127 | if (backlist) |
| 2128 | backlist->debug_on_exit = !NULL (flag); | 2128 | backlist->debug_on_exit = !NILP (flag); |
| 2129 | 2129 | ||
| 2130 | return flag; | 2130 | return flag; |
| 2131 | } | 2131 | } |
| @@ -2164,7 +2164,7 @@ Output stream used is value of `standard-output'.") | |||
| 2164 | if (backlist->nargs == MANY) | 2164 | if (backlist->nargs == MANY) |
| 2165 | { | 2165 | { |
| 2166 | for (tail = *backlist->args, i = 0; | 2166 | for (tail = *backlist->args, i = 0; |
| 2167 | !NULL (tail); | 2167 | !NILP (tail); |
| 2168 | tail = Fcdr (tail), i++) | 2168 | tail = Fcdr (tail), i++) |
| 2169 | { | 2169 | { |
| 2170 | if (i) write_string (" ", -1); | 2170 | if (i) write_string (" ", -1); |
diff --git a/src/fileio.c b/src/fileio.c index ab235fe917f..d1bac1596a5 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -52,9 +52,6 @@ extern int sys_nerr; | |||
| 52 | #include <sys/time.h> | 52 | #include <sys/time.h> |
| 53 | #endif | 53 | #endif |
| 54 | 54 | ||
| 55 | #ifdef NULL | ||
| 56 | #undef NULL | ||
| 57 | #endif | ||
| 58 | #include "config.h" | 55 | #include "config.h" |
| 59 | #include "lisp.h" | 56 | #include "lisp.h" |
| 60 | #include "buffer.h" | 57 | #include "buffer.h" |
| @@ -269,7 +266,7 @@ On VMS, converts \"[X]FOO.DIR\" to \"[X.FOO]\", etc.") | |||
| 269 | char *buf; | 266 | char *buf; |
| 270 | 267 | ||
| 271 | CHECK_STRING (file, 0); | 268 | CHECK_STRING (file, 0); |
| 272 | if (NULL (file)) | 269 | if (NILP (file)) |
| 273 | return Qnil; | 270 | return Qnil; |
| 274 | buf = (char *) alloca (XSTRING (file)->size + 10); | 271 | buf = (char *) alloca (XSTRING (file)->size + 10); |
| 275 | return build_string (file_name_as_directory (buf, XSTRING (file)->data)); | 272 | return build_string (file_name_as_directory (buf, XSTRING (file)->data)); |
| @@ -435,7 +432,7 @@ it returns a file name such as \"[X]Y.DIR.1\".") | |||
| 435 | 432 | ||
| 436 | CHECK_STRING (directory, 0); | 433 | CHECK_STRING (directory, 0); |
| 437 | 434 | ||
| 438 | if (NULL (directory)) | 435 | if (NILP (directory)) |
| 439 | return Qnil; | 436 | return Qnil; |
| 440 | #ifdef VMS | 437 | #ifdef VMS |
| 441 | /* 20 extra chars is insufficient for VMS, since we might perform a | 438 | /* 20 extra chars is insufficient for VMS, since we might perform a |
| @@ -658,7 +655,7 @@ See also the function `substitute-in-file-name'.") | |||
| 658 | #endif /* not VMS */ | 655 | #endif /* not VMS */ |
| 659 | && !newdir) | 656 | && !newdir) |
| 660 | { | 657 | { |
| 661 | if (NULL (defalt)) | 658 | if (NILP (defalt)) |
| 662 | defalt = current_buffer->directory; | 659 | defalt = current_buffer->directory; |
| 663 | CHECK_STRING (defalt, 1); | 660 | CHECK_STRING (defalt, 1); |
| 664 | newdir = XSTRING (defalt)->data; | 661 | newdir = XSTRING (defalt)->data; |
| @@ -994,7 +991,7 @@ See also the function `substitute-in-file-name'.") | |||
| 994 | #endif /* not VMS */ | 991 | #endif /* not VMS */ |
| 995 | && !newdir) | 992 | && !newdir) |
| 996 | { | 993 | { |
| 997 | if (NULL (defalt)) | 994 | if (NILP (defalt)) |
| 998 | defalt = current_buffer->directory; | 995 | defalt = current_buffer->directory; |
| 999 | CHECK_STRING (defalt, 1); | 996 | CHECK_STRING (defalt, 1); |
| 1000 | newdir = XSTRING (defalt)->data; | 997 | newdir = XSTRING (defalt)->data; |
| @@ -1354,7 +1351,7 @@ barf_or_query_if_file_exists (absname, querystring, interactive) | |||
| 1354 | tem = do_yes_or_no_p (format1 ("File %s already exists; %s anyway? ", | 1351 | tem = do_yes_or_no_p (format1 ("File %s already exists; %s anyway? ", |
| 1355 | XSTRING (absname)->data, querystring)); | 1352 | XSTRING (absname)->data, querystring)); |
| 1356 | UNGCPRO; | 1353 | UNGCPRO; |
| 1357 | if (NULL (tem)) | 1354 | if (NILP (tem)) |
| 1358 | Fsignal (Qfile_already_exists, | 1355 | Fsignal (Qfile_already_exists, |
| 1359 | Fcons (build_string ("File already exists"), | 1356 | Fcons (build_string ("File already exists"), |
| 1360 | Fcons (absname, Qnil))); | 1357 | Fcons (absname, Qnil))); |
| @@ -1385,7 +1382,7 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1385 | CHECK_STRING (newname, 1); | 1382 | CHECK_STRING (newname, 1); |
| 1386 | filename = Fexpand_file_name (filename, Qnil); | 1383 | filename = Fexpand_file_name (filename, Qnil); |
| 1387 | newname = Fexpand_file_name (newname, Qnil); | 1384 | newname = Fexpand_file_name (newname, Qnil); |
| 1388 | if (NULL (ok_if_already_exists) | 1385 | if (NILP (ok_if_already_exists) |
| 1389 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1386 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| 1390 | barf_or_query_if_file_exists (newname, "copy to it", | 1387 | barf_or_query_if_file_exists (newname, "copy to it", |
| 1391 | XTYPE (ok_if_already_exists) == Lisp_Int); | 1388 | XTYPE (ok_if_already_exists) == Lisp_Int); |
| @@ -1417,7 +1414,7 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1417 | if (fstat (ifd, &st) >= 0) | 1414 | if (fstat (ifd, &st) >= 0) |
| 1418 | { | 1415 | { |
| 1419 | #ifdef HAVE_TIMEVAL | 1416 | #ifdef HAVE_TIMEVAL |
| 1420 | if (!NULL (keep_date)) | 1417 | if (!NILP (keep_date)) |
| 1421 | { | 1418 | { |
| 1422 | #ifdef USE_UTIME | 1419 | #ifdef USE_UTIME |
| 1423 | /* AIX has utimes() in compatibility package, but it dies. So use good old | 1420 | /* AIX has utimes() in compatibility package, but it dies. So use good old |
| @@ -1521,7 +1518,7 @@ This is what happens in interactive use with M-x.") | |||
| 1521 | CHECK_STRING (newname, 1); | 1518 | CHECK_STRING (newname, 1); |
| 1522 | filename = Fexpand_file_name (filename, Qnil); | 1519 | filename = Fexpand_file_name (filename, Qnil); |
| 1523 | newname = Fexpand_file_name (newname, Qnil); | 1520 | newname = Fexpand_file_name (newname, Qnil); |
| 1524 | if (NULL (ok_if_already_exists) | 1521 | if (NILP (ok_if_already_exists) |
| 1525 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1522 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| 1526 | barf_or_query_if_file_exists (newname, "rename to it", | 1523 | barf_or_query_if_file_exists (newname, "rename to it", |
| 1527 | XTYPE (ok_if_already_exists) == Lisp_Int); | 1524 | XTYPE (ok_if_already_exists) == Lisp_Int); |
| @@ -1572,7 +1569,7 @@ This is what happens in interactive use with M-x.") | |||
| 1572 | CHECK_STRING (newname, 1); | 1569 | CHECK_STRING (newname, 1); |
| 1573 | filename = Fexpand_file_name (filename, Qnil); | 1570 | filename = Fexpand_file_name (filename, Qnil); |
| 1574 | newname = Fexpand_file_name (newname, Qnil); | 1571 | newname = Fexpand_file_name (newname, Qnil); |
| 1575 | if (NULL (ok_if_already_exists) | 1572 | if (NILP (ok_if_already_exists) |
| 1576 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1573 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| 1577 | barf_or_query_if_file_exists (newname, "make it a new name", | 1574 | barf_or_query_if_file_exists (newname, "make it a new name", |
| 1578 | XTYPE (ok_if_already_exists) == Lisp_Int); | 1575 | XTYPE (ok_if_already_exists) == Lisp_Int); |
| @@ -1615,7 +1612,7 @@ This happens for interactive use with M-x.") | |||
| 1615 | filename = Fexpand_file_name (filename, Qnil); | 1612 | filename = Fexpand_file_name (filename, Qnil); |
| 1616 | #endif | 1613 | #endif |
| 1617 | newname = Fexpand_file_name (newname, Qnil); | 1614 | newname = Fexpand_file_name (newname, Qnil); |
| 1618 | if (NULL (ok_if_already_exists) | 1615 | if (NILP (ok_if_already_exists) |
| 1619 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1616 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| 1620 | barf_or_query_if_file_exists (newname, "make it a link", | 1617 | barf_or_query_if_file_exists (newname, "make it a link", |
| 1621 | XTYPE (ok_if_already_exists) == Lisp_Int); | 1618 | XTYPE (ok_if_already_exists) == Lisp_Int); |
| @@ -1653,7 +1650,7 @@ If STRING is nil or a null string, the logical name NAME is deleted.") | |||
| 1653 | Lisp_Object string; | 1650 | Lisp_Object string; |
| 1654 | { | 1651 | { |
| 1655 | CHECK_STRING (varname, 0); | 1652 | CHECK_STRING (varname, 0); |
| 1656 | if (NULL (string)) | 1653 | if (NILP (string)) |
| 1657 | delete_logical_name (XSTRING (varname)->data); | 1654 | delete_logical_name (XSTRING (varname)->data); |
| 1658 | else | 1655 | else |
| 1659 | { | 1656 | { |
| @@ -1809,10 +1806,10 @@ DEFUN ("file-writable-p", Ffile_writable_p, Sfile_writable_p, 1, 1, 0, | |||
| 1809 | return (access (XSTRING (abspath)->data, 2) >= 0) ? Qt : Qnil; | 1806 | return (access (XSTRING (abspath)->data, 2) >= 0) ? Qt : Qnil; |
| 1810 | dir = Ffile_name_directory (abspath); | 1807 | dir = Ffile_name_directory (abspath); |
| 1811 | #ifdef VMS | 1808 | #ifdef VMS |
| 1812 | if (!NULL (dir)) | 1809 | if (!NILP (dir)) |
| 1813 | dir = Fdirectory_file_name (dir); | 1810 | dir = Fdirectory_file_name (dir); |
| 1814 | #endif /* VMS */ | 1811 | #endif /* VMS */ |
| 1815 | return (access (!NULL (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0 | 1812 | return (access (!NILP (dir) ? (char *) XSTRING (dir)->data : "", 2) >= 0 |
| 1816 | ? Qt : Qnil); | 1813 | ? Qt : Qnil); |
| 1817 | } | 1814 | } |
| 1818 | 1815 | ||
| @@ -1947,7 +1944,7 @@ before the error is signaled.") | |||
| 1947 | struct gcpro gcpro1; | 1944 | struct gcpro gcpro1; |
| 1948 | 1945 | ||
| 1949 | GCPRO1 (filename); | 1946 | GCPRO1 (filename); |
| 1950 | if (!NULL (current_buffer->read_only)) | 1947 | if (!NILP (current_buffer->read_only)) |
| 1951 | Fbarf_if_buffer_read_only(); | 1948 | Fbarf_if_buffer_read_only(); |
| 1952 | 1949 | ||
| 1953 | CHECK_STRING (filename, 0); | 1950 | CHECK_STRING (filename, 0); |
| @@ -1964,7 +1961,7 @@ before the error is signaled.") | |||
| 1964 | #endif /* not APOLLO */ | 1961 | #endif /* not APOLLO */ |
| 1965 | { | 1962 | { |
| 1966 | if (fd >= 0) close (fd); | 1963 | if (fd >= 0) close (fd); |
| 1967 | if (NULL (visit)) | 1964 | if (NILP (visit)) |
| 1968 | report_file_error ("Opening input file", Fcons (filename, Qnil)); | 1965 | report_file_error ("Opening input file", Fcons (filename, Qnil)); |
| 1969 | st.st_mtime = -1; | 1966 | st.st_mtime = -1; |
| 1970 | how_much = 0; | 1967 | how_much = 0; |
| @@ -1985,7 +1982,7 @@ before the error is signaled.") | |||
| 1985 | error ("maximum buffer size exceeded"); | 1982 | error ("maximum buffer size exceeded"); |
| 1986 | } | 1983 | } |
| 1987 | 1984 | ||
| 1988 | if (NULL (visit)) | 1985 | if (NILP (visit)) |
| 1989 | prepare_to_modify_buffer (point, point); | 1986 | prepare_to_modify_buffer (point, point); |
| 1990 | 1987 | ||
| 1991 | move_gap (point); | 1988 | move_gap (point); |
| @@ -2025,7 +2022,7 @@ before the error is signaled.") | |||
| 2025 | 2022 | ||
| 2026 | notfound: | 2023 | notfound: |
| 2027 | 2024 | ||
| 2028 | if (!NULL (visit)) | 2025 | if (!NILP (visit)) |
| 2029 | { | 2026 | { |
| 2030 | current_buffer->undo_list = Qnil; | 2027 | current_buffer->undo_list = Qnil; |
| 2031 | #ifdef APOLLO | 2028 | #ifdef APOLLO |
| @@ -2036,7 +2033,7 @@ before the error is signaled.") | |||
| 2036 | current_buffer->auto_save_modified = MODIFF; | 2033 | current_buffer->auto_save_modified = MODIFF; |
| 2037 | XFASTINT (current_buffer->save_length) = Z - BEG; | 2034 | XFASTINT (current_buffer->save_length) = Z - BEG; |
| 2038 | #ifdef CLASH_DETECTION | 2035 | #ifdef CLASH_DETECTION |
| 2039 | if (!NULL (current_buffer->filename)) | 2036 | if (!NILP (current_buffer->filename)) |
| 2040 | unlock_file (current_buffer->filename); | 2037 | unlock_file (current_buffer->filename); |
| 2041 | unlock_file (filename); | 2038 | unlock_file (filename); |
| 2042 | #endif /* CLASH_DETECTION */ | 2039 | #endif /* CLASH_DETECTION */ |
| @@ -2082,7 +2079,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2082 | #endif /* VMS */ | 2079 | #endif /* VMS */ |
| 2083 | 2080 | ||
| 2084 | /* Special kludge to simplify auto-saving */ | 2081 | /* Special kludge to simplify auto-saving */ |
| 2085 | if (NULL (start)) | 2082 | if (NILP (start)) |
| 2086 | { | 2083 | { |
| 2087 | XFASTINT (start) = BEG; | 2084 | XFASTINT (start) = BEG; |
| 2088 | XFASTINT (end) = Z; | 2085 | XFASTINT (end) = Z; |
| @@ -2099,7 +2096,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2099 | #endif /* CLASH_DETECTION */ | 2096 | #endif /* CLASH_DETECTION */ |
| 2100 | 2097 | ||
| 2101 | desc = -1; | 2098 | desc = -1; |
| 2102 | if (!NULL (append)) | 2099 | if (!NILP (append)) |
| 2103 | desc = open (fn, O_WRONLY); | 2100 | desc = open (fn, O_WRONLY); |
| 2104 | 2101 | ||
| 2105 | if (desc < 0) | 2102 | if (desc < 0) |
| @@ -2118,7 +2115,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2118 | Lisp_Object temp_name; | 2115 | Lisp_Object temp_name; |
| 2119 | temp_name = Ffile_name_directory (filename); | 2116 | temp_name = Ffile_name_directory (filename); |
| 2120 | 2117 | ||
| 2121 | if (!NULL (temp_name)) | 2118 | if (!NILP (temp_name)) |
| 2122 | { | 2119 | { |
| 2123 | temp_name = Fmake_temp_name (concat2 (temp_name, | 2120 | temp_name = Fmake_temp_name (concat2 (temp_name, |
| 2124 | build_string ("$$SAVE$$"))); | 2121 | build_string ("$$SAVE$$"))); |
| @@ -2164,7 +2161,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2164 | 2161 | ||
| 2165 | record_unwind_protect (close_file_unwind, make_number (desc)); | 2162 | record_unwind_protect (close_file_unwind, make_number (desc)); |
| 2166 | 2163 | ||
| 2167 | if (!NULL (append)) | 2164 | if (!NILP (append)) |
| 2168 | if (lseek (desc, 0, 2) < 0) | 2165 | if (lseek (desc, 0, 2) < 0) |
| 2169 | { | 2166 | { |
| 2170 | #ifdef CLASH_DETECTION | 2167 | #ifdef CLASH_DETECTION |
| @@ -2297,7 +2294,7 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2297 | XFASTINT (current_buffer->save_length) = Z - BEG; | 2294 | XFASTINT (current_buffer->save_length) = Z - BEG; |
| 2298 | current_buffer->filename = filename; | 2295 | current_buffer->filename = filename; |
| 2299 | } | 2296 | } |
| 2300 | else if (!NULL (visit)) | 2297 | else if (!NILP (visit)) |
| 2301 | return Qnil; | 2298 | return Qnil; |
| 2302 | 2299 | ||
| 2303 | if (!auto_saving) | 2300 | if (!auto_saving) |
| @@ -2463,7 +2460,7 @@ Non-nil second argumet means save only current buffer.") | |||
| 2463 | 2460 | ||
| 2464 | /* Vrun_hooks is nil before emacs is dumped, and inc-vers.el will | 2461 | /* Vrun_hooks is nil before emacs is dumped, and inc-vers.el will |
| 2465 | eventually call do-auto-save, so don't err here in that case. */ | 2462 | eventually call do-auto-save, so don't err here in that case. */ |
| 2466 | if (!NULL (Vrun_hooks)) | 2463 | if (!NILP (Vrun_hooks)) |
| 2467 | call1 (Vrun_hooks, intern ("auto-save-hook")); | 2464 | call1 (Vrun_hooks, intern ("auto-save-hook")); |
| 2468 | 2465 | ||
| 2469 | for (tail = Vbuffer_alist; XGCTYPE (tail) == Lisp_Cons; | 2466 | for (tail = Vbuffer_alist; XGCTYPE (tail) == Lisp_Cons; |
| @@ -2497,7 +2494,7 @@ Non-nil second argumet means save only current buffer.") | |||
| 2497 | continue; | 2494 | continue; |
| 2498 | } | 2495 | } |
| 2499 | set_buffer_internal (b); | 2496 | set_buffer_internal (b); |
| 2500 | if (!auto_saved && NULL (nomsg)) | 2497 | if (!auto_saved && NILP (nomsg)) |
| 2501 | message1 ("Auto-saving..."); | 2498 | message1 ("Auto-saving..."); |
| 2502 | internal_condition_case (auto_save_1, Qt, auto_save_error); | 2499 | internal_condition_case (auto_save_1, Qt, auto_save_error); |
| 2503 | auto_saved++; | 2500 | auto_saved++; |
| @@ -2510,7 +2507,7 @@ Non-nil second argumet means save only current buffer.") | |||
| 2510 | if (auto_saved) | 2507 | if (auto_saved) |
| 2511 | record_auto_save (); | 2508 | record_auto_save (); |
| 2512 | 2509 | ||
| 2513 | if (auto_saved && NULL (nomsg)) | 2510 | if (auto_saved && NILP (nomsg)) |
| 2514 | message1 (omessage ? omessage : "Auto-saving...done"); | 2511 | message1 (omessage ? omessage : "Auto-saving...done"); |
| 2515 | 2512 | ||
| 2516 | auto_saving = 0; | 2513 | auto_saving = 0; |
| @@ -2563,24 +2560,24 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte | |||
| 2563 | string = Fsubstitute_in_file_name (string); | 2560 | string = Fsubstitute_in_file_name (string); |
| 2564 | name = Ffile_name_nondirectory (string); | 2561 | name = Ffile_name_nondirectory (string); |
| 2565 | realdir = Ffile_name_directory (string); | 2562 | realdir = Ffile_name_directory (string); |
| 2566 | if (NULL (realdir)) | 2563 | if (NILP (realdir)) |
| 2567 | realdir = dir; | 2564 | realdir = dir; |
| 2568 | else | 2565 | else |
| 2569 | realdir = Fexpand_file_name (realdir, dir); | 2566 | realdir = Fexpand_file_name (realdir, dir); |
| 2570 | } | 2567 | } |
| 2571 | 2568 | ||
| 2572 | if (NULL (action)) | 2569 | if (NILP (action)) |
| 2573 | { | 2570 | { |
| 2574 | specdir = Ffile_name_directory (string); | 2571 | specdir = Ffile_name_directory (string); |
| 2575 | val = Ffile_name_completion (name, realdir); | 2572 | val = Ffile_name_completion (name, realdir); |
| 2576 | if (XTYPE (val) != Lisp_String) | 2573 | if (XTYPE (val) != Lisp_String) |
| 2577 | { | 2574 | { |
| 2578 | if (NULL (Fstring_equal (string, orig_string))) | 2575 | if (NILP (Fstring_equal (string, orig_string))) |
| 2579 | return string; | 2576 | return string; |
| 2580 | return (val); | 2577 | return (val); |
| 2581 | } | 2578 | } |
| 2582 | 2579 | ||
| 2583 | if (!NULL (specdir)) | 2580 | if (!NILP (specdir)) |
| 2584 | val = concat2 (specdir, val); | 2581 | val = concat2 (specdir, val); |
| 2585 | #ifndef VMS | 2582 | #ifndef VMS |
| 2586 | { | 2583 | { |
| @@ -2641,9 +2638,9 @@ DIR defaults to current buffer's directory default.") | |||
| 2641 | register char *homedir; | 2638 | register char *homedir; |
| 2642 | int count; | 2639 | int count; |
| 2643 | 2640 | ||
| 2644 | if (NULL (dir)) | 2641 | if (NILP (dir)) |
| 2645 | dir = current_buffer->directory; | 2642 | dir = current_buffer->directory; |
| 2646 | if (NULL (defalt)) | 2643 | if (NILP (defalt)) |
| 2647 | defalt = current_buffer->filename; | 2644 | defalt = current_buffer->filename; |
| 2648 | 2645 | ||
| 2649 | /* If dir starts with user's homedir, change that to ~. */ | 2646 | /* If dir starts with user's homedir, change that to ~. */ |
| @@ -2661,7 +2658,7 @@ DIR defaults to current buffer's directory default.") | |||
| 2661 | if (insert_default_directory) | 2658 | if (insert_default_directory) |
| 2662 | { | 2659 | { |
| 2663 | insdef = dir; | 2660 | insdef = dir; |
| 2664 | if (!NULL (initial)) | 2661 | if (!NILP (initial)) |
| 2665 | { | 2662 | { |
| 2666 | Lisp_Object args[2]; | 2663 | Lisp_Object args[2]; |
| 2667 | 2664 | ||
| @@ -2694,10 +2691,10 @@ DIR defaults to current buffer's directory default.") | |||
| 2694 | #endif | 2691 | #endif |
| 2695 | 2692 | ||
| 2696 | UNGCPRO; | 2693 | UNGCPRO; |
| 2697 | if (NULL (val)) | 2694 | if (NILP (val)) |
| 2698 | error ("No file name specified"); | 2695 | error ("No file name specified"); |
| 2699 | tem = Fstring_equal (val, insdef); | 2696 | tem = Fstring_equal (val, insdef); |
| 2700 | if (!NULL (tem) && !NULL (defalt)) | 2697 | if (!NILP (tem) && !NILP (defalt)) |
| 2701 | return defalt; | 2698 | return defalt; |
| 2702 | return Fsubstitute_in_file_name (val); | 2699 | return Fsubstitute_in_file_name (val); |
| 2703 | } | 2700 | } |
| @@ -2720,9 +2717,9 @@ DIR defaults to current buffer's directory default.") | |||
| 2720 | register char *homedir; | 2717 | register char *homedir; |
| 2721 | int count; | 2718 | int count; |
| 2722 | 2719 | ||
| 2723 | if (NULL (dir)) | 2720 | if (NILP (dir)) |
| 2724 | dir = current_buffer->directory; | 2721 | dir = current_buffer->directory; |
| 2725 | if (NULL (defalt)) | 2722 | if (NILP (defalt)) |
| 2726 | defalt = current_buffer->filename; | 2723 | defalt = current_buffer->filename; |
| 2727 | 2724 | ||
| 2728 | /* If dir starts with user's homedir, change that to ~. */ | 2725 | /* If dir starts with user's homedir, change that to ~. */ |
| @@ -2737,7 +2734,7 @@ DIR defaults to current buffer's directory default.") | |||
| 2737 | XSTRING (dir)->data[0] = '~'; | 2734 | XSTRING (dir)->data[0] = '~'; |
| 2738 | } | 2735 | } |
| 2739 | 2736 | ||
| 2740 | if (!NULL (initial)) | 2737 | if (!NILP (initial)) |
| 2741 | insdef = initial; | 2738 | insdef = initial; |
| 2742 | else if (insert_default_directory) | 2739 | else if (insert_default_directory) |
| 2743 | insdef = dir; | 2740 | insdef = dir; |
| @@ -2759,10 +2756,10 @@ DIR defaults to current buffer's directory default.") | |||
| 2759 | #endif | 2756 | #endif |
| 2760 | 2757 | ||
| 2761 | UNGCPRO; | 2758 | UNGCPRO; |
| 2762 | if (NULL (val)) | 2759 | if (NILP (val)) |
| 2763 | error ("No file name specified"); | 2760 | error ("No file name specified"); |
| 2764 | tem = Fstring_equal (val, insdef); | 2761 | tem = Fstring_equal (val, insdef); |
| 2765 | if (!NULL (tem) && !NULL (defalt)) | 2762 | if (!NILP (tem) && !NILP (defalt)) |
| 2766 | return defalt; | 2763 | return defalt; |
| 2767 | return Fsubstitute_in_file_name (val); | 2764 | return Fsubstitute_in_file_name (val); |
| 2768 | } | 2765 | } |
diff --git a/src/filelock.c b/src/filelock.c index df1794cf6bc..f5557d0decb 100644 --- a/src/filelock.c +++ b/src/filelock.c | |||
| @@ -33,7 +33,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 33 | #include <fcntl.h> | 33 | #include <fcntl.h> |
| 34 | #endif /* USG */ | 34 | #endif /* USG */ |
| 35 | 35 | ||
| 36 | #undef NULL | ||
| 37 | #include "lisp.h" | 36 | #include "lisp.h" |
| 38 | #include "paths.h" | 37 | #include "paths.h" |
| 39 | #include "buffer.h" | 38 | #include "buffer.h" |
| @@ -98,9 +97,9 @@ lock_file (fn) | |||
| 98 | /* See if this file is visited and has changed on disk since it was visited. */ | 97 | /* See if this file is visited and has changed on disk since it was visited. */ |
| 99 | { | 98 | { |
| 100 | register Lisp_Object subject_buf = Fget_file_buffer (fn); | 99 | register Lisp_Object subject_buf = Fget_file_buffer (fn); |
| 101 | if (!NULL (subject_buf) | 100 | if (!NILP (subject_buf) |
| 102 | && NULL (Fverify_visited_file_modtime (subject_buf)) | 101 | && NILP (Fverify_visited_file_modtime (subject_buf)) |
| 103 | && !NULL (Ffile_exists_p (fn))) | 102 | && !NILP (Ffile_exists_p (fn))) |
| 104 | call1 (intern ("ask-user-about-supersession-threat"), fn); | 103 | call1 (intern ("ask-user-about-supersession-threat"), fn); |
| 105 | } | 104 | } |
| 106 | 105 | ||
| @@ -112,7 +111,7 @@ lock_file (fn) | |||
| 112 | /* Else consider breaking the lock */ | 111 | /* Else consider breaking the lock */ |
| 113 | attack = call2 (intern ("ask-user-about-lock"), fn, | 112 | attack = call2 (intern ("ask-user-about-lock"), fn, |
| 114 | lock_file_owner_name (lfname)); | 113 | lock_file_owner_name (lfname)); |
| 115 | if (!NULL (attack)) | 114 | if (!NILP (attack)) |
| 116 | /* User says take the lock */ | 115 | /* User says take the lock */ |
| 117 | { | 116 | { |
| 118 | lock_superlock (lfname); | 117 | lock_superlock (lfname); |
| @@ -298,12 +297,12 @@ or else nothing is done if current buffer isn't visiting a file.") | |||
| 298 | (fn) | 297 | (fn) |
| 299 | Lisp_Object fn; | 298 | Lisp_Object fn; |
| 300 | { | 299 | { |
| 301 | if (NULL (fn)) | 300 | if (NILP (fn)) |
| 302 | fn = current_buffer->filename; | 301 | fn = current_buffer->filename; |
| 303 | else | 302 | else |
| 304 | CHECK_STRING (fn, 0); | 303 | CHECK_STRING (fn, 0); |
| 305 | if (current_buffer->save_modified < MODIFF | 304 | if (current_buffer->save_modified < MODIFF |
| 306 | && !NULL (fn)) | 305 | && !NILP (fn)) |
| 307 | lock_file (fn); | 306 | lock_file (fn); |
| 308 | return Qnil; | 307 | return Qnil; |
| 309 | } | 308 | } |
diff --git a/src/floatfns.c b/src/floatfns.c index 1cf132d5f5c..12f14ffef72 100644 --- a/src/floatfns.c +++ b/src/floatfns.c | |||
| @@ -26,7 +26,23 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 26 | Lisp_Object Qarith_error; | 26 | Lisp_Object Qarith_error; |
| 27 | 27 | ||
| 28 | #ifdef LISP_FLOAT_TYPE | 28 | #ifdef LISP_FLOAT_TYPE |
| 29 | |||
| 29 | #include <math.h> | 30 | #include <math.h> |
| 31 | #include <errno.h> | ||
| 32 | |||
| 33 | extern int errno; | ||
| 34 | |||
| 35 | /* Avoid traps on VMS from sinh and cosh. | ||
| 36 | All the other functions set errno instead. */ | ||
| 37 | |||
| 38 | #ifdef VMS | ||
| 39 | #undef cosh | ||
| 40 | #undef sinh | ||
| 41 | #define cosh(x) ((exp(x)+exp(-x))*0.5) | ||
| 42 | #define sinh(x) ((exp(x)-exp(-x))*0.5) | ||
| 43 | #endif /* VMS */ | ||
| 44 | |||
| 45 | static float_error (); | ||
| 30 | 46 | ||
| 31 | /* Nonzero while executing in floating point. | 47 | /* Nonzero while executing in floating point. |
| 32 | This tells float_error what to do. */ | 48 | This tells float_error what to do. */ |
| @@ -34,13 +50,19 @@ Lisp_Object Qarith_error; | |||
| 34 | static int in_float; | 50 | static int in_float; |
| 35 | 51 | ||
| 36 | /* If an argument is out of range for a mathematical function, | 52 | /* If an argument is out of range for a mathematical function, |
| 37 | that is detected with a signal. Here is the actual argument | 53 | here is the actual argument value to use in the error message. */ |
| 38 | value to use in the error message. */ | ||
| 39 | 54 | ||
| 40 | static Lisp_Object float_error_arg; | 55 | static Lisp_Object float_error_arg; |
| 41 | 56 | ||
| 42 | #define IN_FLOAT(d, num) \ | 57 | /* Evaluate the floating point expression D, recording NUM |
| 43 | (in_float = 1, float_error_arg = num, (d), in_float = 0) | 58 | as the original argument for error messages. |
| 59 | D is normally an assignment expression. | ||
| 60 | Handle errors which may result in signals or may set errno. */ | ||
| 61 | |||
| 62 | #define IN_FLOAT(D, NUM) \ | ||
| 63 | (in_float = 1, errno = 0, float_error_arg = NUM, (D), \ | ||
| 64 | (errno == ERANGE || errno == EDOM ? float_error () : 0), \ | ||
| 65 | in_float = 0) | ||
| 44 | 66 | ||
| 45 | /* Extract a Lisp number as a `double', or signal an error. */ | 67 | /* Extract a Lisp number as a `double', or signal an error. */ |
| 46 | 68 | ||
| @@ -476,7 +498,6 @@ Rounds the value toward zero.") | |||
| 476 | return num; | 498 | return num; |
| 477 | } | 499 | } |
| 478 | 500 | ||
| 479 | #ifdef BSD | ||
| 480 | static | 501 | static |
| 481 | float_error (signo) | 502 | float_error (signo) |
| 482 | int signo; | 503 | int signo; |
| @@ -484,22 +505,22 @@ float_error (signo) | |||
| 484 | if (! in_float) | 505 | if (! in_float) |
| 485 | fatal_error_signal (signo); | 506 | fatal_error_signal (signo); |
| 486 | 507 | ||
| 508 | #ifdef BSD | ||
| 487 | #ifdef BSD4_1 | 509 | #ifdef BSD4_1 |
| 488 | sigrelse (SIGILL); | 510 | sigrelse (SIGILL); |
| 489 | #else /* not BSD4_1 */ | 511 | #else /* not BSD4_1 */ |
| 490 | sigsetmask (0); | 512 | sigsetmask (0); |
| 491 | #endif /* not BSD4_1 */ | 513 | #endif /* not BSD4_1 */ |
| 514 | #else | ||
| 515 | /* Must reestablish handler each time it is called. */ | ||
| 516 | signal (SIGILL, float_error); | ||
| 517 | #endif /* BSD */ | ||
| 492 | 518 | ||
| 493 | in_float = 0; | 519 | in_float = 0; |
| 494 | 520 | ||
| 495 | Fsignal (Qarith_error, Fcons (float_error_arg, Qnil)); | 521 | Fsignal (Qarith_error, Fcons (float_error_arg, Qnil)); |
| 496 | } | 522 | } |
| 497 | 523 | ||
| 498 | /* Another idea was to replace the library function `infnan' | ||
| 499 | where SIGILL is signaled. */ | ||
| 500 | |||
| 501 | #endif /* BSD */ | ||
| 502 | |||
| 503 | init_floatfns () | 524 | init_floatfns () |
| 504 | { | 525 | { |
| 505 | signal (SIGILL, float_error); | 526 | signal (SIGILL, float_error); |
| @@ -60,9 +60,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 60 | #undef vector | 60 | #undef vector |
| 61 | #define vector ***** | 61 | #define vector ***** |
| 62 | 62 | ||
| 63 | #ifdef NULL | ||
| 64 | #undef NULL | ||
| 65 | #endif | ||
| 66 | #include "lisp.h" | 63 | #include "lisp.h" |
| 67 | #include "commands.h" | 64 | #include "commands.h" |
| 68 | 65 | ||
| @@ -132,7 +129,7 @@ A byte-code function object is also allowed.") | |||
| 132 | return Farray_length (obj); | 129 | return Farray_length (obj); |
| 133 | else if (CONSP (obj)) | 130 | else if (CONSP (obj)) |
| 134 | { | 131 | { |
| 135 | for (i = 0, tail = obj; !NULL(tail); i++) | 132 | for (i = 0, tail = obj; !NILP(tail); i++) |
| 136 | { | 133 | { |
| 137 | QUIT; | 134 | QUIT; |
| 138 | tail = Fcdr (tail); | 135 | tail = Fcdr (tail); |
| @@ -141,7 +138,7 @@ A byte-code function object is also allowed.") | |||
| 141 | XFASTINT (val) = i; | 138 | XFASTINT (val) = i; |
| 142 | return val; | 139 | return val; |
| 143 | } | 140 | } |
| 144 | else if (NULL(obj)) | 141 | else if (NILP(obj)) |
| 145 | { | 142 | { |
| 146 | XFASTINT (val) = 0; | 143 | XFASTINT (val) = 0; |
| 147 | return val; | 144 | return val; |
| @@ -263,7 +260,7 @@ with the original.") | |||
| 263 | (arg) | 260 | (arg) |
| 264 | Lisp_Object arg; | 261 | Lisp_Object arg; |
| 265 | { | 262 | { |
| 266 | if (NULL (arg)) return arg; | 263 | if (NILP (arg)) return arg; |
| 267 | if (!CONSP (arg) && XTYPE (arg) != Lisp_Vector && XTYPE (arg) != Lisp_String) | 264 | if (!CONSP (arg) && XTYPE (arg) != Lisp_Vector && XTYPE (arg) != Lisp_String) |
| 268 | arg = wrong_type_argument (Qsequencep, arg); | 265 | arg = wrong_type_argument (Qsequencep, arg); |
| 269 | return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); | 266 | return concat (1, &arg, CONSP (arg) ? Lisp_Cons : XTYPE (arg), 0); |
| @@ -298,7 +295,7 @@ concat (nargs, args, target_type, last_special) | |||
| 298 | for (argnum = 0; argnum < nargs; argnum++) | 295 | for (argnum = 0; argnum < nargs; argnum++) |
| 299 | { | 296 | { |
| 300 | this = args[argnum]; | 297 | this = args[argnum]; |
| 301 | if (!(CONSP (this) || NULL (this) | 298 | if (!(CONSP (this) || NILP (this) |
| 302 | || XTYPE (this) == Lisp_Vector || XTYPE (this) == Lisp_String | 299 | || XTYPE (this) == Lisp_Vector || XTYPE (this) == Lisp_String |
| 303 | || XTYPE (this) == Lisp_Compiled)) | 300 | || XTYPE (this) == Lisp_Compiled)) |
| 304 | { | 301 | { |
| @@ -351,7 +348,7 @@ concat (nargs, args, target_type, last_special) | |||
| 351 | register Lisp_Object elt; | 348 | register Lisp_Object elt; |
| 352 | 349 | ||
| 353 | /* Fetch next element of `this' arg into `elt', or break if `this' is exhausted. */ | 350 | /* Fetch next element of `this' arg into `elt', or break if `this' is exhausted. */ |
| 354 | if (NULL (this)) break; | 351 | if (NILP (this)) break; |
| 355 | if (CONSP (this)) | 352 | if (CONSP (this)) |
| 356 | elt = Fcar (this), this = Fcdr (this); | 353 | elt = Fcar (this), this = Fcdr (this); |
| 357 | else | 354 | else |
| @@ -389,7 +386,7 @@ concat (nargs, args, target_type, last_special) | |||
| 389 | } | 386 | } |
| 390 | } | 387 | } |
| 391 | } | 388 | } |
| 392 | if (!NULL (prev)) | 389 | if (!NILP (prev)) |
| 393 | XCONS (prev)->cdr = last_tail; | 390 | XCONS (prev)->cdr = last_tail; |
| 394 | 391 | ||
| 395 | return val; | 392 | return val; |
| @@ -408,7 +405,7 @@ Elements of ALIST that are not conses are also shared.") | |||
| 408 | register Lisp_Object tem; | 405 | register Lisp_Object tem; |
| 409 | 406 | ||
| 410 | CHECK_LIST (alist, 0); | 407 | CHECK_LIST (alist, 0); |
| 411 | if (NULL (alist)) | 408 | if (NILP (alist)) |
| 412 | return alist; | 409 | return alist; |
| 413 | alist = concat (1, &alist, Lisp_Cons, 0); | 410 | alist = concat (1, &alist, Lisp_Cons, 0); |
| 414 | for (tem = alist; CONSP (tem); tem = XCONS (tem)->cdr) | 411 | for (tem = alist; CONSP (tem); tem = XCONS (tem)->cdr) |
| @@ -432,7 +429,7 @@ If FROM or TO is negative, it counts from the end.") | |||
| 432 | { | 429 | { |
| 433 | CHECK_STRING (string, 0); | 430 | CHECK_STRING (string, 0); |
| 434 | CHECK_NUMBER (from, 1); | 431 | CHECK_NUMBER (from, 1); |
| 435 | if (NULL (to)) | 432 | if (NILP (to)) |
| 436 | to = Flength (string); | 433 | to = Flength (string); |
| 437 | else | 434 | else |
| 438 | CHECK_NUMBER (to, 2); | 435 | CHECK_NUMBER (to, 2); |
| @@ -458,7 +455,7 @@ DEFUN ("nthcdr", Fnthcdr, Snthcdr, 2, 2, 0, | |||
| 458 | register int i, num; | 455 | register int i, num; |
| 459 | CHECK_NUMBER (n, 0); | 456 | CHECK_NUMBER (n, 0); |
| 460 | num = XINT (n); | 457 | num = XINT (n); |
| 461 | for (i = 0; i < num && !NULL (list); i++) | 458 | for (i = 0; i < num && !NILP (list); i++) |
| 462 | { | 459 | { |
| 463 | QUIT; | 460 | QUIT; |
| 464 | list = Fcdr (list); | 461 | list = Fcdr (list); |
| @@ -483,7 +480,7 @@ DEFUN ("elt", Felt, Selt, 2, 2, 0, | |||
| 483 | CHECK_NUMBER (n, 0); | 480 | CHECK_NUMBER (n, 0); |
| 484 | while (1) | 481 | while (1) |
| 485 | { | 482 | { |
| 486 | if (XTYPE (seq) == Lisp_Cons || NULL (seq)) | 483 | if (XTYPE (seq) == Lisp_Cons || NILP (seq)) |
| 487 | return Fcar (Fnthcdr (n, seq)); | 484 | return Fcar (Fnthcdr (n, seq)); |
| 488 | else if (XTYPE (seq) == Lisp_String | 485 | else if (XTYPE (seq) == Lisp_String |
| 489 | || XTYPE (seq) == Lisp_Vector) | 486 | || XTYPE (seq) == Lisp_Vector) |
| @@ -501,11 +498,11 @@ The value is actually the tail of LIST whose car is ELT.") | |||
| 501 | Lisp_Object list; | 498 | Lisp_Object list; |
| 502 | { | 499 | { |
| 503 | register Lisp_Object tail; | 500 | register Lisp_Object tail; |
| 504 | for (tail = list; !NULL (tail); tail = Fcdr (tail)) | 501 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 505 | { | 502 | { |
| 506 | register Lisp_Object tem; | 503 | register Lisp_Object tem; |
| 507 | tem = Fcar (tail); | 504 | tem = Fcar (tail); |
| 508 | if (! NULL (Fequal (elt, tem))) | 505 | if (! NILP (Fequal (elt, tem))) |
| 509 | return tail; | 506 | return tail; |
| 510 | QUIT; | 507 | QUIT; |
| 511 | } | 508 | } |
| @@ -520,7 +517,7 @@ The value is actually the tail of LIST whose car is ELT.") | |||
| 520 | Lisp_Object list; | 517 | Lisp_Object list; |
| 521 | { | 518 | { |
| 522 | register Lisp_Object tail; | 519 | register Lisp_Object tail; |
| 523 | for (tail = list; !NULL (tail); tail = Fcdr (tail)) | 520 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 524 | { | 521 | { |
| 525 | register Lisp_Object tem; | 522 | register Lisp_Object tem; |
| 526 | tem = Fcar (tail); | 523 | tem = Fcar (tail); |
| @@ -539,7 +536,7 @@ Elements of LIST that are not conses are ignored.") | |||
| 539 | Lisp_Object list; | 536 | Lisp_Object list; |
| 540 | { | 537 | { |
| 541 | register Lisp_Object tail; | 538 | register Lisp_Object tail; |
| 542 | for (tail = list; !NULL (tail); tail = Fcdr (tail)) | 539 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 543 | { | 540 | { |
| 544 | register Lisp_Object elt, tem; | 541 | register Lisp_Object elt, tem; |
| 545 | elt = Fcar (tail); | 542 | elt = Fcar (tail); |
| @@ -579,13 +576,13 @@ The value is actually the element of LIST whose car is ELT.") | |||
| 579 | Lisp_Object list; | 576 | Lisp_Object list; |
| 580 | { | 577 | { |
| 581 | register Lisp_Object tail; | 578 | register Lisp_Object tail; |
| 582 | for (tail = list; !NULL (tail); tail = Fcdr (tail)) | 579 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 583 | { | 580 | { |
| 584 | register Lisp_Object elt, tem; | 581 | register Lisp_Object elt, tem; |
| 585 | elt = Fcar (tail); | 582 | elt = Fcar (tail); |
| 586 | if (!CONSP (elt)) continue; | 583 | if (!CONSP (elt)) continue; |
| 587 | tem = Fequal (Fcar (elt), key); | 584 | tem = Fequal (Fcar (elt), key); |
| 588 | if (!NULL (tem)) return elt; | 585 | if (!NILP (tem)) return elt; |
| 589 | QUIT; | 586 | QUIT; |
| 590 | } | 587 | } |
| 591 | return Qnil; | 588 | return Qnil; |
| @@ -599,7 +596,7 @@ The value is actually the element of LIST whose cdr is ELT.") | |||
| 599 | Lisp_Object list; | 596 | Lisp_Object list; |
| 600 | { | 597 | { |
| 601 | register Lisp_Object tail; | 598 | register Lisp_Object tail; |
| 602 | for (tail = list; !NULL (tail); tail = Fcdr (tail)) | 599 | for (tail = list; !NILP (tail); tail = Fcdr (tail)) |
| 603 | { | 600 | { |
| 604 | register Lisp_Object elt, tem; | 601 | register Lisp_Object elt, tem; |
| 605 | elt = Fcar (tail); | 602 | elt = Fcar (tail); |
| @@ -626,12 +623,12 @@ to be sure of changing the value of `foo'.") | |||
| 626 | 623 | ||
| 627 | tail = list; | 624 | tail = list; |
| 628 | prev = Qnil; | 625 | prev = Qnil; |
| 629 | while (!NULL (tail)) | 626 | while (!NILP (tail)) |
| 630 | { | 627 | { |
| 631 | tem = Fcar (tail); | 628 | tem = Fcar (tail); |
| 632 | if (EQ (elt, tem)) | 629 | if (EQ (elt, tem)) |
| 633 | { | 630 | { |
| 634 | if (NULL (prev)) | 631 | if (NILP (prev)) |
| 635 | list = Fcdr (tail); | 632 | list = Fcdr (tail); |
| 636 | else | 633 | else |
| 637 | Fsetcdr (prev, Fcdr (tail)); | 634 | Fsetcdr (prev, Fcdr (tail)); |
| @@ -659,12 +656,12 @@ to be sure of changing the value of `foo'.") | |||
| 659 | 656 | ||
| 660 | tail = list; | 657 | tail = list; |
| 661 | prev = Qnil; | 658 | prev = Qnil; |
| 662 | while (!NULL (tail)) | 659 | while (!NILP (tail)) |
| 663 | { | 660 | { |
| 664 | tem = Fcar (tail); | 661 | tem = Fcar (tail); |
| 665 | if (Fequal (elt, tem)) | 662 | if (Fequal (elt, tem)) |
| 666 | { | 663 | { |
| 667 | if (NULL (prev)) | 664 | if (NILP (prev)) |
| 668 | list = Fcdr (tail); | 665 | list = Fcdr (tail); |
| 669 | else | 666 | else |
| 670 | Fsetcdr (prev, Fcdr (tail)); | 667 | Fsetcdr (prev, Fcdr (tail)); |
| @@ -685,10 +682,10 @@ Returns the beginning of the reversed list.") | |||
| 685 | { | 682 | { |
| 686 | register Lisp_Object prev, tail, next; | 683 | register Lisp_Object prev, tail, next; |
| 687 | 684 | ||
| 688 | if (NULL (list)) return list; | 685 | if (NILP (list)) return list; |
| 689 | prev = Qnil; | 686 | prev = Qnil; |
| 690 | tail = list; | 687 | tail = list; |
| 691 | while (!NULL (tail)) | 688 | while (!NILP (tail)) |
| 692 | { | 689 | { |
| 693 | QUIT; | 690 | QUIT; |
| 694 | next = Fcdr (tail); | 691 | next = Fcdr (tail); |
| @@ -774,24 +771,24 @@ merge (org_l1, org_l2, pred) | |||
| 774 | 771 | ||
| 775 | while (1) | 772 | while (1) |
| 776 | { | 773 | { |
| 777 | if (NULL (l1)) | 774 | if (NILP (l1)) |
| 778 | { | 775 | { |
| 779 | UNGCPRO; | 776 | UNGCPRO; |
| 780 | if (NULL (tail)) | 777 | if (NILP (tail)) |
| 781 | return l2; | 778 | return l2; |
| 782 | Fsetcdr (tail, l2); | 779 | Fsetcdr (tail, l2); |
| 783 | return value; | 780 | return value; |
| 784 | } | 781 | } |
| 785 | if (NULL (l2)) | 782 | if (NILP (l2)) |
| 786 | { | 783 | { |
| 787 | UNGCPRO; | 784 | UNGCPRO; |
| 788 | if (NULL (tail)) | 785 | if (NILP (tail)) |
| 789 | return l1; | 786 | return l1; |
| 790 | Fsetcdr (tail, l1); | 787 | Fsetcdr (tail, l1); |
| 791 | return value; | 788 | return value; |
| 792 | } | 789 | } |
| 793 | tem = call2 (pred, Fcar (l2), Fcar (l1)); | 790 | tem = call2 (pred, Fcar (l2), Fcar (l1)); |
| 794 | if (NULL (tem)) | 791 | if (NILP (tem)) |
| 795 | { | 792 | { |
| 796 | tem = l1; | 793 | tem = l1; |
| 797 | l1 = Fcdr (l1); | 794 | l1 = Fcdr (l1); |
| @@ -803,7 +800,7 @@ merge (org_l1, org_l2, pred) | |||
| 803 | l2 = Fcdr (l2); | 800 | l2 = Fcdr (l2); |
| 804 | org_l2 = l2; | 801 | org_l2 = l2; |
| 805 | } | 802 | } |
| 806 | if (NULL (tail)) | 803 | if (NILP (tail)) |
| 807 | value = tem; | 804 | value = tem; |
| 808 | else | 805 | else |
| 809 | Fsetcdr (tail, tem); | 806 | Fsetcdr (tail, tem); |
| @@ -819,7 +816,7 @@ This is the last VALUE stored with `(put SYMBOL PROPNAME VALUE)'.") | |||
| 819 | register Lisp_Object prop; | 816 | register Lisp_Object prop; |
| 820 | { | 817 | { |
| 821 | register Lisp_Object tail; | 818 | register Lisp_Object tail; |
| 822 | for (tail = Fsymbol_plist (sym); !NULL (tail); tail = Fcdr (Fcdr (tail))) | 819 | for (tail = Fsymbol_plist (sym); !NILP (tail); tail = Fcdr (Fcdr (tail))) |
| 823 | { | 820 | { |
| 824 | register Lisp_Object tem; | 821 | register Lisp_Object tem; |
| 825 | tem = Fcar (tail); | 822 | tem = Fcar (tail); |
| @@ -840,7 +837,7 @@ It can be retrieved with `(get SYMBOL PROPNAME)'.") | |||
| 840 | register Lisp_Object tail, prev; | 837 | register Lisp_Object tail, prev; |
| 841 | Lisp_Object newcell; | 838 | Lisp_Object newcell; |
| 842 | prev = Qnil; | 839 | prev = Qnil; |
| 843 | for (tail = Fsymbol_plist (sym); !NULL (tail); tail = Fcdr (Fcdr (tail))) | 840 | for (tail = Fsymbol_plist (sym); !NILP (tail); tail = Fcdr (Fcdr (tail))) |
| 844 | { | 841 | { |
| 845 | register Lisp_Object tem; | 842 | register Lisp_Object tem; |
| 846 | tem = Fcar (tail); | 843 | tem = Fcar (tail); |
| @@ -849,7 +846,7 @@ It can be retrieved with `(get SYMBOL PROPNAME)'.") | |||
| 849 | prev = tail; | 846 | prev = tail; |
| 850 | } | 847 | } |
| 851 | newcell = Fcons (prop, Fcons (val, Qnil)); | 848 | newcell = Fcons (prop, Fcons (val, Qnil)); |
| 852 | if (NULL (prev)) | 849 | if (NILP (prev)) |
| 853 | Fsetplist (sym, newcell); | 850 | Fsetplist (sym, newcell); |
| 854 | else | 851 | else |
| 855 | Fsetcdr (Fcdr (prev), newcell); | 852 | Fsetcdr (Fcdr (prev), newcell); |
| @@ -883,7 +880,7 @@ do_cdr: | |||
| 883 | { | 880 | { |
| 884 | Lisp_Object v1; | 881 | Lisp_Object v1; |
| 885 | v1 = Fequal (Fcar (o1), Fcar (o2), depth + 1); | 882 | v1 = Fequal (Fcar (o1), Fcar (o2), depth + 1); |
| 886 | if (NULL (v1)) | 883 | if (NILP (v1)) |
| 887 | return v1; | 884 | return v1; |
| 888 | o1 = Fcdr (o1), o2 = Fcdr (o2); | 885 | o1 = Fcdr (o1), o2 = Fcdr (o2); |
| 889 | goto do_cdr; | 886 | goto do_cdr; |
| @@ -905,7 +902,7 @@ do_cdr: | |||
| 905 | v1 = XVECTOR (o1)->contents [index]; | 902 | v1 = XVECTOR (o1)->contents [index]; |
| 906 | v2 = XVECTOR (o2)->contents [index]; | 903 | v2 = XVECTOR (o2)->contents [index]; |
| 907 | v = Fequal (v1, v2, depth + 1); | 904 | v = Fequal (v1, v2, depth + 1); |
| 908 | if (NULL (v)) return v; | 905 | if (NILP (v)) return v; |
| 909 | } | 906 | } |
| 910 | return Qt; | 907 | return Qt; |
| 911 | } | 908 | } |
| @@ -981,9 +978,9 @@ Only the last argument is not altered, and need not be a list.") | |||
| 981 | for (argnum = 0; argnum < nargs; argnum++) | 978 | for (argnum = 0; argnum < nargs; argnum++) |
| 982 | { | 979 | { |
| 983 | tem = args[argnum]; | 980 | tem = args[argnum]; |
| 984 | if (NULL (tem)) continue; | 981 | if (NILP (tem)) continue; |
| 985 | 982 | ||
| 986 | if (NULL (val)) | 983 | if (NILP (val)) |
| 987 | val = tem; | 984 | val = tem; |
| 988 | 985 | ||
| 989 | if (argnum + 1 == nargs) break; | 986 | if (argnum + 1 == nargs) break; |
| @@ -1000,7 +997,7 @@ Only the last argument is not altered, and need not be a list.") | |||
| 1000 | 997 | ||
| 1001 | tem = args[argnum + 1]; | 998 | tem = args[argnum + 1]; |
| 1002 | Fsetcdr (tail, tem); | 999 | Fsetcdr (tail, tem); |
| 1003 | if (NULL (tem)) | 1000 | if (NILP (tem)) |
| 1004 | args[argnum + 1] = tail; | 1001 | args[argnum + 1] = tail; |
| 1005 | } | 1002 | } |
| 1006 | 1003 | ||
| @@ -1409,7 +1406,7 @@ This function looks at the value of the variable `features'.") | |||
| 1409 | register Lisp_Object tem; | 1406 | register Lisp_Object tem; |
| 1410 | CHECK_SYMBOL (feature, 0); | 1407 | CHECK_SYMBOL (feature, 0); |
| 1411 | tem = Fmemq (feature, Vfeatures); | 1408 | tem = Fmemq (feature, Vfeatures); |
| 1412 | return (NULL (tem)) ? Qnil : Qt; | 1409 | return (NILP (tem)) ? Qnil : Qt; |
| 1413 | } | 1410 | } |
| 1414 | 1411 | ||
| 1415 | DEFUN ("provide", Fprovide, Sprovide, 1, 1, 0, | 1412 | DEFUN ("provide", Fprovide, Sprovide, 1, 1, 0, |
| @@ -1419,10 +1416,10 @@ DEFUN ("provide", Fprovide, Sprovide, 1, 1, 0, | |||
| 1419 | { | 1416 | { |
| 1420 | register Lisp_Object tem; | 1417 | register Lisp_Object tem; |
| 1421 | CHECK_SYMBOL (feature, 0); | 1418 | CHECK_SYMBOL (feature, 0); |
| 1422 | if (!NULL (Vautoload_queue)) | 1419 | if (!NILP (Vautoload_queue)) |
| 1423 | Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); | 1420 | Vautoload_queue = Fcons (Fcons (Vfeatures, Qnil), Vautoload_queue); |
| 1424 | tem = Fmemq (feature, Vfeatures); | 1421 | tem = Fmemq (feature, Vfeatures); |
| 1425 | if (NULL (tem)) | 1422 | if (NILP (tem)) |
| 1426 | Vfeatures = Fcons (feature, Vfeatures); | 1423 | Vfeatures = Fcons (feature, Vfeatures); |
| 1427 | return feature; | 1424 | return feature; |
| 1428 | } | 1425 | } |
| @@ -1438,7 +1435,7 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name.") | |||
| 1438 | register Lisp_Object tem; | 1435 | register Lisp_Object tem; |
| 1439 | CHECK_SYMBOL (feature, 0); | 1436 | CHECK_SYMBOL (feature, 0); |
| 1440 | tem = Fmemq (feature, Vfeatures); | 1437 | tem = Fmemq (feature, Vfeatures); |
| 1441 | if (NULL (tem)) | 1438 | if (NILP (tem)) |
| 1442 | { | 1439 | { |
| 1443 | int count = specpdl_ptr - specpdl; | 1440 | int count = specpdl_ptr - specpdl; |
| 1444 | 1441 | ||
| @@ -1446,11 +1443,11 @@ If FILENAME is omitted, the printname of FEATURE is used as the file name.") | |||
| 1446 | record_unwind_protect (un_autoload, Vautoload_queue); | 1443 | record_unwind_protect (un_autoload, Vautoload_queue); |
| 1447 | Vautoload_queue = Qt; | 1444 | Vautoload_queue = Qt; |
| 1448 | 1445 | ||
| 1449 | Fload (NULL (file_name) ? Fsymbol_name (feature) : file_name, | 1446 | Fload (NILP (file_name) ? Fsymbol_name (feature) : file_name, |
| 1450 | Qnil, Qt, Qnil); | 1447 | Qnil, Qt, Qnil); |
| 1451 | 1448 | ||
| 1452 | tem = Fmemq (feature, Vfeatures); | 1449 | tem = Fmemq (feature, Vfeatures); |
| 1453 | if (NULL (tem)) | 1450 | if (NILP (tem)) |
| 1454 | error ("Required feature %s was not provided", | 1451 | error ("Required feature %s was not provided", |
| 1455 | XSYMBOL (feature)->name->data ); | 1452 | XSYMBOL (feature)->name->data ); |
| 1456 | 1453 | ||
diff --git a/src/frame.c b/src/frame.c index 5eaf5897e01..67c73950505 100644 --- a/src/frame.c +++ b/src/frame.c | |||
| @@ -163,7 +163,7 @@ make_screen (mini_p) | |||
| 163 | { | 163 | { |
| 164 | XWINDOW (mini_window)->buffer = Qt; | 164 | XWINDOW (mini_window)->buffer = Qt; |
| 165 | Fset_window_buffer (mini_window, | 165 | Fset_window_buffer (mini_window, |
| 166 | (NULL (Vminibuffer_list) | 166 | (NILP (Vminibuffer_list) |
| 167 | ? get_minibuffer (0) | 167 | ? get_minibuffer (0) |
| 168 | : Fcar (Vminibuffer_list))); | 168 | : Fcar (Vminibuffer_list))); |
| 169 | } | 169 | } |
| @@ -190,7 +190,7 @@ make_screen_without_minibuffer (mini_window) | |||
| 190 | register struct screen *s; | 190 | register struct screen *s; |
| 191 | 191 | ||
| 192 | /* Choose the minibuffer window to use. */ | 192 | /* Choose the minibuffer window to use. */ |
| 193 | if (NULL (mini_window)) | 193 | if (NILP (mini_window)) |
| 194 | { | 194 | { |
| 195 | if (XTYPE (Vdefault_minibuffer_screen) != Lisp_Screen) | 195 | if (XTYPE (Vdefault_minibuffer_screen) != Lisp_Screen) |
| 196 | error ("default-minibuffer-screen must be set when creating minibufferless screens."); | 196 | error ("default-minibuffer-screen must be set when creating minibufferless screens."); |
| @@ -207,7 +207,7 @@ make_screen_without_minibuffer (mini_window) | |||
| 207 | /* Install the chosen minibuffer window, with proper buffer. */ | 207 | /* Install the chosen minibuffer window, with proper buffer. */ |
| 208 | s->minibuffer_window = mini_window; | 208 | s->minibuffer_window = mini_window; |
| 209 | Fset_window_buffer (mini_window, | 209 | Fset_window_buffer (mini_window, |
| 210 | (NULL (Vminibuffer_list) | 210 | (NILP (Vminibuffer_list) |
| 211 | ? get_minibuffer (0) | 211 | ? get_minibuffer (0) |
| 212 | : Fcar (Vminibuffer_list))); | 212 | : Fcar (Vminibuffer_list))); |
| 213 | return s; | 213 | return s; |
| @@ -246,7 +246,7 @@ make_minibuffer_screen () | |||
| 246 | /* Put the proper buffer in that window. */ | 246 | /* Put the proper buffer in that window. */ |
| 247 | 247 | ||
| 248 | Fset_window_buffer (mini_window, | 248 | Fset_window_buffer (mini_window, |
| 249 | (NULL (Vminibuffer_list) | 249 | (NILP (Vminibuffer_list) |
| 250 | ? get_minibuffer (0) | 250 | ? get_minibuffer (0) |
| 251 | : Fcar (Vminibuffer_list))); | 251 | : Fcar (Vminibuffer_list))); |
| 252 | return s; | 252 | return s; |
| @@ -289,7 +289,7 @@ focus on that screen.") | |||
| 289 | #ifdef HAVE_X_WINDOWS | 289 | #ifdef HAVE_X_WINDOWS |
| 290 | #ifdef MULTI_SCREEN | 290 | #ifdef MULTI_SCREEN |
| 291 | if (XSCREEN (screen)->output_method == output_x_window | 291 | if (XSCREEN (screen)->output_method == output_x_window |
| 292 | && NULL (no_enter)) | 292 | && NILP (no_enter)) |
| 293 | { | 293 | { |
| 294 | Ffocus_screen (screen); | 294 | Ffocus_screen (screen); |
| 295 | } | 295 | } |
| @@ -323,7 +323,7 @@ DEFUN ("screen-root-window", Fscreen_root_window, Sscreen_root_window, 0, 1, 0, | |||
| 323 | (screen) | 323 | (screen) |
| 324 | Lisp_Object screen; | 324 | Lisp_Object screen; |
| 325 | { | 325 | { |
| 326 | if (NULL (screen)) | 326 | if (NILP (screen)) |
| 327 | XSET (screen, Lisp_Screen, selected_screen); | 327 | XSET (screen, Lisp_Screen, selected_screen); |
| 328 | else | 328 | else |
| 329 | CHECK_LIVE_SCREEN (screen, 0); | 329 | CHECK_LIVE_SCREEN (screen, 0); |
| @@ -337,7 +337,7 @@ DEFUN ("screen-selected-window", Fscreen_selected_window, | |||
| 337 | (screen) | 337 | (screen) |
| 338 | Lisp_Object screen; | 338 | Lisp_Object screen; |
| 339 | { | 339 | { |
| 340 | if (NULL (screen)) | 340 | if (NILP (screen)) |
| 341 | XSET (screen, Lisp_Screen, selected_screen); | 341 | XSET (screen, Lisp_Screen, selected_screen); |
| 342 | else | 342 | else |
| 343 | CHECK_LIVE_SCREEN (screen, 0); | 343 | CHECK_LIVE_SCREEN (screen, 0); |
| @@ -381,7 +381,7 @@ next_screen (screen, minibuf) | |||
| 381 | 381 | ||
| 382 | /* Decide whether this screen is eligible to be returned, | 382 | /* Decide whether this screen is eligible to be returned, |
| 383 | according to minibuf. */ | 383 | according to minibuf. */ |
| 384 | if ((NULL (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (s))) | 384 | if ((NILP (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (s))) |
| 385 | || XTYPE (minibuf) != Lisp_Window | 385 | || XTYPE (minibuf) != Lisp_Window |
| 386 | || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (s)), minibuf) | 386 | || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (s)), minibuf) |
| 387 | || EQ (s, screen)) | 387 | || EQ (s, screen)) |
| @@ -420,18 +420,18 @@ prev_screen (screen, minibuf) | |||
| 420 | if (XTYPE (scr) != Lisp_Screen) | 420 | if (XTYPE (scr) != Lisp_Screen) |
| 421 | abort (); | 421 | abort (); |
| 422 | 422 | ||
| 423 | if (EQ (screen, scr) && !NULL (prev)) | 423 | if (EQ (screen, scr) && !NILP (prev)) |
| 424 | return prev; | 424 | return prev; |
| 425 | 425 | ||
| 426 | /* Decide whether this screen is eligible to be returned, | 426 | /* Decide whether this screen is eligible to be returned, |
| 427 | according to minibuf. */ | 427 | according to minibuf. */ |
| 428 | if ((NULL (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (scr))) | 428 | if ((NILP (minibuf) && ! SCREEN_MINIBUF_ONLY_P (XSCREEN (scr))) |
| 429 | || XTYPE (minibuf) != Lisp_Window | 429 | || XTYPE (minibuf) != Lisp_Window |
| 430 | || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (scr)), minibuf)) | 430 | || EQ (SCREEN_MINIBUF_WINDOW (XSCREEN (scr)), minibuf)) |
| 431 | prev = scr; | 431 | prev = scr; |
| 432 | } | 432 | } |
| 433 | 433 | ||
| 434 | if (NULL (prev)) | 434 | if (NILP (prev)) |
| 435 | /* We went through the whole screen list without finding a single | 435 | /* We went through the whole screen list without finding a single |
| 436 | acceptable screen. Return the original screen. */ | 436 | acceptable screen. Return the original screen. */ |
| 437 | prev = screen; | 437 | prev = screen; |
| @@ -450,7 +450,7 @@ Lisp_Object screen, miniscreen; | |||
| 450 | { | 450 | { |
| 451 | Lisp_Object tail; | 451 | Lisp_Object tail; |
| 452 | 452 | ||
| 453 | if (NULL (screen)) | 453 | if (NILP (screen)) |
| 454 | XSET (screen, Lisp_Screen, selected_screen); | 454 | XSET (screen, Lisp_Screen, selected_screen); |
| 455 | else | 455 | else |
| 456 | CHECK_LIVE_SCREEN (screen, 0); | 456 | CHECK_LIVE_SCREEN (screen, 0); |
| @@ -760,7 +760,7 @@ window when a screen doesn't have its own minibuffer.") | |||
| 760 | { | 760 | { |
| 761 | CHECK_LIVE_SCREEN (screen, 0); | 761 | CHECK_LIVE_SCREEN (screen, 0); |
| 762 | 762 | ||
| 763 | if (NULL (focus_screen)) | 763 | if (NILP (focus_screen)) |
| 764 | focus_screen = screen; | 764 | focus_screen = screen; |
| 765 | else | 765 | else |
| 766 | CHECK_LIVE_SCREEN (focus_screen, 1); | 766 | CHECK_LIVE_SCREEN (focus_screen, 1); |
| @@ -941,7 +941,7 @@ but that the idea of the actual height of the screen should not be changed.") | |||
| 941 | register struct screen *s; | 941 | register struct screen *s; |
| 942 | 942 | ||
| 943 | CHECK_NUMBER (rows, 0); | 943 | CHECK_NUMBER (rows, 0); |
| 944 | if (NULL (screen)) | 944 | if (NILP (screen)) |
| 945 | s = selected_screen; | 945 | s = selected_screen; |
| 946 | else | 946 | else |
| 947 | { | 947 | { |
| @@ -955,7 +955,7 @@ but that the idea of the actual height of the screen should not be changed.") | |||
| 955 | x_set_window_size (s, s->width, XINT (rows)); | 955 | x_set_window_size (s, s->width, XINT (rows)); |
| 956 | } | 956 | } |
| 957 | else | 957 | else |
| 958 | change_screen_size (s, XINT (rows), 0, !NULL (pretend)); | 958 | change_screen_size (s, XINT (rows), 0, !NILP (pretend)); |
| 959 | return Qnil; | 959 | return Qnil; |
| 960 | } | 960 | } |
| 961 | 961 | ||
| @@ -968,7 +968,7 @@ but that the idea of the actual width of the screen should not be changed.") | |||
| 968 | { | 968 | { |
| 969 | register struct screen *s; | 969 | register struct screen *s; |
| 970 | CHECK_NUMBER (cols, 0); | 970 | CHECK_NUMBER (cols, 0); |
| 971 | if (NULL (screen)) | 971 | if (NILP (screen)) |
| 972 | s = selected_screen; | 972 | s = selected_screen; |
| 973 | else | 973 | else |
| 974 | { | 974 | { |
| @@ -982,7 +982,7 @@ but that the idea of the actual width of the screen should not be changed.") | |||
| 982 | x_set_window_size (s, XINT (cols), s->height); | 982 | x_set_window_size (s, XINT (cols), s->height); |
| 983 | } | 983 | } |
| 984 | else | 984 | else |
| 985 | change_screen_size (selected_screen, 0, XINT (cols), !NULL (pretend)); | 985 | change_screen_size (selected_screen, 0, XINT (cols), !NILP (pretend)); |
| 986 | return Qnil; | 986 | return Qnil; |
| 987 | } | 987 | } |
| 988 | 988 | ||
diff --git a/src/frame.h b/src/frame.h index c38b0585d00..a9fca616c8c 100644 --- a/src/frame.h +++ b/src/frame.h | |||
| @@ -55,10 +55,13 @@ struct screen | |||
| 55 | int cursor_x; | 55 | int cursor_x; |
| 56 | int cursor_y; | 56 | int cursor_y; |
| 57 | 57 | ||
| 58 | /* Actual cursor position of this screen. | 58 | /* Actual cursor position of this screen, and the character under it. |
| 59 | (Not used for terminal screens.) */ | 59 | (Not used for terminal screens.) */ |
| 60 | int phys_cursor_x; | 60 | int phys_cursor_x; |
| 61 | int phys_cursor_y; | 61 | int phys_cursor_y; |
| 62 | /* This is handy for undrawing the cursor, because current_glyphs is | ||
| 63 | not always accurate when in do_scrolling. */ | ||
| 64 | GLYPH phys_cursor_glyph; | ||
| 62 | 65 | ||
| 63 | /* Size of this screen, in units of characters. */ | 66 | /* Size of this screen, in units of characters. */ |
| 64 | int height; | 67 | int height; |
| @@ -120,7 +123,7 @@ struct screen | |||
| 120 | /* Nonzero if this screen should be redrawn. */ | 123 | /* Nonzero if this screen should be redrawn. */ |
| 121 | char garbaged; | 124 | char garbaged; |
| 122 | 125 | ||
| 123 | /* True if screen actually has a minibuffer window on it. | 126 | /* True if screen actually has a minibuffer window on it. |
| 124 | 0 if using a minibuffer window that isn't on this screen. */ | 127 | 0 if using a minibuffer window that isn't on this screen. */ |
| 125 | char has_minibuffer; | 128 | char has_minibuffer; |
| 126 | 129 | ||
| @@ -152,9 +155,14 @@ typedef struct screen *SCREEN_PTR; | |||
| 152 | 155 | ||
| 153 | #define WINDOW_SCREEN(w) (w)->screen | 156 | #define WINDOW_SCREEN(w) (w)->screen |
| 154 | 157 | ||
| 158 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | ||
| 159 | #define SCREEN_LIVE_P(s) ((s)->display.nothing != 0) | ||
| 155 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) | 160 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1, s->garbaged = 1) |
| 156 | #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) | 161 | #define SCREEN_IS_TERMCAP(s) ((s)->output_method == output_termcap) |
| 157 | #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) | 162 | #define SCREEN_IS_X(s) ((s)->output_method == output_x_window) |
| 163 | #define SCREEN_MINIBUF_ONLY_P(s) \ | ||
| 164 | EQ (SCREEN_ROOT_WINDOW (s), SCREEN_MINIBUF_WINDOW (s)) | ||
| 165 | #define SCREEN_HAS_MINIBUF(s) ((s)->has_minibuffer) | ||
| 158 | #define SCREEN_CURRENT_GLYPHS(s) (s)->current_glyphs | 166 | #define SCREEN_CURRENT_GLYPHS(s) (s)->current_glyphs |
| 159 | #define SCREEN_DESIRED_GLYPHS(s) (s)->desired_glyphs | 167 | #define SCREEN_DESIRED_GLYPHS(s) (s)->desired_glyphs |
| 160 | #define SCREEN_TEMP_GLYPHS(s) (s)->temp_glyphs | 168 | #define SCREEN_TEMP_GLYPHS(s) (s)->temp_glyphs |
| @@ -172,7 +180,6 @@ typedef struct screen *SCREEN_PTR; | |||
| 172 | #define SCREEN_MINIBUF_WINDOW(s) (s)->minibuffer_window | 180 | #define SCREEN_MINIBUF_WINDOW(s) (s)->minibuffer_window |
| 173 | #define SCREEN_ROOT_WINDOW(s) (s)->root_window | 181 | #define SCREEN_ROOT_WINDOW(s) (s)->root_window |
| 174 | #define SCREEN_SELECTED_WINDOW(s) (s)->selected_window | 182 | #define SCREEN_SELECTED_WINDOW(s) (s)->selected_window |
| 175 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | ||
| 176 | #define SET_GLYPHS_SCREEN(glyphs,screen) ((glyphs)->screen = (screen)) | 183 | #define SET_GLYPHS_SCREEN(glyphs,screen) ((glyphs)->screen = (screen)) |
| 177 | #define SCREEN_INSERT_COST(s) (s)->insert_line_cost | 184 | #define SCREEN_INSERT_COST(s) (s)->insert_line_cost |
| 178 | #define SCREEN_DELETE_COST(s) (s)->delete_line_cost | 185 | #define SCREEN_DELETE_COST(s) (s)->delete_line_cost |
| @@ -182,9 +189,20 @@ typedef struct screen *SCREEN_PTR; | |||
| 182 | #define SCREEN_SCROLL_BOTTOM_VPOS(s) (s)->scroll_bottom_vpos | 189 | #define SCREEN_SCROLL_BOTTOM_VPOS(s) (s)->scroll_bottom_vpos |
| 183 | #define SCREEN_FOCUS_SCREEN(s) (s)->focus_screen | 190 | #define SCREEN_FOCUS_SCREEN(s) (s)->focus_screen |
| 184 | 191 | ||
| 185 | #define CHECK_SCREEN(x, i) \ | 192 | #define CHECK_SCREEN(x, i) \ |
| 186 | { if (XTYPE ((x)) != Lisp_Screen) x = wrong_type_argument (Qscreenp, (x)); } | 193 | { \ |
| 187 | extern Lisp_Object Qscreenp; | 194 | if (! SCREENP (x)) \ |
| 195 | x = wrong_type_argument (Qscreenp, (x)); \ | ||
| 196 | } | ||
| 197 | |||
| 198 | #define CHECK_LIVE_SCREEN(x, i) \ | ||
| 199 | { \ | ||
| 200 | if (! SCREENP (x) \ | ||
| 201 | || ! SCREEN_LIVE_P (XSCREEN (x))) \ | ||
| 202 | x = wrong_type_argument (Qlive_screen_p, (x)); \ | ||
| 203 | } | ||
| 204 | |||
| 205 | extern Lisp_Object Qscreenp, Qlive_screen_p; | ||
| 188 | 206 | ||
| 189 | extern struct screen *selected_screen; | 207 | extern struct screen *selected_screen; |
| 190 | extern struct screen *last_nonminibuf_screen; | 208 | extern struct screen *last_nonminibuf_screen; |
| @@ -195,7 +213,6 @@ extern struct screen *make_minibuffer_screen (); | |||
| 195 | extern struct screen *make_screen_without_minibuffer (); | 213 | extern struct screen *make_screen_without_minibuffer (); |
| 196 | 214 | ||
| 197 | extern Lisp_Object Vscreen_list; | 215 | extern Lisp_Object Vscreen_list; |
| 198 | extern Lisp_Object Vglobal_minibuffer_screen; | ||
| 199 | extern Lisp_Object Vdefault_screen_alist; | 216 | extern Lisp_Object Vdefault_screen_alist; |
| 200 | 217 | ||
| 201 | extern Lisp_Object Vterminal_screen; | 218 | extern Lisp_Object Vterminal_screen; |
| @@ -212,8 +229,13 @@ extern int selected_screen; | |||
| 212 | #define XSCREEN(s) selected_screen | 229 | #define XSCREEN(s) selected_screen |
| 213 | #define WINDOW_SCREEN(w) selected_screen | 230 | #define WINDOW_SCREEN(w) selected_screen |
| 214 | 231 | ||
| 232 | #define SCREENP(s) (XTYPE(s) == Lisp_Screen) | ||
| 233 | #define SCREEN_LIVE_P(s) 1 | ||
| 215 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) | 234 | #define SET_SCREEN_GARBAGED(s) (screen_garbaged = 1) |
| 216 | #define SCREEN_IS_TERMCAP(s) 1 | 235 | #define SCREEN_IS_TERMCAP(s) 1 |
| 236 | #define SCREEN_IS_X(s) 0 | ||
| 237 | #define SCREEN_IS_MINIBUF_ONLY(s) 0 | ||
| 238 | #define SCREEN_HAS_MINIBUF(s) 1 | ||
| 217 | #define SCREEN_CURRENT_GLYPHS(s) current_glyphs | 239 | #define SCREEN_CURRENT_GLYPHS(s) current_glyphs |
| 218 | #define SCREEN_DESIRED_GLYPHS(s) desired_glyphs | 240 | #define SCREEN_DESIRED_GLYPHS(s) desired_glyphs |
| 219 | #define SCREEN_TEMP_GLYPHS(s) temp_glyphs | 241 | #define SCREEN_TEMP_GLYPHS(s) temp_glyphs |
| @@ -231,7 +253,6 @@ extern int selected_screen; | |||
| 231 | #define SCREEN_MINIBUF_WINDOW(s) minibuf_window | 253 | #define SCREEN_MINIBUF_WINDOW(s) minibuf_window |
| 232 | #define SCREEN_ROOT_WINDOW(s) root_window | 254 | #define SCREEN_ROOT_WINDOW(s) root_window |
| 233 | #define SCREEN_SELECTED_WINDOW(s) selected_window | 255 | #define SCREEN_SELECTED_WINDOW(s) selected_window |
| 234 | #define SCREENP(s) 0 | ||
| 235 | #define SET_GLYPHS_SCREEN(glyphs,screen) | 256 | #define SET_GLYPHS_SCREEN(glyphs,screen) |
| 236 | #define SCREEN_INSERT_COST(screen) insert_line_cost | 257 | #define SCREEN_INSERT_COST(screen) insert_line_cost |
| 237 | #define SCREEN_DELETE_COST(screen) delete_line_cost | 258 | #define SCREEN_DELETE_COST(screen) delete_line_cost |
diff --git a/src/hftctl.c b/src/hftctl.c index 3e3788aa709..1e038725777 100644 --- a/src/hftctl.c +++ b/src/hftctl.c | |||
| @@ -9,8 +9,8 @@ | |||
| 9 | /* #include <sys/hft.h> */ | 9 | /* #include <sys/hft.h> */ |
| 10 | /* */ | 10 | /* */ |
| 11 | /* int hftctl(fildes, request, arg ) */ | 11 | /* int hftctl(fildes, request, arg ) */ |
| 12 | /* int fildes, request ; */ | 12 | /* int fildes, request; */ |
| 13 | /* char *arg ; */ | 13 | /* char *arg; */ |
| 14 | /* */ | 14 | /* */ |
| 15 | /* Description: */ | 15 | /* Description: */ |
| 16 | /* */ | 16 | /* */ |
| @@ -49,222 +49,241 @@ | |||
| 49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
| 50 | #include <sys/signal.h> | 50 | #include <sys/signal.h> |
| 51 | #include <sys/devinfo.h> | 51 | #include <sys/devinfo.h> |
| 52 | #include <termios.h> | ||
| 52 | #include <termio.h> | 53 | #include <termio.h> |
| 53 | #include <sys/hft.h> | 54 | #include <sys/hft.h> |
| 54 | #include <termios.h> | ||
| 55 | #include <sys/tty.h> | 55 | #include <sys/tty.h> |
| 56 | /* #include <sys/pty.h> */ | 56 | /* #include <sys/pty.h> */ |
| 57 | #define REMOTE 0x01 | 57 | #define REMOTE 0x01 |
| 58 | 58 | ||
| 59 | #undef ioctl | 59 | #undef ioctl |
| 60 | static char SCCSid[] = "com/gnuemacs/src,3.1,9021-90/05/03-5/3/90" ; | 60 | static char SCCSid[] = "com/gnuemacs/src,3.1,9021-90/05/03-5/3/90"; |
| 61 | 61 | ||
| 62 | /*************** LOCAL DEFINES **********************************/ | 62 | /*************** LOCAL DEFINES **********************************/ |
| 63 | 63 | ||
| 64 | typedef int (*FUNC)() ; /* pointer to a function */ | 64 | typedef int (*FUNC)(); /* pointer to a function */ |
| 65 | 65 | ||
| 66 | #define QDEV ((HFQPDEVCH<<8)|HFQPDEVCL) | 66 | #define QDEV ((HFQPDEVCH<<8)|HFQPDEVCL) |
| 67 | #define QLOC ((HFQLOCCH<<8)|HFQLOCCL) | 67 | #define QLOC ((HFQLOCCH<<8)|HFQLOCCL) |
| 68 | #define QPS ((HFQPRESCH<<8)|HFQPRESCL) | 68 | #define QPS ((HFQPRESCH<<8)|HFQPRESCL) |
| 69 | 69 | ||
| 70 | #ifndef TCGETS | ||
| 71 | #define TCGETS TCGETA | ||
| 72 | #endif | ||
| 73 | #ifndef TCSETS | ||
| 74 | #define TCSETS TCSETA | ||
| 75 | #endif | ||
| 76 | |||
| 70 | /*************** EXTERNAL / GLOBAL DATA AREA ********************/ | 77 | /*************** EXTERNAL / GLOBAL DATA AREA ********************/ |
| 71 | 78 | ||
| 72 | int hfqry() ; | 79 | int hfqry(); |
| 73 | int hfskbd() ; | 80 | int hfskbd(); |
| 74 | char *malloc() ; | 81 | char *malloc(); |
| 75 | 82 | ||
| 76 | extern int errno ; | 83 | extern int errno; |
| 77 | static jmp_buf hftenv ; | 84 | static jmp_buf hftenv; |
| 78 | static int is_ack_vtd ; | 85 | static int is_ack_vtd; |
| 79 | static FUNC sav_alrm ; | 86 | static FUNC sav_alrm; |
| 80 | static struct hfctlreq req = | 87 | static struct hfctlreq req = |
| 81 | { 0x1b,'[','x',0,0,0,21,HFCTLREQCH,HFCTLREQCL}; | 88 | { 0x1b,'[','x',0,0,0,21,HFCTLREQCH,HFCTLREQCL}; |
| 82 | static struct hfctlack ACK = | 89 | static struct hfctlack ACK = |
| 83 | { 0x1b,'[','x',0,0,0,21,HFCTLACKCH,HFCTLACKCL}; | 90 | { 0x1b,'[','x',0,0,0,21,HFCTLACKCH,HFCTLACKCL}; |
| 84 | 91 | ||
| 85 | /* FUNC signal() ; */ | 92 | /* FUNC signal(); */ |
| 86 | 93 | ||
| 87 | /*************** LOCAL MACROS ***********************************/ | 94 | /*************** LOCAL MACROS ***********************************/ |
| 88 | 95 | ||
| 89 | #define HFTYPE(p) ((p->hf_typehi<<8)|(p->hf_typelo)) | 96 | #define HFTYPE(p) ((p->hf_typehi<<8)|(p->hf_typelo)) |
| 90 | 97 | ||
| 91 | #define BYTE4(p) ( (p)[0]<<24 | (p)[1]<<16 | (p)[2]<<8 | (p)[3] ) | 98 | #define BYTE4(p) ((p)[0]<<24 | (p)[1]<<16 | (p)[2]<<8 | (p)[3]) |
| 92 | 99 | ||
| 93 | /* read a buffer */ | 100 | /* read a buffer */ |
| 94 | #define RD_BUF(f,p,l) \ | 101 | #define RD_BUF(f,p,l) \ |
| 95 | while ( (l) ) \ | 102 | while ((l)) \ |
| 96 | if ( ( j = read((f),(p),(l)) ) < 0 ) \ | 103 | if ((j = read((f),(p),(l))) < 0) \ |
| 97 | if ( errno != EINTR ) return (-1) ; \ | 104 | if (errno != EINTR) return (-1); \ |
| 98 | else continue ; \ | 105 | else continue; \ |
| 99 | else { (l)-=j ; (p)+=j ; } | 106 | else { (l) -= j; (p) += j; } |
| 107 | |||
| 108 | /*************** function prototypes ***************************/ | ||
| 109 | #ifdef __STDC__ | ||
| 110 | static GT_ACK (int fd, int req, char *buf); | ||
| 111 | static WR_REQ (int fd, int request, int cmdlen, char *cmd, int resplen); | ||
| 112 | static hft_alrm(int sig); | ||
| 113 | #else | ||
| 114 | static GT_ACK (); | ||
| 115 | static WR_REQ (); | ||
| 116 | static hft_alrm (); | ||
| 117 | #endif | ||
| 100 | 118 | ||
| 101 | /*************** HFTCTL FUNCTION *******************************/ | 119 | /*************** HFTCTL FUNCTION *******************************/ |
| 102 | 120 | ||
| 103 | hftctl( fd, request, arg ) | 121 | hftctl (fd, request, arg) |
| 104 | int fd ; | 122 | int fd; |
| 105 | int request ; | 123 | int request; |
| 106 | union { | 124 | union { |
| 107 | struct hfintro *intro ; | 125 | struct hfintro *intro; |
| 108 | struct hfquery *query ; | 126 | struct hfquery *query; |
| 109 | char *c ; | 127 | char *c; |
| 110 | } arg ; | 128 | } arg; |
| 111 | { | 129 | { |
| 112 | 130 | ||
| 113 | int i ; | 131 | int i; |
| 114 | int fd_flag ; /* fcntl flags */ | 132 | int fd_flag; /* fcntl flags */ |
| 115 | register union { | 133 | register union { |
| 116 | struct hfintro *cmd ; /* p.cmd - intro des. */ | 134 | struct hfintro *cmd; /* p.cmd - intro des. */ |
| 117 | struct hfqphdevc *ph ; /* p.ph - physical dev.*/ | 135 | struct hfqphdevc *ph; /* p.ph - physical dev.*/ |
| 118 | char *c ; /* p.c - char ptr */ | 136 | char *c; /* p.c - char ptr */ |
| 119 | } p ; /* general pointer */ | 137 | } p; /* general pointer */ |
| 120 | int pty_new ; /* pty modes */ | 138 | int pty_new; /* pty modes */ |
| 121 | int pty_old ; | 139 | int pty_old; |
| 122 | int retcode ; | 140 | int retcode; |
| 123 | struct termios term_new ; /* terminal attributes */ | 141 | struct termios term_new; /* terminal attributes */ |
| 124 | struct termios term_old ; | 142 | struct termios term_old; |
| 125 | struct devinfo devInfo ; /* defined in sys/devinfo.h */ | 143 | struct devinfo devInfo; /* defined in sys/devinfo.h */ |
| 126 | 144 | ||
| 127 | 145 | ||
| 128 | if ( ioctl( fd, IOCINFO, &devInfo ) == -1 ) return(-1) ; | 146 | if (ioctl (fd, IOCINFO, &devInfo) == -1) return(-1); |
| 129 | 147 | ||
| 130 | if ( devInfo.devtype != DD_PSEU ) /* is it a pty? */ | 148 | if (devInfo.devtype != DD_PSEU) /* is it a pty? */ |
| 131 | return (ioctl(fd, request, arg) ) ; /* no, do IOCTL */ | 149 | return (ioctl(fd, request, arg)); /* no, do IOCTL */ |
| 132 | 150 | ||
| 133 | /******* START PTY **************/ | 151 | /******* START PTY **************/ |
| 134 | /** Pty found, possible HFT */ | 152 | /** Pty found, possible HFT */ |
| 135 | /** set new file des as raw */ | 153 | /** set new file des as raw */ |
| 136 | /** as you can. */ | 154 | /** as you can. */ |
| 137 | /********************************/ | 155 | /********************************/ |
| 138 | 156 | ||
| 139 | /* Get current state of file */ | 157 | /* Get current state of file */ |
| 140 | /* descriptor & save */ | 158 | /* descriptor & save */ |
| 141 | if ( ( fd_flag = fcntl( fd, F_GETFL, 0 ) ) == -1 ) return (-1) ; | 159 | if ((fd_flag = fcntl (fd, F_GETFL, 0)) == -1) return (-1); |
| 142 | if ( ioctl( fd, TCGETS, &term_old ) == -1 ) return (-1) ; | 160 | if (ioctl (fd, TCGETS, &term_old) == -1) return (-1); |
| 143 | /* set terminal attr to raw */ | 161 | /* set terminal attr to raw */ |
| 144 | /* and to delay on read */ | 162 | /* and to delay on read */ |
| 145 | pty_new = pty_old | REMOTE ; | 163 | pty_new = pty_old | REMOTE; |
| 146 | memcpy( &term_new, &term_old, sizeof( term_new ) ) ; | 164 | memcpy (&term_new, &term_old, sizeof (term_new)); |
| 147 | term_new.c_iflag = 0 ; | 165 | term_new.c_iflag = 0; |
| 148 | term_new.c_oflag = 0 ; | 166 | term_new.c_oflag = 0; |
| 149 | term_new.c_lflag = 0 ; | 167 | term_new.c_lflag = 0; |
| 150 | /* term_new.c_line = 0 ; */ | 168 | /* term_new.c_line = 0; */ |
| 151 | for ( i = 1 ; i <= 5 ; i++ ) | 169 | for (i = 1; i <= 5; i++) |
| 152 | term_new.c_cc[i] = 0 ; | 170 | term_new.c_cc[i] = 0; |
| 153 | term_new.c_cc[0] = -1 ; | 171 | term_new.c_cc[0] = -1; |
| 154 | ioctl( fd, TCSETS, &term_new ) ; | 172 | ioctl (fd, TCSETS, &term_new); |
| 155 | if ( fcntl( fd, F_SETFL, fd_flag & ~O_NDELAY ) == -1 ) | 173 | if (fcntl (fd, F_SETFL, fd_flag & ~O_NDELAY) == -1) |
| 156 | return(-1) ; | 174 | return(-1); |
| 157 | /* call spacific function */ | 175 | /* call spacific function */ |
| 158 | if ( request == HFSKBD ) | 176 | if (request == HFSKBD) |
| 159 | retcode = hfskbd( fd, request, arg.c) ; | 177 | retcode = hfskbd (fd, request, arg.c); |
| 160 | else /* assume HFQUERY */ | 178 | else /* assume HFQUERY */ |
| 161 | retcode = hfqry( fd, request, arg.c) ; | 179 | retcode = hfqry (fd, request, arg.c); |
| 162 | 180 | ||
| 163 | fcntl( fd, F_SETFL, fd_flag ) ; /* reset terminal to original */ | 181 | fcntl (fd, F_SETFL, fd_flag); /* reset terminal to original */ |
| 164 | ioctl( fd, TCSETS, &term_old ) ; | 182 | ioctl (fd, TCSETS, &term_old); |
| 165 | 183 | ||
| 166 | 184 | ||
| 167 | return( retcode ) ; /* return error */ | 185 | return (retcode); /* return error */ |
| 168 | } | 186 | } |
| 169 | 187 | ||
| 170 | /*************** HFSKBD FUNCTION ******************************/ | 188 | /*************** HFSKBD FUNCTION ******************************/ |
| 171 | static hfskbd(fd, request, arg ) | 189 | static int |
| 172 | int fd ; | 190 | hfskbd (fd, request, arg) |
| 173 | int request ; | 191 | int fd; |
| 174 | struct hfbuf *arg ; | 192 | int request; |
| 193 | struct hfbuf *arg; | ||
| 175 | { | 194 | { |
| 176 | WR_REQ(fd, request, arg->hf_buflen, arg->hf_bufp,0) ; | 195 | WR_REQ(fd, request, arg->hf_buflen, arg->hf_bufp,0); |
| 177 | return( GT_ACK(fd, request, arg->hf_bufp) ) ; | 196 | return (GT_ACK(fd, request, arg->hf_bufp)); |
| 178 | } | 197 | } |
| 179 | 198 | ||
| 180 | /*************** HFQUERY FUNCTION ******************************/ | 199 | /*************** HFQUERY FUNCTION ******************************/ |
| 181 | static hfqry(fd, request, arg ) | 200 | static int |
| 182 | int fd ; | 201 | hfqry (fd, request, arg) |
| 183 | int request ; | 202 | int fd; |
| 184 | struct hfquery *arg ; | 203 | int request; |
| 204 | struct hfquery *arg; | ||
| 185 | { | 205 | { |
| 186 | WR_REQ(fd, request, arg->hf_cmdlen, arg->hf_cmd, arg->hf_resplen ) ; | 206 | WR_REQ(fd, request, arg->hf_cmdlen, arg->hf_cmd, arg->hf_resplen); |
| 187 | return( GT_ACK(fd, request, arg->hf_resp ) ) ; | 207 | return (GT_ACK(fd, request, arg->hf_resp)); |
| 188 | } | 208 | } |
| 189 | 209 | ||
| 190 | 210 | ||
| 191 | /*************** GT_ACK FUNCTION ******************************/ | 211 | /*************** GT_ACK FUNCTION ******************************/ |
| 192 | static GT_ACK(fd, req, buf ) | 212 | static int |
| 193 | int fd ; | 213 | GT_ACK (fd, req, buf) |
| 194 | int req ; | 214 | int fd; |
| 195 | char *buf ; | 215 | int req; |
| 216 | char *buf; | ||
| 196 | { | 217 | { |
| 197 | 218 | struct hfctlack ack; | |
| 198 | struct hfctlack ack ; | 219 | int i = sizeof (ack); |
| 199 | int i = sizeof( ack ) ; | 220 | int j = 0; |
| 200 | int j = 0 ; | 221 | union { |
| 201 | union { | 222 | char *c; |
| 202 | char *c ; | 223 | struct hfctlack *ack; |
| 203 | struct hfctlack *ack ; | 224 | } p; |
| 204 | } p ; | 225 | |
| 205 | 226 | is_ack_vtd = 0; /* flag no ACT VTD yet */ | |
| 206 | int hft_alrm() ; | 227 | |
| 207 | 228 | if (setjmp (hftenv)) /* set environment in case */ | |
| 208 | is_ack_vtd = 0 ; /* flag no ACT VTD yet */ | 229 | { /* of time out */ |
| 209 | 230 | errno = ENODEV; /* if time out, set errno */ | |
| 210 | if ( setjmp( hftenv ) ) /* set environment in case */ | 231 | return (-1); /* flag error */ |
| 211 | { /* of time out */ | 232 | } |
| 212 | errno=ENODEV ; /* if time out, set errno */ | 233 | |
| 213 | return( -1 ) ; /* flag error */ | 234 | alarm(3); /* time out in 3 secs */ |
| 214 | } | 235 | sav_alrm = signal (SIGALRM, hft_alrm); /* prepare to catch time out */ |
| 215 | 236 | ||
| 216 | alarm(3) ; /* time out in 3 secs */ | 237 | p.ack = &ack; |
| 217 | sav_alrm = signal( SIGALRM, hft_alrm ) ;/* prepare to catch time out */ | 238 | while (! is_ack_vtd) /* do until valid ACK VTD */ |
| 218 | 239 | { | |
| 219 | p.ack = &ack ; | 240 | RD_BUF(fd, p.c, i); /* read until a ACK VTD is fill*/ |
| 220 | while ( ! is_ack_vtd ) /* do until valid ACK VTD */ | 241 | |
| 221 | { | 242 | if (! memcmp (&ack, &ACK, sizeof (HFINTROSZ)) /* the ACK intro & */ |
| 222 | RD_BUF(fd, p.c, i ) ; /* read until a ACK VTD is fill*/ | 243 | && (ack.hf_request == req)) /* is it the response we want ?*/ |
| 223 | 244 | { /* yes, ACK VTD found */ | |
| 224 | if ( ! memcmp( &ack, &ACK, sizeof( HFINTROSZ ) ) /* the ACK intro & */ | 245 | is_ack_vtd = 1; /* quickly, flag it */ |
| 225 | && ( ack.hf_request == req ) ) /* is it the response we want ?*/ | 246 | break; /* get the %$%#@ out of here */ |
| 226 | { /* yes, ACK VTD found */ | 247 | } |
| 227 | is_ack_vtd = 1 ; /* quickly, flag it */ | 248 | |
| 228 | break ; /* get the %$%#@ out of here */ | 249 | p.ack = &ack; /* no, then skip 1st */ |
| 229 | } | 250 | ++p.c; /* char and start over */ |
| 230 | 251 | i = sizeof (ack) - 1; /* one less ESC to cry over */ | |
| 231 | p.ack = &ack ; /* no, then skip 1st */ | 252 | |
| 232 | ++p.c ; /* char and start over */ | 253 | while ((*p.c != 0x1b) && i) /* scan for next ESC */ |
| 233 | i = sizeof( ack ) - 1 ; /* one less ESC to cry over */ | 254 | { ++p.c; --i; } /* if any */ |
| 234 | 255 | ||
| 235 | while( ( *p.c != 0x1b ) && i ) /* scan for next ESC */ | 256 | (i ? memcpy (&ack, p.c, i) : 0); /* if any left over, then move */ |
| 236 | { ++p.c ; --i ; } /* if any */ | 257 | p.ack = &ack; /* ESC to front of ack struct */ |
| 237 | 258 | p.c += i; /* skip over whats been read */ | |
| 238 | ( i ? memcpy( &ack, p.c, i ) : 0 ) ; /* if any left over, then move */ | 259 | i = sizeof (ack) - i; /* set whats left to be read */ |
| 239 | p.ack = &ack ; /* ESC to front of ack struct */ | 260 | } /***** TRY AGAIN */ |
| 240 | p.c += i ; /* skip over whats been read */ | 261 | |
| 241 | i = sizeof( ack ) - i ; /* set whats left to be read */ | 262 | alarm(0); /* ACK VTD received, reset alrm*/ |
| 242 | } /***** TRY AGAIN */ | 263 | signal (SIGALRM, sav_alrm); /* reset signal */ |
| 243 | 264 | ||
| 244 | alarm(0) ; /* ACK VTD received, reset alrm*/ | 265 | if (i = ack.hf_arg_len) /* any data following ? */ |
| 245 | signal( SIGALRM, sav_alrm ) ; /* reset signal */ | 266 | { /* yes, */ |
| 246 | 267 | RD_BUF(fd,buf,i); /* read until it is received */ | |
| 247 | if ( i = ack.hf_arg_len ) /* any data following ? */ | 268 | } |
| 248 | { /* yes, */ | 269 | |
| 249 | RD_BUF(fd,buf,i) ; /* read until it is received */ | 270 | if (errno = ack.hf_retcode) /* set errno based on returned */ |
| 250 | } | 271 | return (-1); /* code, if 0, then no error */ |
| 251 | 272 | else | |
| 252 | if ( errno = ack.hf_retcode ) /* set errno based on returned */ | 273 | return (0); /* if set, then error returned */ |
| 253 | return (-1) ; /* code, if 0, then no error */ | ||
| 254 | else | ||
| 255 | return (0) ; /* if set, then error returned */ | ||
| 256 | } | 274 | } |
| 257 | 275 | ||
| 258 | /*************** HFT_ALRM FUNCTION ******************************/ | 276 | /*************** HFT_ALRM FUNCTION ******************************/ |
| 259 | static hft_alrm(sig) /* Function hft_alrm - handle */ | 277 | static int |
| 260 | int sig ; /* alarm signal */ | 278 | hft_alrm (sig) /* Function hft_alrm - handle */ |
| 279 | int sig; /* alarm signal */ | ||
| 261 | { | 280 | { |
| 262 | signal( SIGALRM, sav_alrm ) ; /* reset to previous */ | 281 | signal (SIGALRM, sav_alrm); /* reset to previous */ |
| 263 | 282 | ||
| 264 | if ( is_ack_vtd ) /* has ack vtd arrived ? */ | 283 | if (is_ack_vtd) /* has ack vtd arrived ? */ |
| 265 | return(0) ; /* yes, then continue */ | 284 | return(0); /* yes, then continue */ |
| 266 | else /* no, then return with error */ | 285 | else /* no, then return with error */ |
| 267 | longjmp( hftenv, -1 ) ; | 286 | longjmp (hftenv, -1); |
| 268 | 287 | ||
| 269 | } | 288 | } |
| 270 | 289 | ||
| @@ -278,42 +297,43 @@ else /* no, then return with error */ | |||
| 278 | /*** ***/ | 297 | /*** ***/ |
| 279 | /*********************************************************************/ | 298 | /*********************************************************************/ |
| 280 | 299 | ||
| 281 | static WR_REQ(fd, request, cmdlen, cmd, resplen ) | 300 | static int |
| 282 | int fd ; | 301 | WR_REQ (fd, request, cmdlen, cmd, resplen) |
| 283 | int request ; | 302 | int fd; |
| 284 | int cmdlen ; | 303 | int request; |
| 285 | char *cmd ; | 304 | int cmdlen; |
| 286 | int resplen ; | 305 | char *cmd; |
| 306 | int resplen; | ||
| 287 | { | 307 | { |
| 288 | struct { | 308 | struct { |
| 289 | char *c ; | 309 | char *c; |
| 290 | struct hfctlreq *req ; | 310 | struct hfctlreq *req; |
| 291 | } p ; | 311 | } p; |
| 292 | int size ; | 312 | int size; |
| 293 | 313 | ||
| 294 | req.hf_request = request ; | 314 | req.hf_request = request; |
| 295 | req.hf_arg_len = cmdlen ; | 315 | req.hf_arg_len = cmdlen; |
| 296 | req.hf_rsp_len = resplen ; | 316 | req.hf_rsp_len = resplen; |
| 297 | 317 | ||
| 298 | if ( cmdlen ) /* if arg structure to pass */ | 318 | if (cmdlen) /* if arg structure to pass */ |
| 299 | { | 319 | { |
| 300 | size = sizeof( struct hfctlreq ) + cmdlen ; | 320 | size = sizeof (struct hfctlreq) + cmdlen; |
| 301 | if ( ( p.c = malloc(size) ) == NULL ) /* malloc one area */ | 321 | if ((p.c = malloc(size)) == NULL) /* malloc one area */ |
| 302 | return( -1 ) ; | 322 | return (-1); |
| 303 | 323 | ||
| 304 | memcpy( p.c, &req, sizeof( req ) ) ; /* copy CTL REQ struct */ | 324 | memcpy (p.c, &req, sizeof (req)); /* copy CTL REQ struct */ |
| 305 | memcpy( p.c + sizeof( req ), cmd, cmdlen ) ; /* copy arg struct */ | 325 | memcpy (p.c + sizeof (req), cmd, cmdlen); /* copy arg struct */ |
| 306 | } | 326 | } |
| 307 | else | 327 | else |
| 308 | { | 328 | { |
| 309 | p.req = &req ; /* otherwise use only CTL REQ */ | 329 | p.req = &req; /* otherwise use only CTL REQ */ |
| 310 | size = sizeof( req ) ; | 330 | size = sizeof (req); |
| 311 | } | 331 | } |
| 312 | 332 | ||
| 313 | /* write request to terminal */ | 333 | /* write request to terminal */ |
| 314 | if ( write(fd,p.c,size) == -1 ) return (-1) ; | 334 | if (write(fd,p.c,size) == -1) return (-1); |
| 315 | if ( p.req != &req ) /* free if allocated */ | 335 | if (p.req != &req) /* free if allocated */ |
| 316 | free( p.c ) ; | 336 | free (p.c); |
| 317 | return (0) ; | 337 | return (0); |
| 318 | 338 | ||
| 319 | } | 339 | } |
diff --git a/src/keymap.c b/src/keymap.c index d55c369356d..ec45512837b 100644 --- a/src/keymap.c +++ b/src/keymap.c | |||
| @@ -155,7 +155,7 @@ VECTOR is a 128-element vector of bindings for ASCII characters.") | |||
| 155 | (object) | 155 | (object) |
| 156 | Lisp_Object object; | 156 | Lisp_Object object; |
| 157 | { | 157 | { |
| 158 | return (NULL (get_keymap_1 (object, 0)) ? Qnil : Qt); | 158 | return (NILP (get_keymap_1 (object, 0)) ? Qnil : Qt); |
| 159 | } | 159 | } |
| 160 | 160 | ||
| 161 | /* Check that OBJECT is a keymap (after dereferencing through any | 161 | /* Check that OBJECT is a keymap (after dereferencing through any |
| @@ -232,7 +232,7 @@ access_keymap (map, idx) | |||
| 232 | 232 | ||
| 233 | /* A dense keymap indexed by a character? */ | 233 | /* A dense keymap indexed by a character? */ |
| 234 | if (XTYPE (idx) == Lisp_Int | 234 | if (XTYPE (idx) == Lisp_Int |
| 235 | && ! NULL (table)) | 235 | && ! NILP (table)) |
| 236 | return XVECTOR (table)->contents[XFASTINT (idx)]; | 236 | return XVECTOR (table)->contents[XFASTINT (idx)]; |
| 237 | 237 | ||
| 238 | /* This lookup will not involve a vector reference. */ | 238 | /* This lookup will not involve a vector reference. */ |
| @@ -269,7 +269,7 @@ get_keyelt (object) | |||
| 269 | tem = Fkeymapp (map); | 269 | tem = Fkeymapp (map); |
| 270 | 270 | ||
| 271 | /* If the contents are (KEYMAP . ELEMENT), go indirect. */ | 271 | /* If the contents are (KEYMAP . ELEMENT), go indirect. */ |
| 272 | if (!NULL (tem)) | 272 | if (!NILP (tem)) |
| 273 | object = access_keymap (map, Fcdr (object)); | 273 | object = access_keymap (map, Fcdr (object)); |
| 274 | 274 | ||
| 275 | /* If the keymap contents looks like (STRING . DEFN), | 275 | /* If the keymap contents looks like (STRING . DEFN), |
| @@ -306,7 +306,7 @@ store_in_keymap (keymap, idx, def) | |||
| 306 | Lisp_Object table = keymap_table (keymap); | 306 | Lisp_Object table = keymap_table (keymap); |
| 307 | 307 | ||
| 308 | /* A dense keymap indexed by a character? */ | 308 | /* A dense keymap indexed by a character? */ |
| 309 | if (XTYPE (idx) == Lisp_Int && !NULL (table)) | 309 | if (XTYPE (idx) == Lisp_Int && !NILP (table)) |
| 310 | XVECTOR (table)->contents[XFASTINT (idx)] = def; | 310 | XVECTOR (table)->contents[XFASTINT (idx)] = def; |
| 311 | 311 | ||
| 312 | /* Must be a sparse keymap, or a dense keymap indexed by a symbol. */ | 312 | /* Must be a sparse keymap, or a dense keymap indexed by a symbol. */ |
| @@ -315,7 +315,7 @@ store_in_keymap (keymap, idx, def) | |||
| 315 | /* Point to the pointer to the start of the assoc-list part | 315 | /* Point to the pointer to the start of the assoc-list part |
| 316 | of the keymap. */ | 316 | of the keymap. */ |
| 317 | register Lisp_Object *assoc_head | 317 | register Lisp_Object *assoc_head |
| 318 | = (NULL (table) | 318 | = (NILP (table) |
| 319 | ? & XCONS (keymap)->cdr | 319 | ? & XCONS (keymap)->cdr |
| 320 | : & XCONS (XCONS (keymap)->cdr)->cdr); | 320 | : & XCONS (XCONS (keymap)->cdr)->cdr); |
| 321 | register Lisp_Object defining_pair; | 321 | register Lisp_Object defining_pair; |
| @@ -328,7 +328,7 @@ store_in_keymap (keymap, idx, def) | |||
| 328 | /* Point to the pair where idx is bound, if any. */ | 328 | /* Point to the pair where idx is bound, if any. */ |
| 329 | defining_pair = Fassq (idx, *assoc_head); | 329 | defining_pair = Fassq (idx, *assoc_head); |
| 330 | 330 | ||
| 331 | if (NULL (defining_pair)) | 331 | if (NILP (defining_pair)) |
| 332 | *assoc_head = Fcons (Fcons (idx, def), *assoc_head); | 332 | *assoc_head = Fcons (Fcons (idx, def), *assoc_head); |
| 333 | else | 333 | else |
| 334 | Fsetcdr (defining_pair, def); | 334 | Fsetcdr (defining_pair, def); |
| @@ -367,7 +367,7 @@ is not copied.") | |||
| 367 | 367 | ||
| 368 | for (i = 0; i < DENSE_TABLE_SIZE; i++) | 368 | for (i = 0; i < DENSE_TABLE_SIZE; i++) |
| 369 | if (XTYPE (XVECTOR (copy)->contents[i]) != Lisp_Symbol) | 369 | if (XTYPE (XVECTOR (copy)->contents[i]) != Lisp_Symbol) |
| 370 | if (! NULL (Fkeymapp (XVECTOR (table)->contents[i]))) | 370 | if (! NILP (Fkeymapp (XVECTOR (table)->contents[i]))) |
| 371 | XVECTOR (table)->contents[i] | 371 | XVECTOR (table)->contents[i] |
| 372 | = Fcopy_keymap (XVECTOR (table)->contents[i]); | 372 | = Fcopy_keymap (XVECTOR (table)->contents[i]); |
| 373 | XCONS (tail)->car = table; | 373 | XCONS (tail)->car = table; |
| @@ -384,7 +384,7 @@ is not copied.") | |||
| 384 | elt = XCONS (tail)->car; | 384 | elt = XCONS (tail)->car; |
| 385 | if (CONSP (elt) | 385 | if (CONSP (elt) |
| 386 | && XTYPE (XCONS (elt)->cdr) != Lisp_Symbol | 386 | && XTYPE (XCONS (elt)->cdr) != Lisp_Symbol |
| 387 | && ! NULL (Fkeymapp (XCONS (elt)->cdr))) | 387 | && ! NILP (Fkeymapp (XCONS (elt)->cdr))) |
| 388 | XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr); | 388 | XCONS (elt)->cdr = Fcopy_keymap (XCONS (elt)->cdr); |
| 389 | 389 | ||
| 390 | tail = XCONS (tail)->cdr; | 390 | tail = XCONS (tail)->cdr; |
| @@ -461,14 +461,14 @@ the front of KEYMAP.") | |||
| 461 | 461 | ||
| 462 | cmd = get_keyelt (access_keymap (keymap, c)); | 462 | cmd = get_keyelt (access_keymap (keymap, c)); |
| 463 | 463 | ||
| 464 | if (NULL (cmd)) | 464 | if (NILP (cmd)) |
| 465 | { | 465 | { |
| 466 | cmd = Fmake_sparse_keymap (); | 466 | cmd = Fmake_sparse_keymap (); |
| 467 | store_in_keymap (keymap, c, cmd); | 467 | store_in_keymap (keymap, c, cmd); |
| 468 | } | 468 | } |
| 469 | 469 | ||
| 470 | tem = Fkeymapp (cmd); | 470 | tem = Fkeymapp (cmd); |
| 471 | if (NULL (tem)) | 471 | if (NILP (tem)) |
| 472 | error ("Key sequence %s uses invalid prefix characters", | 472 | error ("Key sequence %s uses invalid prefix characters", |
| 473 | XSTRING (key)->data); | 473 | XSTRING (key)->data); |
| 474 | 474 | ||
| @@ -533,7 +533,7 @@ it takes to reach a non-prefix command.") | |||
| 533 | return cmd; | 533 | return cmd; |
| 534 | 534 | ||
| 535 | tem = Fkeymapp (cmd); | 535 | tem = Fkeymapp (cmd); |
| 536 | if (NULL (tem)) | 536 | if (NILP (tem)) |
| 537 | return make_number (idx); | 537 | return make_number (idx); |
| 538 | 538 | ||
| 539 | keymap = get_keymap (cmd); | 539 | keymap = get_keymap (cmd); |
| @@ -568,6 +568,11 @@ append_key (key_sequence, key) | |||
| 568 | 568 | ||
| 569 | /* Global, local, and minor mode keymap stuff. */ | 569 | /* Global, local, and minor mode keymap stuff. */ |
| 570 | 570 | ||
| 571 | /* We can't put these variables inside current_minor_maps, since under | ||
| 572 | DGUX they dump as pure. Bleah. */ | ||
| 573 | static Lisp_Object *cmm_modes, *cmm_maps; | ||
| 574 | static int cmm_size; | ||
| 575 | |||
| 571 | /* Store a pointer to an array of the keymaps of the currently active | 576 | /* Store a pointer to an array of the keymaps of the currently active |
| 572 | minor modes in *buf, and return the number of maps it contains. | 577 | minor modes in *buf, and return the number of maps it contains. |
| 573 | 578 | ||
| @@ -588,9 +593,6 @@ int | |||
| 588 | current_minor_maps (modeptr, mapptr) | 593 | current_minor_maps (modeptr, mapptr) |
| 589 | Lisp_Object **modeptr, **mapptr; | 594 | Lisp_Object **modeptr, **mapptr; |
| 590 | { | 595 | { |
| 591 | static Lisp_Object *modes, *maps; | ||
| 592 | static int size; | ||
| 593 | |||
| 594 | int i = 0; | 596 | int i = 0; |
| 595 | Lisp_Object alist, assoc, var; | 597 | Lisp_Object alist, assoc, var; |
| 596 | 598 | ||
| @@ -599,39 +601,39 @@ current_minor_maps (modeptr, mapptr) | |||
| 599 | alist = XCONS (alist)->cdr) | 601 | alist = XCONS (alist)->cdr) |
| 600 | if (CONSP (assoc = XCONS (alist)->car) | 602 | if (CONSP (assoc = XCONS (alist)->car) |
| 601 | && XTYPE (var = XCONS (assoc)->car) == Lisp_Symbol | 603 | && XTYPE (var = XCONS (assoc)->car) == Lisp_Symbol |
| 602 | && ! NULL (Fboundp (var)) | 604 | && ! NILP (Fboundp (var)) |
| 603 | && ! NULL (Fsymbol_value (var))) | 605 | && ! NILP (Fsymbol_value (var))) |
| 604 | { | 606 | { |
| 605 | if (i >= size) | 607 | if (i >= cmm_size) |
| 606 | { | 608 | { |
| 607 | Lisp_Object *newmodes, *newmaps; | 609 | Lisp_Object *newmodes, *newmaps; |
| 608 | 610 | ||
| 609 | if (maps) | 611 | if (cmm_maps) |
| 610 | { | 612 | { |
| 611 | newmodes = (Lisp_Object *) realloc (modes, size *= 2); | 613 | newmodes = (Lisp_Object *) realloc (cmm_modes, cmm_size *= 2); |
| 612 | newmaps = (Lisp_Object *) realloc (maps, size); | 614 | newmaps = (Lisp_Object *) realloc (cmm_maps, cmm_size); |
| 613 | } | 615 | } |
| 614 | else | 616 | else |
| 615 | { | 617 | { |
| 616 | newmodes = (Lisp_Object *) malloc (size = 30); | 618 | newmodes = (Lisp_Object *) malloc (cmm_size = 30); |
| 617 | newmaps = (Lisp_Object *) malloc (size); | 619 | newmaps = (Lisp_Object *) malloc (cmm_size); |
| 618 | } | 620 | } |
| 619 | 621 | ||
| 620 | if (newmaps && newmodes) | 622 | if (newmaps && newmodes) |
| 621 | { | 623 | { |
| 622 | modes = newmodes; | 624 | cmm_modes = newmodes; |
| 623 | maps = newmaps; | 625 | cmm_maps = newmaps; |
| 624 | } | 626 | } |
| 625 | else | 627 | else |
| 626 | break; | 628 | break; |
| 627 | } | 629 | } |
| 628 | modes[i] = var; | 630 | cmm_modes[i] = var; |
| 629 | maps [i] = XCONS (assoc)->cdr; | 631 | cmm_maps [i] = XCONS (assoc)->cdr; |
| 630 | i++; | 632 | i++; |
| 631 | } | 633 | } |
| 632 | 634 | ||
| 633 | if (modeptr) *modeptr = modes; | 635 | if (modeptr) *modeptr = cmm_modes; |
| 634 | if (mapptr) *mapptr = maps; | 636 | if (mapptr) *mapptr = cmm_maps; |
| 635 | return i; | 637 | return i; |
| 636 | } | 638 | } |
| 637 | 639 | ||
| @@ -647,22 +649,22 @@ The binding is probably a symbol with a function definition.") | |||
| 647 | 649 | ||
| 648 | nmaps = current_minor_maps (0, &maps); | 650 | nmaps = current_minor_maps (0, &maps); |
| 649 | for (i = 0; i < nmaps; i++) | 651 | for (i = 0; i < nmaps; i++) |
| 650 | if (! NULL (maps[i])) | 652 | if (! NILP (maps[i])) |
| 651 | { | 653 | { |
| 652 | value = Flookup_key (maps[i], key); | 654 | value = Flookup_key (maps[i], key); |
| 653 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 655 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 654 | return value; | 656 | return value; |
| 655 | } | 657 | } |
| 656 | 658 | ||
| 657 | if (! NULL (current_buffer->keymap)) | 659 | if (! NILP (current_buffer->keymap)) |
| 658 | { | 660 | { |
| 659 | value = Flookup_key (current_buffer->keymap, key); | 661 | value = Flookup_key (current_buffer->keymap, key); |
| 660 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 662 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 661 | return value; | 663 | return value; |
| 662 | } | 664 | } |
| 663 | 665 | ||
| 664 | value = Flookup_key (current_global_map, key); | 666 | value = Flookup_key (current_global_map, key); |
| 665 | if (! NULL (value) && XTYPE (value) != Lisp_Int) | 667 | if (! NILP (value) && XTYPE (value) != Lisp_Int) |
| 666 | return value; | 668 | return value; |
| 667 | 669 | ||
| 668 | return Qnil; | 670 | return Qnil; |
| @@ -677,7 +679,7 @@ The binding is probably a symbol with a function definition.") | |||
| 677 | { | 679 | { |
| 678 | register Lisp_Object map; | 680 | register Lisp_Object map; |
| 679 | map = current_buffer->keymap; | 681 | map = current_buffer->keymap; |
| 680 | if (NULL (map)) | 682 | if (NILP (map)) |
| 681 | return Qnil; | 683 | return Qnil; |
| 682 | return Flookup_key (map, keys); | 684 | return Flookup_key (map, keys); |
| 683 | } | 685 | } |
| @@ -711,11 +713,11 @@ that come after prefix bindings.") | |||
| 711 | nmaps = current_minor_maps (&modes, &maps); | 713 | nmaps = current_minor_maps (&modes, &maps); |
| 712 | 714 | ||
| 713 | for (i = j = 0; i < nmaps; i++) | 715 | for (i = j = 0; i < nmaps; i++) |
| 714 | if (! NULL (maps[i]) | 716 | if (! NILP (maps[i]) |
| 715 | && ! NULL (binding = Flookup_key (maps[i], key)) | 717 | && ! NILP (binding = Flookup_key (maps[i], key)) |
| 716 | && XTYPE (binding) != Lisp_Int) | 718 | && XTYPE (binding) != Lisp_Int) |
| 717 | { | 719 | { |
| 718 | if (! NULL (get_keymap_1 (binding, 0))) | 720 | if (! NILP (get_keymap_1 (binding, 0))) |
| 719 | maps[j++] = Fcons (modes[i], binding); | 721 | maps[j++] = Fcons (modes[i], binding); |
| 720 | else if (j == 0) | 722 | else if (j == 0) |
| 721 | return Fcons (Fcons (modes[i], binding), Qnil); | 723 | return Fcons (Fcons (modes[i], binding), Qnil); |
| @@ -754,7 +756,7 @@ which is shared with other buffers in the same major mode.") | |||
| 754 | { | 756 | { |
| 755 | register Lisp_Object map; | 757 | register Lisp_Object map; |
| 756 | map = current_buffer->keymap; | 758 | map = current_buffer->keymap; |
| 757 | if (NULL (map)) | 759 | if (NILP (map)) |
| 758 | { | 760 | { |
| 759 | map = Fmake_sparse_keymap (); | 761 | map = Fmake_sparse_keymap (); |
| 760 | current_buffer->keymap = map; | 762 | current_buffer->keymap = map; |
| @@ -785,7 +787,7 @@ KEY is a string representing a sequence of keystrokes.") | |||
| 785 | (keys) | 787 | (keys) |
| 786 | Lisp_Object keys; | 788 | Lisp_Object keys; |
| 787 | { | 789 | { |
| 788 | if (!NULL (current_buffer->keymap)) | 790 | if (!NILP (current_buffer->keymap)) |
| 789 | Flocal_set_key (keys, Qnil); | 791 | Flocal_set_key (keys, Qnil); |
| 790 | return Qnil; | 792 | return Qnil; |
| 791 | } | 793 | } |
| @@ -802,7 +804,7 @@ as a function.") | |||
| 802 | Lisp_Object map; | 804 | Lisp_Object map; |
| 803 | map = Fmake_sparse_keymap (); | 805 | map = Fmake_sparse_keymap (); |
| 804 | Ffset (name, map); | 806 | Ffset (name, map); |
| 805 | if (!NULL (mapvar)) | 807 | if (!NILP (mapvar)) |
| 806 | Fset (mapvar, map); | 808 | Fset (mapvar, map); |
| 807 | else | 809 | else |
| 808 | Fset (name, map); | 810 | Fset (name, map); |
| @@ -825,7 +827,7 @@ If KEYMAP is nil, that means no local keymap.") | |||
| 825 | (keymap) | 827 | (keymap) |
| 826 | Lisp_Object keymap; | 828 | Lisp_Object keymap; |
| 827 | { | 829 | { |
| 828 | if (!NULL (keymap)) | 830 | if (!NILP (keymap)) |
| 829 | keymap = get_keymap (keymap); | 831 | keymap = get_keymap (keymap); |
| 830 | 832 | ||
| 831 | current_buffer->keymap = keymap; | 833 | current_buffer->keymap = keymap; |
| @@ -880,7 +882,7 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 880 | This is a breadth-first traversal, where tail is the queue of | 882 | This is a breadth-first traversal, where tail is the queue of |
| 881 | nodes, and maps accumulates a list of all nodes visited. */ | 883 | nodes, and maps accumulates a list of all nodes visited. */ |
| 882 | 884 | ||
| 883 | while (!NULL (tail)) | 885 | while (!NILP (tail)) |
| 884 | { | 886 | { |
| 885 | register Lisp_Object thisseq = Fcar (Fcar (tail)); | 887 | register Lisp_Object thisseq = Fcar (Fcar (tail)); |
| 886 | register Lisp_Object thismap = Fcdr (Fcar (tail)); | 888 | register Lisp_Object thismap = Fcdr (Fcar (tail)); |
| @@ -908,14 +910,14 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 908 | register Lisp_Object cmd; | 910 | register Lisp_Object cmd; |
| 909 | 911 | ||
| 910 | cmd = get_keyelt (XVECTOR (table)->contents[i]); | 912 | cmd = get_keyelt (XVECTOR (table)->contents[i]); |
| 911 | if (NULL (cmd)) continue; | 913 | if (NILP (cmd)) continue; |
| 912 | tem = Fkeymapp (cmd); | 914 | tem = Fkeymapp (cmd); |
| 913 | if (!NULL (tem)) | 915 | if (!NILP (tem)) |
| 914 | { | 916 | { |
| 915 | cmd = get_keymap (cmd); | 917 | cmd = get_keymap (cmd); |
| 916 | /* Ignore keymaps that are already added to maps. */ | 918 | /* Ignore keymaps that are already added to maps. */ |
| 917 | tem = Frassq (cmd, maps); | 919 | tem = Frassq (cmd, maps); |
| 918 | if (NULL (tem)) | 920 | if (NILP (tem)) |
| 919 | { | 921 | { |
| 920 | /* If the last key in thisseq is meta-prefix-char, | 922 | /* If the last key in thisseq is meta-prefix-char, |
| 921 | turn it into a meta-ized keystroke. We know | 923 | turn it into a meta-ized keystroke. We know |
| @@ -960,12 +962,12 @@ so that the KEYS increase in length. The first element is (\"\" . KEYMAP).") | |||
| 960 | 962 | ||
| 961 | /* Ignore definitions that aren't keymaps themselves. */ | 963 | /* Ignore definitions that aren't keymaps themselves. */ |
| 962 | tem = Fkeymapp (cmd); | 964 | tem = Fkeymapp (cmd); |
| 963 | if (!NULL (tem)) | 965 | if (!NILP (tem)) |
| 964 | { | 966 | { |
| 965 | /* Ignore keymaps that have been seen already. */ | 967 | /* Ignore keymaps that have been seen already. */ |
| 966 | cmd = get_keymap (cmd); | 968 | cmd = get_keymap (cmd); |
| 967 | tem = Frassq (cmd, maps); | 969 | tem = Frassq (cmd, maps); |
| 968 | if (NULL (tem)) | 970 | if (NILP (tem)) |
| 969 | { | 971 | { |
| 970 | /* let elt be the event defined by this map entry. */ | 972 | /* let elt be the event defined by this map entry. */ |
| 971 | elt = XCONS (elt)->car; | 973 | elt = XCONS (elt)->car; |
| @@ -1171,10 +1173,10 @@ indirect definition itself.") | |||
| 1171 | register Lisp_Object maps; | 1173 | register Lisp_Object maps; |
| 1172 | Lisp_Object found; | 1174 | Lisp_Object found; |
| 1173 | 1175 | ||
| 1174 | if (NULL (global_keymap)) | 1176 | if (NILP (global_keymap)) |
| 1175 | global_keymap = current_global_map; | 1177 | global_keymap = current_global_map; |
| 1176 | 1178 | ||
| 1177 | if (!NULL (local_keymap)) | 1179 | if (!NILP (local_keymap)) |
| 1178 | maps = nconc2 (Faccessible_keymaps (get_keymap (local_keymap)), | 1180 | maps = nconc2 (Faccessible_keymaps (get_keymap (local_keymap)), |
| 1179 | Faccessible_keymaps (get_keymap (global_keymap))); | 1181 | Faccessible_keymaps (get_keymap (global_keymap))); |
| 1180 | else | 1182 | else |
| @@ -1182,7 +1184,7 @@ indirect definition itself.") | |||
| 1182 | 1184 | ||
| 1183 | found = Qnil; | 1185 | found = Qnil; |
| 1184 | 1186 | ||
| 1185 | for (; !NULL (maps); maps = Fcdr (maps)) | 1187 | for (; !NILP (maps); maps = Fcdr (maps)) |
| 1186 | { | 1188 | { |
| 1187 | register this = Fcar (Fcar (maps)); /* Key sequence to reach map */ | 1189 | register this = Fcar (Fcar (maps)); /* Key sequence to reach map */ |
| 1188 | register map = Fcdr (Fcar (maps)); /* The map that it reaches */ | 1190 | register map = Fcdr (Fcar (maps)); /* The map that it reaches */ |
| @@ -1245,7 +1247,7 @@ indirect definition itself.") | |||
| 1245 | break; | 1247 | break; |
| 1246 | 1248 | ||
| 1247 | /* Search through indirections unless that's not wanted. */ | 1249 | /* Search through indirections unless that's not wanted. */ |
| 1248 | if (NULL (noindirect)) | 1250 | if (NILP (noindirect)) |
| 1249 | binding = get_keyelt (binding); | 1251 | binding = get_keyelt (binding); |
| 1250 | 1252 | ||
| 1251 | /* End this iteration if this element does not match | 1253 | /* End this iteration if this element does not match |
| @@ -1255,7 +1257,7 @@ indirect definition itself.") | |||
| 1255 | { | 1257 | { |
| 1256 | Lisp_Object tem; | 1258 | Lisp_Object tem; |
| 1257 | tem = Fequal (binding, definition); | 1259 | tem = Fequal (binding, definition); |
| 1258 | if (NULL (tem)) | 1260 | if (NILP (tem)) |
| 1259 | continue; | 1261 | continue; |
| 1260 | } | 1262 | } |
| 1261 | else | 1263 | else |
| @@ -1281,16 +1283,16 @@ indirect definition itself.") | |||
| 1281 | 1283 | ||
| 1282 | Either nil or number as value from Flookup_key | 1284 | Either nil or number as value from Flookup_key |
| 1283 | means undefined. */ | 1285 | means undefined. */ |
| 1284 | if (!NULL (local_keymap)) | 1286 | if (!NILP (local_keymap)) |
| 1285 | { | 1287 | { |
| 1286 | binding = Flookup_key (local_keymap, sequence); | 1288 | binding = Flookup_key (local_keymap, sequence); |
| 1287 | if (!NULL (binding) && XTYPE (binding) != Lisp_Int) | 1289 | if (!NILP (binding) && XTYPE (binding) != Lisp_Int) |
| 1288 | { | 1290 | { |
| 1289 | if (XTYPE (definition) == Lisp_Cons) | 1291 | if (XTYPE (definition) == Lisp_Cons) |
| 1290 | { | 1292 | { |
| 1291 | Lisp_Object tem; | 1293 | Lisp_Object tem; |
| 1292 | tem = Fequal (binding, definition); | 1294 | tem = Fequal (binding, definition); |
| 1293 | if (NULL (tem)) | 1295 | if (NILP (tem)) |
| 1294 | continue; | 1296 | continue; |
| 1295 | } | 1297 | } |
| 1296 | else | 1298 | else |
| @@ -1301,7 +1303,7 @@ indirect definition itself.") | |||
| 1301 | 1303 | ||
| 1302 | /* It is a true unshadowed match. Record it. */ | 1304 | /* It is a true unshadowed match. Record it. */ |
| 1303 | 1305 | ||
| 1304 | if (!NULL (firstonly)) | 1306 | if (!NILP (firstonly)) |
| 1305 | return sequence; | 1307 | return sequence; |
| 1306 | found = Fcons (sequence, found); | 1308 | found = Fcons (sequence, found); |
| 1307 | } | 1309 | } |
| @@ -1392,7 +1394,7 @@ describe_buffer_bindings (descbuf) | |||
| 1392 | } | 1394 | } |
| 1393 | 1395 | ||
| 1394 | start1 = XBUFFER (descbuf)->keymap; | 1396 | start1 = XBUFFER (descbuf)->keymap; |
| 1395 | if (!NULL (start1)) | 1397 | if (!NILP (start1)) |
| 1396 | { | 1398 | { |
| 1397 | insert_string ("Local Bindings:\n"); | 1399 | insert_string ("Local Bindings:\n"); |
| 1398 | insert_string (heading); | 1400 | insert_string (heading); |
| @@ -1428,13 +1430,13 @@ describe_map_tree (startmap, partial, shadow) | |||
| 1428 | maps = Faccessible_keymaps (startmap); | 1430 | maps = Faccessible_keymaps (startmap); |
| 1429 | GCPRO1 (maps); | 1431 | GCPRO1 (maps); |
| 1430 | 1432 | ||
| 1431 | for (; !NULL (maps); maps = Fcdr (maps)) | 1433 | for (; !NILP (maps); maps = Fcdr (maps)) |
| 1432 | { | 1434 | { |
| 1433 | elt = Fcar (maps); | 1435 | elt = Fcar (maps); |
| 1434 | sh = Fcar (elt); | 1436 | sh = Fcar (elt); |
| 1435 | 1437 | ||
| 1436 | /* If there is no shadow keymap given, don't shadow. */ | 1438 | /* If there is no shadow keymap given, don't shadow. */ |
| 1437 | if (NULL (shadow)) | 1439 | if (NILP (shadow)) |
| 1438 | sh = Qnil; | 1440 | sh = Qnil; |
| 1439 | 1441 | ||
| 1440 | /* If the sequence by which we reach this keymap is zero-length, | 1442 | /* If the sequence by which we reach this keymap is zero-length, |
| @@ -1460,7 +1462,7 @@ describe_map_tree (startmap, partial, shadow) | |||
| 1460 | show through), describe the map. Otherwise, sh is a command | 1462 | show through), describe the map. Otherwise, sh is a command |
| 1461 | that completely shadows the current map, and we shouldn't | 1463 | that completely shadows the current map, and we shouldn't |
| 1462 | bother. */ | 1464 | bother. */ |
| 1463 | if (NULL (sh) || !NULL (Fkeymapp (sh))) | 1465 | if (NILP (sh) || !NILP (Fkeymapp (sh))) |
| 1464 | describe_map (Fcdr (elt), Fcar (elt), partial, sh); | 1466 | describe_map (Fcdr (elt), Fcar (elt), partial, sh); |
| 1465 | } | 1467 | } |
| 1466 | 1468 | ||
| @@ -1484,7 +1486,7 @@ describe_command (definition) | |||
| 1484 | else | 1486 | else |
| 1485 | { | 1487 | { |
| 1486 | tem1 = Fkeymapp (definition); | 1488 | tem1 = Fkeymapp (definition); |
| 1487 | if (!NULL (tem1)) | 1489 | if (!NILP (tem1)) |
| 1488 | insert_string ("Prefix Command\n"); | 1490 | insert_string ("Prefix Command\n"); |
| 1489 | else | 1491 | else |
| 1490 | insert_string ("??\n"); | 1492 | insert_string ("??\n"); |
| @@ -1503,7 +1505,7 @@ describe_map (map, keys, partial, shadow) | |||
| 1503 | { | 1505 | { |
| 1504 | register Lisp_Object keysdesc; | 1506 | register Lisp_Object keysdesc; |
| 1505 | 1507 | ||
| 1506 | if (!NULL (keys) && Flength (keys) > 0) | 1508 | if (!NILP (keys) && Flength (keys) > 0) |
| 1507 | keysdesc = concat2 (Fkey_description (keys), | 1509 | keysdesc = concat2 (Fkey_description (keys), |
| 1508 | build_string (" ")); | 1510 | build_string (" ")); |
| 1509 | else | 1511 | else |
| @@ -1560,24 +1562,24 @@ describe_alist (alist, elt_prefix, elt_describer, partial, shadow) | |||
| 1560 | tem2 = get_keyelt (Fcdr_safe (Fcar (alist))); | 1562 | tem2 = get_keyelt (Fcdr_safe (Fcar (alist))); |
| 1561 | 1563 | ||
| 1562 | /* Don't show undefined commands or suppressed commands. */ | 1564 | /* Don't show undefined commands or suppressed commands. */ |
| 1563 | if (NULL (tem2)) continue; | 1565 | if (NILP (tem2)) continue; |
| 1564 | if (XTYPE (tem2) == Lisp_Symbol && partial) | 1566 | if (XTYPE (tem2) == Lisp_Symbol && partial) |
| 1565 | { | 1567 | { |
| 1566 | this = Fget (tem2, suppress); | 1568 | this = Fget (tem2, suppress); |
| 1567 | if (!NULL (this)) | 1569 | if (!NILP (this)) |
| 1568 | continue; | 1570 | continue; |
| 1569 | } | 1571 | } |
| 1570 | 1572 | ||
| 1571 | /* Don't show a command that isn't really visible | 1573 | /* Don't show a command that isn't really visible |
| 1572 | because a local definition of the same key shadows it. */ | 1574 | because a local definition of the same key shadows it. */ |
| 1573 | 1575 | ||
| 1574 | if (!NULL (shadow)) | 1576 | if (!NILP (shadow)) |
| 1575 | { | 1577 | { |
| 1576 | Lisp_Object tem; | 1578 | Lisp_Object tem; |
| 1577 | 1579 | ||
| 1578 | XVECTOR (kludge)->contents[0] = tem1; | 1580 | XVECTOR (kludge)->contents[0] = tem1; |
| 1579 | tem = Flookup_key (shadow, kludge); | 1581 | tem = Flookup_key (shadow, kludge); |
| 1580 | if (!NULL (tem)) continue; | 1582 | if (!NILP (tem)) continue; |
| 1581 | } | 1583 | } |
| 1582 | 1584 | ||
| 1583 | if (first) | 1585 | if (first) |
| @@ -1586,7 +1588,7 @@ describe_alist (alist, elt_prefix, elt_describer, partial, shadow) | |||
| 1586 | first = 0; | 1588 | first = 0; |
| 1587 | } | 1589 | } |
| 1588 | 1590 | ||
| 1589 | if (!NULL (elt_prefix)) | 1591 | if (!NILP (elt_prefix)) |
| 1590 | insert1 (elt_prefix); | 1592 | insert1 (elt_prefix); |
| 1591 | 1593 | ||
| 1592 | /* THIS gets the string to describe the character TEM1. */ | 1594 | /* THIS gets the string to describe the character TEM1. */ |
| @@ -1651,26 +1653,26 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1651 | QUIT; | 1653 | QUIT; |
| 1652 | tem1 = get_keyelt (XVECTOR (vector)->contents[i]); | 1654 | tem1 = get_keyelt (XVECTOR (vector)->contents[i]); |
| 1653 | 1655 | ||
| 1654 | if (NULL (tem1)) continue; | 1656 | if (NILP (tem1)) continue; |
| 1655 | 1657 | ||
| 1656 | /* Don't mention suppressed commands. */ | 1658 | /* Don't mention suppressed commands. */ |
| 1657 | if (XTYPE (tem1) == Lisp_Symbol && partial) | 1659 | if (XTYPE (tem1) == Lisp_Symbol && partial) |
| 1658 | { | 1660 | { |
| 1659 | this = Fget (tem1, suppress); | 1661 | this = Fget (tem1, suppress); |
| 1660 | if (!NULL (this)) | 1662 | if (!NILP (this)) |
| 1661 | continue; | 1663 | continue; |
| 1662 | } | 1664 | } |
| 1663 | 1665 | ||
| 1664 | /* If this command in this map is shadowed by some other map, | 1666 | /* If this command in this map is shadowed by some other map, |
| 1665 | ignore it. */ | 1667 | ignore it. */ |
| 1666 | if (!NULL (shadow)) | 1668 | if (!NILP (shadow)) |
| 1667 | { | 1669 | { |
| 1668 | Lisp_Object tem; | 1670 | Lisp_Object tem; |
| 1669 | 1671 | ||
| 1670 | XVECTOR (kludge)->contents[0] = make_number (i); | 1672 | XVECTOR (kludge)->contents[0] = make_number (i); |
| 1671 | tem = Flookup_key (shadow, kludge); | 1673 | tem = Flookup_key (shadow, kludge); |
| 1672 | 1674 | ||
| 1673 | if (!NULL (tem)) continue; | 1675 | if (!NILP (tem)) continue; |
| 1674 | } | 1676 | } |
| 1675 | 1677 | ||
| 1676 | if (first) | 1678 | if (first) |
| @@ -1680,7 +1682,7 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1680 | } | 1682 | } |
| 1681 | 1683 | ||
| 1682 | /* Output the prefix that applies to every entry in this map. */ | 1684 | /* Output the prefix that applies to every entry in this map. */ |
| 1683 | if (!NULL (elt_prefix)) | 1685 | if (!NILP (elt_prefix)) |
| 1684 | insert1 (elt_prefix); | 1686 | insert1 (elt_prefix); |
| 1685 | 1687 | ||
| 1686 | /* Get the string to describe the character I, and print it. */ | 1688 | /* Get the string to describe the character I, and print it. */ |
| @@ -1702,7 +1704,7 @@ describe_vector (vector, elt_prefix, elt_describer, partial, shadow) | |||
| 1702 | if (i != XINT (dummy)) | 1704 | if (i != XINT (dummy)) |
| 1703 | { | 1705 | { |
| 1704 | insert (" .. ", 4); | 1706 | insert (" .. ", 4); |
| 1705 | if (!NULL (elt_prefix)) | 1707 | if (!NILP (elt_prefix)) |
| 1706 | insert1 (elt_prefix); | 1708 | insert1 (elt_prefix); |
| 1707 | 1709 | ||
| 1708 | XFASTINT (dummy) = i; | 1710 | XFASTINT (dummy) = i; |
| @@ -1729,9 +1731,9 @@ apropos_accum (symbol, string) | |||
| 1729 | register Lisp_Object tem; | 1731 | register Lisp_Object tem; |
| 1730 | 1732 | ||
| 1731 | tem = Fstring_match (string, Fsymbol_name (symbol), Qnil); | 1733 | tem = Fstring_match (string, Fsymbol_name (symbol), Qnil); |
| 1732 | if (!NULL (tem) && !NULL (apropos_predicate)) | 1734 | if (!NILP (tem) && !NILP (apropos_predicate)) |
| 1733 | tem = call1 (apropos_predicate, symbol); | 1735 | tem = call1 (apropos_predicate, symbol); |
| 1734 | if (!NULL (tem)) | 1736 | if (!NILP (tem)) |
| 1735 | apropos_accumulate = Fcons (symbol, apropos_accumulate); | 1737 | apropos_accumulate = Fcons (symbol, apropos_accumulate); |
| 1736 | } | 1738 | } |
| 1737 | 1739 | ||
diff --git a/src/lread.c b/src/lread.c index 73d448dd716..2a8c47e9559 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -122,7 +122,7 @@ readchar (readcharfun) | |||
| 122 | 122 | ||
| 123 | tem = call0 (readcharfun); | 123 | tem = call0 (readcharfun); |
| 124 | 124 | ||
| 125 | if (NULL (tem)) | 125 | if (NILP (tem)) |
| 126 | return -1; | 126 | return -1; |
| 127 | return XINT (tem); | 127 | return XINT (tem); |
| 128 | } | 128 | } |
| @@ -250,13 +250,13 @@ Return t if file exists.") | |||
| 250 | since it would try to load a directory as a Lisp file */ | 250 | since it would try to load a directory as a Lisp file */ |
| 251 | if (XSTRING (str)->size > 0) | 251 | if (XSTRING (str)->size > 0) |
| 252 | { | 252 | { |
| 253 | fd = openp (Vload_path, str, !NULL (nosuffix) ? "" : ".elc:.el:", | 253 | fd = openp (Vload_path, str, !NILP (nosuffix) ? "" : ".elc:.el:", |
| 254 | &found, 0); | 254 | &found, 0); |
| 255 | } | 255 | } |
| 256 | 256 | ||
| 257 | if (fd < 0) | 257 | if (fd < 0) |
| 258 | { | 258 | { |
| 259 | if (NULL (noerror)) | 259 | if (NILP (noerror)) |
| 260 | while (1) | 260 | while (1) |
| 261 | Fsignal (Qfile_error, Fcons (build_string ("Cannot open load file"), | 261 | Fsignal (Qfile_error, Fcons (build_string ("Cannot open load file"), |
| 262 | Fcons (str, Qnil))); | 262 | Fcons (str, Qnil))); |
| @@ -286,7 +286,7 @@ Return t if file exists.") | |||
| 286 | error ("Failure to create stdio stream for %s", XSTRING (str)->data); | 286 | error ("Failure to create stdio stream for %s", XSTRING (str)->data); |
| 287 | } | 287 | } |
| 288 | 288 | ||
| 289 | if (NULL (nomessage)) | 289 | if (NILP (nomessage)) |
| 290 | message ("Loading %s...", XSTRING (str)->data); | 290 | message ("Loading %s...", XSTRING (str)->data); |
| 291 | 291 | ||
| 292 | GCPRO1 (str); | 292 | GCPRO1 (str); |
| @@ -303,11 +303,11 @@ Return t if file exists.") | |||
| 303 | 303 | ||
| 304 | /* Run any load-hooks for this file. */ | 304 | /* Run any load-hooks for this file. */ |
| 305 | temp = Fassoc (str, Vafter_load_alist); | 305 | temp = Fassoc (str, Vafter_load_alist); |
| 306 | if (!NULL (temp)) | 306 | if (!NILP (temp)) |
| 307 | Fprogn (Fcdr (temp)); | 307 | Fprogn (Fcdr (temp)); |
| 308 | UNGCPRO; | 308 | UNGCPRO; |
| 309 | 309 | ||
| 310 | if (!noninteractive && NULL (nomessage)) | 310 | if (!noninteractive && NILP (nomessage)) |
| 311 | message ("Loading %s...done", XSTRING (str)->data); | 311 | message ("Loading %s...done", XSTRING (str)->data); |
| 312 | return Qt; | 312 | return Qt; |
| 313 | } | 313 | } |
| @@ -373,7 +373,7 @@ openp (path, str, suffix, storeptr, exec_only) | |||
| 373 | if (complete_filename_p (str)) | 373 | if (complete_filename_p (str)) |
| 374 | absolute = 1; | 374 | absolute = 1; |
| 375 | 375 | ||
| 376 | for (; !NULL (path); path = Fcdr (path)) | 376 | for (; !NILP (path); path = Fcdr (path)) |
| 377 | { | 377 | { |
| 378 | char *nsuffix; | 378 | char *nsuffix; |
| 379 | 379 | ||
| @@ -472,7 +472,7 @@ readevalloop (readcharfun, stream, evalfun, printflag) | |||
| 472 | if (c < 0) break; | 472 | if (c < 0) break; |
| 473 | if (c == ' ' || c == '\t' || c == '\n' || c == '\f') continue; | 473 | if (c == ' ' || c == '\t' || c == '\n' || c == '\f') continue; |
| 474 | 474 | ||
| 475 | if (!NULL (Vpurify_flag) && c == '(') | 475 | if (!NILP (Vpurify_flag) && c == '(') |
| 476 | { | 476 | { |
| 477 | record_unwind_protect (unreadpure, Qnil); | 477 | record_unwind_protect (unreadpure, Qnil); |
| 478 | val = read_list (-1, readcharfun); | 478 | val = read_list (-1, readcharfun); |
| @@ -513,14 +513,14 @@ point remains at the end of the last character read from the buffer.") | |||
| 513 | int count = specpdl_ptr - specpdl; | 513 | int count = specpdl_ptr - specpdl; |
| 514 | Lisp_Object tem; | 514 | Lisp_Object tem; |
| 515 | 515 | ||
| 516 | if (NULL (printflag)) | 516 | if (NILP (printflag)) |
| 517 | tem = Qsymbolp; | 517 | tem = Qsymbolp; |
| 518 | else | 518 | else |
| 519 | tem = printflag; | 519 | tem = printflag; |
| 520 | specbind (Qstandard_output, tem); | 520 | specbind (Qstandard_output, tem); |
| 521 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 521 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 522 | SET_PT (BEGV); | 522 | SET_PT (BEGV); |
| 523 | readevalloop (Fcurrent_buffer (), 0, Feval, !NULL (printflag)); | 523 | readevalloop (Fcurrent_buffer (), 0, Feval, !NILP (printflag)); |
| 524 | return unbind_to (count, Qnil); | 524 | return unbind_to (count, Qnil); |
| 525 | } | 525 | } |
| 526 | 526 | ||
| @@ -540,20 +540,20 @@ point remains at the end of the last character read from the buffer.") | |||
| 540 | int count = specpdl_ptr - specpdl; | 540 | int count = specpdl_ptr - specpdl; |
| 541 | Lisp_Object tem; | 541 | Lisp_Object tem; |
| 542 | 542 | ||
| 543 | if (NULL (printflag)) | 543 | if (NILP (printflag)) |
| 544 | tem = Qsymbolp; | 544 | tem = Qsymbolp; |
| 545 | else | 545 | else |
| 546 | tem = printflag; | 546 | tem = printflag; |
| 547 | specbind (Qstandard_output, tem); | 547 | specbind (Qstandard_output, tem); |
| 548 | 548 | ||
| 549 | if (NULL (printflag)) | 549 | if (NILP (printflag)) |
| 550 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); | 550 | record_unwind_protect (save_excursion_restore, save_excursion_save ()); |
| 551 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); | 551 | record_unwind_protect (save_restriction_restore, save_restriction_save ()); |
| 552 | 552 | ||
| 553 | /* This both uses b and checks its type. */ | 553 | /* This both uses b and checks its type. */ |
| 554 | Fgoto_char (b); | 554 | Fgoto_char (b); |
| 555 | Fnarrow_to_region (make_number (BEGV), e); | 555 | Fnarrow_to_region (make_number (BEGV), e); |
| 556 | readevalloop (Fcurrent_buffer (), 0, Feval, !NULL (printflag)); | 556 | readevalloop (Fcurrent_buffer (), 0, Feval, !NILP (printflag)); |
| 557 | 557 | ||
| 558 | return unbind_to (count, Qnil); | 558 | return unbind_to (count, Qnil); |
| 559 | } | 559 | } |
| @@ -575,7 +575,7 @@ STREAM or the value of `standard-input' may be:\n\ | |||
| 575 | { | 575 | { |
| 576 | extern Lisp_Object Fread_minibuffer (); | 576 | extern Lisp_Object Fread_minibuffer (); |
| 577 | 577 | ||
| 578 | if (NULL (readcharfun)) | 578 | if (NILP (readcharfun)) |
| 579 | readcharfun = Vstandard_input; | 579 | readcharfun = Vstandard_input; |
| 580 | if (EQ (readcharfun, Qt)) | 580 | if (EQ (readcharfun, Qt)) |
| 581 | readcharfun = Qread_char; | 581 | readcharfun = Qread_char; |
| @@ -604,7 +604,7 @@ START and END optionally delimit a substring of STRING from which to read;\n\ | |||
| 604 | 604 | ||
| 605 | CHECK_STRING (string,0); | 605 | CHECK_STRING (string,0); |
| 606 | 606 | ||
| 607 | if (NULL (end)) | 607 | if (NILP (end)) |
| 608 | endval = XSTRING (string)->size; | 608 | endval = XSTRING (string)->size; |
| 609 | else | 609 | else |
| 610 | { CHECK_NUMBER (end,2); | 610 | { CHECK_NUMBER (end,2); |
| @@ -613,7 +613,7 @@ START and END optionally delimit a substring of STRING from which to read;\n\ | |||
| 613 | args_out_of_range (string, end); | 613 | args_out_of_range (string, end); |
| 614 | } | 614 | } |
| 615 | 615 | ||
| 616 | if (NULL (start)) | 616 | if (NILP (start)) |
| 617 | startval = 0; | 617 | startval = 0; |
| 618 | else | 618 | else |
| 619 | { CHECK_NUMBER (start,1); | 619 | { CHECK_NUMBER (start,1); |
| @@ -659,7 +659,7 @@ read_escape (readcharfun) | |||
| 659 | switch (c) | 659 | switch (c) |
| 660 | { | 660 | { |
| 661 | case 'a': | 661 | case 'a': |
| 662 | return '\a'; | 662 | return '\007'; |
| 663 | case 'b': | 663 | case 'b': |
| 664 | return '\b'; | 664 | return '\b'; |
| 665 | case 'e': | 665 | case 'e': |
| @@ -859,7 +859,7 @@ read1 (readcharfun) | |||
| 859 | /* If purifying, and string starts with \ newline, | 859 | /* If purifying, and string starts with \ newline, |
| 860 | return zero instead. This is for doc strings | 860 | return zero instead. This is for doc strings |
| 861 | that we are really going to find in share-lib/DOC.nn.nn */ | 861 | that we are really going to find in share-lib/DOC.nn.nn */ |
| 862 | if (!NULL (Vpurify_flag) && NULL (Vdoc_file_name) && cancel) | 862 | if (!NILP (Vpurify_flag) && NILP (Vdoc_file_name) && cancel) |
| 863 | return make_number (0); | 863 | return make_number (0); |
| 864 | 864 | ||
| 865 | if (read_pure) | 865 | if (read_pure) |
| @@ -1060,7 +1060,7 @@ read_list (flag, readcharfun) | |||
| 1060 | if (XINT (elt) == '.') | 1060 | if (XINT (elt) == '.') |
| 1061 | { | 1061 | { |
| 1062 | GCPRO2 (val, tail); | 1062 | GCPRO2 (val, tail); |
| 1063 | if (!NULL (tail)) | 1063 | if (!NILP (tail)) |
| 1064 | XCONS (tail)->cdr = read0 (readcharfun); | 1064 | XCONS (tail)->cdr = read0 (readcharfun); |
| 1065 | else | 1065 | else |
| 1066 | val = read0 (readcharfun); | 1066 | val = read0 (readcharfun); |
| @@ -1075,7 +1075,7 @@ read_list (flag, readcharfun) | |||
| 1075 | tem = (read_pure && flag <= 0 | 1075 | tem = (read_pure && flag <= 0 |
| 1076 | ? pure_cons (elt, Qnil) | 1076 | ? pure_cons (elt, Qnil) |
| 1077 | : Fcons (elt, Qnil)); | 1077 | : Fcons (elt, Qnil)); |
| 1078 | if (!NULL (tail)) | 1078 | if (!NILP (tail)) |
| 1079 | XCONS (tail)->cdr = tem; | 1079 | XCONS (tail)->cdr = tem; |
| 1080 | else | 1080 | else |
| 1081 | val = tem; | 1081 | val = tem; |
| @@ -1120,7 +1120,7 @@ intern (str) | |||
| 1120 | tem = oblookup (obarray, str, len); | 1120 | tem = oblookup (obarray, str, len); |
| 1121 | if (XTYPE (tem) == Lisp_Symbol) | 1121 | if (XTYPE (tem) == Lisp_Symbol) |
| 1122 | return tem; | 1122 | return tem; |
| 1123 | return Fintern ((!NULL (Vpurify_flag) | 1123 | return Fintern ((!NILP (Vpurify_flag) |
| 1124 | ? make_pure_string (str, len) | 1124 | ? make_pure_string (str, len) |
| 1125 | : make_string (str, len)), | 1125 | : make_string (str, len)), |
| 1126 | obarray); | 1126 | obarray); |
| @@ -1136,7 +1136,7 @@ it defaults to the value of `obarray'.") | |||
| 1136 | { | 1136 | { |
| 1137 | register Lisp_Object tem, sym, *ptr; | 1137 | register Lisp_Object tem, sym, *ptr; |
| 1138 | 1138 | ||
| 1139 | if (NULL (obarray)) obarray = Vobarray; | 1139 | if (NILP (obarray)) obarray = Vobarray; |
| 1140 | obarray = check_obarray (obarray); | 1140 | obarray = check_obarray (obarray); |
| 1141 | 1141 | ||
| 1142 | CHECK_STRING (str, 0); | 1142 | CHECK_STRING (str, 0); |
| @@ -1145,7 +1145,7 @@ it defaults to the value of `obarray'.") | |||
| 1145 | if (XTYPE (tem) != Lisp_Int) | 1145 | if (XTYPE (tem) != Lisp_Int) |
| 1146 | return tem; | 1146 | return tem; |
| 1147 | 1147 | ||
| 1148 | if (!NULL (Vpurify_flag)) | 1148 | if (!NILP (Vpurify_flag)) |
| 1149 | str = Fpurecopy (str); | 1149 | str = Fpurecopy (str); |
| 1150 | sym = Fmake_symbol (str); | 1150 | sym = Fmake_symbol (str); |
| 1151 | 1151 | ||
| @@ -1167,7 +1167,7 @@ it defaults to the value of `obarray'.") | |||
| 1167 | { | 1167 | { |
| 1168 | register Lisp_Object tem; | 1168 | register Lisp_Object tem; |
| 1169 | 1169 | ||
| 1170 | if (NULL (obarray)) obarray = Vobarray; | 1170 | if (NILP (obarray)) obarray = Vobarray; |
| 1171 | obarray = check_obarray (obarray); | 1171 | obarray = check_obarray (obarray); |
| 1172 | 1172 | ||
| 1173 | CHECK_STRING (str, 0); | 1173 | CHECK_STRING (str, 0); |
| @@ -1270,7 +1270,7 @@ OBARRAY defaults to the value of `obarray'.") | |||
| 1270 | { | 1270 | { |
| 1271 | Lisp_Object tem; | 1271 | Lisp_Object tem; |
| 1272 | 1272 | ||
| 1273 | if (NULL (obarray)) obarray = Vobarray; | 1273 | if (NILP (obarray)) obarray = Vobarray; |
| 1274 | obarray = check_obarray (obarray); | 1274 | obarray = check_obarray (obarray); |
| 1275 | 1275 | ||
| 1276 | map_obarray (obarray, mapatoms_1, function); | 1276 | map_obarray (obarray, mapatoms_1, function); |
| @@ -1452,11 +1452,11 @@ init_lread () | |||
| 1452 | } | 1452 | } |
| 1453 | 1453 | ||
| 1454 | /* Warn if dirs in the *standard* path don't exist. */ | 1454 | /* Warn if dirs in the *standard* path don't exist. */ |
| 1455 | for (; !NULL (normal_path); normal_path = XCONS (normal_path)->cdr) | 1455 | for (; !NILP (normal_path); normal_path = XCONS (normal_path)->cdr) |
| 1456 | { | 1456 | { |
| 1457 | Lisp_Object dirfile; | 1457 | Lisp_Object dirfile; |
| 1458 | dirfile = Fcar (normal_path); | 1458 | dirfile = Fcar (normal_path); |
| 1459 | if (!NULL (dirfile)) | 1459 | if (!NILP (dirfile)) |
| 1460 | { | 1460 | { |
| 1461 | dirfile = Fdirectory_file_name (dirfile); | 1461 | dirfile = Fdirectory_file_name (dirfile); |
| 1462 | if (access (XSTRING (dirfile)->data, 0) < 0) | 1462 | if (access (XSTRING (dirfile)->data, 0) < 0) |
| @@ -1468,7 +1468,7 @@ init_lread () | |||
| 1468 | if (egetenv ("EMACSLOADPATH")) | 1468 | if (egetenv ("EMACSLOADPATH")) |
| 1469 | Vload_path = decode_env_path ("EMACSLOADPATH", normal); | 1469 | Vload_path = decode_env_path ("EMACSLOADPATH", normal); |
| 1470 | #ifndef CANNOT_DUMP | 1470 | #ifndef CANNOT_DUMP |
| 1471 | if (!NULL (Vpurify_flag)) | 1471 | if (!NILP (Vpurify_flag)) |
| 1472 | Vload_path = Fcons (build_string ("../lisp"), Vload_path); | 1472 | Vload_path = Fcons (build_string ("../lisp"), Vload_path); |
| 1473 | #endif | 1473 | #endif |
| 1474 | 1474 | ||
diff --git a/src/macros.c b/src/macros.c index 5b19d926d66..f9c158c89eb 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -64,7 +64,7 @@ Non-nil arg (prefix arg) means append to last macro defined;\n\ | |||
| 64 | error ("Already defining kbd macro"); | 64 | error ("Already defining kbd macro"); |
| 65 | 65 | ||
| 66 | update_mode_lines++; | 66 | update_mode_lines++; |
| 67 | if (NULL (append)) | 67 | if (NILP (append)) |
| 68 | { | 68 | { |
| 69 | kbd_macro_ptr = kbd_macro_buffer; | 69 | kbd_macro_ptr = kbd_macro_buffer; |
| 70 | kbd_macro_end = kbd_macro_buffer; | 70 | kbd_macro_end = kbd_macro_buffer; |
| @@ -97,7 +97,7 @@ An argument of zero means repeat until error.") | |||
| 97 | if (!defining_kbd_macro) | 97 | if (!defining_kbd_macro) |
| 98 | error ("Not defining kbd macro."); | 98 | error ("Not defining kbd macro."); |
| 99 | 99 | ||
| 100 | if (NULL (arg)) | 100 | if (NILP (arg)) |
| 101 | XFASTINT (arg) = 1; | 101 | XFASTINT (arg) = 1; |
| 102 | else | 102 | else |
| 103 | CHECK_NUMBER (arg, 0); | 103 | CHECK_NUMBER (arg, 0); |
| @@ -164,7 +164,7 @@ defining others, use \\[name-last-kbd-macro].") | |||
| 164 | { | 164 | { |
| 165 | if (defining_kbd_macro) | 165 | if (defining_kbd_macro) |
| 166 | error ("Can't execute anonymous macro while defining one"); | 166 | error ("Can't execute anonymous macro while defining one"); |
| 167 | else if (NULL (Vlast_kbd_macro)) | 167 | else if (NILP (Vlast_kbd_macro)) |
| 168 | error ("No kbd macro has been defined"); | 168 | error ("No kbd macro has been defined"); |
| 169 | else | 169 | else |
| 170 | Fexecute_kbd_macro (Vlast_kbd_macro, prefix); | 170 | Fexecute_kbd_macro (Vlast_kbd_macro, prefix); |
| @@ -197,7 +197,7 @@ COUNT is a repeat count, or nil for once, or 0 for infinite loop.") | |||
| 197 | int repeat = 1; | 197 | int repeat = 1; |
| 198 | struct gcpro gcpro1; | 198 | struct gcpro gcpro1; |
| 199 | 199 | ||
| 200 | if (!NULL (prefixarg)) | 200 | if (!NILP (prefixarg)) |
| 201 | prefixarg = Fprefix_numeric_value (prefixarg), | 201 | prefixarg = Fprefix_numeric_value (prefixarg), |
| 202 | repeat = XINT (prefixarg); | 202 | repeat = XINT (prefixarg); |
| 203 | 203 | ||
diff --git a/src/ralloc.c b/src/ralloc.c index 1f92b51be88..d2dae3637a0 100644 --- a/src/ralloc.c +++ b/src/ralloc.c | |||
| @@ -97,7 +97,7 @@ check_memory_limits (address) | |||
| 97 | } | 97 | } |
| 98 | 98 | ||
| 99 | if (EXCEEDS_ELISP_PTR (address)) | 99 | if (EXCEEDS_ELISP_PTR (address)) |
| 100 | (*warnfunction) ("Warning: memory in use exceeds lisp pointer size"); | 100 | memory_full (); |
| 101 | } | 101 | } |
| 102 | 102 | ||
| 103 | /* Obtain SIZE bytes of space. If enough space is not presently available | 103 | /* Obtain SIZE bytes of space. If enough space is not presently available |
diff --git a/src/sunfns.c b/src/sunfns.c index 8fcf8bd507e..7c637e670f0 100644 --- a/src/sunfns.c +++ b/src/sunfns.c | |||
| @@ -107,7 +107,7 @@ or -1 if can not open it.") | |||
| 107 | char *cp; | 107 | char *cp; |
| 108 | static int already_initialized = 0; | 108 | static int already_initialized = 0; |
| 109 | 109 | ||
| 110 | if ((! already_initialized) || (!NULL(force))) { | 110 | if ((! already_initialized) || (!NILP(force))) { |
| 111 | cp = getenv("WINDOW_GFX"); | 111 | cp = getenv("WINDOW_GFX"); |
| 112 | if (cp != 0) win_fd = open(cp, 2); | 112 | if (cp != 0) win_fd = open(cp, 2); |
| 113 | if (win_fd > 0) | 113 | if (win_fd > 0) |
| @@ -213,7 +213,7 @@ expressed as a string. If ICON is nil then the original arrow cursor is used") | |||
| 213 | /* | 213 | /* |
| 214 | * If the icon is null, we just restore the DefaultCursor | 214 | * If the icon is null, we just restore the DefaultCursor |
| 215 | */ | 215 | */ |
| 216 | if (NULL(Icon)) | 216 | if (NILP(Icon)) |
| 217 | CurrentCursor = DefaultCursor; | 217 | CurrentCursor = DefaultCursor; |
| 218 | else { | 218 | else { |
| 219 | /* | 219 | /* |
diff --git a/src/syntax.c b/src/syntax.c index f90ed5cf8f0..4f203caf8f8 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -46,7 +46,7 @@ check_syntax_table (obj) | |||
| 46 | { | 46 | { |
| 47 | register Lisp_Object tem; | 47 | register Lisp_Object tem; |
| 48 | while (tem = Fsyntax_table_p (obj), | 48 | while (tem = Fsyntax_table_p (obj), |
| 49 | NULL (tem)) | 49 | NILP (tem)) |
| 50 | obj = wrong_type_argument (Qsyntax_table_p, obj, 0); | 50 | obj = wrong_type_argument (Qsyntax_table_p, obj, 0); |
| 51 | return obj; | 51 | return obj; |
| 52 | } | 52 | } |
| @@ -79,9 +79,9 @@ It is a copy of the TABLE, which defaults to the standard syntax table.") | |||
| 79 | XFASTINT (size) = 0400; | 79 | XFASTINT (size) = 0400; |
| 80 | XFASTINT (val) = 0; | 80 | XFASTINT (val) = 0; |
| 81 | val = Fmake_vector (size, val); | 81 | val = Fmake_vector (size, val); |
| 82 | if (!NULL (table)) | 82 | if (!NILP (table)) |
| 83 | table = check_syntax_table (table); | 83 | table = check_syntax_table (table); |
| 84 | else if (NULL (Vstandard_syntax_table)) | 84 | else if (NILP (Vstandard_syntax_table)) |
| 85 | /* Can only be null during initialization */ | 85 | /* Can only be null during initialization */ |
| 86 | return val; | 86 | return val; |
| 87 | else table = Vstandard_syntax_table; | 87 | else table = Vstandard_syntax_table; |
| @@ -195,7 +195,7 @@ DEFUN ("modify-syntax-entry", Fmodify_syntax_entry, Smodify_syntax_entry, 2, 3, | |||
| 195 | 195 | ||
| 196 | CHECK_NUMBER (c, 0); | 196 | CHECK_NUMBER (c, 0); |
| 197 | CHECK_STRING (newentry, 1); | 197 | CHECK_STRING (newentry, 1); |
| 198 | if (NULL (syntax_table)) | 198 | if (NILP (syntax_table)) |
| 199 | syntax_table = current_buffer->syntax_table; | 199 | syntax_table = current_buffer->syntax_table; |
| 200 | else | 200 | else |
| 201 | syntax_table = check_syntax_table (syntax_table); | 201 | syntax_table = check_syntax_table (syntax_table); |
| @@ -899,7 +899,7 @@ scan_sexps_forward (from, end, targetdepth, stopbefore, oldstate) | |||
| 899 | immediate_quit = 1; | 899 | immediate_quit = 1; |
| 900 | QUIT; | 900 | QUIT; |
| 901 | 901 | ||
| 902 | if (NULL (oldstate)) | 902 | if (NILP (oldstate)) |
| 903 | { | 903 | { |
| 904 | depth = 0; | 904 | depth = 0; |
| 905 | state.instring = -1; | 905 | state.instring = -1; |
| @@ -908,7 +908,7 @@ scan_sexps_forward (from, end, targetdepth, stopbefore, oldstate) | |||
| 908 | else | 908 | else |
| 909 | { | 909 | { |
| 910 | tem = Fcar (oldstate); | 910 | tem = Fcar (oldstate); |
| 911 | if (!NULL (tem)) | 911 | if (!NILP (tem)) |
| 912 | depth = XINT (tem); | 912 | depth = XINT (tem); |
| 913 | else | 913 | else |
| 914 | depth = 0; | 914 | depth = 0; |
| @@ -917,15 +917,15 @@ scan_sexps_forward (from, end, targetdepth, stopbefore, oldstate) | |||
| 917 | oldstate = Fcdr (oldstate); | 917 | oldstate = Fcdr (oldstate); |
| 918 | oldstate = Fcdr (oldstate); | 918 | oldstate = Fcdr (oldstate); |
| 919 | tem = Fcar (oldstate); | 919 | tem = Fcar (oldstate); |
| 920 | state.instring = !NULL (tem) ? XINT (tem) : -1; | 920 | state.instring = !NILP (tem) ? XINT (tem) : -1; |
| 921 | 921 | ||
| 922 | oldstate = Fcdr (oldstate); | 922 | oldstate = Fcdr (oldstate); |
| 923 | tem = Fcar (oldstate); | 923 | tem = Fcar (oldstate); |
| 924 | state.incomment = !NULL (tem); | 924 | state.incomment = !NILP (tem); |
| 925 | 925 | ||
| 926 | oldstate = Fcdr (oldstate); | 926 | oldstate = Fcdr (oldstate); |
| 927 | tem = Fcar (oldstate); | 927 | tem = Fcar (oldstate); |
| 928 | start_quoted = !NULL (tem); | 928 | start_quoted = !NILP (tem); |
| 929 | } | 929 | } |
| 930 | state.quoted = 0; | 930 | state.quoted = 0; |
| 931 | mindepth = depth; | 931 | mindepth = depth; |
| @@ -1125,7 +1125,7 @@ DEFUN ("parse-partial-sexp", Fparse_partial_sexp, Sparse_partial_sexp, 2, 5, 0, | |||
| 1125 | struct lisp_parse_state state; | 1125 | struct lisp_parse_state state; |
| 1126 | int target; | 1126 | int target; |
| 1127 | 1127 | ||
| 1128 | if (!NULL (targetdepth)) | 1128 | if (!NILP (targetdepth)) |
| 1129 | { | 1129 | { |
| 1130 | CHECK_NUMBER (targetdepth, 3); | 1130 | CHECK_NUMBER (targetdepth, 3); |
| 1131 | target = XINT (targetdepth); | 1131 | target = XINT (targetdepth); |
| @@ -1135,7 +1135,7 @@ DEFUN ("parse-partial-sexp", Fparse_partial_sexp, Sparse_partial_sexp, 2, 5, 0, | |||
| 1135 | 1135 | ||
| 1136 | validate_region (&from, &to); | 1136 | validate_region (&from, &to); |
| 1137 | state = *scan_sexps_forward (XINT (from), XINT (to), | 1137 | state = *scan_sexps_forward (XINT (from), XINT (to), |
| 1138 | target, !NULL (stopbefore), oldstate); | 1138 | target, !NILP (stopbefore), oldstate); |
| 1139 | 1139 | ||
| 1140 | SET_PT (state.location); | 1140 | SET_PT (state.location); |
| 1141 | 1141 | ||
diff --git a/src/termhooks.h b/src/termhooks.h index d414149ca95..ff1df84059d 100644 --- a/src/termhooks.h +++ b/src/termhooks.h | |||
| @@ -45,37 +45,30 @@ extern int (*set_terminal_window_hook) (); | |||
| 45 | 45 | ||
| 46 | extern int (*read_socket_hook) (); | 46 | extern int (*read_socket_hook) (); |
| 47 | 47 | ||
| 48 | /* Hook for Emacs to call to tell the window-system-specific code to | 48 | /* Return the current position of the mouse. This should clear |
| 49 | enable/disable low-level tracking. The value of ENABLE tells the | 49 | mouse_moved until the next motion event arrives. */ |
| 50 | window system event handler whether it should notice or ignore | 50 | extern void (*mouse_position_hook) ( /* SCREEN_PTR *s, |
| 51 | subsequent mouse movement and mouse button releases. | 51 | Lisp_Object *x, |
| 52 | 52 | Lisp_Object *y, | |
| 53 | If this is 0, Emacs should assume that there is no mouse (or at | 53 | Lisp_Object *time */ ); |
| 54 | least no mouse tracking) available. | 54 | |
| 55 | 55 | /* The window system handling code should set this if the mouse has | |
| 56 | If called with ENABLE non-zero, the window system event handler | 56 | moved since the last call to the mouse_position_hook. Calling that |
| 57 | should call set_pointer_loc with the new mouse co-ordinates | 57 | hook should clear this. */ |
| 58 | whenever the mouse moves, and enqueue a mouse button event for | 58 | extern int mouse_moved; |
| 59 | button releases as well as button presses. | ||
| 60 | |||
| 61 | If called with ENABLE zero, the window system event handler should | ||
| 62 | ignore mouse movement events, and not enqueue events for mouse | ||
| 63 | button releases. */ | ||
| 64 | extern int (*mouse_tracking_enable_hook) ( /* int ENABLE */ ); | ||
| 65 | 59 | ||
| 66 | /* When a screen's focus redirection is changed, this hook tells the | 60 | /* When a screen's focus redirection is changed, this hook tells the |
| 67 | window system code to re-decide where to put the highlight. Under | 61 | window system code to re-decide where to put the highlight. Under |
| 68 | X, this means that the system lies about where the focus is. */ | 62 | X, this means that Emacs lies about where the focus is. */ |
| 69 | extern void (*screen_rehighlight_hook) ( /* void */ ); | 63 | extern void (*screen_rehighlight_hook) ( /* void */ ); |
| 70 | 64 | ||
| 71 | /* If nonzero, send all terminal output characters to this stream also. */ | 65 | /* If nonzero, send all terminal output characters to this stream also. */ |
| 72 | |||
| 73 | extern FILE *termscript; | 66 | extern FILE *termscript; |
| 74 | 67 | ||
| 75 | #ifdef XINT | ||
| 76 | /* Expedient hack: only provide the below definitions to files that | 68 | /* Expedient hack: only provide the below definitions to files that |
| 77 | are prepared to handle lispy things. XINT is defined iff lisp.h | 69 | are prepared to handle lispy things. XINT is defined iff lisp.h |
| 78 | has been included in the file before this file. */ | 70 | has been included before this file. */ |
| 71 | #ifdef XINT | ||
| 79 | 72 | ||
| 80 | /* The keyboard input buffer is an array of these structures. Each one | 73 | /* The keyboard input buffer is an array of these structures. Each one |
| 81 | represents some sort of input event - a keystroke, a mouse click, or | 74 | represents some sort of input event - a keystroke, a mouse click, or |
| @@ -93,8 +86,9 @@ struct input_event { | |||
| 93 | was typed. | 86 | was typed. |
| 94 | Note that this includes meta-keys, and | 87 | Note that this includes meta-keys, and |
| 95 | the modifiers field of the event | 88 | the modifiers field of the event |
| 96 | is unused. */ | 89 | is unused. |
| 97 | 90 | .timestamp gives a timestamp (in | |
| 91 | milliseconds) for the keystroke. */ | ||
| 98 | non_ascii_keystroke, /* .code is a number identifying the | 92 | non_ascii_keystroke, /* .code is a number identifying the |
| 99 | function key. A code N represents | 93 | function key. A code N represents |
| 100 | a key whose name is | 94 | a key whose name is |
| @@ -104,7 +98,9 @@ struct input_event { | |||
| 104 | .modifiers holds the state of the | 98 | .modifiers holds the state of the |
| 105 | modifier keys. | 99 | modifier keys. |
| 106 | .screen is the screen in which the key | 100 | .screen is the screen in which the key |
| 107 | was typed. */ | 101 | was typed. |
| 102 | .timestamp gives a timestamp (in | ||
| 103 | milliseconds) for the keystroke. */ | ||
| 108 | mouse_click, /* The button number is in .code. | 104 | mouse_click, /* The button number is in .code. |
| 109 | .modifiers holds the state of the | 105 | .modifiers holds the state of the |
| 110 | modifier keys. | 106 | modifier keys. |
diff --git a/src/undo.c b/src/undo.c index 2993dc77d5e..852771764f1 100644 --- a/src/undo.c +++ b/src/undo.c | |||
| @@ -127,7 +127,7 @@ but another undo command will undo to the previous boundary.") | |||
| 127 | if (EQ (current_buffer->undo_list, Qt)) | 127 | if (EQ (current_buffer->undo_list, Qt)) |
| 128 | return Qnil; | 128 | return Qnil; |
| 129 | tem = Fcar (current_buffer->undo_list); | 129 | tem = Fcar (current_buffer->undo_list); |
| 130 | if (!NULL (tem)) | 130 | if (!NILP (tem)) |
| 131 | current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list); | 131 | current_buffer->undo_list = Fcons (Qnil, current_buffer->undo_list); |
| 132 | return Qnil; | 132 | return Qnil; |
| 133 | } | 133 | } |
| @@ -197,7 +197,7 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 197 | either before or after it. The lower threshold, MINSIZE, | 197 | either before or after it. The lower threshold, MINSIZE, |
| 198 | tells us to truncate after it. If its size pushes past | 198 | tells us to truncate after it. If its size pushes past |
| 199 | the higher threshold MAXSIZE as well, we truncate before it. */ | 199 | the higher threshold MAXSIZE as well, we truncate before it. */ |
| 200 | if (NULL (elt)) | 200 | if (NILP (elt)) |
| 201 | { | 201 | { |
| 202 | if (size_so_far > maxsize) | 202 | if (size_so_far > maxsize) |
| 203 | break; | 203 | break; |
| @@ -222,11 +222,11 @@ truncate_undo_list (list, minsize, maxsize) | |||
| 222 | } | 222 | } |
| 223 | 223 | ||
| 224 | /* If we scanned the whole list, it is short enough; don't change it. */ | 224 | /* If we scanned the whole list, it is short enough; don't change it. */ |
| 225 | if (NULL (next)) | 225 | if (NILP (next)) |
| 226 | return list; | 226 | return list; |
| 227 | 227 | ||
| 228 | /* Truncate at the boundary where we decided to truncate. */ | 228 | /* Truncate at the boundary where we decided to truncate. */ |
| 229 | if (!NULL (last_boundary)) | 229 | if (!NILP (last_boundary)) |
| 230 | { | 230 | { |
| 231 | XCONS (last_boundary)->cdr = Qnil; | 231 | XCONS (last_boundary)->cdr = Qnil; |
| 232 | return list; | 232 | return list; |
| @@ -249,7 +249,7 @@ Return what remains of the list.") | |||
| 249 | /* If the head of the list is a boundary, it is the boundary | 249 | /* If the head of the list is a boundary, it is the boundary |
| 250 | preceding this command. Get rid of it and don't count it. */ | 250 | preceding this command. Get rid of it and don't count it. */ |
| 251 | tem = Fcar (list); | 251 | tem = Fcar (list); |
| 252 | if (NULL (tem)) | 252 | if (NILP (tem)) |
| 253 | list = Fcdr (list); | 253 | list = Fcdr (list); |
| 254 | #endif | 254 | #endif |
| 255 | 255 | ||
| @@ -260,7 +260,7 @@ Return what remains of the list.") | |||
| 260 | Lisp_Object next, car, cdr; | 260 | Lisp_Object next, car, cdr; |
| 261 | next = Fcar (list); | 261 | next = Fcar (list); |
| 262 | list = Fcdr (list); | 262 | list = Fcdr (list); |
| 263 | if (NULL (next)) | 263 | if (NILP (next)) |
| 264 | break; | 264 | break; |
| 265 | car = Fcar (next); | 265 | car = Fcar (next); |
| 266 | cdr = Fcdr (next); | 266 | cdr = Fcdr (next); |
diff --git a/src/unexaix.c b/src/unexaix.c index a1adff12ec9..b2b3dd14e45 100644 --- a/src/unexaix.c +++ b/src/unexaix.c | |||
| @@ -5,8 +5,8 @@ | |||
| 5 | when Emacs was dumped, the dumped data won't work. | 5 | when Emacs was dumped, the dumped data won't work. |
| 6 | No one has been able to prevent the address from varying. | 6 | No one has been able to prevent the address from varying. |
| 7 | 7 | ||
| 8 | The following comments should be in etc/MACHINES if this dumping | 8 | The following comments should be in share-lib/MACHINES if this |
| 9 | is ever made to work: | 9 | dumping is ever made to work: |
| 10 | 10 | ||
| 11 | Note that Emacs can store the pure Lisp data in a shared segment on | 11 | Note that Emacs can store the pure Lisp data in a shared segment on |
| 12 | this machine, but only if you put this command in one of the boot | 12 | this machine, but only if you put this command in one of the boot |
diff --git a/src/unexec.c b/src/unexec.c index ccd67451203..4d4cf20fd55 100644 --- a/src/unexec.c +++ b/src/unexec.c | |||
| @@ -74,6 +74,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 74 | * COFF | 74 | * COFF |
| 75 | 75 | ||
| 76 | Define this if your system uses COFF for executables. | 76 | Define this if your system uses COFF for executables. |
| 77 | |||
| 78 | * COFF_ENCAPSULATE | ||
| 79 | |||
| 80 | Define this if you are using the GNU coff encapsulated a.out format. | ||
| 81 | This is closer to a.out than COFF. You should *not* define COFF if | ||
| 82 | you define COFF_ENCAPSULATE | ||
| 83 | |||
| 77 | Otherwise we assume you use Berkeley format. | 84 | Otherwise we assume you use Berkeley format. |
| 78 | 85 | ||
| 79 | * NO_REMAP | 86 | * NO_REMAP |
| @@ -165,7 +172,13 @@ pointer looks like an int) but not on all machines. | |||
| 165 | 172 | ||
| 166 | #ifndef CANNOT_UNEXEC /* most of rest of file */ | 173 | #ifndef CANNOT_UNEXEC /* most of rest of file */ |
| 167 | 174 | ||
| 175 | #ifdef COFF_ENCAPSULATE | ||
| 176 | int need_coff_header = 1; | ||
| 177 | #include <coff-encap/a.out.encap.h> /* The location might be a poor assumption */ | ||
| 178 | #else | ||
| 168 | #include <a.out.h> | 179 | #include <a.out.h> |
| 180 | #endif | ||
| 181 | |||
| 169 | /* Define getpagesize () if the system does not. | 182 | /* Define getpagesize () if the system does not. |
| 170 | Note that this may depend on symbols defined in a.out.h | 183 | Note that this may depend on symbols defined in a.out.h |
| 171 | */ | 184 | */ |
| @@ -173,7 +186,7 @@ pointer looks like an int) but not on all machines. | |||
| 173 | 186 | ||
| 174 | #ifndef makedev /* Try to detect types.h already loaded */ | 187 | #ifndef makedev /* Try to detect types.h already loaded */ |
| 175 | #include <sys/types.h> | 188 | #include <sys/types.h> |
| 176 | #endif | 189 | #endif /* makedev */ |
| 177 | #include <stdio.h> | 190 | #include <stdio.h> |
| 178 | #include <sys/stat.h> | 191 | #include <sys/stat.h> |
| 179 | #include <errno.h> | 192 | #include <errno.h> |
| @@ -218,7 +231,7 @@ static EXEC_HDR_TYPE hdr, ohdr; | |||
| 218 | 231 | ||
| 219 | #else /* not HPUX */ | 232 | #else /* not HPUX */ |
| 220 | 233 | ||
| 221 | #if defined (USG) && !defined (IBMAIX) && !defined (IRIS) | 234 | #if defined (USG) && !defined (IBMAIX) && !defined (IRIS) && !defined (COFF_ENCAPSULATE) |
| 222 | static struct bhdr hdr, ohdr; | 235 | static struct bhdr hdr, ohdr; |
| 223 | #define a_magic fmagic | 236 | #define a_magic fmagic |
| 224 | #define a_text tsize | 237 | #define a_text tsize |
| @@ -241,6 +254,11 @@ static EXEC_HDR_TYPE hdr, ohdr; | |||
| 241 | static int unexec_text_start; | 254 | static int unexec_text_start; |
| 242 | static int unexec_data_start; | 255 | static int unexec_data_start; |
| 243 | 256 | ||
| 257 | #ifdef COFF_ENCAPSULATE | ||
| 258 | /* coffheader is defined in the GNU a.out.encap.h file. */ | ||
| 259 | struct coffheader coffheader; | ||
| 260 | #endif | ||
| 261 | |||
| 244 | #endif /* not COFF */ | 262 | #endif /* not COFF */ |
| 245 | 263 | ||
| 246 | static int pagemask; | 264 | static int pagemask; |
| @@ -624,6 +642,16 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 624 | /* Get symbol table info from header of a.out file if given one. */ | 642 | /* Get symbol table info from header of a.out file if given one. */ |
| 625 | if (a_out >= 0) | 643 | if (a_out >= 0) |
| 626 | { | 644 | { |
| 645 | #ifdef COFF_ENCAPSULATE | ||
| 646 | if (read (a_out, &coffheader, sizeof coffheader) != sizeof coffheader) | ||
| 647 | { | ||
| 648 | PERROR(a_name); | ||
| 649 | } | ||
| 650 | if (coffheader.f_magic != COFF_MAGIC) | ||
| 651 | { | ||
| 652 | ERROR1("%s doesn't have legal coff magic number\n", a_name); | ||
| 653 | } | ||
| 654 | #endif | ||
| 627 | if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr) | 655 | if (read (a_out, &ohdr, sizeof hdr) != sizeof hdr) |
| 628 | { | 656 | { |
| 629 | PERROR (a_name); | 657 | PERROR (a_name); |
| @@ -637,7 +665,14 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 637 | } | 665 | } |
| 638 | else | 666 | else |
| 639 | { | 667 | { |
| 668 | #ifdef COFF_ENCAPSULATE | ||
| 669 | /* We probably could without too much trouble. The code is in gld | ||
| 670 | * but I don't have that much time or incentive. | ||
| 671 | */ | ||
| 672 | ERROR0 ("can't build a COFF file from scratch yet"); | ||
| 673 | #else | ||
| 640 | bzero (hdr, sizeof hdr); | 674 | bzero (hdr, sizeof hdr); |
| 675 | #endif | ||
| 641 | } | 676 | } |
| 642 | 677 | ||
| 643 | unexec_text_start = (long) start_of_text (); | 678 | unexec_text_start = (long) start_of_text (); |
| @@ -666,6 +701,32 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 666 | 701 | ||
| 667 | #endif /* not NO_REMAP */ | 702 | #endif /* not NO_REMAP */ |
| 668 | 703 | ||
| 704 | #ifdef COFF_ENCAPSULATE | ||
| 705 | /* We are encapsulating BSD format within COFF format. */ | ||
| 706 | { | ||
| 707 | struct coffscn *tp, *dp, *bp; | ||
| 708 | tp = &coffheader.scns[0]; | ||
| 709 | dp = &coffheader.scns[1]; | ||
| 710 | bp = &coffheader.scns[2]; | ||
| 711 | tp->s_size = hdr.a_text + sizeof(struct exec); | ||
| 712 | dp->s_paddr = data_start; | ||
| 713 | dp->s_vaddr = data_start; | ||
| 714 | dp->s_size = hdr.a_data; | ||
| 715 | bp->s_paddr = dp->s_vaddr + dp->s_size; | ||
| 716 | bp->s_vaddr = bp->s_paddr; | ||
| 717 | bp->s_size = hdr.a_bss; | ||
| 718 | coffheader.tsize = tp->s_size; | ||
| 719 | coffheader.dsize = dp->s_size; | ||
| 720 | coffheader.bsize = bp->s_size; | ||
| 721 | coffheader.text_start = tp->s_vaddr; | ||
| 722 | coffheader.data_start = dp->s_vaddr; | ||
| 723 | } | ||
| 724 | if (write (new, &coffheader, sizeof coffheader) != sizeof coffheader) | ||
| 725 | { | ||
| 726 | PERROR(new_name); | ||
| 727 | } | ||
| 728 | #endif /* COFF_ENCAPSULATE */ | ||
| 729 | |||
| 669 | if (write (new, &hdr, sizeof hdr) != sizeof hdr) | 730 | if (write (new, &hdr, sizeof hdr) != sizeof hdr) |
| 670 | { | 731 | { |
| 671 | PERROR (new_name); | 732 | PERROR (new_name); |
diff --git a/src/window.c b/src/window.c index a6e1d9c6c31..738227726f2 100644 --- a/src/window.c +++ b/src/window.c | |||
| @@ -182,7 +182,7 @@ POS defaults to point; WINDOW, to the selected window.") | |||
| 182 | register struct buffer *buf; | 182 | register struct buffer *buf; |
| 183 | struct position posval; | 183 | struct position posval; |
| 184 | 184 | ||
| 185 | if (NULL (pos)) | 185 | if (NILP (pos)) |
| 186 | posint = point; | 186 | posint = point; |
| 187 | else | 187 | else |
| 188 | { | 188 | { |
| @@ -190,7 +190,7 @@ POS defaults to point; WINDOW, to the selected window.") | |||
| 190 | posint = XINT (pos); | 190 | posint = XINT (pos); |
| 191 | } | 191 | } |
| 192 | 192 | ||
| 193 | if (NULL (window)) | 193 | if (NILP (window)) |
| 194 | window = selected_window; | 194 | window = selected_window; |
| 195 | else | 195 | else |
| 196 | CHECK_WINDOW (window, 1); | 196 | CHECK_WINDOW (window, 1); |
| @@ -232,7 +232,7 @@ static struct window * | |||
| 232 | decode_window (window) | 232 | decode_window (window) |
| 233 | register Lisp_Object window; | 233 | register Lisp_Object window; |
| 234 | { | 234 | { |
| 235 | if (NULL (window)) | 235 | if (NILP (window)) |
| 236 | return XWINDOW (selected_window); | 236 | return XWINDOW (selected_window); |
| 237 | 237 | ||
| 238 | CHECK_WINDOW (window, 0); | 238 | CHECK_WINDOW (window, 0); |
| @@ -433,7 +433,7 @@ which are relative to 0,0 at the top left corner of the screen.") | |||
| 433 | { | 433 | { |
| 434 | int part; | 434 | int part; |
| 435 | 435 | ||
| 436 | if (NULL (screen)) | 436 | if (NILP (screen)) |
| 437 | XSET (screen, Lisp_Screen, selected_screen); | 437 | XSET (screen, Lisp_Screen, selected_screen); |
| 438 | else | 438 | else |
| 439 | CHECK_LIVE_SCREEN (screen, 0); | 439 | CHECK_LIVE_SCREEN (screen, 0); |
| @@ -519,7 +519,7 @@ from overriding motion of point in order to display at this exact start.") | |||
| 519 | set_marker_restricted (w->start, pos, w->buffer); | 519 | set_marker_restricted (w->start, pos, w->buffer); |
| 520 | /* this is not right, but much easier than doing what is right. */ | 520 | /* this is not right, but much easier than doing what is right. */ |
| 521 | w->start_at_line_beg = Qnil; | 521 | w->start_at_line_beg = Qnil; |
| 522 | if (NULL (noforce)) | 522 | if (NILP (noforce)) |
| 523 | w->force_start = Qt; | 523 | w->force_start = Qt; |
| 524 | w->update_mode_line = Qt; | 524 | w->update_mode_line = Qt; |
| 525 | XFASTINT (w->last_modified) = 0; | 525 | XFASTINT (w->last_modified) = 0; |
| @@ -549,7 +549,7 @@ buffer appears in it currently).") | |||
| 549 | { | 549 | { |
| 550 | register struct window *w = decode_window (window); | 550 | register struct window *w = decode_window (window); |
| 551 | 551 | ||
| 552 | if (NULL (arg)) | 552 | if (NILP (arg)) |
| 553 | w->dedicated = Qnil; | 553 | w->dedicated = Qnil; |
| 554 | else | 554 | else |
| 555 | { | 555 | { |
| @@ -652,15 +652,15 @@ replace_window (old, replacement) | |||
| 652 | p->height = o->height; | 652 | p->height = o->height; |
| 653 | 653 | ||
| 654 | p->next = tem = o->next; | 654 | p->next = tem = o->next; |
| 655 | if (!NULL (tem)) | 655 | if (!NILP (tem)) |
| 656 | XWINDOW (tem)->prev = replacement; | 656 | XWINDOW (tem)->prev = replacement; |
| 657 | 657 | ||
| 658 | p->prev = tem = o->prev; | 658 | p->prev = tem = o->prev; |
| 659 | if (!NULL (tem)) | 659 | if (!NILP (tem)) |
| 660 | XWINDOW (tem)->next = replacement; | 660 | XWINDOW (tem)->next = replacement; |
| 661 | 661 | ||
| 662 | p->parent = tem = o->parent; | 662 | p->parent = tem = o->parent; |
| 663 | if (!NULL (tem)) | 663 | if (!NILP (tem)) |
| 664 | { | 664 | { |
| 665 | if (EQ (XWINDOW (tem)->vchild, old)) | 665 | if (EQ (XWINDOW (tem)->vchild, old)) |
| 666 | XWINDOW (tem)->vchild = replacement; | 666 | XWINDOW (tem)->vchild = replacement; |
| @@ -682,14 +682,14 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 682 | register struct window *p; | 682 | register struct window *p; |
| 683 | register struct window *par; | 683 | register struct window *par; |
| 684 | 684 | ||
| 685 | if (NULL (window)) | 685 | if (NILP (window)) |
| 686 | window = selected_window; | 686 | window = selected_window; |
| 687 | else | 687 | else |
| 688 | CHECK_WINDOW (window, 0); | 688 | CHECK_WINDOW (window, 0); |
| 689 | 689 | ||
| 690 | p = XWINDOW (window); | 690 | p = XWINDOW (window); |
| 691 | parent = p->parent; | 691 | parent = p->parent; |
| 692 | if (NULL (parent)) | 692 | if (NILP (parent)) |
| 693 | error ("Attempt to delete minibuffer or sole ordinary window"); | 693 | error ("Attempt to delete minibuffer or sole ordinary window"); |
| 694 | par = XWINDOW (parent); | 694 | par = XWINDOW (parent); |
| 695 | 695 | ||
| @@ -701,7 +701,7 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 701 | tem = p->buffer; | 701 | tem = p->buffer; |
| 702 | /* tem is null for dummy parent windows | 702 | /* tem is null for dummy parent windows |
| 703 | (which have inferiors but not any contents themselves) */ | 703 | (which have inferiors but not any contents themselves) */ |
| 704 | if (!NULL (tem)) | 704 | if (!NILP (tem)) |
| 705 | { | 705 | { |
| 706 | unshow_buffer (p); | 706 | unshow_buffer (p); |
| 707 | unchain_marker (p->pointm); | 707 | unchain_marker (p->pointm); |
| @@ -710,11 +710,11 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 710 | } | 710 | } |
| 711 | 711 | ||
| 712 | tem = p->next; | 712 | tem = p->next; |
| 713 | if (!NULL (tem)) | 713 | if (!NILP (tem)) |
| 714 | XWINDOW (tem)->prev = p->prev; | 714 | XWINDOW (tem)->prev = p->prev; |
| 715 | 715 | ||
| 716 | tem = p->prev; | 716 | tem = p->prev; |
| 717 | if (!NULL (tem)) | 717 | if (!NILP (tem)) |
| 718 | XWINDOW (tem)->next = p->next; | 718 | XWINDOW (tem)->next = p->next; |
| 719 | 719 | ||
| 720 | if (EQ (window, par->hchild)) | 720 | if (EQ (window, par->hchild)) |
| @@ -724,7 +724,7 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 724 | 724 | ||
| 725 | /* Find one of our siblings to give our space to. */ | 725 | /* Find one of our siblings to give our space to. */ |
| 726 | sib = p->prev; | 726 | sib = p->prev; |
| 727 | if (NULL (sib)) | 727 | if (NILP (sib)) |
| 728 | { | 728 | { |
| 729 | /* If p gives its space to its next sibling, that sibling needs | 729 | /* If p gives its space to its next sibling, that sibling needs |
| 730 | to have its top/left side pulled back to where p's is. | 730 | to have its top/left side pulled back to where p's is. |
| @@ -736,11 +736,11 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 736 | } | 736 | } |
| 737 | 737 | ||
| 738 | /* Stretch that sibling. */ | 738 | /* Stretch that sibling. */ |
| 739 | if (!NULL (par->vchild)) | 739 | if (!NILP (par->vchild)) |
| 740 | set_window_height (sib, | 740 | set_window_height (sib, |
| 741 | XFASTINT (XWINDOW (sib)->height) + XFASTINT (p->height), | 741 | XFASTINT (XWINDOW (sib)->height) + XFASTINT (p->height), |
| 742 | 1); | 742 | 1); |
| 743 | if (!NULL (par->hchild)) | 743 | if (!NILP (par->hchild)) |
| 744 | set_window_width (sib, | 744 | set_window_width (sib, |
| 745 | XFASTINT (XWINDOW (sib)->width) + XFASTINT (p->width), | 745 | XFASTINT (XWINDOW (sib)->width) + XFASTINT (p->width), |
| 746 | 1); | 746 | 1); |
| @@ -749,9 +749,9 @@ DEFUN ("delete-window", Fdelete_window, Sdelete_window, 0, 1, "", | |||
| 749 | put the child into the parent's place. */ | 749 | put the child into the parent's place. */ |
| 750 | 750 | ||
| 751 | tem = par->hchild; | 751 | tem = par->hchild; |
| 752 | if (NULL (tem)) | 752 | if (NILP (tem)) |
| 753 | tem = par->vchild; | 753 | tem = par->vchild; |
| 754 | if (NULL (XWINDOW (tem)->next)) | 754 | if (NILP (XWINDOW (tem)->next)) |
| 755 | replace_window (parent, tem); | 755 | replace_window (parent, tem); |
| 756 | return Qnil; | 756 | return Qnil; |
| 757 | } | 757 | } |
| @@ -783,7 +783,7 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 783 | register Lisp_Object tem; | 783 | register Lisp_Object tem; |
| 784 | Lisp_Object start_window; | 784 | Lisp_Object start_window; |
| 785 | 785 | ||
| 786 | if (NULL (window)) | 786 | if (NILP (window)) |
| 787 | window = selected_window; | 787 | window = selected_window; |
| 788 | else | 788 | else |
| 789 | CHECK_WINDOW (window, 0); | 789 | CHECK_WINDOW (window, 0); |
| @@ -792,12 +792,12 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 792 | 792 | ||
| 793 | /* minibuf == nil may or may not include minibuffers. | 793 | /* minibuf == nil may or may not include minibuffers. |
| 794 | Decide if it does. */ | 794 | Decide if it does. */ |
| 795 | if (NULL (minibuf)) | 795 | if (NILP (minibuf)) |
| 796 | minibuf = (minibuf_level ? Qt : Qlambda); | 796 | minibuf = (minibuf_level ? Qt : Qlambda); |
| 797 | 797 | ||
| 798 | /* all_screens == nil doesn't specify which screens to include. | 798 | /* all_screens == nil doesn't specify which screens to include. |
| 799 | Decide which screens it includes. */ | 799 | Decide which screens it includes. */ |
| 800 | if (NULL (all_screens)) | 800 | if (NILP (all_screens)) |
| 801 | all_screens = (EQ (minibuf, Qt) | 801 | all_screens = (EQ (minibuf, Qt) |
| 802 | ? (SCREEN_MINIBUF_WINDOW | 802 | ? (SCREEN_MINIBUF_WINDOW |
| 803 | (XSCREEN | 803 | (XSCREEN |
| @@ -813,8 +813,8 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 813 | { | 813 | { |
| 814 | /* Find a window that actually has a next one. This loop | 814 | /* Find a window that actually has a next one. This loop |
| 815 | climbs up the tree. */ | 815 | climbs up the tree. */ |
| 816 | while (tem = XWINDOW (window)->next, NULL (tem)) | 816 | while (tem = XWINDOW (window)->next, NILP (tem)) |
| 817 | if (tem = XWINDOW (window)->parent, !NULL (tem)) | 817 | if (tem = XWINDOW (window)->parent, !NILP (tem)) |
| 818 | window = tem; | 818 | window = tem; |
| 819 | else | 819 | else |
| 820 | { | 820 | { |
| @@ -822,7 +822,7 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 822 | Which other screens are acceptable? */ | 822 | Which other screens are acceptable? */ |
| 823 | tem = WINDOW_SCREEN (XWINDOW (window)); | 823 | tem = WINDOW_SCREEN (XWINDOW (window)); |
| 824 | #ifdef MULTI_SCREEN | 824 | #ifdef MULTI_SCREEN |
| 825 | if (! NULL (all_screens)) | 825 | if (! NILP (all_screens)) |
| 826 | tem = next_screen (tem, all_screens); | 826 | tem = next_screen (tem, all_screens); |
| 827 | #endif | 827 | #endif |
| 828 | tem = SCREEN_ROOT_WINDOW (XSCREEN (tem)); | 828 | tem = SCREEN_ROOT_WINDOW (XSCREEN (tem)); |
| @@ -836,9 +836,9 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 836 | recurse on that. Otherwise, we've found the window we want. */ | 836 | recurse on that. Otherwise, we've found the window we want. */ |
| 837 | while (1) | 837 | while (1) |
| 838 | { | 838 | { |
| 839 | if (!NULL (XWINDOW (window)->hchild)) | 839 | if (!NILP (XWINDOW (window)->hchild)) |
| 840 | window = XWINDOW (window)->hchild; | 840 | window = XWINDOW (window)->hchild; |
| 841 | else if (!NULL (XWINDOW (window)->vchild)) | 841 | else if (!NILP (XWINDOW (window)->vchild)) |
| 842 | window = XWINDOW (window)->vchild; | 842 | window = XWINDOW (window)->vchild; |
| 843 | else break; | 843 | else break; |
| 844 | } | 844 | } |
| @@ -880,7 +880,7 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 880 | register Lisp_Object tem; | 880 | register Lisp_Object tem; |
| 881 | Lisp_Object start_window; | 881 | Lisp_Object start_window; |
| 882 | 882 | ||
| 883 | if (NULL (window)) | 883 | if (NILP (window)) |
| 884 | window = selected_window; | 884 | window = selected_window; |
| 885 | else | 885 | else |
| 886 | CHECK_WINDOW (window, 0); | 886 | CHECK_WINDOW (window, 0); |
| @@ -889,12 +889,12 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 889 | 889 | ||
| 890 | /* minibuf == nil may or may not include minibuffers. | 890 | /* minibuf == nil may or may not include minibuffers. |
| 891 | Decide if it does. */ | 891 | Decide if it does. */ |
| 892 | if (NULL (minibuf)) | 892 | if (NILP (minibuf)) |
| 893 | minibuf = (minibuf_level ? Qt : Qlambda); | 893 | minibuf = (minibuf_level ? Qt : Qlambda); |
| 894 | 894 | ||
| 895 | /* all_screens == nil doesn't specify which screens to include. | 895 | /* all_screens == nil doesn't specify which screens to include. |
| 896 | Decide which screens it includes. */ | 896 | Decide which screens it includes. */ |
| 897 | if (NULL (all_screens)) | 897 | if (NILP (all_screens)) |
| 898 | all_screens = (EQ (minibuf, Qt) | 898 | all_screens = (EQ (minibuf, Qt) |
| 899 | ? (SCREEN_MINIBUF_WINDOW | 899 | ? (SCREEN_MINIBUF_WINDOW |
| 900 | (XSCREEN | 900 | (XSCREEN |
| @@ -910,8 +910,8 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 910 | { | 910 | { |
| 911 | /* Find a window that actually has a previous one. This loop | 911 | /* Find a window that actually has a previous one. This loop |
| 912 | climbs up the tree. */ | 912 | climbs up the tree. */ |
| 913 | while (tem = XWINDOW (window)->prev, NULL (tem)) | 913 | while (tem = XWINDOW (window)->prev, NILP (tem)) |
| 914 | if (tem = XWINDOW (window)->parent, !NULL (tem)) | 914 | if (tem = XWINDOW (window)->parent, !NILP (tem)) |
| 915 | window = tem; | 915 | window = tem; |
| 916 | else | 916 | else |
| 917 | { | 917 | { |
| @@ -919,7 +919,7 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 919 | Which screens are acceptable? */ | 919 | Which screens are acceptable? */ |
| 920 | tem = WINDOW_SCREEN (XWINDOW (window)); | 920 | tem = WINDOW_SCREEN (XWINDOW (window)); |
| 921 | #ifdef MULTI_SCREEN | 921 | #ifdef MULTI_SCREEN |
| 922 | if (! NULL (all_screens)) | 922 | if (! NILP (all_screens)) |
| 923 | tem = next_screen (tem, all_screens); | 923 | tem = next_screen (tem, all_screens); |
| 924 | #endif | 924 | #endif |
| 925 | tem = SCREEN_ROOT_WINDOW (XSCREEN (tem)); | 925 | tem = SCREEN_ROOT_WINDOW (XSCREEN (tem)); |
| @@ -932,12 +932,12 @@ above. If neither nil nor t, restrict to WINDOW's screen.") | |||
| 932 | recurse on that. Otherwise, we've found the window we want. */ | 932 | recurse on that. Otherwise, we've found the window we want. */ |
| 933 | while (1) | 933 | while (1) |
| 934 | { | 934 | { |
| 935 | if (!NULL (XWINDOW (window)->hchild)) | 935 | if (!NILP (XWINDOW (window)->hchild)) |
| 936 | window = XWINDOW (window)->hchild; | 936 | window = XWINDOW (window)->hchild; |
| 937 | else if (!NULL (XWINDOW (window)->vchild)) | 937 | else if (!NILP (XWINDOW (window)->vchild)) |
| 938 | window = XWINDOW (window)->vchild; | 938 | window = XWINDOW (window)->vchild; |
| 939 | else break; | 939 | else break; |
| 940 | while (tem = XWINDOW (window)->next, !NULL (tem)) | 940 | while (tem = XWINDOW (window)->next, !NILP (tem)) |
| 941 | window = tem; | 941 | window = tem; |
| 942 | } | 942 | } |
| 943 | } | 943 | } |
| @@ -1018,7 +1018,7 @@ window_loop (type, obj, mini, screens) | |||
| 1018 | on all screens, screen is 0. */ | 1018 | on all screens, screen is 0. */ |
| 1019 | if (SCREENP (screens)) | 1019 | if (SCREENP (screens)) |
| 1020 | screen = XSCREEN (screens); | 1020 | screen = XSCREEN (screens); |
| 1021 | else if (NULL (screens)) | 1021 | else if (NILP (screens)) |
| 1022 | screen = selected_screen; | 1022 | screen = selected_screen; |
| 1023 | else | 1023 | else |
| 1024 | screen = 0; | 1024 | screen = 0; |
| @@ -1063,7 +1063,7 @@ window_loop (type, obj, mini, screens) | |||
| 1063 | 1063 | ||
| 1064 | case GET_LRU_WINDOW: | 1064 | case GET_LRU_WINDOW: |
| 1065 | /* t as arg means consider only full-width windows */ | 1065 | /* t as arg means consider only full-width windows */ |
| 1066 | if (!NULL (obj) && XFASTINT (XWINDOW (w)->width) != screen->width) | 1066 | if (!NILP (obj) && XFASTINT (XWINDOW (w)->width) != screen->width) |
| 1067 | break; | 1067 | break; |
| 1068 | #if 0 | 1068 | #if 0 |
| 1069 | /* Ignore invisible and iconified screens. */ | 1069 | /* Ignore invisible and iconified screens. */ |
| @@ -1073,9 +1073,9 @@ window_loop (type, obj, mini, screens) | |||
| 1073 | #endif | 1073 | #endif |
| 1074 | /* Ignore dedicated windows and minibuffers. */ | 1074 | /* Ignore dedicated windows and minibuffers. */ |
| 1075 | if (MINI_WINDOW_P (XWINDOW (w)) | 1075 | if (MINI_WINDOW_P (XWINDOW (w)) |
| 1076 | || !NULL (XWINDOW (w)->dedicated)) | 1076 | || !NILP (XWINDOW (w)->dedicated)) |
| 1077 | break; | 1077 | break; |
| 1078 | if (NULL (best_window) | 1078 | if (NILP (best_window) |
| 1079 | || (XFASTINT (XWINDOW (best_window)->use_time) | 1079 | || (XFASTINT (XWINDOW (best_window)->use_time) |
| 1080 | > XFASTINT (XWINDOW (w)->use_time))) | 1080 | > XFASTINT (XWINDOW (w)->use_time))) |
| 1081 | best_window = w; | 1081 | best_window = w; |
| @@ -1091,10 +1091,10 @@ window_loop (type, obj, mini, screens) | |||
| 1091 | { | 1091 | { |
| 1092 | /* If we're deleting the buffer displayed in the only window | 1092 | /* If we're deleting the buffer displayed in the only window |
| 1093 | on the screen, find a new buffer to display there. */ | 1093 | on the screen, find a new buffer to display there. */ |
| 1094 | if (NULL (XWINDOW (w)->parent)) | 1094 | if (NILP (XWINDOW (w)->parent)) |
| 1095 | { | 1095 | { |
| 1096 | Lisp_Object new_buffer = Fother_buffer (obj); | 1096 | Lisp_Object new_buffer = Fother_buffer (obj); |
| 1097 | if (NULL (new_buffer)) | 1097 | if (NILP (new_buffer)) |
| 1098 | new_buffer | 1098 | new_buffer |
| 1099 | = Fget_buffer_create (build_string ("*scratch*")); | 1099 | = Fget_buffer_create (build_string ("*scratch*")); |
| 1100 | Fset_window_buffer (w, new_buffer); | 1100 | Fset_window_buffer (w, new_buffer); |
| @@ -1114,12 +1114,12 @@ window_loop (type, obj, mini, screens) | |||
| 1114 | #endif | 1114 | #endif |
| 1115 | /* Ignore dedicated windows and minibuffers. */ | 1115 | /* Ignore dedicated windows and minibuffers. */ |
| 1116 | if (MINI_WINDOW_P (XWINDOW (w)) | 1116 | if (MINI_WINDOW_P (XWINDOW (w)) |
| 1117 | || !NULL (XWINDOW (w)->dedicated)) | 1117 | || !NILP (XWINDOW (w)->dedicated)) |
| 1118 | break; | 1118 | break; |
| 1119 | { | 1119 | { |
| 1120 | struct window *best_window_ptr = XWINDOW (best_window); | 1120 | struct window *best_window_ptr = XWINDOW (best_window); |
| 1121 | struct window *w_ptr = XWINDOW (w); | 1121 | struct window *w_ptr = XWINDOW (w); |
| 1122 | if (NULL (best_window) || | 1122 | if (NILP (best_window) || |
| 1123 | (XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)) | 1123 | (XFASTINT (w_ptr->height) * XFASTINT (w_ptr->width)) |
| 1124 | > (XFASTINT (best_window_ptr->height) | 1124 | > (XFASTINT (best_window_ptr->height) |
| 1125 | * XFASTINT (best_window_ptr->width))) | 1125 | * XFASTINT (best_window_ptr->width))) |
| @@ -1132,7 +1132,7 @@ window_loop (type, obj, mini, screens) | |||
| 1132 | { | 1132 | { |
| 1133 | /* Find another buffer to show in this window. */ | 1133 | /* Find another buffer to show in this window. */ |
| 1134 | Lisp_Object another_buffer = Fother_buffer (obj); | 1134 | Lisp_Object another_buffer = Fother_buffer (obj); |
| 1135 | if (NULL (another_buffer)) | 1135 | if (NILP (another_buffer)) |
| 1136 | another_buffer | 1136 | another_buffer |
| 1137 | = Fget_buffer_create (build_string ("*scratch*")); | 1137 | = Fget_buffer_create (build_string ("*scratch*")); |
| 1138 | Fset_window_buffer (w, another_buffer); | 1138 | Fset_window_buffer (w, another_buffer); |
| @@ -1158,7 +1158,7 @@ screen, search only that screen.\n") | |||
| 1158 | register Lisp_Object w; | 1158 | register Lisp_Object w; |
| 1159 | /* First try for a window that is full-width */ | 1159 | /* First try for a window that is full-width */ |
| 1160 | w = window_loop (GET_LRU_WINDOW, Qt, 0, screens); | 1160 | w = window_loop (GET_LRU_WINDOW, Qt, 0, screens); |
| 1161 | if (!NULL (w) && !EQ (w, selected_window)) | 1161 | if (!NILP (w) && !EQ (w, selected_window)) |
| 1162 | return w; | 1162 | return w; |
| 1163 | /* If none of them, try the rest */ | 1163 | /* If none of them, try the rest */ |
| 1164 | return window_loop (GET_LRU_WINDOW, Qnil, 0, screens); | 1164 | return window_loop (GET_LRU_WINDOW, Qnil, 0, screens); |
| @@ -1201,7 +1201,7 @@ Only the screen WINDOW is on is affected.") | |||
| 1201 | struct buffer *obuf = current_buffer; | 1201 | struct buffer *obuf = current_buffer; |
| 1202 | int top; | 1202 | int top; |
| 1203 | 1203 | ||
| 1204 | if (NULL (window)) | 1204 | if (NILP (window)) |
| 1205 | window = selected_window; | 1205 | window = selected_window; |
| 1206 | else | 1206 | else |
| 1207 | CHECK_WINDOW (window, 0); | 1207 | CHECK_WINDOW (window, 0); |
| @@ -1226,7 +1226,7 @@ DEFUN ("delete-windows-on", Fdelete_windows_on, Sdelete_windows_on, | |||
| 1226 | (buffer) | 1226 | (buffer) |
| 1227 | Lisp_Object buffer; | 1227 | Lisp_Object buffer; |
| 1228 | { | 1228 | { |
| 1229 | if (!NULL (buffer)) | 1229 | if (!NILP (buffer)) |
| 1230 | { | 1230 | { |
| 1231 | buffer = Fget_buffer (buffer); | 1231 | buffer = Fget_buffer (buffer); |
| 1232 | CHECK_BUFFER (buffer, 0); | 1232 | CHECK_BUFFER (buffer, 0); |
| @@ -1242,7 +1242,7 @@ DEFUN ("replace-buffer-in-windows", Freplace_buffer_in_windows, | |||
| 1242 | (buffer) | 1242 | (buffer) |
| 1243 | Lisp_Object buffer; | 1243 | Lisp_Object buffer; |
| 1244 | { | 1244 | { |
| 1245 | if (!NULL (buffer)) | 1245 | if (!NILP (buffer)) |
| 1246 | { | 1246 | { |
| 1247 | buffer = Fget_buffer (buffer); | 1247 | buffer = Fget_buffer (buffer); |
| 1248 | CHECK_BUFFER (buffer, 0); | 1248 | CHECK_BUFFER (buffer, 0); |
| @@ -1268,7 +1268,7 @@ set_window_height (window, height, nodelete) | |||
| 1268 | Lisp_Object child; | 1268 | Lisp_Object child; |
| 1269 | 1269 | ||
| 1270 | if (!nodelete | 1270 | if (!nodelete |
| 1271 | && ! NULL (w->parent) | 1271 | && ! NILP (w->parent) |
| 1272 | && height < window_min_height) | 1272 | && height < window_min_height) |
| 1273 | { | 1273 | { |
| 1274 | Fdelete_window (window); | 1274 | Fdelete_window (window); |
| @@ -1278,19 +1278,19 @@ set_window_height (window, height, nodelete) | |||
| 1278 | XFASTINT (w->last_modified) = 0; | 1278 | XFASTINT (w->last_modified) = 0; |
| 1279 | windows_or_buffers_changed++; | 1279 | windows_or_buffers_changed++; |
| 1280 | XFASTINT (w->height) = height; | 1280 | XFASTINT (w->height) = height; |
| 1281 | if (!NULL (w->hchild)) | 1281 | if (!NILP (w->hchild)) |
| 1282 | { | 1282 | { |
| 1283 | for (child = w->hchild; !NULL (child); child = XWINDOW (child)->next) | 1283 | for (child = w->hchild; !NILP (child); child = XWINDOW (child)->next) |
| 1284 | { | 1284 | { |
| 1285 | XWINDOW (child)->top = w->top; | 1285 | XWINDOW (child)->top = w->top; |
| 1286 | set_window_height (child, height, nodelete); | 1286 | set_window_height (child, height, nodelete); |
| 1287 | } | 1287 | } |
| 1288 | } | 1288 | } |
| 1289 | else if (!NULL (w->vchild)) | 1289 | else if (!NILP (w->vchild)) |
| 1290 | { | 1290 | { |
| 1291 | lastbot = top = XFASTINT (w->top); | 1291 | lastbot = top = XFASTINT (w->top); |
| 1292 | lastobot = 0; | 1292 | lastobot = 0; |
| 1293 | for (child = w->vchild; !NULL (child); child = c->next) | 1293 | for (child = w->vchild; !NILP (child); child = c->next) |
| 1294 | { | 1294 | { |
| 1295 | c = XWINDOW (child); | 1295 | c = XWINDOW (child); |
| 1296 | 1296 | ||
| @@ -1310,7 +1310,7 @@ set_window_height (window, height, nodelete) | |||
| 1310 | } | 1310 | } |
| 1311 | /* Now delete any children that became too small. */ | 1311 | /* Now delete any children that became too small. */ |
| 1312 | if (!nodelete) | 1312 | if (!nodelete) |
| 1313 | for (child = w->vchild; !NULL (child); child = XWINDOW (child)->next) | 1313 | for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) |
| 1314 | { | 1314 | { |
| 1315 | set_window_height (child, XINT (XWINDOW (child)->height), 0); | 1315 | set_window_height (child, XINT (XWINDOW (child)->height), 0); |
| 1316 | } | 1316 | } |
| @@ -1339,19 +1339,19 @@ set_window_width (window, width, nodelete) | |||
| 1339 | XFASTINT (w->last_modified) = 0; | 1339 | XFASTINT (w->last_modified) = 0; |
| 1340 | windows_or_buffers_changed++; | 1340 | windows_or_buffers_changed++; |
| 1341 | XFASTINT (w->width) = width; | 1341 | XFASTINT (w->width) = width; |
| 1342 | if (!NULL (w->vchild)) | 1342 | if (!NILP (w->vchild)) |
| 1343 | { | 1343 | { |
| 1344 | for (child = w->vchild; !NULL (child); child = XWINDOW (child)->next) | 1344 | for (child = w->vchild; !NILP (child); child = XWINDOW (child)->next) |
| 1345 | { | 1345 | { |
| 1346 | XWINDOW (child)->left = w->left; | 1346 | XWINDOW (child)->left = w->left; |
| 1347 | set_window_width (child, width, nodelete); | 1347 | set_window_width (child, width, nodelete); |
| 1348 | } | 1348 | } |
| 1349 | } | 1349 | } |
| 1350 | else if (!NULL (w->hchild)) | 1350 | else if (!NILP (w->hchild)) |
| 1351 | { | 1351 | { |
| 1352 | lastright = left = XFASTINT (w->left); | 1352 | lastright = left = XFASTINT (w->left); |
| 1353 | lastoright = 0; | 1353 | lastoright = 0; |
| 1354 | for (child = w->hchild; !NULL (child); child = c->next) | 1354 | for (child = w->hchild; !NILP (child); child = c->next) |
| 1355 | { | 1355 | { |
| 1356 | c = XWINDOW (child); | 1356 | c = XWINDOW (child); |
| 1357 | 1357 | ||
| @@ -1370,7 +1370,7 @@ set_window_width (window, width, nodelete) | |||
| 1370 | } | 1370 | } |
| 1371 | /* Delete children that became too small */ | 1371 | /* Delete children that became too small */ |
| 1372 | if (!nodelete) | 1372 | if (!nodelete) |
| 1373 | for (child = w->hchild; !NULL (child); child = XWINDOW (child)->next) | 1373 | for (child = w->hchild; !NILP (child); child = XWINDOW (child)->next) |
| 1374 | { | 1374 | { |
| 1375 | set_window_width (child, XINT (XWINDOW (child)->width), 0); | 1375 | set_window_width (child, XINT (XWINDOW (child)->width), 0); |
| 1376 | } | 1376 | } |
| @@ -1391,16 +1391,16 @@ BUFFER can be a buffer or buffer name.") | |||
| 1391 | buffer = Fget_buffer (buffer); | 1391 | buffer = Fget_buffer (buffer); |
| 1392 | CHECK_BUFFER (buffer, 1); | 1392 | CHECK_BUFFER (buffer, 1); |
| 1393 | 1393 | ||
| 1394 | if (NULL (XBUFFER (buffer)->name)) | 1394 | if (NILP (XBUFFER (buffer)->name)) |
| 1395 | error ("Attempt to display deleted buffer"); | 1395 | error ("Attempt to display deleted buffer"); |
| 1396 | 1396 | ||
| 1397 | tem = w->buffer; | 1397 | tem = w->buffer; |
| 1398 | if (NULL (tem)) | 1398 | if (NILP (tem)) |
| 1399 | error ("Window is deleted"); | 1399 | error ("Window is deleted"); |
| 1400 | else if (! EQ (tem, Qt)) /* w->buffer is t when the window | 1400 | else if (! EQ (tem, Qt)) /* w->buffer is t when the window |
| 1401 | is first being set up. */ | 1401 | is first being set up. */ |
| 1402 | { | 1402 | { |
| 1403 | if (!NULL (w->dedicated) && !EQ (tem, buffer)) | 1403 | if (!NILP (w->dedicated) && !EQ (tem, buffer)) |
| 1404 | error ("Window is dedicated to %s\n", tem); | 1404 | error ("Window is dedicated to %s\n", tem); |
| 1405 | 1405 | ||
| 1406 | unshow_buffer (w); | 1406 | unshow_buffer (w); |
| @@ -1436,7 +1436,7 @@ before each command.") | |||
| 1436 | 1436 | ||
| 1437 | w = XWINDOW (window); | 1437 | w = XWINDOW (window); |
| 1438 | 1438 | ||
| 1439 | if (NULL (w->buffer)) | 1439 | if (NILP (w->buffer)) |
| 1440 | error ("Trying to select deleted window or non-leaf window"); | 1440 | error ("Trying to select deleted window or non-leaf window"); |
| 1441 | 1441 | ||
| 1442 | XFASTINT (w->use_time) = ++window_select_count; | 1442 | XFASTINT (w->use_time) = ++window_select_count; |
| @@ -1494,16 +1494,16 @@ Returns the window displaying BUFFER.") | |||
| 1494 | buffer = Fget_buffer (buffer); | 1494 | buffer = Fget_buffer (buffer); |
| 1495 | CHECK_BUFFER (buffer, 0); | 1495 | CHECK_BUFFER (buffer, 0); |
| 1496 | 1496 | ||
| 1497 | if (!NULL (Vdisplay_buffer_function)) | 1497 | if (!NILP (Vdisplay_buffer_function)) |
| 1498 | return call2 (Vdisplay_buffer_function, buffer, not_this_window); | 1498 | return call2 (Vdisplay_buffer_function, buffer, not_this_window); |
| 1499 | 1499 | ||
| 1500 | if (NULL (not_this_window) | 1500 | if (NILP (not_this_window) |
| 1501 | && XBUFFER (XWINDOW (selected_window)->buffer) == XBUFFER (buffer)) | 1501 | && XBUFFER (XWINDOW (selected_window)->buffer) == XBUFFER (buffer)) |
| 1502 | return selected_window; | 1502 | return selected_window; |
| 1503 | 1503 | ||
| 1504 | window = Fget_buffer_window (buffer, Qnil); | 1504 | window = Fget_buffer_window (buffer, Qnil); |
| 1505 | if (!NULL (window) | 1505 | if (!NILP (window) |
| 1506 | && (NULL (not_this_window) || !EQ (window, selected_window))) | 1506 | && (NILP (not_this_window) || !EQ (window, selected_window))) |
| 1507 | return window; | 1507 | return window; |
| 1508 | 1508 | ||
| 1509 | #ifdef MULTI_SCREEN | 1509 | #ifdef MULTI_SCREEN |
| @@ -1539,7 +1539,7 @@ Returns the window displaying BUFFER.") | |||
| 1539 | 1539 | ||
| 1540 | window = Fget_largest_window (screens); | 1540 | window = Fget_largest_window (screens); |
| 1541 | 1541 | ||
| 1542 | if (!NULL (window) | 1542 | if (!NILP (window) |
| 1543 | && window_height (window) >= split_height_threshold | 1543 | && window_height (window) >= split_height_threshold |
| 1544 | && | 1544 | && |
| 1545 | (XFASTINT (XWINDOW (window)->width) | 1545 | (XFASTINT (XWINDOW (window)->width) |
| @@ -1637,16 +1637,16 @@ and put SIZE columns in the first of the pair.") | |||
| 1637 | register struct window *o, *p; | 1637 | register struct window *o, *p; |
| 1638 | register int size; | 1638 | register int size; |
| 1639 | 1639 | ||
| 1640 | if (NULL (window)) | 1640 | if (NILP (window)) |
| 1641 | window = selected_window; | 1641 | window = selected_window; |
| 1642 | else | 1642 | else |
| 1643 | CHECK_WINDOW (window, 0); | 1643 | CHECK_WINDOW (window, 0); |
| 1644 | 1644 | ||
| 1645 | o = XWINDOW (window); | 1645 | o = XWINDOW (window); |
| 1646 | 1646 | ||
| 1647 | if (NULL (chsize)) | 1647 | if (NILP (chsize)) |
| 1648 | { | 1648 | { |
| 1649 | if (!NULL (horflag)) | 1649 | if (!NILP (horflag)) |
| 1650 | /* Round odd size up, since this is for the left-hand window, | 1650 | /* Round odd size up, since this is for the left-hand window, |
| 1651 | and it will lose a column for the separators. */ | 1651 | and it will lose a column for the separators. */ |
| 1652 | size = ((XFASTINT (o->width) + 1) & -2) >> 1; | 1652 | size = ((XFASTINT (o->width) + 1) & -2) >> 1; |
| @@ -1670,13 +1670,13 @@ and put SIZE columns in the first of the pair.") | |||
| 1670 | if (window_min_height < 2) | 1670 | if (window_min_height < 2) |
| 1671 | window_min_height = 2; | 1671 | window_min_height = 2; |
| 1672 | 1672 | ||
| 1673 | if (NULL (horflag)) | 1673 | if (NILP (horflag)) |
| 1674 | { | 1674 | { |
| 1675 | if (size < window_min_height | 1675 | if (size < window_min_height |
| 1676 | || size + window_min_height > XFASTINT (o->height)) | 1676 | || size + window_min_height > XFASTINT (o->height)) |
| 1677 | args_out_of_range_3 (window, chsize, horflag); | 1677 | args_out_of_range_3 (window, chsize, horflag); |
| 1678 | if (NULL (o->parent) | 1678 | if (NILP (o->parent) |
| 1679 | || NULL (XWINDOW (o->parent)->vchild)) | 1679 | || NILP (XWINDOW (o->parent)->vchild)) |
| 1680 | { | 1680 | { |
| 1681 | make_dummy_parent (window); | 1681 | make_dummy_parent (window); |
| 1682 | new = o->parent; | 1682 | new = o->parent; |
| @@ -1688,8 +1688,8 @@ and put SIZE columns in the first of the pair.") | |||
| 1688 | if (size < window_min_width | 1688 | if (size < window_min_width |
| 1689 | || size + window_min_width > XFASTINT (o->width)) | 1689 | || size + window_min_width > XFASTINT (o->width)) |
| 1690 | args_out_of_range_3 (window, chsize, horflag); | 1690 | args_out_of_range_3 (window, chsize, horflag); |
| 1691 | if (NULL (o->parent) | 1691 | if (NILP (o->parent) |
| 1692 | || NULL (XWINDOW (o->parent)->hchild)) | 1692 | || NILP (XWINDOW (o->parent)->hchild)) |
| 1693 | { | 1693 | { |
| 1694 | make_dummy_parent (window); | 1694 | make_dummy_parent (window); |
| 1695 | new = o->parent; | 1695 | new = o->parent; |
| @@ -1707,7 +1707,7 @@ and put SIZE columns in the first of the pair.") | |||
| 1707 | 1707 | ||
| 1708 | p->screen = o->screen; | 1708 | p->screen = o->screen; |
| 1709 | p->next = o->next; | 1709 | p->next = o->next; |
| 1710 | if (!NULL (p->next)) | 1710 | if (!NILP (p->next)) |
| 1711 | XWINDOW (p->next)->prev = new; | 1711 | XWINDOW (p->next)->prev = new; |
| 1712 | p->prev = window; | 1712 | p->prev = window; |
| 1713 | o->next = new; | 1713 | o->next = new; |
| @@ -1718,7 +1718,7 @@ and put SIZE columns in the first of the pair.") | |||
| 1718 | 1718 | ||
| 1719 | /* Apportion the available screen space among the two new windows */ | 1719 | /* Apportion the available screen space among the two new windows */ |
| 1720 | 1720 | ||
| 1721 | if (!NULL (horflag)) | 1721 | if (!NILP (horflag)) |
| 1722 | { | 1722 | { |
| 1723 | p->height = o->height; | 1723 | p->height = o->height; |
| 1724 | p->top = o->top; | 1724 | p->top = o->top; |
| @@ -1745,7 +1745,7 @@ From program, optional second arg non-nil means grow sideways ARG columns.") | |||
| 1745 | register Lisp_Object n, side; | 1745 | register Lisp_Object n, side; |
| 1746 | { | 1746 | { |
| 1747 | CHECK_NUMBER (n, 0); | 1747 | CHECK_NUMBER (n, 0); |
| 1748 | change_window_height (XINT (n), !NULL (side)); | 1748 | change_window_height (XINT (n), !NILP (side)); |
| 1749 | return Qnil; | 1749 | return Qnil; |
| 1750 | } | 1750 | } |
| 1751 | 1751 | ||
| @@ -1756,7 +1756,7 @@ From program, optional second arg non-nil means shrink sideways ARG columns.") | |||
| 1756 | register Lisp_Object n, side; | 1756 | register Lisp_Object n, side; |
| 1757 | { | 1757 | { |
| 1758 | CHECK_NUMBER (n, 0); | 1758 | CHECK_NUMBER (n, 0); |
| 1759 | change_window_height (-XINT (n), !NULL (side)); | 1759 | change_window_height (-XINT (n), !NILP (side)); |
| 1760 | return Qnil; | 1760 | return Qnil; |
| 1761 | } | 1761 | } |
| 1762 | 1762 | ||
| @@ -1813,14 +1813,14 @@ change_window_height (delta, widthflag) | |||
| 1813 | { | 1813 | { |
| 1814 | p = XWINDOW (window); | 1814 | p = XWINDOW (window); |
| 1815 | parent = p->parent; | 1815 | parent = p->parent; |
| 1816 | if (NULL (parent)) | 1816 | if (NILP (parent)) |
| 1817 | { | 1817 | { |
| 1818 | if (widthflag) | 1818 | if (widthflag) |
| 1819 | error ("No other window to side of this one"); | 1819 | error ("No other window to side of this one"); |
| 1820 | break; | 1820 | break; |
| 1821 | } | 1821 | } |
| 1822 | if (widthflag ? !NULL (XWINDOW (parent)->hchild) | 1822 | if (widthflag ? !NILP (XWINDOW (parent)->hchild) |
| 1823 | : !NULL (XWINDOW (parent)->vchild)) | 1823 | : !NILP (XWINDOW (parent)->vchild)) |
| 1824 | break; | 1824 | break; |
| 1825 | window = parent; | 1825 | window = parent; |
| 1826 | } | 1826 | } |
| @@ -1828,7 +1828,7 @@ change_window_height (delta, widthflag) | |||
| 1828 | sizep = &CURSIZE (p); | 1828 | sizep = &CURSIZE (p); |
| 1829 | 1829 | ||
| 1830 | if (*sizep + delta < MINSIZE (p) | 1830 | if (*sizep + delta < MINSIZE (p) |
| 1831 | && !NULL (XWINDOW (window)->parent)) | 1831 | && !NILP (XWINDOW (window)->parent)) |
| 1832 | { | 1832 | { |
| 1833 | Fdelete_window (window); | 1833 | Fdelete_window (window); |
| 1834 | return; | 1834 | return; |
| @@ -1837,9 +1837,9 @@ change_window_height (delta, widthflag) | |||
| 1837 | { | 1837 | { |
| 1838 | register int maxdelta; | 1838 | register int maxdelta; |
| 1839 | 1839 | ||
| 1840 | maxdelta = (!NULL (parent) ? (*sizefun) (parent) - *sizep | 1840 | maxdelta = (!NILP (parent) ? (*sizefun) (parent) - *sizep |
| 1841 | : !NULL (p->next) ? (*sizefun) (p->next) - MINSIZE (p->next) | 1841 | : !NILP (p->next) ? (*sizefun) (p->next) - MINSIZE (p->next) |
| 1842 | : !NULL (p->prev) ? (*sizefun) (p->prev) - MINSIZE (p->prev) | 1842 | : !NILP (p->prev) ? (*sizefun) (p->prev) - MINSIZE (p->prev) |
| 1843 | /* This is a screen with only one window, a minibuffer-only | 1843 | /* This is a screen with only one window, a minibuffer-only |
| 1844 | or a minibufferless screen. */ | 1844 | or a minibufferless screen. */ |
| 1845 | : (delta = 0)); | 1845 | : (delta = 0)); |
| @@ -1854,7 +1854,7 @@ change_window_height (delta, widthflag) | |||
| 1854 | return; | 1854 | return; |
| 1855 | } | 1855 | } |
| 1856 | 1856 | ||
| 1857 | if (!NULL (p->next) && | 1857 | if (!NILP (p->next) && |
| 1858 | (*sizefun) (p->next) - delta >= MINSIZE (p->next)) | 1858 | (*sizefun) (p->next) - delta >= MINSIZE (p->next)) |
| 1859 | { | 1859 | { |
| 1860 | (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); | 1860 | (*setsizefun) (p->next, (*sizefun) (p->next) - delta, 0); |
| @@ -1864,7 +1864,7 @@ change_window_height (delta, widthflag) | |||
| 1864 | but it propagates the new top edge to its children */ | 1864 | but it propagates the new top edge to its children */ |
| 1865 | (*setsizefun) (p->next, (*sizefun) (p->next), 0); | 1865 | (*setsizefun) (p->next, (*sizefun) (p->next), 0); |
| 1866 | } | 1866 | } |
| 1867 | else if (!NULL (p->prev) && | 1867 | else if (!NILP (p->prev) && |
| 1868 | (*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) | 1868 | (*sizefun) (p->prev) - delta >= MINSIZE (p->prev)) |
| 1869 | { | 1869 | { |
| 1870 | (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); | 1870 | (*setsizefun) (p->prev, (*sizefun) (p->prev) - delta, 0); |
| @@ -1919,8 +1919,8 @@ window_internal_height (w) | |||
| 1919 | if (MINI_WINDOW_P (w)) | 1919 | if (MINI_WINDOW_P (w)) |
| 1920 | return ht; | 1920 | return ht; |
| 1921 | 1921 | ||
| 1922 | if (!NULL (w->parent) || !NULL (w->vchild) || !NULL (w->hchild) | 1922 | if (!NILP (w->parent) || !NILP (w->vchild) || !NILP (w->hchild) |
| 1923 | || !NULL (w->next) || !NULL (w->prev) | 1923 | || !NILP (w->next) || !NILP (w->prev) |
| 1924 | || SCREEN_WANTS_MODELINE_P (XSCREEN (WINDOW_SCREEN (w)))) | 1924 | || SCREEN_WANTS_MODELINE_P (XSCREEN (WINDOW_SCREEN (w)))) |
| 1925 | return ht - 1; | 1925 | return ht - 1; |
| 1926 | 1926 | ||
| @@ -1945,7 +1945,7 @@ window_scroll (window, n) | |||
| 1945 | XFASTINT (tem) = point; | 1945 | XFASTINT (tem) = point; |
| 1946 | tem = Fpos_visible_in_window_p (tem, window); | 1946 | tem = Fpos_visible_in_window_p (tem, window); |
| 1947 | 1947 | ||
| 1948 | if (NULL (tem)) | 1948 | if (NILP (tem)) |
| 1949 | { | 1949 | { |
| 1950 | Fvertical_motion (make_number (- ht / 2)); | 1950 | Fvertical_motion (make_number (- ht / 2)); |
| 1951 | XFASTINT (tem) = point; | 1951 | XFASTINT (tem) = point; |
| @@ -2012,7 +2012,7 @@ scroll_command (n, direction) | |||
| 2012 | - next_screen_context_lines); | 2012 | - next_screen_context_lines); |
| 2013 | defalt = direction * (defalt < 1 ? 1 : defalt); | 2013 | defalt = direction * (defalt < 1 ? 1 : defalt); |
| 2014 | 2014 | ||
| 2015 | if (NULL (n)) | 2015 | if (NILP (n)) |
| 2016 | window_scroll (selected_window, defalt); | 2016 | window_scroll (selected_window, defalt); |
| 2017 | else if (EQ (n, Qminus)) | 2017 | else if (EQ (n, Qminus)) |
| 2018 | window_scroll (selected_window, - defalt); | 2018 | window_scroll (selected_window, - defalt); |
| @@ -2066,13 +2066,13 @@ showing that buffer, popping the buffer up if necessary.") | |||
| 2066 | register int count = specpdl_ptr - specpdl; | 2066 | register int count = specpdl_ptr - specpdl; |
| 2067 | 2067 | ||
| 2068 | if (MINI_WINDOW_P (XWINDOW (selected_window)) | 2068 | if (MINI_WINDOW_P (XWINDOW (selected_window)) |
| 2069 | && !NULL (Vminibuf_scroll_window)) | 2069 | && !NILP (Vminibuf_scroll_window)) |
| 2070 | window = Vminibuf_scroll_window; | 2070 | window = Vminibuf_scroll_window; |
| 2071 | /* If buffer is specified, scroll that buffer. */ | 2071 | /* If buffer is specified, scroll that buffer. */ |
| 2072 | else if (!NULL (Vother_window_scroll_buffer)) | 2072 | else if (!NILP (Vother_window_scroll_buffer)) |
| 2073 | { | 2073 | { |
| 2074 | window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil); | 2074 | window = Fget_buffer_window (Vother_window_scroll_buffer, Qnil); |
| 2075 | if (NULL (window)) | 2075 | if (NILP (window)) |
| 2076 | window = Fdisplay_buffer (Vother_window_scroll_buffer, Qt); | 2076 | window = Fdisplay_buffer (Vother_window_scroll_buffer, Qt); |
| 2077 | } | 2077 | } |
| 2078 | else | 2078 | else |
| @@ -2092,7 +2092,7 @@ showing that buffer, popping the buffer up if necessary.") | |||
| 2092 | Fset_buffer (w->buffer); | 2092 | Fset_buffer (w->buffer); |
| 2093 | SET_PT (marker_position (w->pointm)); | 2093 | SET_PT (marker_position (w->pointm)); |
| 2094 | 2094 | ||
| 2095 | if (NULL (n)) | 2095 | if (NILP (n)) |
| 2096 | window_scroll (window, ht - next_screen_context_lines); | 2096 | window_scroll (window, ht - next_screen_context_lines); |
| 2097 | else if (EQ (n, Qminus)) | 2097 | else if (EQ (n, Qminus)) |
| 2098 | window_scroll (window, next_screen_context_lines - ht); | 2098 | window_scroll (window, next_screen_context_lines - ht); |
| @@ -2117,7 +2117,7 @@ Default for ARG is window width minus 2.") | |||
| 2117 | register Lisp_Object arg; | 2117 | register Lisp_Object arg; |
| 2118 | { | 2118 | { |
| 2119 | 2119 | ||
| 2120 | if (NULL (arg)) | 2120 | if (NILP (arg)) |
| 2121 | XFASTINT (arg) = XFASTINT (XWINDOW (selected_window)->width) - 2; | 2121 | XFASTINT (arg) = XFASTINT (XWINDOW (selected_window)->width) - 2; |
| 2122 | else | 2122 | else |
| 2123 | arg = Fprefix_numeric_value (arg); | 2123 | arg = Fprefix_numeric_value (arg); |
| @@ -2134,7 +2134,7 @@ Default for ARG is window width minus 2.") | |||
| 2134 | (arg) | 2134 | (arg) |
| 2135 | register Lisp_Object arg; | 2135 | register Lisp_Object arg; |
| 2136 | { | 2136 | { |
| 2137 | if (NULL (arg)) | 2137 | if (NILP (arg)) |
| 2138 | XFASTINT (arg) = XFASTINT (XWINDOW (selected_window)->width) - 2; | 2138 | XFASTINT (arg) = XFASTINT (XWINDOW (selected_window)->width) - 2; |
| 2139 | else | 2139 | else |
| 2140 | arg = Fprefix_numeric_value (arg); | 2140 | arg = Fprefix_numeric_value (arg); |
| @@ -2158,7 +2158,7 @@ redraws with point in the center.") | |||
| 2158 | register int ht = window_internal_height (w); | 2158 | register int ht = window_internal_height (w); |
| 2159 | register int opoint = point; | 2159 | register int opoint = point; |
| 2160 | 2160 | ||
| 2161 | if (NULL (n)) | 2161 | if (NILP (n)) |
| 2162 | { | 2162 | { |
| 2163 | extern int screen_garbaged; | 2163 | extern int screen_garbaged; |
| 2164 | 2164 | ||
| @@ -2203,7 +2203,7 @@ negative means relative to bottom of window.") | |||
| 2203 | register int height = window_internal_height (w); | 2203 | register int height = window_internal_height (w); |
| 2204 | register int start; | 2204 | register int start; |
| 2205 | 2205 | ||
| 2206 | if (NULL (arg)) | 2206 | if (NILP (arg)) |
| 2207 | XFASTINT (arg) = height / 2; | 2207 | XFASTINT (arg) = height / 2; |
| 2208 | else | 2208 | else |
| 2209 | { | 2209 | { |
| @@ -2310,7 +2310,7 @@ by `current-window-configuration' (which see).") | |||
| 2310 | 2310 | ||
| 2311 | windows_or_buffers_changed++; | 2311 | windows_or_buffers_changed++; |
| 2312 | new_current_buffer = data->current_buffer; | 2312 | new_current_buffer = data->current_buffer; |
| 2313 | if (NULL (XBUFFER (new_current_buffer)->name)) | 2313 | if (NILP (XBUFFER (new_current_buffer)->name)) |
| 2314 | new_current_buffer = Qnil; | 2314 | new_current_buffer = Qnil; |
| 2315 | 2315 | ||
| 2316 | /* Mark all windows now on screen as "deleted". | 2316 | /* Mark all windows now on screen as "deleted". |
| @@ -2328,12 +2328,12 @@ by `current-window-configuration' (which see).") | |||
| 2328 | w = XWINDOW (p->window); | 2328 | w = XWINDOW (p->window); |
| 2329 | w->next = Qnil; | 2329 | w->next = Qnil; |
| 2330 | 2330 | ||
| 2331 | if (!NULL (p->parent)) | 2331 | if (!NILP (p->parent)) |
| 2332 | w->parent = SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window; | 2332 | w->parent = SAVED_WINDOW_N (saved_windows, XFASTINT (p->parent))->window; |
| 2333 | else | 2333 | else |
| 2334 | w->parent = Qnil; | 2334 | w->parent = Qnil; |
| 2335 | 2335 | ||
| 2336 | if (!NULL (p->prev)) | 2336 | if (!NILP (p->prev)) |
| 2337 | { | 2337 | { |
| 2338 | w->prev = SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window; | 2338 | w->prev = SAVED_WINDOW_N (saved_windows, XFASTINT (p->prev))->window; |
| 2339 | #ifdef MULTI_SCREEN | 2339 | #ifdef MULTI_SCREEN |
| @@ -2347,7 +2347,7 @@ by `current-window-configuration' (which see).") | |||
| 2347 | else | 2347 | else |
| 2348 | { | 2348 | { |
| 2349 | w->prev = Qnil; | 2349 | w->prev = Qnil; |
| 2350 | if (!NULL (w->parent)) | 2350 | if (!NILP (w->parent)) |
| 2351 | { | 2351 | { |
| 2352 | if (EQ (p->width, XWINDOW (w->parent)->width)) | 2352 | if (EQ (p->width, XWINDOW (w->parent)->width)) |
| 2353 | { | 2353 | { |
| @@ -2370,11 +2370,11 @@ by `current-window-configuration' (which see).") | |||
| 2370 | XFASTINT (w->last_modified) = 0; | 2370 | XFASTINT (w->last_modified) = 0; |
| 2371 | 2371 | ||
| 2372 | /* Reinstall the saved buffer and pointers into it. */ | 2372 | /* Reinstall the saved buffer and pointers into it. */ |
| 2373 | if (NULL (p->buffer)) | 2373 | if (NILP (p->buffer)) |
| 2374 | w->buffer = p->buffer; | 2374 | w->buffer = p->buffer; |
| 2375 | else | 2375 | else |
| 2376 | { | 2376 | { |
| 2377 | if (!NULL (XBUFFER (p->buffer)->name)) | 2377 | if (!NILP (XBUFFER (p->buffer)->name)) |
| 2378 | /* If saved buffer is alive, install it. */ | 2378 | /* If saved buffer is alive, install it. */ |
| 2379 | { | 2379 | { |
| 2380 | w->buffer = p->buffer; | 2380 | w->buffer = p->buffer; |
| @@ -2388,7 +2388,7 @@ by `current-window-configuration' (which see).") | |||
| 2388 | XBUFFER (p->buffer) == current_buffer) | 2388 | XBUFFER (p->buffer) == current_buffer) |
| 2389 | Fgoto_char (w->pointm); | 2389 | Fgoto_char (w->pointm); |
| 2390 | } | 2390 | } |
| 2391 | else if (NULL (XBUFFER (w->buffer)->name)) | 2391 | else if (NILP (XBUFFER (w->buffer)->name)) |
| 2392 | /* Else if window's old buffer is dead too, get a live one. */ | 2392 | /* Else if window's old buffer is dead too, get a live one. */ |
| 2393 | { | 2393 | { |
| 2394 | w->buffer = Fcdr (Fcar (Vbuffer_alist)); | 2394 | w->buffer = Fcdr (Fcar (Vbuffer_alist)); |
| @@ -2423,7 +2423,7 @@ by `current-window-configuration' (which see).") | |||
| 2423 | if (s == selected_screen) | 2423 | if (s == selected_screen) |
| 2424 | { | 2424 | { |
| 2425 | Fselect_window (data->current_window); | 2425 | Fselect_window (data->current_window); |
| 2426 | if (!NULL (new_current_buffer)) | 2426 | if (!NILP (new_current_buffer)) |
| 2427 | Fset_buffer (new_current_buffer); | 2427 | Fset_buffer (new_current_buffer); |
| 2428 | else | 2428 | else |
| 2429 | Fset_buffer (XWINDOW (selected_window)->buffer); | 2429 | Fset_buffer (XWINDOW (selected_window)->buffer); |
| @@ -2442,11 +2442,11 @@ delete_all_subwindows (w) | |||
| 2442 | { | 2442 | { |
| 2443 | register int count = 1; | 2443 | register int count = 1; |
| 2444 | w->buffer = Qnil; | 2444 | w->buffer = Qnil; |
| 2445 | if (!NULL (w->next)) | 2445 | if (!NILP (w->next)) |
| 2446 | delete_all_subwindows (XWINDOW (w->next)); | 2446 | delete_all_subwindows (XWINDOW (w->next)); |
| 2447 | if (!NULL (w->vchild)) | 2447 | if (!NILP (w->vchild)) |
| 2448 | delete_all_subwindows (XWINDOW (w->vchild)); | 2448 | delete_all_subwindows (XWINDOW (w->vchild)); |
| 2449 | if (!NULL (w->hchild)) | 2449 | if (!NILP (w->hchild)) |
| 2450 | delete_all_subwindows (XWINDOW (w->hchild)); | 2450 | delete_all_subwindows (XWINDOW (w->hchild)); |
| 2451 | } | 2451 | } |
| 2452 | 2452 | ||
| @@ -2455,11 +2455,11 @@ count_windows (window) | |||
| 2455 | register struct window *window; | 2455 | register struct window *window; |
| 2456 | { | 2456 | { |
| 2457 | register int count = 1; | 2457 | register int count = 1; |
| 2458 | if (!NULL (window->next)) | 2458 | if (!NILP (window->next)) |
| 2459 | count += count_windows (XWINDOW (window->next)); | 2459 | count += count_windows (XWINDOW (window->next)); |
| 2460 | if (!NULL (window->vchild)) | 2460 | if (!NILP (window->vchild)) |
| 2461 | count += count_windows (XWINDOW (window->vchild)); | 2461 | count += count_windows (XWINDOW (window->vchild)); |
| 2462 | if (!NULL (window->hchild)) | 2462 | if (!NILP (window->hchild)) |
| 2463 | count += count_windows (XWINDOW (window->hchild)); | 2463 | count += count_windows (XWINDOW (window->hchild)); |
| 2464 | return count; | 2464 | return count; |
| 2465 | } | 2465 | } |
| @@ -2474,7 +2474,7 @@ save_window_save (window, vector, i) | |||
| 2474 | register struct window *w; | 2474 | register struct window *w; |
| 2475 | register Lisp_Object tem; | 2475 | register Lisp_Object tem; |
| 2476 | 2476 | ||
| 2477 | for (;!NULL (window); window = w->next) | 2477 | for (;!NILP (window); window = w->next) |
| 2478 | { | 2478 | { |
| 2479 | p = SAVED_WINDOW_N (vector, i); | 2479 | p = SAVED_WINDOW_N (vector, i); |
| 2480 | w = XWINDOW (window); | 2480 | w = XWINDOW (window); |
| @@ -2488,7 +2488,7 @@ save_window_save (window, vector, i) | |||
| 2488 | p->height = w->height; | 2488 | p->height = w->height; |
| 2489 | p->hscroll = w->hscroll; | 2489 | p->hscroll = w->hscroll; |
| 2490 | p->display_table = w->display_table; | 2490 | p->display_table = w->display_table; |
| 2491 | if (!NULL (w->buffer)) | 2491 | if (!NILP (w->buffer)) |
| 2492 | { | 2492 | { |
| 2493 | /* Save w's value of point in the window configuration. | 2493 | /* Save w's value of point in the window configuration. |
| 2494 | If w is the selected window, then get the value of point | 2494 | If w is the selected window, then get the value of point |
| @@ -2516,19 +2516,19 @@ save_window_save (window, vector, i) | |||
| 2516 | p->start_at_line_beg = Qnil; | 2516 | p->start_at_line_beg = Qnil; |
| 2517 | } | 2517 | } |
| 2518 | 2518 | ||
| 2519 | if (NULL (w->parent)) | 2519 | if (NILP (w->parent)) |
| 2520 | p->parent = Qnil; | 2520 | p->parent = Qnil; |
| 2521 | else | 2521 | else |
| 2522 | p->parent = XWINDOW (w->parent)->temslot; | 2522 | p->parent = XWINDOW (w->parent)->temslot; |
| 2523 | 2523 | ||
| 2524 | if (NULL (w->prev)) | 2524 | if (NILP (w->prev)) |
| 2525 | p->prev = Qnil; | 2525 | p->prev = Qnil; |
| 2526 | else | 2526 | else |
| 2527 | p->prev = XWINDOW (w->prev)->temslot; | 2527 | p->prev = XWINDOW (w->prev)->temslot; |
| 2528 | 2528 | ||
| 2529 | if (!NULL (w->vchild)) | 2529 | if (!NILP (w->vchild)) |
| 2530 | i = save_window_save (w->vchild, vector, i); | 2530 | i = save_window_save (w->vchild, vector, i); |
| 2531 | if (!NULL (w->hchild)) | 2531 | if (!NILP (w->hchild)) |
| 2532 | i = save_window_save (w->hchild, vector, i); | 2532 | i = save_window_save (w->hchild, vector, i); |
| 2533 | } | 2533 | } |
| 2534 | 2534 | ||
| @@ -2552,7 +2552,7 @@ its value is -not- saved.") | |||
| 2552 | register int i; | 2552 | register int i; |
| 2553 | SCREEN_PTR s; | 2553 | SCREEN_PTR s; |
| 2554 | 2554 | ||
| 2555 | if (NULL (screen)) | 2555 | if (NILP (screen)) |
| 2556 | s = selected_screen; | 2556 | s = selected_screen; |
| 2557 | else | 2557 | else |
| 2558 | { | 2558 | { |
diff --git a/src/xdisp.c b/src/xdisp.c index 66f213ddf1c..86be201caf7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -221,18 +221,20 @@ message (m, a1, a2, a3) | |||
| 221 | Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window))); | 221 | Fmake_screen_visible (WINDOW_SCREEN (XWINDOW (minibuf_window))); |
| 222 | #endif | 222 | #endif |
| 223 | 223 | ||
| 224 | { | ||
| 224 | #ifdef NO_ARG_ARRAY | 225 | #ifdef NO_ARG_ARRAY |
| 225 | int a[3]; | 226 | int a[3]; |
| 226 | a[0] = a1; | 227 | a[0] = a1; |
| 227 | a[1] = a2; | 228 | a[1] = a2; |
| 228 | a[2] = a3; | 229 | a[2] = a3; |
| 229 | 230 | ||
| 230 | doprnt (SCREEN_MESSAGE_BUF (selected_screen), | 231 | doprnt (SCREEN_MESSAGE_BUF (selected_screen), |
| 231 | SCREEN_WIDTH (selected_screen), m, 0, 3, a); | 232 | SCREEN_WIDTH (selected_screen), m, 0, 3, a); |
| 232 | #else | 233 | #else |
| 233 | doprnt (SCREEN_MESSAGE_BUF (selected_screen), | 234 | doprnt (SCREEN_MESSAGE_BUF (selected_screen), |
| 234 | SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); | 235 | SCREEN_WIDTH (selected_screen), m, 0, 3, &a1); |
| 235 | #endif /* NO_ARG_ARRAY */ | 236 | #endif /* NO_ARG_ARRAY */ |
| 237 | } | ||
| 236 | 238 | ||
| 237 | echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); | 239 | echo_area_glyphs = SCREEN_MESSAGE_BUF (selected_screen); |
| 238 | 240 | ||
| @@ -391,12 +393,12 @@ redisplay () | |||
| 391 | 393 | ||
| 392 | tlbufpos = this_line_bufpos; | 394 | tlbufpos = this_line_bufpos; |
| 393 | tlendpos = this_line_endpos; | 395 | tlendpos = this_line_endpos; |
| 394 | if (!all_windows && tlbufpos > 0 && NULL (w->update_mode_line) | 396 | if (!all_windows && tlbufpos > 0 && NILP (w->update_mode_line) |
| 395 | && SCREEN_VISIBLE_P (XSCREEN (w->screen)) | 397 | && SCREEN_VISIBLE_P (XSCREEN (w->screen)) |
| 396 | /* Make sure recorded data applies to current buffer, etc */ | 398 | /* Make sure recorded data applies to current buffer, etc */ |
| 397 | && this_line_buffer == current_buffer | 399 | && this_line_buffer == current_buffer |
| 398 | && current_buffer == XBUFFER (w->buffer) | 400 | && current_buffer == XBUFFER (w->buffer) |
| 399 | && NULL (w->force_start) | 401 | && NILP (w->force_start) |
| 400 | /* Point must be on the line that we have info recorded about */ | 402 | /* Point must be on the line that we have info recorded about */ |
| 401 | && point >= tlbufpos | 403 | && point >= tlbufpos |
| 402 | && point <= Z - tlendpos | 404 | && point <= Z - tlendpos |
| @@ -557,7 +559,7 @@ update: | |||
| 557 | if (pause) | 559 | if (pause) |
| 558 | { | 560 | { |
| 559 | this_line_bufpos = 0; | 561 | this_line_bufpos = 0; |
| 560 | if (!NULL (last_arrow_position)) | 562 | if (!NILP (last_arrow_position)) |
| 561 | { | 563 | { |
| 562 | last_arrow_position = Qt; | 564 | last_arrow_position = Qt; |
| 563 | last_arrow_string = Qt; | 565 | last_arrow_string = Qt; |
| @@ -643,11 +645,11 @@ mark_window_display_accurate (window, flag) | |||
| 643 | { | 645 | { |
| 644 | register struct window *w; | 646 | register struct window *w; |
| 645 | 647 | ||
| 646 | for (;!NULL (window); window = w->next) | 648 | for (;!NILP (window); window = w->next) |
| 647 | { | 649 | { |
| 648 | w = XWINDOW (window); | 650 | w = XWINDOW (window); |
| 649 | 651 | ||
| 650 | if (!NULL (w->buffer)) | 652 | if (!NILP (w->buffer)) |
| 651 | XFASTINT (w->last_modified) | 653 | XFASTINT (w->last_modified) |
| 652 | = !flag ? 0 | 654 | = !flag ? 0 |
| 653 | : XBUFFER (w->buffer) == current_buffer | 655 | : XBUFFER (w->buffer) == current_buffer |
| @@ -655,9 +657,9 @@ mark_window_display_accurate (window, flag) | |||
| 655 | w->window_end_valid = Qt; | 657 | w->window_end_valid = Qt; |
| 656 | w->update_mode_line = Qnil; | 658 | w->update_mode_line = Qnil; |
| 657 | 659 | ||
| 658 | if (!NULL (w->vchild)) | 660 | if (!NILP (w->vchild)) |
| 659 | mark_window_display_accurate (w->vchild, flag); | 661 | mark_window_display_accurate (w->vchild, flag); |
| 660 | if (!NULL (w->hchild)) | 662 | if (!NILP (w->hchild)) |
| 661 | mark_window_display_accurate (w->hchild, flag); | 663 | mark_window_display_accurate (w->hchild, flag); |
| 662 | } | 664 | } |
| 663 | 665 | ||
| @@ -680,7 +682,7 @@ static void | |||
| 680 | redisplay_windows (window) | 682 | redisplay_windows (window) |
| 681 | Lisp_Object window; | 683 | Lisp_Object window; |
| 682 | { | 684 | { |
| 683 | for (; !NULL (window); window = XWINDOW (window)->next) | 685 | for (; !NILP (window); window = XWINDOW (window)->next) |
| 684 | redisplay_window (window, 0); | 686 | redisplay_window (window, 0); |
| 685 | } | 687 | } |
| 686 | 688 | ||
| @@ -708,17 +710,17 @@ redisplay_window (window, just_this_one) | |||
| 708 | 710 | ||
| 709 | /* If this is a combination window, do its children; that's all. */ | 711 | /* If this is a combination window, do its children; that's all. */ |
| 710 | 712 | ||
| 711 | if (!NULL (w->vchild)) | 713 | if (!NILP (w->vchild)) |
| 712 | { | 714 | { |
| 713 | redisplay_windows (w->vchild); | 715 | redisplay_windows (w->vchild); |
| 714 | return; | 716 | return; |
| 715 | } | 717 | } |
| 716 | if (!NULL (w->hchild)) | 718 | if (!NILP (w->hchild)) |
| 717 | { | 719 | { |
| 718 | redisplay_windows (w->hchild); | 720 | redisplay_windows (w->hchild); |
| 719 | return; | 721 | return; |
| 720 | } | 722 | } |
| 721 | if (NULL (w->buffer)) | 723 | if (NILP (w->buffer)) |
| 722 | abort (); | 724 | abort (); |
| 723 | 725 | ||
| 724 | height = window_internal_height (w); | 726 | height = window_internal_height (w); |
| @@ -770,12 +772,12 @@ redisplay_window (window, just_this_one) | |||
| 770 | SET_PT (marker_position (w->pointm)); | 772 | SET_PT (marker_position (w->pointm)); |
| 771 | if (point < BEGV) | 773 | if (point < BEGV) |
| 772 | { | 774 | { |
| 773 | point = BEGV; | 775 | SET_PT (BEGV); |
| 774 | Fset_marker (w->pointm, make_number (point), Qnil); | 776 | Fset_marker (w->pointm, make_number (point), Qnil); |
| 775 | } | 777 | } |
| 776 | else if (point > (ZV - 1)) | 778 | else if (point > (ZV - 1)) |
| 777 | { | 779 | { |
| 778 | point = ZV; | 780 | SET_PT (ZV); |
| 779 | Fset_marker (w->pointm, make_number (point), Qnil); | 781 | Fset_marker (w->pointm, make_number (point), Qnil); |
| 780 | } | 782 | } |
| 781 | } | 783 | } |
| @@ -788,7 +790,7 @@ redisplay_window (window, just_this_one) | |||
| 788 | 790 | ||
| 789 | /* Handle case where place to start displaying has been specified, | 791 | /* Handle case where place to start displaying has been specified, |
| 790 | unless the specified location is outside the visible range. */ | 792 | unless the specified location is outside the visible range. */ |
| 791 | if (!NULL (w->force_start)) | 793 | if (!NILP (w->force_start)) |
| 792 | { | 794 | { |
| 793 | w->update_mode_line = Qt; | 795 | w->update_mode_line = Qt; |
| 794 | w->force_start = Qnil; | 796 | w->force_start = Qnil; |
| @@ -862,7 +864,7 @@ redisplay_window (window, just_this_one) | |||
| 862 | } | 864 | } |
| 863 | /* If current starting point was originally the beginning of a line | 865 | /* If current starting point was originally the beginning of a line |
| 864 | but no longer is, find a new starting point. */ | 866 | but no longer is, find a new starting point. */ |
| 865 | else if (!NULL (w->start_at_line_beg) | 867 | else if (!NILP (w->start_at_line_beg) |
| 866 | && !(startp == BEGV | 868 | && !(startp == BEGV |
| 867 | || FETCH_CHAR (startp - 1) == '\n')) | 869 | || FETCH_CHAR (startp - 1) == '\n')) |
| 868 | { | 870 | { |
| @@ -943,7 +945,7 @@ recenter: | |||
| 943 | done: | 945 | done: |
| 944 | /* If window not full width, must redo its mode line | 946 | /* If window not full width, must redo its mode line |
| 945 | if the window to its side is being redone */ | 947 | if the window to its side is being redone */ |
| 946 | if ((!NULL (w->update_mode_line) | 948 | if ((!NILP (w->update_mode_line) |
| 947 | || (!just_this_one && width < SCREEN_WIDTH (s) - 1)) | 949 | || (!just_this_one && width < SCREEN_WIDTH (s) - 1)) |
| 948 | && height != XFASTINT (w->height)) | 950 | && height != XFASTINT (w->height)) |
| 949 | display_mode_line (w); | 951 | display_mode_line (w); |
| @@ -1432,7 +1434,7 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1432 | register GLYPH *p1prev; | 1434 | register GLYPH *p1prev; |
| 1433 | SCREEN_PTR s = XSCREEN (w->screen); | 1435 | SCREEN_PTR s = XSCREEN (w->screen); |
| 1434 | int tab_width = XINT (current_buffer->tab_width); | 1436 | int tab_width = XINT (current_buffer->tab_width); |
| 1435 | int ctl_arrow = !NULL (current_buffer->ctl_arrow); | 1437 | int ctl_arrow = !NILP (current_buffer->ctl_arrow); |
| 1436 | int width = XFASTINT (w->width) - 1 | 1438 | int width = XFASTINT (w->width) - 1 |
| 1437 | - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); | 1439 | - (XFASTINT (w->width) + XFASTINT (w->left) != SCREEN_WIDTH (s)); |
| 1438 | struct position val; | 1440 | struct position val; |
| @@ -1442,13 +1444,13 @@ display_text_line (w, start, vpos, hpos, taboffset) | |||
| 1442 | int truncate = hscroll | 1444 | int truncate = hscroll |
| 1443 | || (truncate_partial_width_windows | 1445 | || (truncate_partial_width_windows |
| 1444 | && XFASTINT (w->width) < SCREEN_WIDTH (s)) | 1446 | && XFASTINT (w->width) < SCREEN_WIDTH (s)) |
| 1445 | || !NULL (current_buffer->truncate_lines); | 1447 | || !NILP (current_buffer->truncate_lines); |
| 1446 | int selective | 1448 | int selective |
| 1447 | = XTYPE (current_buffer->selective_display) == Lisp_Int | 1449 | = XTYPE (current_buffer->selective_display) == Lisp_Int |
| 1448 | ? XINT (current_buffer->selective_display) | 1450 | ? XINT (current_buffer->selective_display) |
| 1449 | : !NULL (current_buffer->selective_display) ? -1 : 0; | 1451 | : !NILP (current_buffer->selective_display) ? -1 : 0; |
| 1450 | #ifndef old | 1452 | #ifndef old |
| 1451 | int selective_e = selective && !NULL (current_buffer->selective_display_ellipses); | 1453 | int selective_e = selective && !NILP (current_buffer->selective_display_ellipses); |
| 1452 | #endif | 1454 | #endif |
| 1453 | register struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (s); | 1455 | register struct screen_glyphs *desired_glyphs = SCREEN_DESIRED_GLYPHS (s); |
| 1454 | register struct Lisp_Vector *dp = window_display_table (w); | 1456 | register struct Lisp_Vector *dp = window_display_table (w); |
| @@ -1768,7 +1770,7 @@ display_mode_line (w) | |||
| 1768 | if (SCREEN_IS_X (s) | 1770 | if (SCREEN_IS_X (s) |
| 1769 | && ! SCREEN_MINIBUF_ONLY_P (s) | 1771 | && ! SCREEN_MINIBUF_ONLY_P (s) |
| 1770 | && w == XWINDOW (s->selected_window) | 1772 | && w == XWINDOW (s->selected_window) |
| 1771 | && (NULL (Fstring_equal (XBUFFER (w->buffer)->name, s->name)))) | 1773 | && (NILP (Fstring_equal (XBUFFER (w->buffer)->name, s->name)))) |
| 1772 | x_set_name (s, XBUFFER (w->buffer)->name, Qnil); | 1774 | x_set_name (s, XBUFFER (w->buffer)->name, Qnil); |
| 1773 | #endif | 1775 | #endif |
| 1774 | } | 1776 | } |
| @@ -1875,7 +1877,7 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 1875 | { | 1877 | { |
| 1876 | register Lisp_Object tem; | 1878 | register Lisp_Object tem; |
| 1877 | tem = Fboundp (elt); | 1879 | tem = Fboundp (elt); |
| 1878 | if (!NULL (tem)) | 1880 | if (!NILP (tem)) |
| 1879 | { | 1881 | { |
| 1880 | tem = Fsymbol_value (elt); | 1882 | tem = Fsymbol_value (elt); |
| 1881 | /* If value is a string, output that string literally: | 1883 | /* If value is a string, output that string literally: |
| @@ -1911,17 +1913,17 @@ display_mode_element (w, vpos, hpos, depth, minendcol, maxendcol, elt) | |||
| 1911 | goto invalid; | 1913 | goto invalid; |
| 1912 | /* elt is now the cdr, and we know it is a cons cell. | 1914 | /* elt is now the cdr, and we know it is a cons cell. |
| 1913 | Use its car if CAR has a non-nil value. */ | 1915 | Use its car if CAR has a non-nil value. */ |
| 1914 | if (!NULL (tem)) | 1916 | if (!NILP (tem)) |
| 1915 | { | 1917 | { |
| 1916 | tem = Fsymbol_value (car); | 1918 | tem = Fsymbol_value (car); |
| 1917 | if (!NULL (tem)) | 1919 | if (!NILP (tem)) |
| 1918 | { elt = XCONS (elt)->car; goto tail_recurse; } | 1920 | { elt = XCONS (elt)->car; goto tail_recurse; } |
| 1919 | } | 1921 | } |
| 1920 | /* Symbol's value is nil (or symbol is unbound) | 1922 | /* Symbol's value is nil (or symbol is unbound) |
| 1921 | Get the cddr of the original list | 1923 | Get the cddr of the original list |
| 1922 | and if possible find the caddr and use that. */ | 1924 | and if possible find the caddr and use that. */ |
| 1923 | elt = XCONS (elt)->cdr; | 1925 | elt = XCONS (elt)->cdr; |
| 1924 | if (NULL (elt)) | 1926 | if (NILP (elt)) |
| 1925 | break; | 1927 | break; |
| 1926 | else if (XTYPE (elt) != Lisp_Cons) | 1928 | else if (XTYPE (elt) != Lisp_Cons) |
| 1927 | goto invalid; | 1929 | goto invalid; |
| @@ -2015,7 +2017,7 @@ decode_mode_spec (w, c, maxwidth) | |||
| 2015 | case 'f': | 2017 | case 'f': |
| 2016 | obj = current_buffer->filename; | 2018 | obj = current_buffer->filename; |
| 2017 | #if 0 | 2019 | #if 0 |
| 2018 | if (NULL (obj)) | 2020 | if (NILP (obj)) |
| 2019 | return "[none]"; | 2021 | return "[none]"; |
| 2020 | else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) | 2022 | else if (XTYPE (obj) == Lisp_String && XSTRING (obj)->size > maxwidth) |
| 2021 | { | 2023 | { |
| @@ -2037,7 +2039,7 @@ decode_mode_spec (w, c, maxwidth) | |||
| 2037 | break; | 2039 | break; |
| 2038 | 2040 | ||
| 2039 | case '*': | 2041 | case '*': |
| 2040 | if (!NULL (current_buffer->read_only)) | 2042 | if (!NILP (current_buffer->read_only)) |
| 2041 | return "%"; | 2043 | return "%"; |
| 2042 | if (MODIFF > current_buffer->save_modified) | 2044 | if (MODIFF > current_buffer->save_modified) |
| 2043 | return "*"; | 2045 | return "*"; |
| @@ -2047,7 +2049,7 @@ decode_mode_spec (w, c, maxwidth) | |||
| 2047 | /* status of process */ | 2049 | /* status of process */ |
| 2048 | #ifdef subprocesses | 2050 | #ifdef subprocesses |
| 2049 | obj = Fget_buffer_process (Fcurrent_buffer ()); | 2051 | obj = Fget_buffer_process (Fcurrent_buffer ()); |
| 2050 | if (NULL (obj)) | 2052 | if (NILP (obj)) |
| 2051 | return "no process"; | 2053 | return "no process"; |
| 2052 | obj = Fsymbol_name (Fprocess_status (obj)); | 2054 | obj = Fsymbol_name (Fprocess_status (obj)); |
| 2053 | break; | 2055 | break; |
diff --git a/src/xfns.c b/src/xfns.c index 4af2c899390..387af54197d 100644 --- a/src/xfns.c +++ b/src/xfns.c | |||
| @@ -479,10 +479,10 @@ x_decode_color (arg, def) | |||
| 479 | return WHITE_PIX_DEFAULT; | 479 | return WHITE_PIX_DEFAULT; |
| 480 | 480 | ||
| 481 | #ifdef HAVE_X11 | 481 | #ifdef HAVE_X11 |
| 482 | if (XFASTINT (x_screen_planes) <= 2) | 482 | if (XFASTINT (x_screen_planes) == 1) |
| 483 | return def; | 483 | return def; |
| 484 | #else | 484 | #else |
| 485 | if (DISPLAY_CELLS <= 2) | 485 | if (DISPLAY_CELLS == 1) |
| 486 | return def; | 486 | return def; |
| 487 | #endif | 487 | #endif |
| 488 | 488 | ||
| @@ -956,7 +956,7 @@ x_set_icon_type (s, arg, oldval) | |||
| 956 | return; | 956 | return; |
| 957 | 957 | ||
| 958 | BLOCK_INPUT; | 958 | BLOCK_INPUT; |
| 959 | if (NULL (arg)) | 959 | if (NILP (arg)) |
| 960 | result = x_text_icon (s, 0); | 960 | result = x_text_icon (s, 0); |
| 961 | else | 961 | else |
| 962 | result = x_bitmap_icon (s, 0); | 962 | result = x_bitmap_icon (s, 0); |
| @@ -1327,14 +1327,14 @@ key of the form INSTANCE.COMPONENT.ATTRIBUTE, with class \"Emacs.CLASS\".") | |||
| 1327 | char *class_key; | 1327 | char *class_key; |
| 1328 | 1328 | ||
| 1329 | CHECK_STRING (attribute, 0); | 1329 | CHECK_STRING (attribute, 0); |
| 1330 | if (!NULL (name)) | 1330 | if (!NILP (name)) |
| 1331 | CHECK_STRING (name, 1); | 1331 | CHECK_STRING (name, 1); |
| 1332 | if (!NULL (class)) | 1332 | if (!NILP (class)) |
| 1333 | CHECK_STRING (class, 2); | 1333 | CHECK_STRING (class, 2); |
| 1334 | if (NULL (name) != NULL (class)) | 1334 | if (NILP (name) != NILP (class)) |
| 1335 | error ("x-get-resource: must specify both NAME and CLASS or neither"); | 1335 | error ("x-get-resource: must specify both NAME and CLASS or neither"); |
| 1336 | 1336 | ||
| 1337 | if (NULL (name)) | 1337 | if (NILP (name)) |
| 1338 | { | 1338 | { |
| 1339 | name_key = (char *) alloca (XSTRING (invocation_name)->size + 1 | 1339 | name_key = (char *) alloca (XSTRING (invocation_name)->size + 1 |
| 1340 | + XSTRING (attribute)->size + 1); | 1340 | + XSTRING (attribute)->size + 1); |
| @@ -1424,7 +1424,6 @@ x_get_arg (alist, param, screen_name, attribute, type) | |||
| 1424 | enum resource_types type; | 1424 | enum resource_types type; |
| 1425 | { | 1425 | { |
| 1426 | register Lisp_Object tem; | 1426 | register Lisp_Object tem; |
| 1427 | int i; | ||
| 1428 | 1427 | ||
| 1429 | tem = Fassq (param, alist); | 1428 | tem = Fassq (param, alist); |
| 1430 | if (EQ (tem, Qnil)) | 1429 | if (EQ (tem, Qnil)) |
| @@ -1437,13 +1436,27 @@ x_get_arg (alist, param, screen_name, attribute, type) | |||
| 1437 | component name. */ | 1436 | component name. */ |
| 1438 | if (XTYPE (screen_name) == Lisp_String) | 1437 | if (XTYPE (screen_name) == Lisp_String) |
| 1439 | { | 1438 | { |
| 1440 | sterile_name = make_uninit_string (XSTRING (screen_name)->size); | 1439 | int i; |
| 1441 | 1440 | ||
| 1442 | for (i = 0; i < XSTRING (sterile_name)->size; i++) | 1441 | sterile_name = make_uninit_string (XSTRING (screen_name)->size); |
| 1442 | for (i = 0; i < XSTRING (screen_name)->size; i++) | ||
| 1443 | { | 1443 | { |
| 1444 | int c = XSTRING (screen_name)->data[i]; | 1444 | int c = XSTRING (screen_name)->data[i]; |
| 1445 | if (c == ':' || c == '.' || c == '*' || isspace (c)) | 1445 | |
| 1446 | c = '_'; | 1446 | switch (c) |
| 1447 | { | ||
| 1448 | case ':': | ||
| 1449 | case '.': | ||
| 1450 | case '*': | ||
| 1451 | case ' ': | ||
| 1452 | case '\t': | ||
| 1453 | case '\n': | ||
| 1454 | c = '_'; | ||
| 1455 | break; | ||
| 1456 | default: | ||
| 1457 | break; | ||
| 1458 | } | ||
| 1459 | |||
| 1447 | XSTRING (sterile_name)->data[i] = c; | 1460 | XSTRING (sterile_name)->data[i] = c; |
| 1448 | } | 1461 | } |
| 1449 | } | 1462 | } |
| @@ -1452,9 +1465,9 @@ x_get_arg (alist, param, screen_name, attribute, type) | |||
| 1452 | 1465 | ||
| 1453 | tem = Fx_get_resource (build_string (attribute), | 1466 | tem = Fx_get_resource (build_string (attribute), |
| 1454 | sterile_name, | 1467 | sterile_name, |
| 1455 | (NULL (sterile_name) ? Qnil : screen_class)); | 1468 | (NILP (sterile_name) ? Qnil : screen_class)); |
| 1456 | 1469 | ||
| 1457 | if (NULL (tem)) | 1470 | if (NILP (tem)) |
| 1458 | return Qnil; | 1471 | return Qnil; |
| 1459 | 1472 | ||
| 1460 | switch (type) | 1473 | switch (type) |
| @@ -1677,7 +1690,7 @@ x_window (s) | |||
| 1677 | screen_visual, /* set in Fx_open_connection */ | 1690 | screen_visual, /* set in Fx_open_connection */ |
| 1678 | attribute_mask, &attributes); | 1691 | attribute_mask, &attributes); |
| 1679 | 1692 | ||
| 1680 | class_hints.res_name = s->name; | 1693 | class_hints.res_name = (char *) XSTRING (s->name)->data; |
| 1681 | class_hints.res_class = EMACS_CLASS; | 1694 | class_hints.res_class = EMACS_CLASS; |
| 1682 | XSetClassHint (x_current_display, s->display.x->window_desc, &class_hints); | 1695 | XSetClassHint (x_current_display, s->display.x->window_desc, &class_hints); |
| 1683 | 1696 | ||
| @@ -1823,13 +1836,13 @@ x_make_gc (s) | |||
| 1823 | 1836 | ||
| 1824 | DEFUN ("x-create-screen", Fx_create_screen, Sx_create_screen, | 1837 | DEFUN ("x-create-screen", Fx_create_screen, Sx_create_screen, |
| 1825 | 1, 1, 0, | 1838 | 1, 1, 0, |
| 1826 | "Make a new X window, which is considered a \"screen\" in Emacs terms.\n\ | 1839 | "Make a new X window, which is called a \"screen\" in Emacs terms.\n\ |
| 1827 | Return an Emacs screen object representing the X window.\n\ | 1840 | Return an Emacs screen object representing the X window.\n\ |
| 1828 | ALIST is an alist of screen parameters.\n\ | 1841 | ALIST is an alist of screen parameters.\n\ |
| 1829 | The value of ``x-screen-defaults'' is an additional alist\n\ | 1842 | The value of ``x-screen-defaults'' is an additional alist\n\ |
| 1830 | of default parameters which apply when not overridden by ALIST.\n\ | 1843 | of default parameters which apply when not overridden by ALIST.\n\ |
| 1831 | If the parameters specify that the screen should not have a minibuffer,\n\ | 1844 | If the parameters specify that the screen should not have a minibuffer,\n\ |
| 1832 | then ``global-minibuffer-screen'' must be a screen whose minibuffer can\n\ | 1845 | then ``default-minibuffer-screen'' must be a screen whose minibuffer can\n\ |
| 1833 | be shared by the new screen.") | 1846 | be shared by the new screen.") |
| 1834 | (parms) | 1847 | (parms) |
| 1835 | Lisp_Object parms; | 1848 | Lisp_Object parms; |
| @@ -1846,7 +1859,7 @@ be shared by the new screen.") | |||
| 1846 | error ("X windows are not in use or not initialized"); | 1859 | error ("X windows are not in use or not initialized"); |
| 1847 | 1860 | ||
| 1848 | name = x_get_arg (parms, intern ("name"), Qnil, "Title", string); | 1861 | name = x_get_arg (parms, intern ("name"), Qnil, "Title", string); |
| 1849 | if (NULL (name)) | 1862 | if (NILP (name)) |
| 1850 | name = build_string (x_id_name); | 1863 | name = build_string (x_id_name); |
| 1851 | if (XTYPE (name) != Lisp_String) | 1864 | if (XTYPE (name) != Lisp_String) |
| 1852 | error ("x-create-screen: name parameter must be a string"); | 1865 | error ("x-create-screen: name parameter must be a string"); |
| @@ -1859,10 +1872,10 @@ be shared by the new screen.") | |||
| 1859 | s = make_minibuffer_screen (); | 1872 | s = make_minibuffer_screen (); |
| 1860 | minibuffer_only = 1; | 1873 | minibuffer_only = 1; |
| 1861 | } | 1874 | } |
| 1862 | else if (! EQ (tem, Qnil)) | 1875 | else if (EQ (tem, Qnil) || EQ (tem, Qt)) |
| 1863 | s = make_screen_without_minibuffer (tem); | ||
| 1864 | else | ||
| 1865 | s = make_screen (1); | 1876 | s = make_screen (1); |
| 1877 | else | ||
| 1878 | s = make_screen_without_minibuffer (tem); | ||
| 1866 | 1879 | ||
| 1867 | /* Set the name; the functions to which we pass s expect the | 1880 | /* Set the name; the functions to which we pass s expect the |
| 1868 | name to be set. */ | 1881 | name to be set. */ |
| @@ -1873,6 +1886,9 @@ be shared by the new screen.") | |||
| 1873 | s->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); | 1886 | s->display.x = (struct x_display *) xmalloc (sizeof (struct x_display)); |
| 1874 | bzero (s->display.x, sizeof (struct x_display)); | 1887 | bzero (s->display.x, sizeof (struct x_display)); |
| 1875 | 1888 | ||
| 1889 | /* Note that the screen has no physical cursor right now. */ | ||
| 1890 | s->phys_cursor_x = -1; | ||
| 1891 | |||
| 1876 | /* Extract the window parameters from the supplied values | 1892 | /* Extract the window parameters from the supplied values |
| 1877 | that are needed to determine window geometry. */ | 1893 | that are needed to determine window geometry. */ |
| 1878 | x_default_parameter (s, parms, "font", | 1894 | x_default_parameter (s, parms, "font", |
| @@ -1882,7 +1898,7 @@ be shared by the new screen.") | |||
| 1882 | x_default_parameter (s, parms, "border-width", | 1898 | x_default_parameter (s, parms, "border-width", |
| 1883 | make_number (2), "BorderWidth", number); | 1899 | make_number (2), "BorderWidth", number); |
| 1884 | x_default_parameter (s, parms, "internal-border-width", | 1900 | x_default_parameter (s, parms, "internal-border-width", |
| 1885 | make_number (4), "InternalBorderWidth", number); | 1901 | make_number (1), "InternalBorderWidth", number); |
| 1886 | 1902 | ||
| 1887 | /* Also do the stuff which must be set before the window exists. */ | 1903 | /* Also do the stuff which must be set before the window exists. */ |
| 1888 | x_default_parameter (s, parms, "foreground-color", | 1904 | x_default_parameter (s, parms, "foreground-color", |
| @@ -2066,7 +2082,7 @@ be shared by the new screen.") | |||
| 2066 | (XTYPE (tem) == Lisp_String | 2082 | (XTYPE (tem) == Lisp_String |
| 2067 | ? (char *) XSTRING (tem)->data : ""), | 2083 | ? (char *) XSTRING (tem)->data : ""), |
| 2068 | XSTRING (s->name)->data, | 2084 | XSTRING (s->name)->data, |
| 2069 | !NULL (hscroll), !NULL (vscroll)); | 2085 | !NILP (hscroll), !NILP (vscroll)); |
| 2070 | } | 2086 | } |
| 2071 | else | 2087 | else |
| 2072 | { | 2088 | { |
| @@ -2099,10 +2115,10 @@ be shared by the new screen.") | |||
| 2099 | 2115 | ||
| 2100 | pixelwidth = (width * FONT_WIDTH (s->display.x->font) | 2116 | pixelwidth = (width * FONT_WIDTH (s->display.x->font) |
| 2101 | + 2 * s->display.x->internal_border_width | 2117 | + 2 * s->display.x->internal_border_width |
| 2102 | + (!NULL (vscroll) ? VSCROLL_WIDTH : 0)); | 2118 | + (!NILP (vscroll) ? VSCROLL_WIDTH : 0)); |
| 2103 | pixelheight = (height * FONT_HEIGHT (s->display.x->font) | 2119 | pixelheight = (height * FONT_HEIGHT (s->display.x->font) |
| 2104 | + 2 * s->display.x->internal_border_width | 2120 | + 2 * s->display.x->internal_border_width |
| 2105 | + (!NULL (hscroll) ? HSCROLL_HEIGHT : 0)); | 2121 | + (!NILP (hscroll) ? HSCROLL_HEIGHT : 0)); |
| 2106 | 2122 | ||
| 2107 | BLOCK_INPUT; | 2123 | BLOCK_INPUT; |
| 2108 | s->display.x->window_desc | 2124 | s->display.x->window_desc |
| @@ -2158,9 +2174,9 @@ be shared by the new screen.") | |||
| 2158 | 2174 | ||
| 2159 | Fmodify_screen_parameters (screen, parms); | 2175 | Fmodify_screen_parameters (screen, parms); |
| 2160 | 2176 | ||
| 2161 | if (!NULL (vscroll)) | 2177 | if (!NILP (vscroll)) |
| 2162 | install_vertical_scrollbar (s, pixelwidth, pixelheight); | 2178 | install_vertical_scrollbar (s, pixelwidth, pixelheight); |
| 2163 | if (!NULL (hscroll)) | 2179 | if (!NILP (hscroll)) |
| 2164 | install_horizontal_scrollbar (s, pixelwidth, pixelheight); | 2180 | install_horizontal_scrollbar (s, pixelwidth, pixelheight); |
| 2165 | 2181 | ||
| 2166 | /* Make the window appear on the screen and enable display. */ | 2182 | /* Make the window appear on the screen and enable display. */ |
| @@ -2178,7 +2194,7 @@ DEFUN ("focus-screen", Ffocus_screen, Sfocus_screen, 1, 1, 0, | |||
| 2178 | (screen) | 2194 | (screen) |
| 2179 | Lisp_Object screen; | 2195 | Lisp_Object screen; |
| 2180 | { | 2196 | { |
| 2181 | CHECK_SCREEN (screen, 0); | 2197 | CHECK_LIVE_SCREEN (screen, 0); |
| 2182 | 2198 | ||
| 2183 | if (SCREEN_IS_X (XSCREEN (screen))) | 2199 | if (SCREEN_IS_X (XSCREEN (screen))) |
| 2184 | { | 2200 | { |
| @@ -2291,7 +2307,7 @@ x_set_horizontal_scrollbar (s, val, oldval) | |||
| 2291 | struct screen *s; | 2307 | struct screen *s; |
| 2292 | Lisp_Object val, oldval; | 2308 | Lisp_Object val, oldval; |
| 2293 | { | 2309 | { |
| 2294 | if (!NULL (val)) | 2310 | if (!NILP (val)) |
| 2295 | { | 2311 | { |
| 2296 | if (s->display.x->window_desc != 0) | 2312 | if (s->display.x->window_desc != 0) |
| 2297 | { | 2313 | { |
| @@ -2325,7 +2341,7 @@ x_set_vertical_scrollbar (s, val, oldval) | |||
| 2325 | struct screen *s; | 2341 | struct screen *s; |
| 2326 | Lisp_Object val, oldval; | 2342 | Lisp_Object val, oldval; |
| 2327 | { | 2343 | { |
| 2328 | if (!NULL (val)) | 2344 | if (!NILP (val)) |
| 2329 | { | 2345 | { |
| 2330 | if (s->display.x->window_desc != 0) | 2346 | if (s->display.x->window_desc != 0) |
| 2331 | { | 2347 | { |
| @@ -2878,7 +2894,7 @@ DEFUN ("x-pixel-width", Fx_pixel_width, Sx_pixel_width, 1, 1, 0, | |||
| 2878 | (screen) | 2894 | (screen) |
| 2879 | Lisp_Object screen; | 2895 | Lisp_Object screen; |
| 2880 | { | 2896 | { |
| 2881 | CHECK_SCREEN (screen, 0); | 2897 | CHECK_LIVE_SCREEN (screen, 0); |
| 2882 | return make_number (XSCREEN (screen)->display.x->pixel_width); | 2898 | return make_number (XSCREEN (screen)->display.x->pixel_width); |
| 2883 | } | 2899 | } |
| 2884 | 2900 | ||
| @@ -2887,7 +2903,7 @@ DEFUN ("x-pixel-height", Fx_pixel_height, Sx_pixel_height, 1, 1, 0, | |||
| 2887 | (screen) | 2903 | (screen) |
| 2888 | Lisp_Object screen; | 2904 | Lisp_Object screen; |
| 2889 | { | 2905 | { |
| 2890 | CHECK_SCREEN (screen, 0); | 2906 | CHECK_LIVE_SCREEN (screen, 0); |
| 2891 | return make_number (XSCREEN (screen)->display.x->pixel_height); | 2907 | return make_number (XSCREEN (screen)->display.x->pixel_height); |
| 2892 | } | 2908 | } |
| 2893 | 2909 | ||
| @@ -2929,7 +2945,7 @@ numbers X0, Y0, X1, Y1 in the cursor pixel.") | |||
| 2929 | { | 2945 | { |
| 2930 | register int x0, y0, x1, y1, top, left, n_chars, n_lines; | 2946 | register int x0, y0, x1, y1, top, left, n_chars, n_lines; |
| 2931 | 2947 | ||
| 2932 | CHECK_SCREEN (screen, 0); | 2948 | CHECK_LIVE_SCREEN (screen, 0); |
| 2933 | CHECK_NUMBER (X0, 0); | 2949 | CHECK_NUMBER (X0, 0); |
| 2934 | CHECK_NUMBER (Y0, 1); | 2950 | CHECK_NUMBER (Y0, 1); |
| 2935 | CHECK_NUMBER (X1, 2); | 2951 | CHECK_NUMBER (X1, 2); |
| @@ -3528,7 +3544,7 @@ DEFUN ("x-track-pointer", Fx_track_pointer, Sx_track_pointer, 1, 1, "e", | |||
| 3528 | int len = SCREEN_CURRENT_GLYPHS (s)->used[x_mouse_y]; | 3544 | int len = SCREEN_CURRENT_GLYPHS (s)->used[x_mouse_y]; |
| 3529 | int p = SCREEN_CURRENT_GLYPHS (s)->bufp[x_mouse_y]; | 3545 | int p = SCREEN_CURRENT_GLYPHS (s)->bufp[x_mouse_y]; |
| 3530 | int tab_width = XINT (b->tab_width); | 3546 | int tab_width = XINT (b->tab_width); |
| 3531 | int ctl_arrow_p = !NULL (b->ctl_arrow); | 3547 | int ctl_arrow_p = !NILP (b->ctl_arrow); |
| 3532 | unsigned char c; | 3548 | unsigned char c; |
| 3533 | int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; | 3549 | int mode_line_vpos = XFASTINT (w->height) + XFASTINT (w->top) - 1; |
| 3534 | int in_mode_line = 0; | 3550 | int in_mode_line = 0; |
| @@ -3692,38 +3708,6 @@ x_draw_pixmap (s, x, y, image_data, width, height) | |||
| 3692 | } | 3708 | } |
| 3693 | #endif | 3709 | #endif |
| 3694 | 3710 | ||
| 3695 | x_read_mouse_position (s, x, y) | ||
| 3696 | struct screen *s; | ||
| 3697 | int *x, *y; | ||
| 3698 | { | ||
| 3699 | Window w; | ||
| 3700 | int ix, iy; | ||
| 3701 | int ibw = s->display.x->internal_border_width; | ||
| 3702 | |||
| 3703 | #ifdef HAVE_X11 | ||
| 3704 | Window root_window; | ||
| 3705 | int root_x, root_y; | ||
| 3706 | unsigned int keys_and_buttons; | ||
| 3707 | |||
| 3708 | BLOCK_INPUT; | ||
| 3709 | if (XQueryPointer (x_current_display, s->display.x->window_desc, | ||
| 3710 | &root_window, &w, &root_x, &root_y, &ix, &iy, | ||
| 3711 | &keys_and_buttons) == False) | ||
| 3712 | { | ||
| 3713 | UNBLOCK_INPUT; | ||
| 3714 | error ("Pointer not on same screen as window."); | ||
| 3715 | } | ||
| 3716 | UNBLOCK_INPUT; | ||
| 3717 | #else | ||
| 3718 | BLOCK_INPUT; | ||
| 3719 | XQueryMouse (s->display.x->window_desc, &ix, &iy, &w); | ||
| 3720 | UNBLOCK_INPUT; | ||
| 3721 | #endif /* not HAVE_X11 */ | ||
| 3722 | |||
| 3723 | x_mouse_x = *x = (ix - ibw) / FONT_WIDTH (s->display.x->font); | ||
| 3724 | x_mouse_y = *y = (iy - ibw) / FONT_HEIGHT (s->display.x->font); | ||
| 3725 | } | ||
| 3726 | |||
| 3727 | #if 0 | 3711 | #if 0 |
| 3728 | 3712 | ||
| 3729 | #ifdef HAVE_X11 | 3713 | #ifdef HAVE_X11 |
| @@ -3920,7 +3904,7 @@ the mouse event.") | |||
| 3920 | } | 3904 | } |
| 3921 | } | 3905 | } |
| 3922 | 3906 | ||
| 3923 | if (!NULL (arg)) | 3907 | if (!NILP (arg)) |
| 3924 | return Qnil; | 3908 | return Qnil; |
| 3925 | 3909 | ||
| 3926 | /* Wait till we get another mouse event. */ | 3910 | /* Wait till we get another mouse event. */ |
| @@ -3990,7 +3974,7 @@ also be depressed for NEWSTRING to appear.") | |||
| 3990 | if (keysym == NoSymbol) | 3974 | if (keysym == NoSymbol) |
| 3991 | error ("Keysym does not exist"); | 3975 | error ("Keysym does not exist"); |
| 3992 | 3976 | ||
| 3993 | if (NULL (modifiers)) | 3977 | if (NILP (modifiers)) |
| 3994 | XRebindKeysym (x_current_display, keysym, modifier_list, 0, | 3978 | XRebindKeysym (x_current_display, keysym, modifier_list, 0, |
| 3995 | XSTRING (newstring)->data, XSTRING (newstring)->size); | 3979 | XSTRING (newstring)->data, XSTRING (newstring)->size); |
| 3996 | else | 3980 | else |
| @@ -3998,7 +3982,7 @@ also be depressed for NEWSTRING to appear.") | |||
| 3998 | register Lisp_Object rest, mod; | 3982 | register Lisp_Object rest, mod; |
| 3999 | register int i = 0; | 3983 | register int i = 0; |
| 4000 | 3984 | ||
| 4001 | for (rest = modifiers; !NULL (rest); rest = Fcdr (rest)) | 3985 | for (rest = modifiers; !NILP (rest); rest = Fcdr (rest)) |
| 4002 | { | 3986 | { |
| 4003 | if (i == 16) | 3987 | if (i == 16) |
| 4004 | error ("Can't have more than 16 modifiers"); | 3988 | error ("Can't have more than 16 modifiers"); |
| @@ -4040,7 +4024,7 @@ See the documentation of `x-rebind-key' for more information.") | |||
| 4040 | for (i = 0; i <= 15; strings = Fcdr (strings), i++) | 4024 | for (i = 0; i <= 15; strings = Fcdr (strings), i++) |
| 4041 | { | 4025 | { |
| 4042 | item = Fcar (strings); | 4026 | item = Fcar (strings); |
| 4043 | if (!NULL (item)) | 4027 | if (!NILP (item)) |
| 4044 | { | 4028 | { |
| 4045 | CHECK_STRING (item, 2); | 4029 | CHECK_STRING (item, 2); |
| 4046 | strsize = XSTRING (item)->size; | 4030 | strsize = XSTRING (item)->size; |
| @@ -4080,7 +4064,7 @@ This problem will be fixed in X version 11.") | |||
| 4080 | int i, strsize; | 4064 | int i, strsize; |
| 4081 | 4065 | ||
| 4082 | CHECK_NUMBER (keycode, 1); | 4066 | CHECK_NUMBER (keycode, 1); |
| 4083 | if (!NULL (shift_mask)) | 4067 | if (!NILP (shift_mask)) |
| 4084 | CHECK_NUMBER (shift_mask, 2); | 4068 | CHECK_NUMBER (shift_mask, 2); |
| 4085 | CHECK_STRING (newstring, 3); | 4069 | CHECK_STRING (newstring, 3); |
| 4086 | strsize = XSTRING (newstring)->size; | 4070 | strsize = XSTRING (newstring)->size; |
| @@ -4089,7 +4073,7 @@ This problem will be fixed in X version 11.") | |||
| 4089 | 4073 | ||
| 4090 | keysym = ((unsigned) (XINT (keycode))) & 255; | 4074 | keysym = ((unsigned) (XINT (keycode))) & 255; |
| 4091 | 4075 | ||
| 4092 | if (NULL (shift_mask)) | 4076 | if (NILP (shift_mask)) |
| 4093 | { | 4077 | { |
| 4094 | for (i = 0; i <= 15; i++) | 4078 | for (i = 0; i <= 15; i++) |
| 4095 | XRebindCode (keysym, i<<11, rawstring, strsize); | 4079 | XRebindCode (keysym, i<<11, rawstring, strsize); |
| @@ -4123,7 +4107,7 @@ See the documentation of `x-rebind-key' for more information.") | |||
| 4123 | for (i = 0; i <= 15; strings = Fcdr (strings), i++) | 4107 | for (i = 0; i <= 15; strings = Fcdr (strings), i++) |
| 4124 | { | 4108 | { |
| 4125 | item = Fcar (strings); | 4109 | item = Fcar (strings); |
| 4126 | if (!NULL (item)) | 4110 | if (!NILP (item)) |
| 4127 | { | 4111 | { |
| 4128 | CHECK_STRING (item, 2); | 4112 | CHECK_STRING (item, 2); |
| 4129 | strsize = XSTRING (item)->size; | 4113 | strsize = XSTRING (item)->size; |
diff --git a/src/xmenu.c b/src/xmenu.c index 553e5b35a7a..120af6bf94c 100644 --- a/src/xmenu.c +++ b/src/xmenu.c | |||
| @@ -320,7 +320,7 @@ list_of_panes (vector, panes, names, items, menu) | |||
| 320 | *items = (int *) xmalloc (i * sizeof (int)); | 320 | *items = (int *) xmalloc (i * sizeof (int)); |
| 321 | *names = (char ***) xmalloc (i * sizeof (char **)); | 321 | *names = (char ***) xmalloc (i * sizeof (char **)); |
| 322 | 322 | ||
| 323 | for (i=0, tail = menu; !NULL (tail); tail = Fcdr (tail), i++) | 323 | for (i=0, tail = menu; !NILP (tail); tail = Fcdr (tail), i++) |
| 324 | { | 324 | { |
| 325 | item = Fcdr (Fcar (tail)); | 325 | item = Fcdr (Fcar (tail)); |
| 326 | if (XTYPE (item) != Lisp_Cons) (void) wrong_type_argument (Qlistp, item); | 326 | if (XTYPE (item) != Lisp_Cons) (void) wrong_type_argument (Qlistp, item); |
| @@ -358,7 +358,7 @@ list_of_items (vector, names, pane) /* get list from emacs and put to vector */ | |||
| 358 | *vector = (Lisp_Object *) xmalloc (i * sizeof (Lisp_Object)); | 358 | *vector = (Lisp_Object *) xmalloc (i * sizeof (Lisp_Object)); |
| 359 | *names = (char **) xmalloc (i * sizeof (char *)); | 359 | *names = (char **) xmalloc (i * sizeof (char *)); |
| 360 | 360 | ||
| 361 | for (i=0, tail = pane; !NULL (tail); tail = Fcdr (tail), i++) | 361 | for (i=0, tail = pane; !NILP (tail); tail = Fcdr (tail), i++) |
| 362 | { | 362 | { |
| 363 | item = Fcar (tail); | 363 | item = Fcar (tail); |
| 364 | if (XTYPE (item) != Lisp_Cons) (void) wrong_type_argument (Qlistp, item); | 364 | if (XTYPE (item) != Lisp_Cons) (void) wrong_type_argument (Qlistp, item); |
diff --git a/src/xrdb.c b/src/xrdb.c index 930b4d54d43..23f6b942469 100644 --- a/src/xrdb.c +++ b/src/xrdb.c | |||
| @@ -26,13 +26,14 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 26 | #include <sys/param.h> | 26 | #include <sys/param.h> |
| 27 | #include <pwd.h> | 27 | #include <pwd.h> |
| 28 | #include <sys/stat.h> | 28 | #include <sys/stat.h> |
| 29 | #include <sys/types.h> | ||
| 29 | 30 | ||
| 30 | #ifdef emacs | 31 | #ifdef emacs |
| 31 | #include "config.h" | 32 | #include "config.h" |
| 32 | #endif | 33 | #endif |
| 33 | 34 | ||
| 34 | extern char *getenv (); | 35 | extern char *getenv (); |
| 35 | extern int getuid (); | 36 | extern uid_t getuid (); |
| 36 | extern struct passwd *getpwuid (); | 37 | extern struct passwd *getpwuid (); |
| 37 | extern struct passwd *getpwnam (); | 38 | extern struct passwd *getpwnam (); |
| 38 | 39 | ||
diff --git a/src/xselect.c.old b/src/xselect.c.old index 8d3e3d12fc4..81f069e341e 100644 --- a/src/xselect.c.old +++ b/src/xselect.c.old | |||
| @@ -28,11 +28,13 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 28 | #define MAX_SELECTION(dpy) (((dpy)->max_request_size << 3) - 100) | 28 | #define MAX_SELECTION(dpy) (((dpy)->max_request_size << 3) - 100) |
| 29 | #define SELECTION_LENGTH(len,format) ((len) * ((format) >> 3)) | 29 | #define SELECTION_LENGTH(len,format) ((len) * ((format) >> 3)) |
| 30 | 30 | ||
| 31 | /* The last 23 bits of the timestamp of the last mouse button event. */ | 31 | /* From keyboard.c. This is almost always the right timestamp for |
| 32 | extern Time mouse_timestamp; | 32 | ownership arbitration, since the last event was either the |
| 33 | keystroke bound to the command now running, or something else read | ||
| 34 | by that command. */ | ||
| 35 | extern unsigned long last_event_timestamp; | ||
| 33 | 36 | ||
| 34 | /* t if a mouse button is depressed. */ | 37 | /* t if a mouse button is depressed. */ |
| 35 | |||
| 36 | extern Lisp_Object Vmouse_grabbed; | 38 | extern Lisp_Object Vmouse_grabbed; |
| 37 | 39 | ||
| 38 | /* When emacs became the PRIMARY selection owner. */ | 40 | /* When emacs became the PRIMARY selection owner. */ |
| @@ -113,7 +115,7 @@ This is done with the X11 selection mechanism.") | |||
| 113 | 115 | ||
| 114 | if (EQ (Qnil, Vx_selection_value)) /* We are not the owner. */ | 116 | if (EQ (Qnil, Vx_selection_value)) /* We are not the owner. */ |
| 115 | { | 117 | { |
| 116 | event_time = mouse_timestamp; | 118 | event_time = last_event_timestamp; |
| 117 | XSetSelectionOwner (x_current_display, XA_PRIMARY, | 119 | XSetSelectionOwner (x_current_display, XA_PRIMARY, |
| 118 | selecting_window, event_time); | 120 | selecting_window, event_time); |
| 119 | owner_window = XGetSelectionOwner (x_current_display, XA_PRIMARY); | 121 | owner_window = XGetSelectionOwner (x_current_display, XA_PRIMARY); |
| @@ -150,7 +152,7 @@ DEFUN ("x-own-clipboard", Fx_own_clipboard, Sx_own_clipboard, | |||
| 150 | 152 | ||
| 151 | if (EQ (Qnil, Vx_clipboard_value)) | 153 | if (EQ (Qnil, Vx_clipboard_value)) |
| 152 | { | 154 | { |
| 153 | event_time = mouse_timestamp; | 155 | event_time = last_event_timestamp; |
| 154 | XSetSelectionOwner (x_current_display, Xatom_clipboard, | 156 | XSetSelectionOwner (x_current_display, Xatom_clipboard, |
| 155 | selecting_window, event_time); | 157 | selecting_window, event_time); |
| 156 | owner_window = XGetSelectionOwner (x_current_display, Xatom_clipboard); | 158 | owner_window = XGetSelectionOwner (x_current_display, Xatom_clipboard); |
| @@ -489,7 +491,7 @@ This is done with the X11 selection mechanism.") | |||
| 489 | return Vx_selection_value; | 491 | return Vx_selection_value; |
| 490 | 492 | ||
| 491 | BLOCK_INPUT; | 493 | BLOCK_INPUT; |
| 492 | requestor_time = mouse_timestamp; | 494 | requestor_time = last_event_timestamp; |
| 493 | requestor_window = selected_screen->display.x->window_desc; | 495 | requestor_window = selected_screen->display.x->window_desc; |
| 494 | XConvertSelection (x_current_display, XA_PRIMARY, XA_STRING, | 496 | XConvertSelection (x_current_display, XA_PRIMARY, XA_STRING, |
| 495 | Xatom_emacs_selection, requestor_window, requestor_time); | 497 | Xatom_emacs_selection, requestor_window, requestor_time); |
| @@ -520,7 +522,7 @@ This is done with the X11 selection mechanism.") | |||
| 520 | return Vx_selection_value; | 522 | return Vx_selection_value; |
| 521 | 523 | ||
| 522 | BLOCK_INPUT; | 524 | BLOCK_INPUT; |
| 523 | requestor_time = mouse_timestamp; | 525 | requestor_time = last_event_timestamp; |
| 524 | requestor_window = selected_screen->display.x->window_desc; | 526 | requestor_window = selected_screen->display.x->window_desc; |
| 525 | XConvertSelection (x_current_display, Xatom_clipboard, XA_STRING, | 527 | XConvertSelection (x_current_display, Xatom_clipboard, XA_STRING, |
| 526 | Xatom_clipboard_selection, | 528 | Xatom_clipboard_selection, |
diff --git a/src/xterm.c b/src/xterm.c index 079f162505c..dd07185ca23 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -30,7 +30,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |||
| 30 | #ifdef HAVE_X_WINDOWS | 30 | #ifdef HAVE_X_WINDOWS |
| 31 | 31 | ||
| 32 | #include "lisp.h" | 32 | #include "lisp.h" |
| 33 | #undef NULL | ||
| 34 | 33 | ||
| 35 | /* On 4.3 this loses if it comes after xterm.h. */ | 34 | /* On 4.3 this loses if it comes after xterm.h. */ |
| 36 | #include <signal.h> | 35 | #include <signal.h> |
| @@ -368,6 +367,7 @@ XTreset_terminal_modes () | |||
| 368 | where display update commands will take effect. | 367 | where display update commands will take effect. |
| 369 | This does not affect the place where the cursor-box is displayed. */ | 368 | This does not affect the place where the cursor-box is displayed. */ |
| 370 | 369 | ||
| 370 | static | ||
| 371 | XTcursor_to (row, col) | 371 | XTcursor_to (row, col) |
| 372 | register int row, col; | 372 | register int row, col; |
| 373 | { | 373 | { |
| @@ -401,8 +401,6 @@ dumpglyphs (s, left, top, gp, n, hl, font) | |||
| 401 | int hl; | 401 | int hl; |
| 402 | FONT_TYPE *font; | 402 | FONT_TYPE *font; |
| 403 | { | 403 | { |
| 404 | char buf[s->width]; | ||
| 405 | register char *cp = buf; | ||
| 406 | register int len; | 404 | register int len; |
| 407 | Window window = s->display.x->window_desc; | 405 | Window window = s->display.x->window_desc; |
| 408 | GC drawing_gc = (hl == 2 ? s->display.x->cursor_gc | 406 | GC drawing_gc = (hl == 2 ? s->display.x->cursor_gc |
diff --git a/src/xterm.h b/src/xterm.h index c11f8ca713a..934a2917f34 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -158,7 +158,8 @@ extern int x_pending_input; | |||
| 158 | #define BLOCK_INPUT (x_input_blocked++) | 158 | #define BLOCK_INPUT (x_input_blocked++) |
| 159 | 159 | ||
| 160 | /* End critical section. */ | 160 | /* End critical section. */ |
| 161 | #define UNBLOCK_INPUT (x_input_blocked--, (x_input_blocked < 0 ? abort () : 0)) | 161 | #define UNBLOCK_INPUT \ |
| 162 | (x_input_blocked--, (x_input_blocked < 0 ? (abort (), 0) : 0)) | ||
| 162 | 163 | ||
| 163 | #define TOTALLY_UNBLOCK_INPUT (x_input_blocked = 0) | 164 | #define TOTALLY_UNBLOCK_INPUT (x_input_blocked = 0) |
| 164 | #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT | 165 | #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT |