diff options
| author | Richard M. Stallman | 1995-02-23 04:54:59 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-02-23 04:54:59 +0000 |
| commit | 824977b67ebda6e0a4f87188c77a118b8b82ef0b (patch) | |
| tree | dc3fba184e5630dee7ed9efcf8cc4435302e56b5 /src | |
| parent | 754ad884197028f99ca5d3297c4d7c57d7cbd3b9 (diff) | |
| download | emacs-824977b67ebda6e0a4f87188c77a118b8b82ef0b.tar.gz emacs-824977b67ebda6e0a4f87188c77a118b8b82ef0b.zip | |
(Fcall_interactively): Use markers temporarily in
args vector to stand for point and mark values; replace them
with integers just before calling the command.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callint.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/callint.c b/src/callint.c index cb6dad1e41e..0dedc47f509 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -42,7 +42,10 @@ Lisp_Object Vmark_even_if_inactive; | |||
| 42 | Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; | 42 | Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; |
| 43 | 43 | ||
| 44 | Lisp_Object Qlist; | 44 | Lisp_Object Qlist; |
| 45 | Lisp_Object preserved_fns; | 45 | static Lisp_Object preserved_fns; |
| 46 | |||
| 47 | /* Marker used within call-interactively to refer to point. */ | ||
| 48 | static Lisp_Object point_marker; | ||
| 46 | 49 | ||
| 47 | /* This comment supplies the doc string for interactive, | 50 | /* This comment supplies the doc string for interactive, |
| 48 | for make-docfile to see. We cannot put this in the real DEFUN | 51 | for make-docfile to see. We cannot put this in the real DEFUN |
| @@ -443,7 +446,8 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 443 | break; | 446 | break; |
| 444 | 447 | ||
| 445 | case 'd': /* Value of point. Does not do I/O. */ | 448 | case 'd': /* Value of point. Does not do I/O. */ |
| 446 | XSETFASTINT (args[i], point); | 449 | Fset_marker (point_marker, make_number (PT), Qnil); |
| 450 | args[i] = point_marker; | ||
| 447 | /* visargs[i] = Qnil; */ | 451 | /* visargs[i] = Qnil; */ |
| 448 | varies[i] = 1; | 452 | varies[i] = 1; |
| 449 | break; | 453 | break; |
| @@ -495,7 +499,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 495 | case 'm': /* Value of mark. Does not do I/O. */ | 499 | case 'm': /* Value of mark. Does not do I/O. */ |
| 496 | check_mark (); | 500 | check_mark (); |
| 497 | /* visargs[i] = Qnil; */ | 501 | /* visargs[i] = Qnil; */ |
| 498 | XSETFASTINT (args[i], marker_position (current_buffer->mark)); | 502 | args[i] = current_buffer->mark; |
| 499 | varies[i] = 2; | 503 | varies[i] = 2; |
| 500 | break; | 504 | break; |
| 501 | 505 | ||
| @@ -524,12 +528,13 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 524 | 528 | ||
| 525 | case 'r': /* Region, point and mark as 2 args. */ | 529 | case 'r': /* Region, point and mark as 2 args. */ |
| 526 | check_mark (); | 530 | check_mark (); |
| 531 | Fset_marker (point_marker, make_number (PT), Qnil); | ||
| 527 | /* visargs[i+1] = Qnil; */ | 532 | /* visargs[i+1] = Qnil; */ |
| 528 | foo = marker_position (current_buffer->mark); | 533 | foo = marker_position (current_buffer->mark); |
| 529 | /* visargs[i] = Qnil; */ | 534 | /* visargs[i] = Qnil; */ |
| 530 | XSETFASTINT (args[i], point < foo ? point : foo); | 535 | args[i] = point < foo ? point_marker : current_buffer->mark; |
| 531 | varies[i] = 3; | 536 | varies[i] = 3; |
| 532 | XSETFASTINT (args[++i], point > foo ? point : foo); | 537 | args[++i] = point > foo ? point_marker : current_buffer->mark; |
| 533 | varies[i] = 4; | 538 | varies[i] = 4; |
| 534 | break; | 539 | break; |
| 535 | 540 | ||
| @@ -585,14 +590,22 @@ Otherwise, this is done only if an arg is read using the minibuffer.") | |||
| 585 | { | 590 | { |
| 586 | visargs[0] = function; | 591 | visargs[0] = function; |
| 587 | for (i = 1; i < count + 1; i++) | 592 | for (i = 1; i < count + 1; i++) |
| 588 | if (varies[i] > 0) | 593 | { |
| 589 | visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil); | 594 | if (varies[i] > 0) |
| 590 | else | 595 | visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil); |
| 591 | visargs[i] = quotify_arg (args[i]); | 596 | else |
| 597 | visargs[i] = quotify_arg (args[i]); | ||
| 598 | } | ||
| 592 | Vcommand_history = Fcons (Flist (count + 1, visargs), | 599 | Vcommand_history = Fcons (Flist (count + 1, visargs), |
| 593 | Vcommand_history); | 600 | Vcommand_history); |
| 594 | } | 601 | } |
| 595 | 602 | ||
| 603 | /* If we used a marker to hold point, mark, or an end of the region, | ||
| 604 | temporarily, convert it to an integer now. */ | ||
| 605 | for (i = 0; i++; i < count) | ||
| 606 | if (varies[i] >= 1 && varies[i] <= 4) | ||
| 607 | XSETINT (args[i], marker_position (args[i])); | ||
| 608 | |||
| 596 | { | 609 | { |
| 597 | Lisp_Object val; | 610 | Lisp_Object val; |
| 598 | specbind (Qcommand_debug_status, Qnil); | 611 | specbind (Qcommand_debug_status, Qnil); |
| @@ -629,6 +642,9 @@ Its numeric meaning is what you would get from `(interactive \"p\")'.") | |||
| 629 | 642 | ||
| 630 | syms_of_callint () | 643 | syms_of_callint () |
| 631 | { | 644 | { |
| 645 | point_marker = Fmake_marker (); | ||
| 646 | staticpro (&point_marker); | ||
| 647 | |||
| 632 | preserved_fns = Fcons (intern ("region-beginning"), | 648 | preserved_fns = Fcons (intern ("region-beginning"), |
| 633 | Fcons (intern ("region-end"), | 649 | Fcons (intern ("region-end"), |
| 634 | Fcons (intern ("point"), | 650 | Fcons (intern ("point"), |