aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-06-07 22:12:07 +0000
committerKarl Heuer1995-06-07 22:12:07 +0000
commit1e0c5826c5f701b1b1a46e7af702ed2e149df648 (patch)
treed621d934575abf2c5c3170076c2026552f4c2b7c /src
parent2b1ffa341978eb6289c6ddb82ae2d383cbbac6b9 (diff)
downloademacs-1e0c5826c5f701b1b1a46e7af702ed2e149df648.tar.gz
emacs-1e0c5826c5f701b1b1a46e7af702ed2e149df648.zip
(current_prefix_partial): Deleted.
(Vprefix_arg): Deleted; not part of struct kboard again. (Funiversal_argument, Fnegative_argument, Fdigit_argument) (clear_prefix_arg, finalize_prefix_arg, describe_prefix_arg): Deleted. (syms_of_callint): Use DEFVAR_KBOARD for Vprefix_arg. Remove defsubrs for deleted functions.
Diffstat (limited to 'src')
-rw-r--r--src/callint.c107
1 files changed, 2 insertions, 105 deletions
diff --git a/src/callint.c b/src/callint.c
index c58f91b7c10..cb49ec0ef93 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -28,8 +28,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
28 28
29extern char *index (); 29extern char *index ();
30 30
31int current_prefix_partial; 31Lisp_Object Vcurrent_prefix_arg, Qminus, Qplus;
32Lisp_Object Vprefix_arg, Vcurrent_prefix_arg, Qminus, Qplus;
33Lisp_Object Qcall_interactively; 32Lisp_Object Qcall_interactively;
34Lisp_Object Vcommand_history; 33Lisp_Object Vcommand_history;
35 34
@@ -49,45 +48,6 @@ static Lisp_Object preserved_fns;
49static Lisp_Object point_marker; 48static Lisp_Object point_marker;
50 49
51 50
52void
53clear_prefix_arg ()
54{
55 Vprefix_arg = Qnil;
56 if (!current_prefix_partial)
57 {
58 current_kboard->prefix_factor = Qnil;
59 current_kboard->prefix_value = Qnil;
60 current_kboard->prefix_sign = 1;
61 current_kboard->prefix_partial = 0;
62 }
63}
64
65void
66finalize_prefix_arg ()
67{
68 if (!NILP (current_kboard->prefix_factor))
69 Vprefix_arg = Fcons (current_kboard->prefix_factor, Qnil);
70 else if (NILP (current_kboard->prefix_value))
71 Vprefix_arg = (current_kboard->prefix_sign > 0 ? Qnil : Qminus);
72 else if (current_kboard->prefix_sign > 0)
73 Vprefix_arg = current_kboard->prefix_value;
74 else
75 XSETINT (Vprefix_arg, -XINT (current_kboard->prefix_value));
76 current_kboard->prefix_partial = 0;
77}
78
79static void
80describe_prefix_arg ()
81{
82 if (INTEGERP (Vprefix_arg))
83 message ("Arg: %d", Vprefix_arg);
84 else if (CONSP (Vprefix_arg))
85 message ("Arg: [%d]", XCONS (Vprefix_arg)->car);
86 else if (EQ (Vprefix_arg, Qminus))
87 message ("Arg: -");
88}
89
90
91/* This comment supplies the doc string for interactive, 51/* This comment supplies the doc string for interactive,
92 for make-docfile to see. We cannot put this in the real DEFUN 52 for make-docfile to see. We cannot put this in the real DEFUN
93 due to limits in the Unix cpp. 53 due to limits in the Unix cpp.
@@ -694,65 +654,6 @@ Its numeric meaning is what you would get from `(interactive \"p\")'.")
694 return val; 654 return val;
695} 655}
696 656
697DEFUN ("universal-argument", Funiversal_argument, Suniversal_argument, 0, 0, "",
698 "Begin a numeric argument for the following command.\n\
699Digits or minus sign following \\[universal-argument] make up the numeric argument.\n\
700\\[universal-argument] following the digits or minus sign ends the argument.\n\
701\\[universal-argument] without digits or minus sign provides 4 as argument.\n\
702Repeating \\[universal-argument] without digits or minus sign\n\
703 multiplies the argument by 4 each time.")
704 ()
705{
706 if (!current_prefix_partial)
707 {
708 /* First C-u */
709 XSETFASTINT (current_kboard->prefix_factor, 4);
710 current_kboard->prefix_value = Qnil;
711 current_kboard->prefix_sign = 1;
712 current_kboard->prefix_partial = 1;
713 }
714 else if (!NILP (current_kboard->prefix_factor))
715 {
716 /* Subsequent C-u */
717 XSETINT (current_kboard->prefix_factor,
718 XINT (current_kboard->prefix_factor) * 4);
719 current_kboard->prefix_partial = 1;
720 }
721 else
722 {
723 /* Terminating C-u */
724 finalize_prefix_arg ();
725 describe_prefix_arg ();
726 }
727}
728
729DEFUN ("negative-argument", Fnegative_argument, Snegative_argument, 0, 0, "",
730 "Begin a negative numeric argument for the next command.\n\
731\\[universal-argument] following digits or minus sign ends the argument.")
732 ()
733{
734 current_kboard->prefix_factor = Qnil;
735 current_kboard->prefix_sign *= -1;
736 current_kboard->prefix_partial = 1;
737}
738
739DEFUN ("digit-argument", Fdigit_argument, Sdigit_argument, 0, 0, "",
740 "Part of the numeric argument for the next command.\n\
741\\[universal-argument] following digits or minus sign ends the argument.")
742 ()
743{
744 int c;
745 if (!(INTEGERP (last_command_char)
746 && (c = (XINT (last_command_char) & 0177)) >= '0' && c <= '9'))
747 error("digit-argument must be bound to a digit key");
748 current_kboard->prefix_factor = Qnil;
749 if (NILP (current_kboard->prefix_value))
750 XSETFASTINT (current_kboard->prefix_value, 0);
751 XSETINT (current_kboard->prefix_value,
752 XINT (current_kboard->prefix_value) * 10 + (c - '0'));
753 current_kboard->prefix_partial = 1;
754}
755
756syms_of_callint () 657syms_of_callint ()
757{ 658{
758 point_marker = Fmake_marker (); 659 point_marker = Fmake_marker ();
@@ -785,7 +686,7 @@ syms_of_callint ()
785 Qmouse_leave_buffer_hook = intern ("mouse-leave-buffer-hook"); 686 Qmouse_leave_buffer_hook = intern ("mouse-leave-buffer-hook");
786 staticpro (&Qmouse_leave_buffer_hook); 687 staticpro (&Qmouse_leave_buffer_hook);
787 688
788 DEFVAR_LISP ("prefix-arg", &Vprefix_arg, 689 DEFVAR_KBOARD ("prefix-arg", Vprefix_arg,
789 "The value of the prefix argument for the next editing command.\n\ 690 "The value of the prefix argument for the next editing command.\n\
790It may be a number, or the symbol `-' for just a minus sign as arg,\n\ 691It may be a number, or the symbol `-' for just a minus sign as arg,\n\
791or a list whose car is a number for just one or more C-U's\n\ 692or a list whose car is a number for just one or more C-U's\n\
@@ -795,7 +696,6 @@ You cannot examine this variable to find the argument for this command\n\
795since it has been set to nil by the time you can look.\n\ 696since it has been set to nil by the time you can look.\n\
796Instead, you should use the variable `current-prefix-arg', although\n\ 697Instead, you should use the variable `current-prefix-arg', although\n\
797normally commands can get this prefix argument with (interactive \"P\")."); 698normally commands can get this prefix argument with (interactive \"P\").");
798 Vprefix_arg = Qnil;
799 699
800 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg, 700 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg,
801 "The value of the prefix argument for this editing command.\n\ 701 "The value of the prefix argument for this editing command.\n\
@@ -833,7 +733,4 @@ a way to turn themselves off when a mouse command switches windows.");
833 defsubr (&Sinteractive); 733 defsubr (&Sinteractive);
834 defsubr (&Scall_interactively); 734 defsubr (&Scall_interactively);
835 defsubr (&Sprefix_numeric_value); 735 defsubr (&Sprefix_numeric_value);
836 defsubr (&Suniversal_argument);
837 defsubr (&Snegative_argument);
838 defsubr (&Sdigit_argument);
839} 736}